A cone with its tip rounded: the cone on the z axis with its base, of radius 6, at z = 0 and its apex at z = 12, so that its side leans in 1 for every 2 it rises, and the tip rounded by a ball of radius 1 tangent to the side. The ball's center is on the axis at z = 12 − √5, and it touches the side along the circle of radius 2/√5 at z = 12 − 4/√5; above that circle the solid's surface is the ball, below it the cone. Shrink it by 2: the solid of every point at least 2 from the solid's outside.
The side, moved 2 inward, is the cone about the same axis with the same lean and its apex 2√5 lower, at z = 12 − 2√5. The ball's face, moved 2 inward, would be a ball of radius 1 − 2, less than nothing: it is no part of the result, and the moved side runs on to its own apex. The base moves up to z = 2.
The result is a plain cone: its base, of radius h/2, at z = 2 and its apex h above, at z = 12 − 2√5, with h = 10 − 2√5 ≈ 5.528.
As a set: every point with 2 ≤ z ≤ 12 − 2√5 and ρ ≤ (12 − 2√5 − z)/2, ρ its distance from the z axis.
expected
closed form
volume
44.22223482
πh³/12, h = 10 − 2√5: the cone of height h and base radius h/2
area
77.66444155
πh²(1 + √5)/4: its base and its side
Drawing
TopIsometricFrontRight
Third-angle projection, the three views at one scale. Drawn from occt's result, which passed.
† works around a missing feature. Pick an entry to see its solid, its measures and its code.
Drag to turn, scroll or pinch to zoom, right-drag to move. The solid as its STEP file has it, meshed in the browser by Open CASCADE (occt-import-js): each face colored by the kind of its surface, and the edges that bound each face drawn between them.
Drag to turn, scroll or pinch to zoom, right-drag to move. Black lines are where the surface turns sharply; red ones, seen through the solid, are open edges, where the mesh is not closed.
Time
34 ms; CPU time 38 ms; peak memory 12.4 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no offset past a round's radius (offset in two steps, the first the round's radius)
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! The cone on the z axis from its base of radius 6 at z = 0 to its apex at z = 12, its tip rounded//! by a ball of radius 1 tangent to its side, shrunk by 2: the ball's face, moved in by more than//! its radius, drops, and the moved side runs on to its own apex.//!//! The kernel's offset sweeps a round's sphere inward only as far as its radius: past it//! the sphere would turn inside out, and the offset refuses it rather than drop it. A solid shrunk//! by a and then by b is the solid shrunk by a + b (the points a ball of radius a + b about them//! fits in), so it is shrunk first by the tip's radius, which takes the tip down to a sharp//! apex, and then by the rest.use cad_kernel::build::{revolve, Profile, ProfileEdge};
use cad_kernel::geom::Frame;
use cad_kernel::offset::{shrunk, Join};
use cad_kernel::topo::Brep;
use std::f64::consts::{FRAC_PI_2, TAU};
constBASE_RADIUS: f64 = 6.;
constAPEX: f64 = 12.;
constTIP: f64 = 1.;
constSHRINK: f64 = 2.;
pubfnbuild() -> Result<Brep, String> {
// the side leans in 1 for every 2 it rises: in the half-section its outward normal is// (2, 1)/√5, and the ball of radius TIP touching it has its centre on the axis TIP·√5 below// the apex, and touches it TIP from there along that normallet s5 = 5f64.sqrt();
let centre = APEX - TIP * s5;
let touch = [2. * TIP / s5, 0., centre + TIP / s5];
// the half-section in the plane y = 0: out along the base, up the side to where the ball// touches it, round the ball (from the normal's angle, atan ½, to the axis), down the axislet ball = Frame::new([0., 0., centre], [0., -1., 0.], [1., 0., 0.]);
let edges = vec![
ProfileEdge::Line { a: [0., 0., 0.], b: [BASE_RADIUS, 0., 0.] },
ProfileEdge::Line { a: [BASE_RADIUS, 0., 0.], b: touch },
ProfileEdge::Arc { frame: ball, r: TIP, span: Some([0.5f64.atan(), FRAC_PI_2]) },
ProfileEdge::Line { a: [0., 0., centre + TIP], b: [0., 0., 0.] },
];
let section = Profile { origin: [0., 0., 0.], normal: [0., -1., 0.], loops: vec![edges],
names: Vec::new() };
let tipped = revolve(§ion, [0., 0., 0.], [0., 0., 1.], TAU)?;
shrunk(&shrunk(&tipped, TIP, Join::Round)?, SHRINK - TIP, Join::Round)
}
Time
626 ms; CPU time 625 ms; peak memory 361.7 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no offset that drops a ball-rounded tip past its radius (a face is left where the tip was); the stated cone is built
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
"""A ball-tipped cone shrunk by twice its tip's radius. A cone with its tip rounded: the cone on the
z axis with its base, of radius 6, at z = 0 and its apex at z = 12, so that its side leans in 1
for every 2 it rises, and the tip rounded by a ball of radius 1 tangent to the side. The ball's
center is on the axis at z = 12 − √5, and it touches the side along the circle of radius 2/√5 at
z = 12 − 4/√5; above that circle the solid's surface is the ball, below it the cone. Shrink it by
2: the solid of every point at least 2 from the solid's outside.
The side, moved 2 inward, is the cone about the same axis with the same lean and its apex 2√5 lower,
at z = 12 − 2√5. The ball's face, moved 2 inward, would be a ball of radius 1 − 2, less than
nothing: it is no part of the result, and the moved side runs on to its own apex. The base moves up
to z = 2.
The result is a plain cone: its base, of radius h/2, at z = 2 and its apex h above, at z = 12 − 2√5,
with h = 10 − 2√5 ≈ 5.528."""import math
from offset import upright_cone
defbuild():
# OCCT's offset keeps a face where the tip was; the stated cone is built outright.
height = 12 - 2 * math.sqrt(5) - 2returnupright_cone(2, height)
arris left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
3.9 ms; CPU time 3.7 ms; peak memory 10.5 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! The cone on the z axis, its base of radius 6 at z = 0 and its apex at z = 12, its tip rounded by//! the ball of radius 1 tangent to its side, shrunk by 2: every point at least 2 from its outside.//! The ball moved inward would have a radius below nothing and drops; the moved side runs on to its//! own apex, 2√5 lower, and the result is a plain cone on the base moved up to z = 2.usecrate::Refusal;
usecrate::shared::offset::ball_tipped_cone;
use kentron::offset::{self, Join};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> Result<Shape, Refusal> {
let cone = ball_tipped_cone(m)?;
Ok(offset::shape(m, cone, -2.0, Join::Arc)?)
}
vcad left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
86 ms; CPU time 86 ms; peak memory 49 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! The ball-tipped cone of `offset/ball-tipped-cone-shrunk-past-its-tip`, its tip a ball of radius//! 1, shrunk by 2: every point at least 2 from its outside, SolidCraft's offset of the whole solid//! inward (`offset_solid`, rounded), the moved faces that cross trimmed and merged.usesuper::ball_tipped_cone_shrunk_past_its_tip::ball_tipped_cone;
usecrate::solids::*;
pubfnbuild() -> R<Body> {
solidcraft_kernel::offset_solid(&ball_tipped_cone()?, -2.0, true)
}
brepkit left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
popkern left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
aetheris left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
51 ms; CPU time 50 ms; peak memory 21.7 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! The cone on the z axis from its base of radius 6 at z = 0 to its apex at z = 12, the tip rounded//! by a ball of radius 1 tangent to its side; a ball-tipped cone shrunk by twice its tip's radius.//! The ball's face moved 2 inward is gone, and the moved side runs on to a sharp apex at z = 12 −//! 2√5.//!//! The cone's frustum united with the ball, then the kernel's rounded `offset_solid`, inward.usecrate::solids::offset::{ball_tipped_cone, parallel};
usecrate::Refusal;
use brep_kernel::BrepSolid;
pubfnbuild() -> Result<BrepSolid, Refusal> {
Ok(parallel(&ball_tipped_cone()?, -2.0)?)
}
geop left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
10 ms; CPU time 13 ms; peak memory 10 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! The cone on the z axis from its base of radius 6 at z = 0 to its apex at z = 12, the tip rounded//! by a ball of radius 1 tangent to its side; a ball-tipped cone shrunk by twice its tip's radius.//! The ball's face moved 2 inward is gone, and the moved side runs on to a sharp apex at z = 12 −//! 2√5.//!//! A cone frustum and a ball united, then cadrs's offset of the whole solid, inward.usecrate::shared::offset::{ball_tipped_cone, shrunk};
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let body = ball_tipped_cone(k)?;
shrunk(k, body, 2.0)
}
smlib left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
2.7 ms; CPU time 2.5 ms; peak memory 7.9 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! A cone of base radius 6 and height 12 with its tip rounded by a ball of radius 1, shrunk by 2://! the ball's face vanishes and the moved side runs on to its own apex, a plain cone.//! springrep 1.0.1 refuses it: its face offset cannot follow the ball-rounded tip moved past its//! radius ("an offset … closes a sphere to nothing").use springrep::topo::Brep;
usecrate::shared::offset::{ball_tipped_cone, shrunk};
pubfnbuild() -> Result<Brep, String> {
shrunk(&ball_tipped_cone()?, 2.)
}
geomsolver left no solid to show.
Time
48 ms; CPU time 48 ms; peak memory 25.6 MB
Notes
refused error[E080]: `shrunk.body`: a body shelled that is no body of terms
// A ball-tipped cone shrunk by 2: its half-section drawn in the front plane (x, z) — the base out// to radius 6 at z = 0, the side running up toward the apex at (0, 12) until it meets, tangent,// the arc of radius 1 about a centre on the axis that rounds the tip — turned a whole turn about// the z axis; and the points of it at least 2 from its outside, `std.rounds.Grown`'s body for a// negative reach.unit mm
use std
use std.place (vertical)
use std.solids
use std.rounds
in std.front {
o := point
rim := point hint((6, 0))
t := point hint((0.9, 10.2))
c := point hint((0, 9.8))
tip := point hint((0, 10.8))
construction apex := point hint((0, 12))
half := horizontal line(o, rim) -> (side := line(rim, t)) ->
tangent (cap := arc(center: c, start: t, end: tip)) -> vertical line(tip, o) -> close
fix((0, 0)) o
o distance(6) rim
o vertical apex
o distance(12) apex
apex coincident side
o vertical c
radius(1) cap
}
cone := solid(std.solids.Revolution(half, about: std.z))
shrunk := std.rounds.Grown(cone, d: -2mm)
part := solid(shrunk.body)
anvilcad left no solid to show.
Time
1.2 ms; CPU time 1 ms; peak memory 5 MB
Notes
refused not supported yet: the offset is larger than a curved face's radius
//! A cone on the z axis from radius 6 at z = 0 to its apex at z = 12, its tip rounded by a ball of//! radius 1 tangent to its side, shrunk by 2..use std::f64::consts::FRAC_PI_2;
use anvil_brep::Solid;
use anvil_brep::profile::Segment;
usecrate::shared::{line, offset, revolved, v2};
pubfnbuild() -> Result<Solid, String> {
// the half section: the base, the side up to where the tip ball of radius 1 about// (0, 12 − √5) touches it, that ball's arc to the axis, and down the axislet s5 = 5f64.sqrt();
let c = 12. - s5;
let touch = v2(2. / s5, 12. - 4. / s5);
let start = (touch.y - c).atan2(touch.x);
let cone = revolved(vec![
line(v2(0., 0.), v2(6., 0.)),
line(v2(6., 0.), touch),
Segment::Arc { center: v2(0., c), radius: 1., start, sweep: FRAC_PI_2 - start },
line(v2(0., c + 1.), v2(0., 0.)),
])?;
offset(&cone, -2.)
}