A turned post on the z axis: the cylinder of radius 5 from z = 0 to z = 6, topped by the cone frustum from radius 5 at z = 6 to radius 2 at z = 10 (its side the cone 4r + 3z = 38), joined. The convex edge between the cylinder and the cone, the circle of radius 5 at z = 6, is rounded to radius 1: a piece of a torus tangent to both. Shrink it by 2: the solid of every point at least 2 from its outside.
That is more than the round's radius. The round moved 2 inward would be a torus of tube radius 1 − 2 < 0, turned inside out, and drops; the moved cylinder and cone meet in a sharp edge. The post is convex, and the rounded post lies between the sharp post shrunk by 1 and grown back by 1 and the sharp post itself; both shrink by 2 to the same solid, the sharp post's points at least 2 inside: its half-section the polygon (0, 2), (3, 2), (3, 5.33333333333), (1, 8), (0, 8) turned about the axis (the base up 2, the side in 2, the cone in 2 along its normal, 4r + 3z = 38 − 5·2, the top down 2).
As a set:
$$\{\, d \le z \le 10 - d,\ \sqrt{x^2 + y^2} \le 5 - d,\ 4\sqrt{x^2 + y^2} + 3z \le 38 - 5d \,\},\quad d = 2$$
expected
closed form
volume
130.550628
2π∫∫ρ dA over the inset half-section (Pappus): the polygon's first moment about the axis, Σ(ρᵢ + ρᵢ₊₁)(ρᵢzᵢ₊₁ − ρᵢ₊₁zᵢ)/6, with the corners in the text
area
136.1356817
Σ π(ρᵢ + ρᵢ₊₁)·|segment| over the inset half-section's sides off the axis
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
20 ms; CPU time 24 ms; peak memory 11.6 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.
Data
its STEP's
expected
rel. error
volume
130.550628
130.550628
4.4e-16
area
136.1356817
136.1356817
4.2e-16
agrees with
occt, kentron, next.BREP, cadrs, springrep
mesh
2836 triangles, closed
centre of gravity
(-2.81381e-16, 3.29536e-17, 4.38681) its STEP's solid
inertia
about it, of unit density: Ixx 542.506; Iyy 542.506; Izz 525.484; Ixy 2.9747e-14; Iyz 4.80048e-15; Izx 3.94006e-14
//! A turned post on the z axis, the cylinder of radius 5 from z = 0 to z = 6 topped by the cone//! frustum from radius 5 at z = 6 to radius 2 at z = 10, the convex edge between them rounded to//! radius 1, shrunk by 2: every point of it 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, disc, prism};
use cad_kernel::fillet::roll;
use cad_kernel::geom::tolerance;
use cad_kernel::offset::{shrunk, Join};
use cad_kernel::topo::Brep;
constRADIUS: f64 = 5.;
constSHOULDER: f64 = 6.;
constTOP_RADIUS: f64 = 2.;
constTOP: f64 = 10.;
constROUND: f64 = 1.;
constSHRINK: f64 = 2.;
pubfnbuild() -> Result<Brep, String> {
let up = [0., 0., 1.];
let body = prism(&disc([0., 0., 0.], up, RADIUS), 0., SHOULDER)?;
let head = cone([0., 0., SHOULDER], up, RADIUS, TOP_RADIUS, TOP - SHOULDER)?;
let post = combined(&body, &head, Op::Union, 0.)?;
// the shoulder is picked by a point on it; the kernel rolls the ball between the cylinder and// the cone round the loop and builds the ring of material outside the roundlet round = roll(&post, [0., RADIUS, SHOULDER], ROUND, tolerance(post.size()))?;
let op = if round.concave { Op::Union } else { Op::Cut };
let turned = combined(&post, &round.piece, op, 0.)?;
shrunk(&shrunk(&turned, ROUND, Join::Round)?, SHRINK - ROUND, Join::Round)
}
Time
635 ms; CPU time 635 ms; peak memory 369.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.
Data
its STEP's
expected
rel. error
volume
130.550628
130.550628
1.3e-13
area
136.1356817
136.1356817
7.2e-14
agrees with
cad-kernel, kentron, next.BREP, cadrs, springrep
mesh
2844 triangles, closed
centre of gravity
(-1.01665e-16, 1.06302e-18, 4.38681) its STEP's solid
inertia
about it, of unit density: Ixx 542.506; Iyy 542.506; Izz 525.484; Ixy 2.8387e-14; Iyz -7.14724e-14; Izx 2.16559e-14
"""A turned post with its shoulder rounded, shrunk by 2, past the round. A turned post on the z axis: the cylinder of radius 5 from z = 0 to z = 6, topped by the cone frustum from radius 5 at
z = 6 to radius 2 at z = 10 (its side the cone 4r + 3z = 38), joined. The convex edge between the cylinder and the cone,
the circle of radius 5 at z = 6, is rounded to radius 1: a piece of a torus tangent to both. Shrink it by 2: the solid
of every point at least 2 from its outside.
That is more than the round's radius. The round moved 2 inward would be a torus of tube radius 1 − 2 < 0, turned
inside out, and drops; the moved cylinder and cone meet in a sharp edge. The post is convex, and the rounded post lies
between the sharp post shrunk by 1 and grown back by 1 and the sharp post itself; both shrink by 2 to the same solid,
the sharp post's points at least 2 inside: its half-section the polygon (0, 2), (3, 2), (3, 5.33333333333),
(1, 8), (0, 8) turned about the axis (the base up 2, the side in 2, the cone in 2 along its
normal, 4r + 3z = 38 − 5·2, the top down 2)."""fromOCP.BRepAlgoAPIimportBRepAlgoAPI_FusefromOCP.BRepBuilderAPIimportBRepBuilderAPI_MakeSolidfromOCP.BRepPrimAPIimportBRepPrimAPI_MakeCone, BRepPrimAPI_MakeCylinderfromOCP.TopAbsimportTopAbs_ShapeEnumfromOCP.TopoDSimportTopoDSfromOCP.gp import gp_Ax2, gp_Dir, gp_Pnt
from blend import edges_where, rounded
from edit import on_circle
from offset import offset
DISTANCE = 2.0defbuild():
cone = BRepPrimAPI_MakeCone(gp_Ax2(gp_Pnt(0, 0, 6), gp_Dir(0, 0, 1)), 5, 2, 4).Shape()
post = BRepAlgoAPI_Fuse(BRepPrimAPI_MakeCylinder(5, 6).Shape(), cone).Shape()
solid = rounded(post, 1, edges_where(post, on_circle((0, 0, 6), 5)), "the shoulder")
result = offset(solid, -DISTANCE)
# OCCT's offset may give the solid back as its closed shell; the solid is the one it bounds.if result.ShapeType() == TopAbs_ShapeEnum.TopAbs_SHELL:
result = BRepBuilderAPI_MakeSolid(TopoDS.Shell(result)).Solid()
return result
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
21 ms; CPU time 21 ms; peak memory 13.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.
Data
its STEP's
expected
rel. error
volume
130.550628
130.550628
1.8e-14
area
136.1356817
136.1356817
1.6e-14
agrees with
cad-kernel, occt, next.BREP, cadrs, springrep
mesh
2844 triangles, closed
centre of gravity
(8.05769e-17, -3.81244e-16, 4.38681) its STEP's solid
inertia
about it, of unit density: Ixx 542.506; Iyy 542.506; Izz 525.484; Ixy 6.76629e-15; Iyz 1.10265e-14; Izx -5.21525e-15
//! The turned post, the cylinder of radius 5 on the z axis from z = 0 to z = 6 topped by the cone//! frustum from radius 5 at z = 6 to radius 2 at z = 10, the edge between them rounded to radius 1,//! shrunk by 2: every point at least 2 from its outside. The round drops; the moved cylinder and//! cone meet in a sharp edge.usecrate::Refusal;
usecrate::shared::offset::turned_post;
use kentron::offset::{self, Join};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> Result<Shape, Refusal> {
let post = turned_post(m)?;
Ok(offset::shape(m, post, -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
539 ms; CPU time 540 ms; peak memory 57.1 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.
Data
its STEP's
expected
rel. error
volume
130.55059
130.550628
2.9e-07
area
136.1356413
136.1356817
3.0e-07
agrees with
no other kernel
mesh
2948 triangles, closed
centre of gravity
(4.70135e-09, 9.60383e-09, 4.38681) its STEP's solid
inertia
about it, of unit density: Ixx 542.505; Iyy 542.505; Izz 525.484; Ixy -1.29262e-06; Iyz 1.89211e-07; Izx -4.96156e-07
//! The turned post of `offset/turned-post-shrunk-past-its-round`, its shoulder rounded to 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::turned_post_shrunk_past_its_round::turned_post;
usecrate::solids::*;
pubfnbuild() -> R<Body> {
solidcraft_kernel::offset_solid(&turned_post()?, -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
23 ms; CPU time 23 ms; peak memory 22.2 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.
Data
its STEP's
expected
rel. error
volume
130.550628
130.550628
0.0e+00
area
136.1356817
136.1356817
0.0e+00
agrees with
cad-kernel, occt, kentron, cadrs, springrep
mesh
2844 triangles, closed
centre of gravity
(3.89359e-16, 6.13788e-16, 4.38681) its STEP's solid
inertia
about it, of unit density: Ixx 542.506; Iyy 542.506; Izz 525.484; Ixy -3.90729e-14; Iyz 4.43308e-15; Izx -8.40623e-14
//! A turned post with its shoulder rounded, shrunk by 2, past the round: the cylinder of radius 5 from z = 0 to 6 topped by the frustum from radius 5 to 2 over z = 6 to 10,//! the edge between them rounded to radius 1, shrunk by 2.//!//! The round is the kernel's fillet; the solid is shrunk by its rounded offset, which drops a round turned inside out.usecrate::solids::boolean::union;
usecrate::solids::offset::parallel;
usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{fillet_edges, make_cone_brep, make_cylinder_brep, BrepSolid};
constDISTANCE: f64 = 2.0;
pubfnbuild() -> Result<BrepSolid, Refusal> {
let z = p(0.0, 0.0, 1.0);
let post = union(&make_cylinder_brep(p(0.0, 0.0, 0.0), z, 5.0, 6.0)?, &make_cone_brep(p(0.0, 0.0, 6.0), z, 5.0, 2.0, 4.0)?)?;
let rounded = fillet_edges(&post, &[p(0.0, -5.0, 6.0)], None, 1.0, 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.6 ms; CPU time 3.4 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.
Data
its STEP's
expected
rel. error
volume
130.550628
130.550628
2.2e-16
area
136.1356817
136.1356817
2.1e-16
agrees with
cad-kernel, occt, kentron, next.BREP, springrep
mesh
2846 triangles, closed
centre of gravity
(-4.62626e-16, -6.80333e-17, 4.38681) its STEP's solid
inertia
about it, of unit density: Ixx 542.506; Iyy 542.506; Izz 525.484; Ixy 1.59872e-14; Iyz 3.56443e-14; Izx 5.16893e-14
//! A turned post with its shoulder rounded, shrunk by 2, past the round: the cylinder of radius 5 from z = 0 to 6 topped by the frustum from radius 5 to 2 over z = 6 to 10,//! the edge between them rounded to radius 1, shrunk by 2. cadrs's cylinder and cone united, filleted, then its offset (shrunk).usecrate::bench::{cone, cylinder, p3, union, 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 z = v3(0.0, 0.0, 1.0);
let c = cylinder(k, p3(0.0, 0.0, 0.0), z, 5.0, 6.0)?;
let f = cone(k, p3(0.0, 0.0, 6.0), z, 5.0, 2.0, 4.0)?;
let post = union(k, c, f)?;
let shoulder = k.edge_at(post, p3(0.0, -5.0, 6.0))?;
let rounded = fillet(k, post, &[shoulder], 1.0)?;
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
7.6 ms; CPU time 7.2 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.
Data
its STEP's
expected
rel. error
volume
130.550628
130.550628
0.0e+00
area
136.1356817
136.1356817
0.0e+00
agrees with
cad-kernel, occt, kentron, next.BREP, cadrs
mesh
2844 triangles, closed
centre of gravity
(-2.30782e-16, 2.46621e-17, 4.38681) its STEP's solid
inertia
about it, of unit density: Ixx 542.506; Iyy 542.506; Izz 525.484; Ixy 3.19744e-14; Iyz 2.38939e-14; Izx 3.80146e-14
//! The cylinder of radius 5 from z = 0 to z = 6 topped by the frustum from radius 5 to radius 2 at//! z = 10, its shoulder rounded to radius 1, shrunk by 2: the round vanishes and the moved//! cylinder and cone meet in a sharp edge.//! 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::{shrunk, turned_post};
pubfnbuild() -> Result<Brep, String> {
shrunk(&turned_post()?, 2.)
}
geomsolver left no solid to show.
Time
64 ms; CPU time 64 ms; peak memory 25.7 MB
Notes
refused error[E080]: `shrunk.body`: a body shelled and rounded as well is read by the field
// A turned post with its shoulder rounded, shrunk by 2: its half-section drawn in the front plane// (x, z), out to radius 5 from z = 0 to z = 6 and then in along the cone to radius 2 at z = 10,// turned a whole turn about the z axis; the convex edge where the cylinder meets the cone rounded// to radius 1, 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((5, 0))
c := point hint((5, 6))
d := point hint((2, 10))
e := point hint((0, 10))
horizontal (base := line(a, b)) -> vertical (wall := line(b, c)) -> (cone := line(c, d)) ->
horizontal (top := line(d, e)) -> vertical (axis_run := line(e, a)) -> close
fix((0, 0)) a
a distance(5) b
b distance(6) c
a distance(10) e
e distance(2) d
half := face(base, wall, cone, top, axis_run)
}
post := solid(std.solids.Revolution(half, about: std.z))
post.wall round(r: 1mm) post.cone
shrunk := std.rounds.Grown(post, d: -2mm)
part := solid(shrunk.body)
anvilcad left no solid to show.
Time
6.8 ms; CPU time 6.6 ms; peak memory 5 MB
Notes
refused not supported yet: the offset is larger than a curved face's radius
//! A turned post on the z axis, the cylinder of radius 5 from z = 0 to 6 topped by the frustum from//! radius 5 at z = 6 to 2 at z = 10, the edge between them rounded to radius 1; shrunk by 2..use anvil_brep::Solid;
usecrate::shared::{fillet, offset, polygon, ring, turned};
pubfnbuild() -> Result<Solid, String> {
let post = turned(&anvil_brep::Frame::world(), polygon(&[(0., 0.), (5., 0.), (5., 6.), (2., 10.), (0., 10.)]))?;
offset(&fillet(&post, &[ring(5., 6.)], 1.)?, -2.)
}