A cone frustum on the z axis, from the disk of radius 6 at z = 0 to the disk of radius 3 at z = 6 (its side the cone 2r + z = 12), with both its circular edges rounded to radius 1.5: the top rim by a piece of a torus tangent to the top and to the cone, the bottom rim by one tangent to the bottom and to the cone, each of tube radius 1.5. Shrink it by 2: the solid of every point at least 2 from the frustum's outside.
That is more than the rounds' radius. A round moved 2 inward would be a torus of tube radius 1.5 − 2 < 0, turned inside out: it is no part of the result, and the moved cone and the moved top or bottom run on past it until they meet in a sharp edge. The result is the frustum shrunk with sharp edges: from z = 2 to z = 4, its side the cone 2r + z = 12 − 2√5 (the side moved 2 along its normal), so its radius is (12 − 2√5 − 2)/2 at the bottom and (12 − 2√5 − 4)/2 at the top.
As a set: the rounded frustum lies between the sharp frustum shrunk by 1.5 and grown back by 1.5 and the sharp frustum itself, so for any distance of at least 1.5 its points at least that far inside are the sharp frustum's:
$$\{\, d \le z \le 6 - d,\ 2\sqrt{x^2 + y^2} + z \le 12 - d\sqrt{5} \,\},\quad d = 2$$
expected
closed form
volume
32.72736262
πh(a² + ab + b²)/3, h = 6 − 2d, a = (12 − d√5 − d)/2, b = (12 − d√5 − (6 − d))/2, d = 2
area
65.58196622
πa² + πb² + π(a + b)√((a − b)² + h²), with a, b and h as for the volume
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
22 ms; CPU time 27 ms; peak memory 12 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 frustum on the z axis from the disk of radius 6 at z = 0 to the disk of radius 3 at//! z = 6, both its rims rounded to radius 1.5, shrunk by 2: its points at least 2 inside it.//!//! The kernel's offset sweeps a round's torus inward only as far as its tube's radius: past it//! the torus 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 round's radius, which takes the round down to a sharp//! edge, and then by the rest.use cad_kernel::boolean::{combined, Op};
use cad_kernel::build::cone;
use cad_kernel::fillet::roll;
use cad_kernel::geom::{tolerance, V};
use cad_kernel::offset::{shrunk, Join};
use cad_kernel::topo::Brep;
constFOOT: f64 = 6.;
constTOP: f64 = 3.;
constHEIGHT: f64 = 6.;
constROUND: f64 = 1.5;
constSHRINK: f64 = 2.;
/// `part` with the edge through `at` rounded to `ROUND`: the kernel's piece taken off a convex/// edge, filled in at a concave one.fnrounded(part: &Brep, at: V) -> Result<Brep, String> {
let round = roll(part, at, ROUND, tolerance(part.size()))?;
let op = if round.concave { Op::Union } else { Op::Cut };
Ok(combined(part, &round.piece, op, 0.)?)
}
pubfnbuild() -> Result<Brep, String> {
let frustum = cone([0., 0., 0.], [0., 0., 1.], FOOT, TOP, HEIGHT)?;
// each rim is picked by a point on it, the top's and then the bottom'slet frustum = rounded(&rounded(&frustum, [0., TOP, HEIGHT])?, [0., FOOT, 0.])?;
shrunk(&shrunk(&frustum, ROUND, Join::Round)?, SHRINK - ROUND, Join::Round)
}
Time
636 ms; CPU time 635 ms; peak memory 368.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.
"""A rounded cone frustum shrunk past its rounds' radius. A cone frustum on the z axis, from the disk of radius 6 at z = 0 to the disk of radius 3 at z = 6 (its side
the cone 2r + z = 12), with both its circular edges rounded to radius 1.5: the top rim by a piece of a torus tangent to the top and to the cone, the bottom rim by one tangent to the bottom and to the cone, each of tube radius 1.5. Shrink it by 2: the solid of every point at least 2 from the
frustum's outside.
That is more than the rounds' radius. A round moved 2 inward would be a torus of tube radius
1.5 − 2 < 0, turned inside out: it is no part of the result, and the moved cone and the moved top or
bottom run on past it until they meet in a sharp edge. The result is the frustum shrunk with sharp
edges: from z = 2 to z = 4, its side the cone 2r + z = 12 − 2√5 (the side moved 2 along its
normal), so its radius is (12 − 2√5 − 2)/2 at the bottom and (12 − 2√5 − 4)/2 at the top."""fromOCP.BRepBuilderAPIimportBRepBuilderAPI_MakeSolidfromOCP.BRepPrimAPIimportBRepPrimAPI_MakeConefromOCP.TopAbsimportTopAbs_ShapeEnumfromOCP.TopoDSimportTopoDSfrom blend import edges_where, rounded
from edit import on_circle
from offset import offset
DISTANCE = 2.0defbuild():
solid = BRepPrimAPI_MakeCone(6, 3, 6).Shape()
solid = rounded(solid, 1.5, edges_where(solid, on_circle((0, 0, 6), 3)) + edges_where(solid, on_circle((0, 0, 0), 6)), "the rims")
shrunk = offset(solid, -DISTANCE)
# OCCT's offset gives this solid back as its closed shell; the solid is the one it bounds.if shrunk.ShapeType() == TopAbs_ShapeEnum.TopAbs_SHELL:
shrunk = BRepBuilderAPI_MakeSolid(TopoDS.Shell(shrunk)).Solid()
return shrunk
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
13 ms; CPU time 13 ms; peak memory 11.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.
//! The cone frustum on the z axis from the disc of radius 6 at z = 0 to the disc of radius 3 at z = 6,//! both rims rounded to radius 1.5, shrunk by 2: every point at least 2 from its outside. The//! rounds moved inward turn inside out and drop: the result is the sharp frustum shrunk by 2, from//! z = 2 to z = 4.usecrate::Refusal;
usecrate::shared::offset::rounded_frustum;
use kentron::offset::{self, Join};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> Result<Shape, Refusal> {
let frustum = rounded_frustum(m, Some(1.5), Some(1.5))?;
Ok(offset::shape(m, frustum, -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
277 ms; CPU time 276 ms; peak memory 54.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 frustum on the z axis from radius 6 at z = 0 to radius 3 at z = 6, both rims rounded//! to radius 1.5, 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::rounded_puck_shrunk_by_its_rounds::round_circles;
usecrate::solids::*;
/// The frustum with the rims `rims` (each `(radius, z)`: (6, 0) the bottom, (3, 6) the top)/// rounded to 1.5. solidcraft-kernel has no cone: the frustum is its half section turned about/// the z axis.pubfnfrustum_rounded(rims: &[(f64, f64)]) -> R<Body> {
let frustum = revolve_z(polygon(&[(0.0, 0.0), (6.0, 0.0), (3.0, 6.0), (0.0, 6.0)]), 360.0)?;
round_circles(&frustum, rims, 1.5)
}
pubfnbuild() -> R<Body> {
solidcraft_kernel::offset_solid(&frustum_rounded(&[(6.0, 0.0), (3.0, 6.0)])?, -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
34 ms; CPU time 34 ms; peak memory 22.6 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 rounded cone frustum shrunk past its rounds' radius: the frustum from radius 6 at z = 0 to radius 3 at z = 6, both rims//! rounded to radius 1.5, shrunk by 2: every point at least 2 from its outside.//!//! The rims are rounded by the kernel's fillet and the solid shrunk by its offset, which drops a//! round turned inside out and joins the faces on either side of it.usecrate::solids::offset::parallel;
usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{fillet_edges, make_cone_brep, BrepSolid};
constDISTANCE: f64 = 2.0;
pubfnbuild() -> Result<BrepSolid, Refusal> {
let frustum = make_cone_brep(p(0.0, 0.0, 0.0), p(0.0, 0.0, 1.0), 6.0, 3.0, 6.0)?;
// the rounded rims, each by a point on itlet rounded = fillet_edges(&frustum, &[p(0.0, -3.0, 6.0), p(0.0, -6.0, 0.0)], None, 1.5, false, None)?;
Ok(parallel(&rounded, -DISTANCE)?)
}
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
3.2 ms; CPU time 2.9 ms; peak memory 8.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 rounded cone frustum shrunk past its rounds' radius: the frustum from radius 6 at z = 0 to radius 3 at z = 6, both rims//! rounded to radius 1.5, shrunk by 2. cadrs's cone primitive, filleted, then its offset (shrunk).usecrate::bench::{cone, p3, v3};
usecrate::shared::fillet::fillet;
usecrate::shared::offset::shrunk;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, Pick};
constDISTANCE: f64 = 2.0;
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let frustum = cone(k, p3(0.0, 0.0, 0.0), v3(0.0, 0.0, 1.0), 6.0, 3.0, 6.0)?;
let edges = k.edges_at(frustum, &[p3(0.0, -3.0, 6.0), p3(0.0, -6.0, 0.0)])?;
let rounded = fillet(k, frustum, &edges, 1.5)?;
shrunk(k, rounded, DISTANCE)
}
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
4.3 ms; CPU time 4.1 ms; peak memory 8.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 frustum from radius 6 at z = 0 to radius 3 at z = 6, both rims rounded to radius 1.5,//! shrunk by 2, past the rounds' radius: the rounds vanish and the frustum shrinks with sharp//! edges. springrep 1.0.1 refuses it: its face offset cannot follow a round moved past its radius//! ("an offset … closes a torus to nothing").use springrep::topo::Brep;
usecrate::shared::offset::{rounded_frustum, shrunk};
pubfnbuild() -> Result<Brep, String> {
shrunk(&rounded_frustum()?, 2.)
}
geomsolver left no solid to show.
Time
73 ms; CPU time 73 ms; peak memory 26.8 MB
Notes
refused error[E080]: `shrunk.body`: a body shelled and rounded as well is read by the field
// A cone frustum on the z axis from radius 6 at z = 0 to radius 3 at z = 6, both its circular edges// rounded to radius 1.5, shrunk by 2: its half-section drawn in the front plane (x, z) and turned a// whole turn about the z axis, the round put on, 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.solids
use std.rounds
use std.rounds (round)
in std.front {
a := point
b := point hint((6, 0))
c := point hint((3, 6))
d := point hint((0, 6))
horizontal (bottom := line(a, b)) -> (side := line(b, c)) -> horizontal (top := line(c, d)) ->
vertical (axis_run := line(d, a)) -> close
fix((0, 0)) a
a distance(6) b
a distance(6) d
d distance(3) c
half := face(bottom, side, top, axis_run)
}
frustum := solid(std.solids.Revolution(half, about: std.z))
frustum.side round(r: 1.5mm) frustum
shrunk := std.rounds.Grown(frustum, d: -2mm)
part := solid(shrunk.body)
anvilcad left no solid to show.
Time
13 ms; CPU time 13 ms; peak memory 5.2 MB
Notes
refused not supported yet: the offset is larger than a curved face's radius
//! A frustum on the z axis from radius 6 at z = 0 to 3 at z = 6, both rims rounded to radius 1.5, shrunk//! by 2..use anvil_brep::{Frame, Solid};
usecrate::shared::{cone, fillet, offset, ring};
pubfnbuild() -> Result<Solid, String> {
let f = fillet(&cone(&Frame::world(), 6., 3., 6.)?, &[ring(6., 0.), ring(3., 6.)], 1.5)?;
offset(&f, -2.)
}