A dumbbell-shaped plate: its outline in the xy plane is the polygon through (0, 0), (10, 0), (10, 4), (14, 4), (14, 0), (24, 0), (24, 10), (14, 10), (14, 6), (10, 6), (10, 10) and (0, 10), two 10 × 10 squares joined by a neck 4 long and 2 wide, extruded 6 along +z.
Shrink the whole solid inward by 1.5: keep every point inside it at least 1.5 from its boundary. The neck disappears, leaving two separate bodies; keep both. The moved walls that cross in the neck are not part of either body. This is an offset of the solid, not its shell or hollowed wall.
Each body runs from z = 1.5 to z = 4.5. The left one's section is the square from (1.5, 1.5) to (8.5, 8.5), with a small bulge toward the lost neck. At its mouth the nearest original walls end at (10, 4) and (10, 6), so the bulge is bounded by arcs of radius 1.5 about those corners. The arcs leave x = 8.5 tangentially at y = 4 and y = 6 and meet at (10 − √5/2, 5). The right body is the reflection of the left in x = 12.
The bulge's area is β = 3 − √5/2 − (9/4)·asin(2/3), and each section's perimeter is 26 + 3·asin(2/3), with the angles in radians. Multiply the two section areas by height 3 for the volume; the four ends and the two perimeters times 3 give the surface area.
† 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
37 ms; CPU time 49 ms; peak memory 12.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
295.4404727
295.4404727
7.7e-16
area
366.095413
366.095413
4.7e-16
agrees with
occt, kentron, next.BREP, cadrs, springrep
mesh
272 triangles, closed
centre of gravity
(12, 5, 3) its STEP's solid
inertia
about it, of unit density: Ixx 1422.22; Iyy 15844.6; Izz 16823.7; Ixy -2.04281e-13; Iyz -1.15884e-19; Izx 1.3671e-30
//! The dumbbell-shaped plate, two 10 × 10 squares joined by a neck 4 long and 2 wide, 6 thick,//! shrunk by 1.5: the neck vanishes and both halves are kept, two lumps of one solid.usecrate::sketch::polygon;
use cad_kernel::build::prism;
use cad_kernel::offset::{shrunk, Join};
use cad_kernel::topo::Brep;
constTHICKNESS: f64 = 6.;
constSHRINK: f64 = 1.5;
pubfnbuild() -> Result<Brep, String> {
// the outline in the xy plane: the left square, the neck, the right squarelet outline = polygon(&[[0., 0., 0.], [10., 0., 0.], [10., 4., 0.], [14., 4., 0.],
[14., 0., 0.], [24., 0., 0.], [24., 10., 0.], [14., 10., 0.], [14., 6., 0.],
[10., 6., 0.], [10., 10., 0.], [0., 10., 0.]]);
shrunk(&prism(&outline, 0., THICKNESS)?, SHRINK, Join::Round)
}
Time
648 ms; CPU time 647 ms; peak memory 369 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
295.4404727
295.4404727
1.5e-15
area
366.095413
366.095413
2.8e-15
agrees with
cad-kernel, kentron, next.BREP, cadrs, springrep
mesh
272 triangles, closed
centre of gravity
(12, 5, 3) its STEP's solid
inertia
about it, of unit density: Ixx 1422.22; Iyy 15844.6; Izz 16823.7; Ixy -2.27374e-13; Iyz -2.7342e-30; Izx -5.68434e-14
"""A dumbbell plate shrunk inward by 1.5, past half its neck width, leaving two separate bodies.
The outline is two 10 × 10 squares joined by a 4 × 2 neck, extruded 6 along z."""fromOCP.BRepBuilderAPIimportBRepBuilderAPI_MakeFace, BRepBuilderAPI_MakePolygonfromOCP.BRepPrimAPIimportBRepPrimAPI_MakePrismfromOCP.gp import gp_Pnt, gp_Vec
from offset import offset
OUTLINE = [(0, 0), (10, 0), (10, 4), (14, 4), (14, 0), (24, 0), (24, 10), (14, 10),
(14, 6), (10, 6), (10, 10), (0, 10)]
defbuild():
polygon = BRepBuilderAPI_MakePolygon()
for x, y inOUTLINE:
polygon.Add(gp_Pnt(x, y, 0))
polygon.Close()
face = BRepBuilderAPI_MakeFace(polygon.Wire()).Face()
solid = BRepPrimAPI_MakePrism(face, gp_Vec(0, 0, 6)).Shape()
returnoffset(solid, -1.5)
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
98 ms; CPU time 97 ms; peak memory 17.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
295.4404727
295.4404727
7.7e-16
area
366.095413
366.095413
3.1e-16
agrees with
cad-kernel, occt, next.BREP, cadrs, springrep
mesh
272 triangles, closed
centre of gravity
(12, 5, 3) its STEP's solid
inertia
about it, of unit density: Ixx 1422.22; Iyy 15844.6; Izz 16823.7; Ixy -2.00728e-13; Iyz -0; Izx 1.70888e-30
//! The dumbbell plate, two 10 × 10 squares joined by a neck 4 long and 2 wide in the xy plane,//! extruded 6 along +z, shrunk by 1.5: every point at least 1.5 from its outside. The neck vanishes,//! leaving two bodies, both kept.usecrate::Refusal;
usecrate::shared::shell::plate;
use kentron::offset::{self, Join};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> Result<Shape, Refusal> {
let outline = [
(0.0, 0.0), (10.0, 0.0), (10.0, 4.0), (14.0, 4.0), (14.0, 0.0), (24.0, 0.0),
(24.0, 10.0), (14.0, 10.0), (14.0, 6.0), (10.0, 6.0), (10.0, 10.0), (0.0, 10.0),
];
let dumbbell = plate(m, &outline, 6.0)?;
Ok(offset::shape(m, dumbbell, -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.
solidcraft left no solid to show.
Time
147 ms; CPU time 147 ms; peak memory 55.6 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 dumbbell plate, two 10 × 10 squares joined by a neck 4 long and 2 wide, extruded 6 along +z,//! shrunk by 1.5: every point at least 1.5 from its outside. The neck's moved walls cross and are//! trimmed away by SolidCraft's offset of the whole solid inward (`offset_solid`, rounded; its//! self-intersections merged), leaving two bodies.usecrate::solids::*;
pubfnbuild() -> R<Body> {
let outline = polygon(&[
(0.0, 0.0),
(10.0, 0.0),
(10.0, 4.0),
(14.0, 4.0),
(14.0, 0.0),
(24.0, 0.0),
(24.0, 10.0),
(14.0, 10.0),
(14.0, 6.0),
(10.0, 6.0),
(10.0, 10.0),
(0.0, 10.0),
]);
let plate = extrude(&Plane::XY, outline, 0.0, 6.0)?;
solidcraft_kernel::offset_solid(&plate, -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
17 ms; CPU time 23 ms; peak memory 24.9 MB
Notes
refused FeatureFailed at dumbbell_split.rhai:7:7: feature 'shrunk' (offset_solid) failed: offset 1.500000 exceeds the maximum 0.990000 supported by the geometry (the wall between face FaceHandle(3v1) and face FaceHandle(9v1) closes)
// A dumbbell plate (two 10 by 10 squares joined by a neck 4 long and 2 wide, 6 tall) shrunk by// 1.5: the neck goes, leaving two bodies.let m = model();
let d = m.profile(xy()).polygon([[0.0, 0.0], [10.0, 0.0], [10.0, 4.0], [14.0, 4.0], [14.0, 0.0],
[24.0, 0.0], [24.0, 10.0], [14.0, 10.0], [14.0, 6.0], [10.0, 6.0], [10.0, 10.0], [0.0, 10.0]])
.sketch("outline").extrude(blind(6.0));
d = d.offset_solid(-1.5, #{ 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
4.7 ms; CPU time 3.7 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
295.4404727
295.4404727
5.8e-16
area
366.095413
366.095413
4.7e-16
agrees with
cad-kernel, occt, kentron, cadrs, springrep
mesh
272 triangles, closed
centre of gravity
(12, 5, 3) its STEP's solid
inertia
about it, of unit density: Ixx 1422.22; Iyy 15844.6; Izz 16823.7; Ixy -1.77636e-15; Iyz 6.13687e-18; Izx -1.7053e-13
//! Two 10 × 10 squares joined by a neck 4 long and 2 wide, extruded 6 along +z, shrunk by 1.5://! the neck disappears and both of the bodies left are kept.usecrate::solids::offset::parallel;
usecrate::solids::{p, polygon};
usecrate::Refusal;
use brep_kernel::{extrude_profile_brep, BrepSolid};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let outline = polygon(&[
p(0.0, 0.0, 0.0), p(10.0, 0.0, 0.0), p(10.0, 4.0, 0.0), p(14.0, 4.0, 0.0),
p(14.0, 0.0, 0.0), p(24.0, 0.0, 0.0), p(24.0, 10.0, 0.0), p(14.0, 10.0, 0.0),
p(14.0, 6.0, 0.0), p(10.0, 6.0, 0.0), p(10.0, 10.0, 0.0), p(0.0, 10.0, 0.0),
])?;
let plate = extrude_profile_brep(&outline, p(0.0, 0.0, 1.0), 6.0)?;
Ok(parallel(&plate, -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
2.9 ms; CPU time 3.3 ms; peak memory 6.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
295.4404727
295.4404727
3.8e-16
area
366.095413
366.095413
4.7e-16
agrees with
cad-kernel, occt, kentron, next.BREP, springrep
mesh
272 triangles, closed
centre of gravity
(12, 5, 3) its STEP's solid
inertia
about it, of unit density: Ixx 1422.22; Iyy 15844.6; Izz 16823.7; Ixy -1.33227e-13; Iyz -1.6855e-18; Izx -5.68434e-14
//! A dumbbell-shaped plate, the polygon through (0, 0), (10, 0), (10, 4), (14, 4), (14, 0),//! (24, 0), (24, 10), (14, 10), (14, 6), (10, 6), (10, 10), (0, 10) extruded 6 along +z, shrunk//! by 1.5: every point at least 1.5 from its outside. The neck is lost and the plate splits in//! two; both are kept.//!//! The plate is the polygon sketched on the Top plane and extruded; the shrink is cadrs's offset//! of a solid (`Kernel::offset`, rounded, inward), which gives each piece it leaves as a body of//! its own; their union is the one body of both.usecrate::bench::{extrude, union};
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, Kernel, Loop, OffsetSpec, Plane, Profile};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let outline = Loop::polygon(&[
[0.0, 0.0],
[10.0, 0.0],
[10.0, 4.0],
[14.0, 4.0],
[14.0, 0.0],
[24.0, 0.0],
[24.0, 10.0],
[14.0, 10.0],
[14.0, 6.0],
[10.0, 6.0],
[10.0, 10.0],
[0.0, 10.0],
]);
let plate = extrude(k, &Profile::of(Plane::xy(0.0), vec![outline]), 6.0)?;
let r = k.offset(plate, &OffsetSpec { distance: -1.5, faces: vec![], sharp: false })?;
letmut pieces = r.bodies.into_iter();
let first = pieces.next().ok_or_else(|| Refusal::from("the offset made no body"))?;
pieces.try_fold(first, |all, piece| union(k, all, piece))
}
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
156 ms; CPU time 155 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
295.4404727
295.4404727
5.8e-16
area
366.095413
366.095413
3.1e-16
agrees with
cad-kernel, occt, kentron, next.BREP, cadrs
mesh
272 triangles, closed
centre of gravity
(12, 5, 3) its STEP's solid
inertia
about it, of unit density: Ixx 1422.22; Iyy 15844.6; Izz 16823.7; Ixy -2.13163e-13; Iyz -1.2708e-17; Izx -5.68434e-14
// A dumbbell-shaped plate shrunk by 1.5 until its neck is gone: its outline drawn in the top plane// (x, y), two 10 × 10 squares joined by a neck 4 long and 2 wide, the prism over it to z = 6, and// the points of it at least 1.5 from its outside, `std.rounds.Grown`'s body for a negative reach —// two bodies, both kept.unit mm
use std
use std.solids
use std.rounds
in std.top {
a := point
b := point hint((10, 0))
c := point hint((10, 4))
d := point hint((14, 4))
e := point hint((14, 0))
f := point hint((24, 0))
g := point hint((24, 10))
h := point hint((14, 10))
i := point hint((14, 6))
j := point hint((10, 6))
k := point hint((10, 10))
l := point hint((0, 10))
outline := 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, i) -> horizontal line(i, j) ->
vertical line(j, k) -> horizontal line(k, l) -> vertical line(l, a) -> close
fix((0, 0)) a
a distance(10) b
b distance(4) c
c distance(4) d
d distance(4) e
e distance(10) f
f distance(10) g
g distance(10) h
h distance(4) i
i distance(4) j
j distance(4) k
}
dumbbell := solid(std.solids.Prism(outline, from: 0mm, to: 6mm))
shrunk := std.rounds.Grown(dumbbell, d: -1.5mm)
part := solid(shrunk.body)
anvilcad left no solid to show.
Time
1.1 ms; CPU time 970 µ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 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 dumbbell shrunk until it splits into two bodies, 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())
}