A drum: the cylinder of radius 8 on the z axis from z = 0 to z = 6, with a thin flange around its side, a ring from radius 8 out to radius 11 and from z = 2.2 to z = 3.8, 1.6 thick. Shrink it by 1: the solid of every point at least 1 from the flanged drum's outside.
Every point of the flange is within 0.8 of its top or bottom face, so shrinking takes the whole flange away: its faces, moved 1 inward from each side, cross each other and are gone. The drum's top and bottom move in to z = 5 and z = 1 and its side to radius 7, with its outer edges sharp. Where the flange met the drum, its two inside edges (the circles of radius 8 at z = 2.2 and z = 3.8) become concave pieces of tori, tubes of radius 1 about those circles, running from the side at radius 7 outward and meeting each other in a sharp ridge, the circle of radius 7.4 at z = 3. So a low ridge, 0.4 high, is all that is left of the flange.
As a set:
$$\bigl(\{\,\rho \le 8,\ 0 \le z \le 6\,\} \cup \{\,\rho \le 11,\ 2.2 \le z \le 3.8\,\}\bigr)
\ominus B_{1}$$
expected
closed form
volume
624.3662287
π·7²·4 + 2π(16a − 8(a√(1 − a²) + asin a) − a³/3), a = 0.8
area
496.6023797
2π(49 + 7(4 − 2a) + 2(8 asin a − a)), a = 0.8
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
28 ms; CPU time 34 ms; peak memory 11.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
624.3662287
624.3662287
0.0e+00
area
496.6023797
496.6023797
2.3e-16
agrees with
occt, kentron, next.BREP, cadrs, springrep
mesh
19964 triangles, closed
centre of gravity
(-7.51095e-16, 2.95886e-16, 3) its STEP's solid
inertia
about it, of unit density: Ixx 8582.58; Iyy 8582.58; Izz 15522.1; Ixy 7.38964e-13; Iyz 2.13163e-14; Izx -4.71845e-16
//! The cylinder of radius 8 on the z axis from z = 0 to z = 6, with a flange round its side from//! radius 8 to 11 between z = 2.2 and z = 3.8, shrunk by 1.use cad_kernel::boolean::{combined, Op};
use cad_kernel::build::{disc, prism};
use cad_kernel::offset::{shrunk, Join};
use cad_kernel::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
let drum = prism(&disc([0., 0., 0.], [0., 0., 1.], 8.), 0., 6.)?;
let flange = prism(&disc([0., 0., 2.2], [0., 0., 1.], 11.), 0., 1.6)?;
shrunk(&combined(&drum, &flange, Op::Union, 0.)?, 1., Join::Round)
}
Time
649 ms; CPU time 648 ms; peak memory 368.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.
Data
its STEP's
expected
rel. error
volume
624.3662287
624.3662287
3.6e-16
area
496.6023797
496.6023797
3.4e-16
agrees with
cad-kernel, kentron, next.BREP, cadrs, springrep
mesh
19964 triangles, closed
centre of gravity
(1.25182e-16, -3.64167e-16, 3) its STEP's solid
inertia
about it, of unit density: Ixx 8582.58; Iyy 8582.58; Izz 15522.1; Ixy 8.10019e-13; Iyz 1.06581e-14; Izx -2.93932e-14
"""A flanged drum shrunk until its flange is gone. A drum, the cylinder of radius 8 on the z axis
from z = 0 to z = 6, with a thin flange round its side, a ring from radius 8 out to radius 11 and
from z = 2.2 to z = 3.8, shrunk by 1."""fromOCP.BRepAlgoAPIimportBRepAlgoAPI_FusefromOCP.BRepPrimAPIimportBRepPrimAPI_MakeCylinderfromOCP.gp import gp, gp_Ax2, gp_Pnt
from bench importRefusedfrom offset import offset
RADIUS = 8HEIGHT = 6FLANGE_BOTTOM, FLANGE_TOP = 2.2, 3.8FLANGE_RADIUS = 11SHRINKAGE = 1defbuild():
drum = BRepPrimAPI_MakeCylinder(RADIUS, HEIGHT).Shape()
flange = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, 0, FLANGE_BOTTOM), gp.DZ_s()),
FLANGE_RADIUS, FLANGE_TOP - FLANGE_BOTTOM).Shape()
fuse = BRepAlgoAPI_Fuse(drum, flange)
ifnot fuse.IsDone():
raiseRefused("BRepAlgoAPI_Fuse declined the flange")
returnoffset(fuse.Shape(), -SHRINKAGE)
arris left no solid to show.
Time
1.2 ms; CPU time 980 µs; peak memory 3.6 MB
Notes
refused arris has no offset that trims an offset that crosses itself, nor rounded joins: `offset_faces` keeps the topology, and refuses the flange's faces moved through each other ("the offset would make the edge or face vanish or turn inside out")
//! A drum of radius 8 from z = 0 to z = 6, with a flange 1.6 thick out to radius 11 round its//! side from z = 2.2 to z = 3.8, shrunk by 1, so that the flange is gone.//!//! Refused: arris's `offset_faces` keeps the solid's topology: the flange's faces, moved 1 towards//! each other, cross, and it refuses them ("the offset would make the edge or face vanish or turn//! inside out") and does not trim them away. Where the flange meets the drum, a concave edge//! shrunk, it has no rounded join either.usecrate::Refusal;
use arris::topo::{Body, Model};
pubfnbuild(_: &mutModel) -> Result<Body, Refusal> {
Err("arris has no offset that trims an offset that crosses itself, nor rounded joins: `offset_faces` keeps the topology, and refuses the flange's faces moved through each other (\"the offset would make the edge or face vanish or turn inside out\")".into())
}
Time
18 ms; CPU time 18 ms; peak memory 11.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
624.3662287
624.3662287
3.6e-16
area
496.6023797
496.6023797
4.6e-16
agrees with
cad-kernel, occt, next.BREP, cadrs, springrep
mesh
19964 triangles, closed
centre of gravity
(2.04844e-16, -6.37293e-16, 3) its STEP's solid
inertia
about it, of unit density: Ixx 8582.58; Iyy 8582.58; Izz 15522.1; Ixy 8.52651e-13; Iyz 3.50231e-29; Izx -2.67841e-14
//! A drum, the cylinder of radius 8 on the z axis from z = 0 to z = 6, with a flange round its//! side from radius 8 to 11 and from z = 2.2 to z = 3.8, shrunk by 1: every point at least 1 from//! its outside. The flange, 1.6 thick, shrinks away to a low ridge: two concave pieces of tori//! meeting in the circle of radius 7.4 at z = 3.usecrate::bench::{frame, p};
use kentron::boolean;
use kentron::math::Direction;
use kentron::offset::{self, Join};
use kentron::primitives::Cylinder;
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let drum = Cylinder::new(8.0, 6.0).build(m)?;
let flange = Cylinder::new(11.0, 1.6).with_frame(frame(p(0.0, 0.0, 2.2), Direction::Z)).build(m)?;
let flanged = boolean::union(m, drum, flange)?;
offset::shape(m, flanged, -1.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.
solidcraft left no solid to show.
Time
391 ms; CPU time 390 ms; peak memory 54.3 MB
Notes
refused the operation failed: SMLib offset: operation: the offset is refused: the body built is not a manifold solid, as its input was: offset::offset_executive::p2::offset_brep: the body built is not a manifold solid, as its input was: refused
//! A drum, the cylinder of radius 8 on the z axis from z = 0 to z = 6, with a flange round its//! side out to radius 11 from z = 2.2 to z = 3.8, shrunk by 1: every point at least 1 from its//! outside. The flange's faces, moved 1 in from each side, cross and are trimmed away by//! SolidCraft's offset of the whole solid inward (`offset_solid`, rounded; its self-intersections//! merged), and the flange's inside edges, where the moved faces part, become concave tori.usecrate::solids::*;
pubfnbuild() -> R<Body> {
let drum = zcyl(0.0, 0.0, 8.0, 0.0, 6.0)?;
let flange = zcyl(0.0, 0.0, 11.0, 2.2, 3.8)?;
solidcraft_kernel::offset_solid(&union(&drum, &flange)?, -1.0, true)
}
brepkit left no solid to show.
Time
2.3 ms; CPU time 2.1 ms; peak memory 10.3 MB
Notes
refused invalid input: invalid input: arc joint construction is not yet implemented; use JointType::Intersection
//! A drum, the cylinder of radius 8 on the z axis from z = 0 to 6, with a flange round its side//! from radius 8 to 11 and from z = 2.2 to 3.8, shrunk by 1 with brepkit's rounded offset, whose//! joints roll a ball of radius 1 along the flange's inside edges.use brepkit_operations::offset_v2::offset_solid_arc_v2;
use brepkit_operations::primitives::make_cylinder;
use brepkit_topology::solid::SolidId;
use brepkit_topology::Topology;
usecrate::solids::{fuse, moved};
usecrate::Refusal;
pubfnbuild(topo: &mutTopology) -> Result<SolidId, Refusal> {
let drum = make_cylinder(topo, 8.0, 6.0)?;
let flange = make_cylinder(topo, 11.0, 1.6)?;
let flange = moved(topo, flange, 0.0, 0.0, 2.2)?;
let flanged = fuse(topo, drum, flange)?;
Ok(offset_solid_arc_v2(topo, flanged, -1.0)?)
}
popkern left no solid to show.
Time
62 ms; CPU time 144 ms; peak memory 30.6 MB
Notes
refused FeatureFailed at flanged_drum_shrunk.rhai:7:13: feature 'shrunk' (offset_solid) failed: offset 1.000000 exceeds the maximum 0.792000 supported by the geometry (edge EdgeHandle(4v1) (length 1.600000) collapses at this distance; trim declined: self-intersection trim failed: rim edge EdgeHandle(3v1) has no opposing weld partner — the trim region does not close (start Point3 { x: 7.0, y: 0.0, z: 5.0 }, end Point3 { x: 7.0, y: 0.0, z: 5.0 }))
// A drum, the cylinder of radius 8 on the z axis from z = 0 to 6, with a flange round its side// from radius 8 out to 11 and from z = 2.2 to 3.8; shrunk by 1, which takes the flange away.let m = model();
let drum = m.profile(xy()).circle(8.0).sketch("drum").extrude(blind(6.0));
let flange = m.tool(|m| m.profile(xy_at(2.2)).circle(11.0).sketch("flange").extrude(blind(1.6)));
drum = drum.union(flange, #{ label: "flanged" });
drum = drum.offset_solid(-1.0, #{ label: "shrunk" });
m
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
21 ms; CPU time 21 ms; peak memory 18.4 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
624.3662287
624.3662287
1.8e-16
area
496.6023797
496.6023797
3.4e-16
agrees with
cad-kernel, occt, kentron, cadrs, springrep
mesh
73604 triangles, closed, 2 degenerate
centre of gravity
(2.91675e-16, -3.66284e-16, 3) its STEP's solid
inertia
about it, of unit density: Ixx 8582.58; Iyy 8582.58; Izz 15522.1; Ixy 2.00656e-13; Iyz 1.58312e-13; Izx 5.68434e-14
//! A drum, the cylinder of radius 8 on the z axis from z = 0 to z = 6, with a flange round its side//! from radius 8 to 11 and z = 2.2 to 3.8, shrunk by 1: every point at least 1 from its outside.//! The flange is gone but for a low ridge where its inside edges become concave pieces of tori.//!//! The flange is a ring, its section revolved a full turn, joined to the drum.usecrate::solids::offset::{parallel, union};
usecrate::solids::{p, polygon};
usecrate::Refusal;
use brep_kernel::{make_cylinder_brep, revolve_profile_brep, BrepSolid};
use std::f64::consts::TAU;
pubfnbuild() -> Result<BrepSolid, Refusal> {
let z = p(0.0, 0.0, 1.0);
let drum = make_cylinder_brep(p(0.0, 0.0, 0.0), z, 8.0, 6.0)?;
let section =
polygon(&[p(8.0, 0.0, 2.2), p(11.0, 0.0, 2.2), p(11.0, 0.0, 3.8), p(8.0, 0.0, 3.8)])?;
let flange = revolve_profile_brep(§ion, p(0.0, 0.0, 0.0), z, TAU)?;
let flanged = union(&drum, &flange)?;
Ok(parallel(&flanged, -1.0)?)
}
geop left no solid to show.
Time
2.1 ms; CPU time 1.9 ms; peak memory 9.8 MB
Notes
refused geop has no offset of a solid as every point at least a distance from its outside: its face offset keeps every face and meets them sharp, so it can neither drop the flange whose moved faces cross nor make the rounds that form the ridge
//! A drum, the cylinder of radius 8 on the z axis from z = 0 to z = 6, with a flange from//! radius 8 out to 11 between z = 2.2 and z = 3.8, shrunk by 1: every point at least 1 from its//! outside. The flange, thinner than 2, is gone, and where it met the drum two concave pieces of//! tori meet in a low ridge.//!//! geop has no offset of a solid that is every point at least a distance from its outside: its//! face offset moves the faces and meets them sharp, keeping every face, so it can neither drop//! the flange whose moved faces cross nor round the concave edges where the flange met the drum//! into the tori that make the ridge. So it is refused.usecrate::{Bench, Refusal};
pubfnbuild(_: &mutBench) -> Result<(), Refusal> {
Err("geop has no offset of a solid as every point at least a distance from its outside: its \
face offset keeps every face and meets them sharp, so it can neither drop the flange \
whose moved faces cross nor make the rounds that form the ridge"
.into())
}
Time
12 ms; CPU time 14 ms; peak memory 10.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
624.3662287
624.3662287
3.6e-16
area
496.6023797
496.6023797
3.4e-16
agrees with
cad-kernel, occt, kentron, next.BREP, springrep
mesh
19964 triangles, closed
centre of gravity
(-6.82813e-17, -4.55209e-17, 3) its STEP's solid
inertia
about it, of unit density: Ixx 8582.58; Iyy 8582.58; Izz 15522.1; Ixy 4.83169e-13; Iyz 2.55795e-13; Izx -2.95319e-14
//! A drum, the cylinder of radius 8 on the z axis from z = 0 to z = 6, with a flange around its//! side, a ring from radius 8 to 11 and from z = 2.2 to z = 3.8, shrunk by 1: the solid of every//! point at least 1 from its outside. The flange, thinner than 2, is taken away whole; the drum//! moves in to radius 7 and z = 1 to 5, and the flange's inside edges become concave pieces of//! tori meeting in a low ridge at radius 7.4, z = 3.//!//! The drum a circle extruded; the flange an annulus sketched at z = 2.2 and extruded 1.6,//! united with it; then cadrs's offset inward.usecrate::bench::{cylinder, extrude, p3, union, v3};
usecrate::shared::offset::shrunk;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, Loop, Plane, Profile};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let drum = cylinder(k, p3(0.0, 0.0, 0.0), v3(0.0, 0.0, 1.0), 8.0, 6.0)?;
let ring = Profile::with_holes(Plane::xy(2.2), Loop::circle([0.0, 0.0], 11.0), vec![Loop::circle([0.0, 0.0], 8.0)]);
let flange = extrude(k, &ring, 1.6)?;
let part = union(k, drum, flange)?;
shrunk(k, part, 1.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
38 ms; CPU time 37 ms; peak memory 9.4 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
624.3662287
624.3662287
0.0e+00
area
496.6023797
496.6023797
2.3e-16
agrees with
cad-kernel, occt, kentron, next.BREP, cadrs
mesh
19964 triangles, closed
centre of gravity
(-7.05574e-16, 3.18646e-16, 3) its STEP's solid
inertia
about it, of unit density: Ixx 8582.58; Iyy 8582.58; Izz 15522.1; Ixy 5.11591e-13; Iyz 7.10543e-14; Izx 2.22045e-16
//! The cylinder of radius 8 on the z axis from z = 0 to z = 6 with a flange round its side, from//! radius 8 out to 11 and z = 2.2 to 3.8, shrunk by 1: the flange is gone but for a low ridge.//! springrep 1.0.1 refuses it: the offset of the complement does not follow the flange's faces//! through each other ("a moved edge runs backwards").use springrep::boolean::union;
use springrep::primitive::cylinder;
use springrep::topo::Brep;
usecrate::shared::offset::shrunk;
usecrate::shared::{at, e};
pubfnbuild() -> Result<Brep, String> {
let drum = cylinder(&at([0., 0., 0.]), 8., 6., "drum").map_err(e)?;
let flange = cylinder(&at([0., 0., 2.2]), 11., 1.6, "flange").map_err(e)?;
let flanged = union(&drum, &flange).map_err(e)?;
shrunk(&flanged, 1.)
}
geomsolver left no solid to show.
Time
50 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 flanged drum shrunk by 1: the drum's half-section drawn in the front plane (x, z), out from the// axis to radius 8 from z = 0 to z = 6 with the flange standing out to radius 11 from z = 2.2 to// z = 3.8, turned a whole turn about the z axis; and the points of it at least 1 from its outside,// `std.rounds.Grown`'s body for a negative reach.unit mm
use std
use std.solids
use std.rounds
in std.front {
a := point
b := point hint((8, 0))
c := point hint((8, 2.2))
d := point hint((11, 2.2))
e := point hint((11, 3.8))
f := point hint((8, 3.8))
g := point hint((8, 6))
h := point hint((0, 6))
half := horizontal line(a, b) -> vertical line(b, c) -> horizontal line(c, d) ->
vertical line(d, e) -> horizontal line(e, f) -> vertical line(f, g) ->
horizontal line(g, h) -> vertical line(h, a) -> close
fix((0, 0)) a
a distance(8) b
a distance(6) h
b distance(2.2) c
c distance(3) d
d distance(1.6) e
e distance(3) f
}
drum := solid(std.solids.Revolution(half, about: std.z))
shrunk := std.rounds.Grown(drum, d: -1mm)
part := solid(shrunk.body)
anvilcad left no solid to show.
Time
1.1 ms; CPU time 940 µs; peak memory 3.5 MB
Notes
refused anvil-brep's offset moves each face along its normal and extends the moved faces until they meet, keeping the solid's edges; it adds no round at a concave edge and drops no feature the offset consumes, so it cannot shrink this solid to every point at least that far inside
//! A flanged drum shrunk until its flange is gone, shrunk.use anvil_brep::Solid;
pubfnbuild() -> Result<Solid, String> {
Err("anvil-brep's offset moves each face along its normal and extends the moved faces until they meet, keeping the solid's edges; it adds no round at a concave edge and drops no feature the offset consumes, so it cannot shrink this solid to every point at least that far inside".into())
}