A drum: the cylinder of radius 10 on the z axis from z = 0 to z = 10, with a groove around its side from z = 4.2 to z = 5.8, 1.6 wide, cut 3 deep (to radius 7). Grow it by 1: the solid of every point within 1 of the grooved drum.
Every point of the groove is within 0.8 of one of its walls, so growing fills it: its faces, moved 1 into the groove from each side, cross each other and are gone. The drum's top and bottom move out to z = 11 and z = −1, its side to radius 11, and its two outer rims round to the outer quarter of a torus's tube of radius 1. Where the groove was, the groove's two outer rims (the circles of radius 10 at z = 4.2 and z = 5.8) become pieces of tori too, tubes of radius 1 about those circles, running from the side at radius 11 inward and meeting each other in a sharp crease, the circle of radius 10.6 at z = 5. So a shallow V-shaped notch, 0.4 deep, is all that is left of the groove.
In a section through the axis, Q is the integral of the distance from the axis over the grown drum with no groove, and M over the notch.
As a set:
$$\bigl(\{\,\rho \le 10,\ 0 \le z \le 10\,\} \setminus \{\,\rho \ge 7,\ 4.2 \le z \le 5.8\,\}\bigr)
\oplus B_{1}$$
expected
closed form
volume
4519.350147
2π(Q − M), Q = 705 + 5π + 2/3, M = 20a − 10(a√(1 − a²) + asin a) + a³/3, a = 0.8
area
1545.423762
2π(2·50 + 2(5π + 1) + 11(10 − 2a) + 2(10 asin a + a)), a = 0.8
Drawing
TopIsometricFrontRight
Third-angle projection, the three views at one scale. Drawn from next.BREP'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
30 ms; CPU time 37 ms; peak memory 11.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 cylinder of radius 10 on the z axis from z = 0 to z = 10, a groove round its side from//! z = 4.2 to z = 5.8 cut to radius 7, grown by 1.use cad_kernel::boolean::{combined, Op};
use cad_kernel::build::{disc, prism, Profile, ProfileEdge};
use cad_kernel::geom::Frame;
use cad_kernel::offset::{grown, Join};
use cad_kernel::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
let drum = prism(&disc([0., 0., 0.], [0., 0., 1.], 10.), 0., 10.)?;
// the groove: the ring from radius 7 out past the sidelet o = [0., 0., 4.2];
let ring = Profile { origin: o, normal: [0., 0., 1.], names: Vec::new(), loops: vec![
vec![ProfileEdge::Arc { frame: Frame::about(o, [0., 0., 1.]), r: 12., span: None }],
vec![ProfileEdge::Arc { frame: Frame::about(o, [0., 0., 1.]), r: 7., span: None }],
] };
let groove = prism(&ring, 0., 1.6)?;
grown(&combined(&drum, &groove, Op::Cut, 0.)?, 1., Join::Round)
}
Time
667 ms; CPU time 666 ms; peak memory 369 MB
Notes
wrong its STEP's loops along seams run clockwise about their faces' normals, against ISO 10303-42: read by the standard, those faces are the rest of their surfaces, where the seams are not (read its way, it holds the solid)
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 grooved drum grown until its groove closes. A drum, the cylinder of radius 10 on the z axis
from z = 0 to z = 10, with a groove round its side from z = 4.2 to z = 5.8 cut 3 deep (to radius
7), grown by 1."""fromOCP.BRepAlgoAPIimportBRepAlgoAPI_CutfromOCP.BRepPrimAPIimportBRepPrimAPI_MakeCylinderfromOCP.gp import gp, gp_Ax2, gp_Pnt
from bench importRefusedfrom offset import offset
RADIUS = 10HEIGHT = 10GROOVE_BOTTOM, GROOVE_TOP = 4.2, 5.8GROOVE_RADIUS = 7GROWTH = 1defbuild():
drum = BRepPrimAPI_MakeCylinder(RADIUS, HEIGHT).Shape()
# The groove is a ring: a disc reaching past the drum's side, less the core it leaves.
axis = gp_Ax2(gp_Pnt(0, 0, GROOVE_BOTTOM), gp.DZ_s())
ring = BRepAlgoAPI_Cut(
BRepPrimAPI_MakeCylinder(axis, RADIUS + 1, GROOVE_TOP - GROOVE_BOTTOM).Shape(),
BRepPrimAPI_MakeCylinder(axis, GROOVE_RADIUS, GROOVE_TOP - GROOVE_BOTTOM).Shape())
cut = BRepAlgoAPI_Cut(drum, ring.Shape())
ifnot ring.IsDone() ornot cut.IsDone():
raiseRefused("BRepAlgoAPI_Cut declined the groove")
returnoffset(cut.Shape(), GROWTH)
arris left no solid to show.
Time
1.1 ms; CPU time 970 µs; peak memory 3.8 MB
Notes
refused arris has no offset with rounded joins, and none that trims an offset that crosses itself: `offset_faces` joins sharp and keeps the topology, and refuses the groove's walls moved through each other ("the offset would make the edge or face vanish or turn inside out")
//! A drum of radius 10 from z = 0 to z = 10, with a groove 1.6 wide and 3 deep round its side//! from z = 4.2 to z = 5.8, grown by 1, so that the groove closes.//!//! Refused: arris's `offset_faces` joins sharp, so grown it would not round the drum's edges, and//! it keeps the solid's topology: the groove's walls, 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.usecrate::Refusal;
use arris::topo::{Body, Model};
pubfnbuild(_: &mutModel) -> Result<Body, Refusal> {
Err("arris has no offset with rounded joins, and none that trims an offset that crosses itself: `offset_faces` joins sharp and keeps the topology, and refuses the groove's walls moved through each other (\"the offset would make the edge or face vanish or turn inside out\")".into())
}
Time
23 ms; CPU time 23 ms; peak memory 11.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.
//! A drum, the cylinder of radius 10 on the z axis from z = 0 to z = 10, with a groove round its//! side from z = 4.2 to z = 5.8 cut to radius 7, grown by 1: every point within 1 of it. The//! groove, 1.6 wide, fills, leaving a shallow V-shaped notch: two pieces of tori meeting in the//! circle of radius 10.6 at z = 5. The groove is cut as a ring reaching past the drum's side.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(10.0, 10.0).build(m)?;
let at = frame(p(0.0, 0.0, 4.2), Direction::Z);
let disc = Cylinder::new(11.0, 1.6).with_frame(at).build(m)?;
let core = Cylinder::new(7.0, 1.6).with_frame(at).build(m)?;
let ring = boolean::difference(m, disc, core)?;
let grooved = boolean::difference(m, drum, ring)?;
offset::shape(m, grooved, 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.
Time
551 ms; CPU time 550 ms; peak memory 52.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 drum, the cylinder of radius 10 on the z axis from z = 0 to z = 10, with a groove round its//! side from z = 4.2 to z = 5.8 cut to radius 7, grown by 1: every point within 1 of it. The//! groove, narrower than 2, fills but for a shallow notch, SolidCraft's offset of the whole solid//! (`offset_solid`), its convex edges rounded.usecrate::solids::*;
pubfnbuild() -> R<Body> {
let drum = zcyl(0.0, 0.0, 10.0, 0.0, 10.0)?;
// the groove: a ring from radius 7 out past the sidelet ring = cut(&zcyl(0.0, 0.0, 11.0, 4.2, 5.8)?, &zcyl(0.0, 0.0, 7.0, 4.0, 6.0)?)?;
let grooved = cut(&drum, &ring)?;
solidcraft_kernel::offset_solid(&grooved, 1.0, true)
}
brepkit left no solid to show.
Time
3 ms; CPU time 2.9 ms; peak memory 10 MB
Notes
refused invalid input: invalid input: arc joint construction is not yet implemented; use JointType::Intersection
//! A drum, the cylinder of radius 10 on the z axis from z = 0 to 10, with a groove round its side//! from z = 4.2 to 5.8 cut to radius 7, grown by 1 with brepkit's rounded offset, whose joints//! roll a ball of radius 1 round its rims.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::{cut, moved};
usecrate::Refusal;
pubfnbuild(topo: &mutTopology) -> Result<SolidId, Refusal> {
let drum = make_cylinder(topo, 10.0, 10.0)?;
// the groove: a ring from radius 7 out past the drum's sidelet outer = make_cylinder(topo, 11.0, 1.6)?;
let outer = moved(topo, outer, 0.0, 0.0, 4.2)?;
let core = make_cylinder(topo, 7.0, 3.0)?;
let core = moved(topo, core, 0.0, 0.0, 3.5)?;
let groove = cut(topo, outer, core)?;
let grooved = cut(topo, drum, groove)?;
Ok(offset_solid_arc_v2(topo, grooved, 1.0)?)
}
Time
193 ms; CPU time 274 ms; peak memory 35.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.
// A drum, the cylinder of radius 10 on the z axis from z = 0 to 10, with a groove round its side// from z = 4.2 to 5.8 cut to radius 7; grown by 1, which fills the groove.let m = model();
let drum = m.profile(xy()).circle(10.0).sketch("drum").extrude(blind(10.0));
let groove = m.tool(|m| m.profile(xz())
.path(7.0, 4.2).line_to(11.0, 4.2).line_to(11.0, 5.8).line_to(7.0, 5.8).close()
.sketch("groove_section").revolve(axis_at([0.0, 0.0, 0.0], [0.0, 0.0, 1.0]), full_circle()));
drum = drum.subtract(groove, #{ label: "groove" });
drum = drum.offset_solid(1.0, #{ label: "grown" });
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
24 ms; CPU time 24 ms; peak memory 18.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 drum, the cylinder of radius 10 on the z axis from z = 0 to z = 10, with a groove round its//! side from z = 4.2 to 5.8 cut to radius 7, grown by 1 to its parallel body: the groove filled//! but for a shallow notch where its outer rims become pieces of tori.//!//! The groove is cut by a ring, its section revolved a full turn, reaching past the drum's side.usecrate::solids::offset::{parallel, subtract};
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, 10.0, 10.0)?;
let section =
polygon(&[p(7.0, 0.0, 4.2), p(12.0, 0.0, 4.2), p(12.0, 0.0, 5.8), p(7.0, 0.0, 5.8)])?;
let groove = revolve_profile_brep(§ion, p(0.0, 0.0, 0.0), z, TAU)?;
let grooved = subtract(&drum, &groove)?;
Ok(parallel(&grooved, 1.0)?)
}
geop left no solid to show.
Time
1.9 ms; CPU time 1.7 ms; peak memory 9.9 MB
Notes
refused geop has no offset of a solid as every point within a distance of it: its face offset keeps every face and meets them sharp, so it can neither fill the groove whose moved walls cross nor make the rounds that form the notch
//! A drum, the cylinder of radius 10 on the z axis from z = 0 to z = 10, with a groove 1.6//! wide and 3 deep round its side between z = 4.2 and z = 5.8, grown by 1: every point within 1//! of it. The groove fills, and its outer rims become pieces of tori meeting in a shallow notch.//!//! geop has no offset of a solid that is every point within a distance of it: its face offset//! moves the faces and meets them sharp, keeping every face, so it can neither fill the groove//! whose moved walls cross nor round the groove's rims into the tori that make the notch. So it//! is refused.usecrate::{Bench, Refusal};
pubfnbuild(_: &mutBench) -> Result<(), Refusal> {
Err("geop has no offset of a solid as every point within a distance of it: its face offset \
keeps every face and meets them sharp, so it can neither fill the groove whose moved \
walls cross nor make the rounds that form the notch"
.into())
}
Time
15 ms; CPU time 22 ms; peak memory 11.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.
//! A drum, the cylinder of radius 10 on the z axis from z = 0 to z = 10, with a groove around its//! side from z = 4.2 to z = 5.8, cut 3 deep to radius 7, grown by 1: the solid of every point//! within 1 of it. The groove, narrower than 2, fills; the drum grows to radius 11 and z = −1 to//! 11 with rounded rims, and the groove's outer rims become pieces of tori meeting in a shallow//! V-shaped notch at radius 10.6, z = 5.//!//! The drum a circle extruded; the groove an annulus from radius 7 to beyond the drum sketched//! at z = 4.2 and extruded 1.6, cut from it; then cadrs's offset with rounded edges.usecrate::bench::{cut, cylinder, extrude, p3, v3};
usecrate::shared::offset::grown;
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), 10.0, 10.0)?;
let ring = Profile::with_holes(Plane::xy(4.2), Loop::circle([0.0, 0.0], 12.0), vec![Loop::circle([0.0, 0.0], 7.0)]);
let groove = extrude(k, &ring, 1.6)?;
let part = cut(k, drum, groove)?;
grown(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
26 ms; CPU time 26 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.
//! The cylinder of radius 10 on the z axis from z = 0 to z = 10, with a groove 1.6 wide (z = 4.2 to//! 5.8) cut 3 deep round its side, grown by 1: the groove closes, leaving a shallow V notch.//! springrep 1.0.1 refuses it: its offset does not follow the groove's walls through each other ("a//! moved edge runs backwards").use springrep::boolean::difference;
use springrep::primitive::cylinder;
use springrep::topo::Brep;
usecrate::shared::offset::grown;
usecrate::shared::{at, e};
pubfnbuild() -> Result<Brep, String> {
let drum = cylinder(&at([0., 0., 0.]), 10., 10., "drum").map_err(e)?;
// the groove: a ring from radius 7 out past the sidelet outer = cylinder(&at([0., 0., 4.2]), 11., 1.6, "groove").map_err(e)?;
let core = cylinder(&at([0., 0., 4.]), 7., 2., "core").map_err(e)?;
let groove = difference(&outer, &core).map_err(e)?;
let grooved = difference(&drum, &groove).map_err(e)?;
grown(&grooved, 1.)
}
geomsolver left no solid to show.
Time
50 ms; CPU time 50 ms; peak memory 25.2 MB
Notes
refused error[E080]: `grown.body`: a cylinder's face that is no band between two circles about its axis, a bore no wider than the reach, or a band shorter than it between its feet: read by the field
// A grooved drum grown by 1: the drum's half-section drawn in the front plane (x, z), out from the// axis to radius 10 from z = 0 to z = 10 with the groove's notch cut 3 deep (to radius 7) from// z = 4.2 to z = 5.8, turned a whole turn about the z axis; and the points within 1 of it,// `std.rounds.Grown`'s body.unit mm
use std
use std.solids
use std.rounds
in std.front {
a := point
b := point hint((10, 0))
c := point hint((10, 4.2))
d := point hint((7, 4.2))
e := point hint((7, 5.8))
f := point hint((10, 5.8))
g := point hint((10, 10))
h := point hint((0, 10))
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(10) b
a distance(10) h
b distance(4.2) c
c distance(3) d
d distance(1.6) e
e distance(3) f
}
drum := solid(std.solids.Revolution(half, about: std.z))
grown := std.rounds.Grown(drum, d: 1mm)
part := solid(grown.body)
anvilcad left no solid to show.
Time
1.1 ms; CPU time 960 µs; peak memory 3.4 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 about a convex edge or corner, so it cannot grow a solid to every point within a distance of it
//! A grooved drum grown until its groove closes, grown with its convex edges rounded.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 about a convex edge or corner, so it cannot grow a solid to every point within a distance of it".into())
}