The block from (0, 0, 0) to (20, 20, 6) with a square pocket cut down into its top: the square from (6, 6) to (14, 14), its sides parallel to the block's and its corners square, from the top down to a flat floor at z = 3. Grow it by 1: the solid of every point within 1 of the pocketed block.
The block grows as a box does: each outer face moves 1 outward, each outer edge becomes a quarter of a cylinder of radius 1, each outer corner an eighth of a ball. In the pocket, every point within 1 of its walls or its floor is filled: the floor rises to z = 4 and the walls come in 1, so the pocket left below the grown top is the square from (7, 7) to (13, 13), from z = 4 up to z = 6, with sharp concave edges along its floor and its four vertical corners. The pocket's rim, where its walls meet the block's top, is a convex edge and becomes a quarter of a cylinder of radius 1 about it, so above z = 6 the pocket flares: at a height u above the top (0 ≤ u ≤ 1) the opening left is the square from (6 + √(1 − u²), 6 + √(1 − u²)) to (14 − √(1 − u²), 14 − √(1 − u²)), its corners sharp, closing to the full 8 × 8 square at z = 7. At each of the pocket's four corners the rims' two rounds meet in a sharp concave crease above the corner's vertical edge.
The grown solid is the grown box, of volume V₀, less that opening.
† 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
113 ms; CPU time 172 ms; peak memory 15.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
3715.168127
3715.168127
3.7e-16
area
1643.858377
1643.858377
6.9e-16
agrees with
occt, solidcraft, next.BREP, cadrs, springrep
mesh
16428 triangles, closed, 8 degenerate
centre of gravity
(10, 10, 2.92169) its STEP's solid
inertia
about it, of unit density: Ixx 171447; Iyy 171447; Izz 304423; Ixy -1.98952e-12; Iyz 9.93003e-13; Izx 3.81764e-13
//! The block from (0, 0, 0) to (20, 20, 6) with the square pocket from (6, 6) to (14, 14) cut down//! to z = 3, grown by 1: the pocket's rims round over and its concave edges stay sharp.usecrate::sketch::block;
use cad_kernel::boolean::{combined, Op};
use cad_kernel::offset::{grown, Join};
use cad_kernel::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
let solid = block([0., 0., 0.], [20., 20., 6.])?;
// the cutter from the pocket's floor on 1 past the toplet pocket = block([6., 6., 3.], [14., 14., 7.])?;
grown(&combined(&solid, &pocket, Op::Cut, 0.)?, 1., Join::Round)
}
Time
637 ms; CPU time 636 ms; peak memory 370.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 block with a square pocket grown by 1. The block from (0, 0, 0) to (20, 20, 6) with a square
pocket cut down into its top, the square from (6, 6) to (14, 14), its corners square, from the top
down to a flat floor at z = 3, grown by 1: every point within 1 of it."""fromOCP.BRepPrimAPIimportBRepPrimAPI_MakeBoxfromOCP.gp import gp_Pnt
from offset import less, offset
BLOCK = ((0, 0, 0), (20, 20, 6))
POCKET = ((6, 6, 3), (14, 14, 7)) # the pocket's cutter, running 1 above the block's topGROWTH = 1defbuild():
block = BRepPrimAPI_MakeBox(gp_Pnt(*BLOCK[0]), gp_Pnt(*BLOCK[1])).Shape()
cutter = BRepPrimAPI_MakeBox(gp_Pnt(*POCKET[0]), gp_Pnt(*POCKET[1])).Shape()
returnoffset(less(block, cutter, "the pocket"), GROWTH)
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.
kentron 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.
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
1.36 s; CPU time 1.36 s; peak memory 58.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
3715.168127
3715.168127
2.8e-15
area
1643.858377
1643.858377
1.8e-15
agrees with
cad-kernel, occt, next.BREP, cadrs, springrep
mesh
9794 triangles, closed, 8 degenerate
centre of gravity
(10, 10, 2.92169) its STEP's solid
inertia
about it, of unit density: Ixx 171447; Iyy 171447; Izz 304423; Ixy -8.05585e-10; Iyz 2.40744e-10; Izx -1.29551e-10
//! The block from (0, 0, 0) to (20, 20, 6) with the square pocket from (6, 6) to (14, 14) cut down//! from its top to a floor at z = 3, grown by 1: every point within 1 of it, its convex edges//! rounded and the pocket's concave ones sharp, SolidCraft's offset of the whole solid//! (`offset_solid`), its convex edges rounded.usecrate::solids::*;
pubfnbuild() -> R<Body> {
let solid = block((0.0, 0.0, 0.0), (20.0, 20.0, 6.0))?;
// the pocket's cutter runs on past the toplet pocket = block((6.0, 6.0, 3.0), (14.0, 14.0, 7.0))?;
solidcraft_kernel::offset_solid(&cut(&solid, &pocket)?, 1.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
425 ms; CPU time 423 ms; peak memory 39.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
3715.168127
3715.168127
1.2e-13
area
1643.858377
1643.858377
9.2e-12
agrees with
cad-kernel, occt, solidcraft, cadrs, springrep
mesh
9471 triangles, closed, 7 degenerate
centre of gravity
(10, 10, 2.92169) its STEP's solid
inertia
about it, of unit density: Ixx 171447; Iyy 171447; Izz 304423; Ixy 2.99419e-07; Iyz 2.37785e-07; Izx -1.99645e-07
//! The block from (0, 0, 0) to (20, 20, 6) with the square pocket from (6, 6) to (14, 14) cut//! down from its top to a floor at z = 3, grown by 1 to its parallel body: its convex edges//! rounded, the pocket's concave edges left sharp.usecrate::solids::boolean::cut;
usecrate::solids::offset::parallel;
usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{make_box_brep, BrepSolid};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let block = make_box_brep(p(0.0, 0.0, 0.0), 20.0, 20.0, 6.0)?;
// the pocket's cutter runs out past the toplet pocket = make_box_brep(p(6.0, 6.0, 3.0), 8.0, 8.0, 4.0)?;
Ok(parallel(&cut(&block, &pocket)?, 1.0)?)
}
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
42 ms; CPU time 64 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.
//! The block from (0, 0, 0) to (20, 20, 6) with a square pocket, from (6, 6) to (14, 14), cut//! down from its top to a flat floor at z = 3, grown by 1: the solid of every point within 1 of//! it. The pocket's floor rises to z = 4 and its walls come in 1, its concave edges sharp; its//! rim rounds in quarter cylinders.//!//! The block a rectangle extruded, the pocket a square extruded from the floor up past the top//! and cut; then cadrs's offset with rounded edges.usecrate::bench::{block, cut, p3};
usecrate::shared::offset::grown;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let b = block(k, p3(0.0, 0.0, 0.0), p3(20.0, 20.0, 6.0))?;
let pocket = block(k, p3(6.0, 6.0, 3.0), p3(14.0, 14.0, 7.0))?;
let pocketed = cut(k, b, pocket)?;
grown(k, pocketed, 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
15 ms; CPU time 14 ms; peak memory 9.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
3715.168127
3715.168127
1.2e-16
area
1643.858377
1643.858377
6.9e-16
agrees with
cad-kernel, occt, solidcraft, next.BREP, cadrs
mesh
7430 triangles, closed
centre of gravity
(10, 10, 2.92169) its STEP's solid
inertia
about it, of unit density: Ixx 171447; Iyy 171447; Izz 304423; Ixy 3.86535e-12; Iyz -4.12371e-13; Izx 7.09774e-13
//! The block from (0, 0, 0) to (20, 20, 6) with the square pocket from (6, 6) to (14, 14) cut down//! from its top to a floor at z = 3, grown by 1: springrep's own offset (convex edges rounded, the//! pocket's concave edges run on until their faces meet).use springrep::boolean::difference;
use springrep::topo::Brep;
usecrate::shared::boolean::between;
usecrate::shared::e;
usecrate::shared::offset::grown;
pubfnbuild() -> Result<Brep, String> {
let block = between([0., 0., 0.], [20., 20., 6.], "block")?;
// the pocket's cutter runs out past the toplet pocket = between([6., 6., 3.], [14., 14., 7.], "pocket")?;
let pocketed = difference(&block, &pocket).map_err(e)?;
grown(&pocketed, 1.)
}
geomsolver 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.
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 about a convex edge or corner, so it cannot grow a solid to every point within a distance of it
//! A block with a square pocket grown by 1.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())
}