A plate shaped like a plus sign, as in offset/plus-shaped-plate-grown but 4 thick: its outline in the xy plane is the polygon through (3, 0), (6, 0), (6, 3), (9, 3), (9, 6), (6, 6), (6, 9), (3, 9), (3, 6), (0, 6), (0, 3) and (3, 3), extruded 4 along +z. Shrink it by 1: keep every point of it at least 1 from its boundary.
The top and the bottom move in to z = 3 and z = 1, and each side moves 1 into the material, so each arm, 3 wide, is left 1 wide. The eight convex vertical edges and the edges round the top and the bottom stay sharp. Each of the four concave vertical edges is rounded by the shrink: the material left there is bounded by the cylinder of radius 1 about the edge, such as the one about the vertical line through (6, 3), between the two moved sides, which it meets tangentially.
The section at any height from z = 1 to z = 3 is the outline shrunk by 1: of area A − Pd + (8·tan 45° − 4·π/4)d², its eight convex corners still square and its four inside corners rounded to radius 1.
† 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
36 ms; CPU time 48 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
27.71681469
27.71681469
1.3e-16
area
80.28318531
80.28318531
1.8e-16
agrees with
occt, solidcraft, next.BREP, cadrs, springrep
mesh
556 triangles, closed
centre of gravity
(4.5, 4.5, 2) its STEP's solid
inertia
about it, of unit density: Ixx 68.3643; Iyy 68.3643; Izz 118.251; Ixy -0; Iyz -0; Izx 1.22125e-15
//! The plus-shaped plate of `offset/plus-shaped-plate-grown`, 4 thick, shrunk by 1: each arm is//! left 1 wide, and each concave edge is rounded by the cylinder of radius 1 about it.usesuper::plus_shaped_plate_grown::PLUS;
usecrate::sketch::polygon;
use cad_kernel::build::prism;
use cad_kernel::offset::{shrunk, Join};
use cad_kernel::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
let outline = polygon(&PLUS.map(|[x, y]| [x, y, 0.]));
shrunk(&prism(&outline, 0., 4.)?, 1., Join::Round)
}
Time
654 ms; CPU time 653 ms; peak memory 369.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 plus-shaped plate shrunk by 1. The plate whose outline in the xy plane is the polygon through
(3, 0), (6, 0), (6, 3), (9, 3), (9, 6), (6, 6), (6, 9), (3, 9), (3, 6), (0, 6), (0, 3) and (3, 3),
extruded 4 along +z, shrunk by 1: every point of it at least 1 from its boundary. Each of its four
concave vertical edges is rounded by the shrink to a cylinder of radius 1."""fromOCP.BRepBuilderAPIimportBRepBuilderAPI_MakeFace, BRepBuilderAPI_MakePolygonfromOCP.BRepPrimAPIimportBRepPrimAPI_MakePrismfromOCP.gp import gp_Pnt, gp_Vec
from offset import offset
OUTLINE = [(3, 0), (6, 0), (6, 3), (9, 3), (9, 6), (6, 6), (6, 9), (3, 9), (3, 6), (0, 6), (0, 3),
(3, 3)]
THICKNESS = 4SHRINKAGE = 1defbuild():
polygon = BRepBuilderAPI_MakePolygon()
for x, y inOUTLINE:
polygon.Add(gp_Pnt(x, y, 0))
polygon.Close()
outline = BRepBuilderAPI_MakeFace(polygon.Wire()).Face()
plate = BRepPrimAPI_MakePrism(outline, gp_Vec(0, 0, THICKNESS)).Shape()
returnoffset(plate, -SHRINKAGE)
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
109 ms; CPU time 109 ms; peak memory 53.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.
Data
its STEP's
expected
rel. error
volume
27.71681469
27.71681469
0.0e+00
area
80.28318531
80.28318531
3.5e-16
agrees with
cad-kernel, occt, next.BREP, cadrs, springrep
mesh
556 triangles, closed
centre of gravity
(4.5, 4.5, 2) its STEP's solid
inertia
about it, of unit density: Ixx 68.3643; Iyy 68.3643; Izz 118.251; Ixy 3.10862e-15; Iyz 5.69229e-32; Izx 7.21645e-16
//! The plus-shaped plate of `offset/plus-shaped-plate-grown`, 4 thick, shrunk by 1: every point at//! least 1 from its outside, its convex edges sharp and its four concave vertical edges quarter//! cylinders, SolidCraft's offset of the whole solid inward (`offset_solid`), rounded where the//! moved faces part.usesuper::plus_shaped_plate_grown::plus_plate;
usecrate::solids::*;
pubfnbuild() -> R<Body> {
solidcraft_kernel::offset_solid(&plus_plate(4.0)?, -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
29 ms; CPU time 28 ms; peak memory 25 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
27.71681469
27.71681469
5.1e-16
area
80.28318531
80.28318531
3.5e-16
agrees with
cad-kernel, occt, solidcraft, cadrs, springrep
mesh
556 triangles, closed
centre of gravity
(4.5, 4.5, 2) its STEP's solid
inertia
about it, of unit density: Ixx 68.3643; Iyy 68.3643; Izz 118.251; Ixy 4.44089e-16; Iyz 1.19702e-16; Izx 4.996e-16
//! The plus-shaped plate, the outline through (3, 0), (6, 0), (6, 3), (9, 3), (9, 6), (6, 6),//! (6, 9), (3, 9), (3, 6), (0, 6), (0, 3) and (3, 3) extruded 4 along +z, shrunk by 1 to its//! inner parallel body: its four concave vertical edges rounded, the rest sharp.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(3.0, 0.0, 0.0), p(6.0, 0.0, 0.0), p(6.0, 3.0, 0.0), p(9.0, 3.0, 0.0),
p(9.0, 6.0, 0.0), p(6.0, 6.0, 0.0), p(6.0, 9.0, 0.0), p(3.0, 9.0, 0.0),
p(3.0, 6.0, 0.0), p(0.0, 6.0, 0.0), p(0.0, 3.0, 0.0), p(3.0, 3.0, 0.0),
])?;
let plate = extrude_profile_brep(&outline, p(0.0, 0.0, 1.0), 4.0)?;
Ok(parallel(&plate, -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
3.2 ms; CPU time 3.6 ms; peak memory 6.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.
//! The plus-shaped plate of `offset/plus-shaped-plate-grown`, extruded 4 along +z, shrunk by 1://! the solid of every point at least 1 from its outside. Each arm is left 1 wide; the four//! concave vertical edges are rounded to radius 1 by the shrink.//!//! The outline extruded, then cadrs's offset inward.usecrate::bench::extrude;
usecrate::shared::offset::shrunk;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, Loop, Plane, Profile};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let outline = Loop::polygon(&super::r#plus_shaped_plate_grown::PLUS);
let plate = extrude(k, &Profile::of(Plane::xy(0.0), vec![outline]), 4.0)?;
shrunk(k, plate, 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
3.3 ms; CPU time 3 ms; peak memory 8.5 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
27.71681469
27.71681469
0.0e+00
area
80.28318531
80.28318531
0.0e+00
agrees with
cad-kernel, occt, solidcraft, next.BREP, cadrs
mesh
556 triangles, closed
centre of gravity
(4.5, 4.5, 2) its STEP's solid
inertia
about it, of unit density: Ixx 68.3643; Iyy 68.3643; Izz 118.251; Ixy 3.88578e-16; Iyz -1.42307e-32; Izx -1.34788e-15
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 plus-shaped plate shrunk 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 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())
}