The block from (−20, −15, 0) to (20, 15, 10) with a pocket cut down into its top: the rectangle from (−10, −7) to (10, 7), its four corners rounded to radius 2, from the top down to a flat floor at z = 4. Grow it by 3, more than the pocket's corner radius: the solid of every point within 3 of the pocketed block.
The block grows as a box does: each face moves 3 outward, each outer edge becomes a quarter of a cylinder of radius 3, each corner an eighth of a ball. In the pocket, every point within 3 of its walls or its floor is filled: the floor rises to z = 7, the walls come in 3, and the rounded corners, of radius 2, close up, so the pocket left below the grown top is the rectangle from (−7, −4) to (7, 4) with square corners, from z = 7 up to z = 10. Above the pocket, a point is within 3 of the block only within 3 of the pocket's rim, so the grown top dips there: over the straight parts of the rim the dip is bounded by quarter cylinders of radius 3 about the rim's edges, and over each rounded corner by the inner side of a tube of radius 3 about the corner's arc. Section by section, at a height u above the top (0 ≤ u ≤ 3) the opening left is the pocket's outline shrunk by √(9 − u²): the rounded rectangle with its sides moved in that far and its corners' radius 2 − √(9 − u²) where that is positive, square where it is not.
† 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
128 ms; CPU time 197 ms; peak memory 15.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
25008.10866
25008.10866
1.5e-16
area
5633.355635
5633.355635
3.2e-16
agrees with
occt, next.BREP, cadrs
mesh
19240 triangles, closed, 12 degenerate
centre of gravity
(-3.54588e-16, 0, 4.83771) its STEP's solid
inertia
about it, of unit density: Ixx 3.19912e+06; Iyy 4.91871e+06; Izz 7.10634e+06; Ixy -9.82254e-11; Iyz -2.72848e-11; Izx -5.3821e-12
//! The block from (−20, −15, 0) to (20, 15, 10) with a pocket down to z = 4, the rectangle from//! (−10, −7) to (10, 7) with its corners rounded to radius 2, grown by 3, more than the corners'//! radius: the pocket's rounded corners close up square.usecrate::sketch::{block, rounded_rectangle};
use cad_kernel::boolean::{combined, Op};
use cad_kernel::build::prism;
use cad_kernel::offset::{grown, Join};
use cad_kernel::topo::Brep;
constFLOOR: f64 = 4.;
pubfnbuild() -> Result<Brep, String> {
let solid = block([-20., -15., 0.], [20., 15., 10.])?;
// the pocket: its rounded outline on the floor swept up past the toplet pocket = prism(&rounded_rectangle([-10., -7.], [10., 7.], 2., FLOOR), 0., 10. - FLOOR + 1.)?;
grown(&combined(&solid, &pocket, Op::Cut, 0.)?, 3., Join::Round)
}
Time
659 ms; CPU time 658 ms; peak memory 370.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
25008.10866
25008.10866
2.8e-12
area
5633.355635
5633.355635
4.4e-14
agrees with
cad-kernel, next.BREP, cadrs
mesh
9800 triangles, closed, 4 degenerate
centre of gravity
(-1.16378e-15, -4.72784e-16, 4.83771) its STEP's solid
inertia
about it, of unit density: Ixx 3.19912e+06; Iyy 4.91871e+06; Izz 7.10634e+06; Ixy -2.91038e-11; Iyz 1.94436e-11; Izx 3.75155e-12
"""A pocketed block grown by 3, past its pocket's corner radius. The block from (−20, −15, 0) to
(20, 15, 10) with a pocket cut down into its top: the rectangle from (−10, −7) to (10, 7), its four
corners rounded to radius 2, from the top down to a flat floor at z = 4. Grown by 3, the pocket's
rounded corners close up, and over its rim the grown top dips."""fromOCP.BRepPrimAPIimportBRepPrimAPI_MakeBoxfromOCP.gp import gp_Pnt
from draft import rounded_box
from offset import less, offset
BLOCK = ((-20, -15, 0), (20, 15, 10))
POCKET = ((-10, -7), (10, 7))
CORNER_RADIUS = 2FLOOR = 4GROWTH = 3defbuild():
block = BRepPrimAPI_MakeBox(gp_Pnt(*BLOCK[0]), gp_Pnt(*BLOCK[1])).Shape()
(x0, y0), (x1, y1) = POCKET# The pocket's cutter runs 1 above the block's top.
cutter = rounded_box((x0, y0, FLOOR), (x1, y1, BLOCK[1][2] + 1), CORNER_RADIUS)
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.
solidcraft left no solid to show.
Time
123 ms; CPU time 122 ms; peak memory 49.3 MB
Notes
refused the operation failed: SMLib offset: operation: solidcore: offset::offset_executive::p2::offset_brep: the offset could not be built; caused by offset::offset_executive::p1: the rounded offset's tube about edge 4 by 3 folds over itself: the edge bends more tightly than that on the side the tube faces (the largest distance at which this edge's tube is proved not to fold is 1.3281168699519923)
//! The block from (−20, −15, 0) to (20, 15, 10) with a pocket cut down from its top to a floor at//! z = 4, the rectangle from (−10, −7) to (10, 7) with its corners rounded to radius 2, grown by 3,//! more than the corners' radius: every point within 3 of it, SolidCraft's offset of the whole//! solid (`offset_solid`), its convex edges rounded.usecrate::solids::*;
/// The box from `a` to `b` with its four vertical edges, each picked at its middle, rounded to/// `radius`.pubfnrounded_box(a: (f64, f64, f64), b: (f64, f64, f64), radius: f64) -> R<Body> {
let z = (a.2 + b.2) / 2.0;
let verticals = [v3(a.0, a.1, z), v3(b.0, a.1, z), v3(b.0, b.1, z), v3(a.0, b.1, z)];
solidcraft_kernel::fillet(&block(a, b)?, &verticals, radius)
}
pubfnbuild() -> R<Body> {
let block = block((-20.0, -15.0, 0.0), (20.0, 15.0, 10.0))?;
// the pocket's cutter, a box with its vertical edges rounded, runs on past the toplet pocket = rounded_box((-10.0, -7.0, 4.0), (10.0, 7.0, 11.0), 2.0)?;
solidcraft_kernel::offset_solid(&cut(&block, &pocket)?, 3.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
730 ms; CPU time 730 ms; peak memory 44 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 (−20, −15, 0) to (20, 15, 10) with a pocket down to a floor at z = 4, the//! rectangle from (−10, −7) to (10, 7) with its corners rounded to radius 2, grown by 3, more than//! the corners' radius, to its parallel body.//!//! The pocket's rounded rectangle is extruded from the floor up past the top and cut away.usecrate::solids::offset::{parallel, subtract};
usecrate::solids::outline::{deg, Chain};
usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{extrude_profile_brep, make_box_brep, transform_brep, AffineTransform, BrepSolid};
pubfnbuild() -> Result<BrepSolid, Refusal> {
letmut c = Chain::new();
c.line((-8.0, -7.0), (8.0, -7.0))?
.arc((8.0, -5.0), 2.0, deg(270.0), deg(360.0), true)?
.line((10.0, -5.0), (10.0, 5.0))?
.arc((8.0, 5.0), 2.0, deg(0.0), deg(90.0), true)?
.line((8.0, 7.0), (-8.0, 7.0))?
.arc((-8.0, 5.0), 2.0, deg(90.0), deg(180.0), true)?
.line((-10.0, 5.0), (-10.0, -5.0))?
.arc((-8.0, -5.0), 2.0, deg(180.0), deg(270.0), true)?;
let pocket = extrude_profile_brep(&c.curves, p(0.0, 0.0, 1.0), 7.0)?;
let up = AffineTransform { elements: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 4.0, 0.0, 0.0, 0.0, 1.0] };
let pocket = transform_brep(&pocket, up, false)?;
let block = make_box_brep(p(-20.0, -15.0, 0.0), 40.0, 30.0, 10.0)?;
let pocketed = subtract(&block, &pocket)?;
Ok(parallel(&pocketed, 3.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
44 ms; CPU time 80 ms; peak memory 12.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
25008.10866
25008.10866
1.5e-16
area
5633.355635
5633.355635
0.0e+00
agrees with
cad-kernel, occt, next.BREP
mesh
12632 triangles, closed, 12 degenerate
centre of gravity
(-3.6368e-17, -2.63668e-16, 4.83771) its STEP's solid
inertia
about it, of unit density: Ixx 3.19912e+06; Iyy 4.91871e+06; Izz 7.10634e+06; Ixy -1.67347e-10; Iyz 1.6061e-13; Izx -2.89562e-11
//! The block from (−20, −15, 0) to (20, 15, 10) with a pocket cut down into its top to a flat//! floor at z = 4, the rectangle from (−10, −7) to (10, 7) with its four corners rounded to//! radius 2, grown by 3, more than the corners' radius: the solid of every point within 3 of it.//!//! The block a rectangle extruded, the pocket its rounded rectangle sketched at the floor and//! extruded up past the top, and cut; then cadrs's offset with rounded edges.usecrate::bench::{block, cut, extrude, p3};
usecrate::shared::fillet::rounded_polygon;
usecrate::shared::offset::grown;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, Loop, Plane, Profile};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let b = block(k, p3(-20.0, -15.0, 0.0), p3(20.0, 15.0, 10.0))?;
let outline = rounded_polygon(&[(-10.0, -7.0), (10.0, -7.0), (10.0, 7.0), (-10.0, 7.0)], &[2.0; 4]);
let pocket = extrude(k, &Profile::of(Plane::xy(4.0), vec![Loop::new(outline)]), 7.0)?;
let pocketed = cut(k, b, pocket)?;
grown(k, pocketed, 3.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
85 ms; CPU time 84 ms; peak memory 10.3 MB
Notes
wrong volume 24952.8334475 against 25008.1086587 (its STEP's); area 5773.91007481 against 5633.35563549 (its STEP's)
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
24952.83345
25008.10866
2.2e-03
area
5773.910075
5633.355635
2.5e-02
agrees with
no other kernel
mesh
19582 triangles, closed, 4 degenerate
centre of gravity
(7.9959e-16, 2.54855e-17, 4.83188) its STEP's solid
inertia
about it, of unit density: Ixx 3.19727e+06; Iyy 4.91469e+06; Izz 7.10126e+06; Ixy -3.22586e-12; Iyz 7.23827e-11; Izx -2.41643e-12
//! The block (−20, −15, 0)–(20, 15, 10) with a pocket down to z = 4, the rectangle from (−10, −7)//! to (10, 7) with its corners rounded to radius 2, grown by 3: springrep's own offset.use std::f64::consts::FRAC_PI_2;
use springrep::boolean::difference;
use springrep::math::{Vec2, Vec3};
use springrep::primitive::block;
use springrep::profile::{NamedSegment, Profile};
use springrep::sweep::extrude;
use springrep::topo::Brep;
usecrate::shared::offset::grown;
usecrate::shared::{at, e};
pubfnbuild() -> Result<Brep, String> {
let body = block(&at([-20., -15., 0.]), Vec3::new(40., 30., 10.), "block").map_err(e)?;
let p = |x: f64, y: f64| Vec2::new(x, y);
let outline = Profile::outline(vec![
NamedSegment::line(p(-8., -7.), p(8., -7.), "wall"),
NamedSegment::arc(p(8., -5.), 2., -FRAC_PI_2, FRAC_PI_2, "corner"),
NamedSegment::line(p(10., -5.), p(10., 5.), "wall"),
NamedSegment::arc(p(8., 5.), 2., 0., FRAC_PI_2, "corner"),
NamedSegment::line(p(8., 7.), p(-8., 7.), "wall"),
NamedSegment::arc(p(-8., 5.), 2., FRAC_PI_2, FRAC_PI_2, "corner"),
NamedSegment::line(p(-10., 5.), p(-10., -5.), "wall"),
NamedSegment::arc(p(-8., -5.), 2., 2. * FRAC_PI_2, FRAC_PI_2, "corner"),
]);
// the pocket from its floor up past the block's toplet pocket = extrude(&outline, &at([0., 0., 4.]), 7., "pocket").map_err(e)?;
let pocketed = difference(&body, &pocket).map_err(e)?;
grown(&pocketed, 3.)
}
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 950 µ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 pocketed block grown past its pocket's corner radius.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())
}