A square plate from (0, 0, 0) to (10, 10, 2) with a square hole through it, the square from (3, 3) to (7, 7), its sides parallel to the plate's. Grow it by 1: the solid of every point within 1 of the plate.
Each face moves 1 outward. Each convex edge, the plate's outer edges and the hole's rims on the top and the bottom, becomes a quarter of a cylinder of radius 1 about it, and each outer corner an eighth of a ball. The hole's four walls move 1 into the hole, which is left the square from (4, 4) to (6, 6) through the grown plate's middle. The hole's four vertical edges are concave and stay sharp: the two walls beside each, moved, meet along a vertical line, such as x = 4, y = 4. Where such an edge meets the top or the bottom, the rounds of the two hole rims beside it meet in a sharp concave crease.
The grown plate's section at any height from z = 0 to z = 2 is the plate's section grown by 1: the outer square's sides moved out 1 and its corners rounded to radius 1, the hole's sides moved in 1 and its corners sharp, of area A + Pd + kd², where A = 84 and P = 56 are the section's area and the length of its boundary, both squares, and k = 4·(π/4) − 4·1 counts a quarter disc's worth at each outer corner and takes off the square that the two walls beside a hole corner both cover. Above the top, at height u (0 ≤ u ≤ 1), the section is the plate's section grown by √(1 − u²) in the same way, and likewise below the bottom.
† 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
112 ms; CPU time 181 ms; peak memory 15.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
533.1032365
533.1032365
8.5e-16
area
449.0619298
449.0619298
5.1e-16
agrees with
occt, solidcraft, next.BREP, cadrs, springrep
mesh
16696 triangles, closed, 8 degenerate
centre of gravity
(5, 5, 1) its STEP's solid
inertia
about it, of unit density: Ixx 7032.28; Iyy 7032.28; Izz 12730.3; Ixy -1.13687e-13; Iyz 1.10134e-13; Izx 2.04281e-14
//! The plate from (0, 0, 0) to (10, 10, 2) with the square hole from (3, 3) to (7, 7) through it,//! grown by 1: the hole's four upright edges are concave and 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 plate = block([0., 0., 0.], [10., 10., 2.])?;
// the punch runs 1 past both faces of the platelet punch = block([3., 3., -1.], [7., 7., 3.])?;
grown(&combined(&plate, &punch, Op::Cut, 0.)?, 1., Join::Round)
}
Time
665 ms; CPU time 664 ms; peak memory 369.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.
"""A plate with a square hole grown by 1. The plate from (0, 0, 0) to (10, 10, 2) with a square hole
through it, the square from (3, 3) to (7, 7), grown by 1: every point within 1 of it. The hole's
four vertical edges are concave and stay sharp."""fromOCP.BRepBuilderAPIimportBRepBuilderAPI_MakeFace, BRepBuilderAPI_MakePolygonfromOCP.BRepPrimAPIimportBRepPrimAPI_MakePrismfromOCP.gp import gp_Pnt, gp_Vec
from offset import offset
OUTSIDE = [(0, 0), (10, 0), (10, 10), (0, 10)]
HOLE = [(3, 3), (3, 7), (7, 7), (7, 3)] # clockwise, as a hole in the faceTHICKNESS = 2GROWTH = 1defloop(corners):
polygon = BRepBuilderAPI_MakePolygon()
for x, y in corners:
polygon.Add(gp_Pnt(x, y, 0))
polygon.Close()
return polygon.Wire()
defbuild():
# the plate's section, the outer square with the hole's square as a second wire, extruded
section = BRepBuilderAPI_MakeFace(loop(OUTSIDE))
section.Add(loop(HOLE))
plate = BRepPrimAPI_MakePrism(section.Face(), gp_Vec(0, 0, THICKNESS)).Shape()
returnoffset(plate, 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.48 s; CPU time 1.48 s; peak memory 59.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
533.1032365
533.1032365
0.0e+00
area
449.0619298
449.0619298
2.5e-16
agrees with
cad-kernel, occt, next.BREP, cadrs, springrep
mesh
10112 triangles, closed, 8 degenerate
centre of gravity
(5, 5, 1) its STEP's solid
inertia
about it, of unit density: Ixx 7032.28; Iyy 7032.28; Izz 12730.3; Ixy 1.54454e-12; Iyz 7.31774e-12; Izx -1.98952e-13
//! The plate from (0, 0, 0) to (10, 10, 2) with the square hole from (3, 3) to (7, 7) through it,//! grown by 1: every point within 1 of it, its convex edges rounded and the hole's four concave//! corners sharp, SolidCraft's offset of the whole solid (`offset_solid`), its convex edges//! rounded.usecrate::solids::*;
pubfnbuild() -> R<Body> {
let plate = block((0.0, 0.0, 0.0), (10.0, 10.0, 2.0))?;
// the hole's cutter runs past both faceslet hole = block((3.0, 3.0, -1.0), (7.0, 7.0, 3.0))?;
solidcraft_kernel::offset_solid(&cut(&plate, &hole)?, 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
291 ms; CPU time 291 ms; peak memory 35.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
533.1032365
533.1032365
8.3e-11
area
449.06193
449.0619298
2.9e-10
agrees with
cad-kernel, occt, solidcraft, cadrs, springrep
mesh
10068 triangles, closed, 8 degenerate
centre of gravity
(5, 5, 1) its STEP's solid
inertia
about it, of unit density: Ixx 7032.28; Iyy 7032.28; Izz 12730.3; Ixy -2.55707e-07; Iyz -2.87117e-07; Izx 3.28489e-07
//! The plate from (0, 0, 0) to (10, 10, 2) with the square hole from (3, 3) to (7, 7) through it,//! grown by 1 to its parallel body: its convex edges rounded, the hole's four concave vertical//! 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 plate = make_box_brep(p(0.0, 0.0, 0.0), 10.0, 10.0, 2.0)?;
// the hole's cutter runs past both faceslet hole = make_box_brep(p(3.0, 3.0, -1.0), 4.0, 4.0, 4.0)?;
Ok(parallel(&cut(&plate, &hole)?, 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
33 ms; CPU time 51 ms; peak memory 10.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 square plate from (0, 0, 0) to (10, 10, 2) with the square hole from (3, 3) to (7, 7)//! through it, grown by 1: the solid of every point within 1 of it. The hole's walls move 1 into//! it and its four vertical edges, concave, stay sharp.//!//! The plate a rectangle extruded, the hole a square extruded through it 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 plate = block(k, p3(0.0, 0.0, 0.0), p3(10.0, 10.0, 2.0))?;
let hole = block(k, p3(3.0, 3.0, -1.0), p3(7.0, 7.0, 3.0))?;
let holed = cut(k, plate, hole)?;
grown(k, holed, 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
23 ms; CPU time 23 ms; peak memory 9.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
533.1032365
533.1032365
8.5e-16
area
449.0619298
449.0619298
5.1e-16
agrees with
cad-kernel, occt, solidcraft, next.BREP, cadrs
mesh
7720 triangles, closed
centre of gravity
(5, 5, 1) its STEP's solid
inertia
about it, of unit density: Ixx 7032.28; Iyy 7032.28; Izz 12730.3; Ixy 1.42109e-13; Iyz 4.9738e-14; Izx 2.13163e-14
//! The plate from (0, 0, 0) to (10, 10, 2) with the square hole from (3, 3) to (7, 7) through it,//! grown by 1: springrep's own offset (convex edges rounded, the hole's four 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 plate = between([0., 0., 0.], [10., 10., 2.], "plate")?;
// the hole's cutter runs past both faceslet hole = between([3., 3., -1.], [7., 7., 3.], "hole")?;
let holed = difference(&plate, &hole).map_err(e)?;
grown(&holed, 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 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 plate with a square hole 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())
}