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 1.5: the solid of every point at least 1.5 from the solid's outside.
The side, moved 1.5 inward, is the cone about the same axis with the same lean and its apex 1.5√5 lower, at z = 12 − 1.5√5. The ball's face, moved 1.5 inward, would be a ball of radius 1 − 1.5, 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 = 1.5.
The result is a plain cone: its base, of radius h/2, at z = 1.5 and its apex h above, at z = 12 − 1.5√5, with h = 10.5 − 1.5√5 ≈ 7.146.
As a set: every point with 1.5 ≤ z ≤ 12 − 1.5√5 and ρ ≤ (12 − 1.5√5 − z)/2, ρ its distance from the z axis.
expected
closed form
volume
95.5298446
πh³/12, h = 10.5 − 1.5√5: the cone of height h and base radius h/2
area
129.7839976
π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 37 ms; peak memory 12.2 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 1.5: 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 = 1.5;
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
632 ms; CPU time 631 ms; peak memory 361.8 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 past 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
1.5: the solid of every point at least 1.5 from the solid's outside.
The side, moved 1.5 inward, is the cone about the same axis with the same lean and its apex 1.5√5
lower, at z = 12 − 1.5√5. The ball's face, moved 1.5 inward, would be a ball of radius 1 − 1.5, 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 = 1.5.
The result is a plain cone: its base, of radius h/2, at z = 1.5 and its apex h above, at z = 12 −
1.5√5, with h = 10.5 − 1.5√5 ≈ 7.146."""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 - 1.5 * math.sqrt(5) - 1.5returnupright_cone(1.5, 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.8 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 1.5: every point at least 1.5 from its outside.//! The ball moved inward would have a radius below nothing and drops; the moved side runs on to its//! own apex, 1.5√5 lower, and the result is a plain cone on the base moved up to z = 1.5.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, -1.5, 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
106 ms; CPU time 106 ms; peak memory 48.8 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 towards its apex at z = 12, its tip//! rounded by the ball of radius 1 tangent to its side, shrunk by 1.5: every point at least 1.5//! from its outside, SolidCraft's offset of the whole solid inward (`offset_solid`, rounded), the//! moved faces that cross trimmed and merged.usecrate::solids::*;
use solidcore_record::Seg2;
use std::f64::consts::FRAC_PI_2;
/// The ball-tipped cone, its half-section in x and z turned about the z axis: the base, the side/// up to the circle of radius 2/√5 at z = 12 − 4/√5 where the ball touches it, the ball's arc/// about (0, 12 − √5) on to the axis, and the axis back down.pubfnball_tipped_cone() -> R<Body> {
let s5 = 5f64.sqrt();
let centre = 12.0 - s5;
// the side touches the ball at the angle atan2(1, 2) from +x towards +zlet touch = 1f64.atan2(2.0);
let (o, rim, tangent, tip) = (v2(0.0, 0.0), v2(6.0, 0.0), v2(2.0 / s5, 12.0 - 4.0 / s5), v2(0.0, centre + 1.0));
let segs = vec![
Seg2::Line { a: o, b: rim },
Seg2::Line { a: rim, b: tangent },
Seg2::Arc { center: v2(0.0, centre), radius: 1.0, start: touch, sweep: FRAC_PI_2 - touch },
Seg2::Line { a: tip, b: o },
];
revolve_z(Region2 { outer: Loop2 { segs }, holes: vec![] }, 360.0)
}
pubfnbuild() -> R<Body> {
solidcraft_kernel::offset_solid(&ball_tipped_cone()?, -1.5, 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
54 ms; CPU time 54 ms; peak memory 21.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 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 past its tip's radius. The//! ball's face moved 1.5 inward is gone, and the moved side runs on to a sharp apex at z = 12 −//! 1.5√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()?, -1.5)?)
}
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
9.9 ms; CPU time 13 ms; peak memory 10.3 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 past its tip's radius. The//! ball's face moved 1.5 inward is gone, and the moved side runs on to a sharp apex at z = 12 −//! 1.5√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, 1.5)
}
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.9 ms; CPU time 2.7 ms; peak memory 8.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.
//! A cone of base radius 6 and height 12 with its tip rounded by a ball of radius 1, shrunk by 1.5://! 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()?, 1.5)
}
geomsolver left no solid to show.
Time
49 ms; CPU time 50 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 1.5: 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 1.5 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: -1.5mm)
part := solid(shrunk.body)
anvilcad left no solid to show.
Time
1.2 ms; CPU time 1 ms; peak memory 4.7 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 1.5.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, -1.5)
}