The L-shaped plate whose outline in the xy plane is the polygon through (0, 0), (20, 0), (20, 5), (5, 5), (5, 15) and (0, 15), extruded 8 along +z. Shrink it by 1: the solid of every point at least 1 from the plate's outside.
Each face moves 1 inward and every convex edge stays sharp. The inside corner's edge, the concave one along (5, 5), becomes a round: a quarter of a cylinder of radius 1 about that edge, concave, joining the two faces beside it, which have moved in to x = 4 and y = 4.
So the shrunk plate runs from z = 1 to z = 7, and its section is the polygon through (1, 1), (19, 1), (19, 4), (5, 4), (4, 5), (4, 14) and (1, 14) with its edge from (5, 4) to (4, 5) replaced by the quarter circle of radius 1 about (5, 5).
† 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
16 ms; CPU time 21 ms; peak memory 11.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.
//! The L-shaped plate through (0, 0), (20, 0), (20, 5), (5, 5), (5, 15), (0, 15), 8 thick, shrunk//! by 1: every point of it at least 1 inside it.usecrate::sketch::l_block;
use cad_kernel::offset::{shrunk, Join};
use cad_kernel::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
shrunk(&l_block()?, 1., Join::Round)
}
Time
651 ms; CPU time 650 ms; peak memory 368.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.
"""An L-shaped plate shrunk. The L-shaped plate whose outline in the xy plane is the polygon through
(0, 0), (20, 0), (20, 5), (5, 5), (5, 15) and (0, 15), extruded 8 along +z."""fromOCP.BRepBuilderAPIimportBRepBuilderAPI_MakeFace, BRepBuilderAPI_MakePolygonfromOCP.BRepPrimAPIimportBRepPrimAPI_MakePrismfromOCP.gp import gp_Pnt, gp_Vec
from offset import offset
OUTLINE = [(0, 0), (20, 0), (20, 5), (5, 5), (5, 15), (0, 15)]
THICKNESS = 8DISTANCE = -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, DISTANCE)
arris left no solid to show.
Time
1.2 ms; CPU time 970 µs; peak memory 3.5 MB
Notes
refused arris has no offset with rounded joins: `offset_faces` moves every face and joins the moved faces sharp, so the concave edge would not be rounded
//! The L-shaped plate through (0, 0), (20, 0), (20, 5), (5, 5), (5, 15) and (0, 15), extruded 8//! along +z, shrunk by 1: its concave edge rounded, its convex edges kept sharp.//!//! Refused: arris's `offset_faces` moves every face of a solid along its normal and joins the moved//! faces where they meet, so the inside corner's edge, concave, would stay sharp. Shrinking by//! every point at least 1 inside rounds it, and arris has no rounded join.usecrate::Refusal;
use arris::topo::{Body, Model};
pubfnbuild(_: &mutModel) -> Result<Body, Refusal> {
Err("arris has no offset with rounded joins: `offset_faces` moves every face and joins the moved faces sharp, so the concave edge would not be rounded".into())
}
Time
5.5 ms; CPU time 5.3 ms; peak memory 11.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 L-shaped plate, the outline through (0, 0), (20, 0), (20, 5), (5, 5), (5, 15) and (0, 15)//! extruded 8 along +z, shrunk by 1: every point at least 1 from its outside. Its convex edges stay//! sharp; the concave edge along (5, 5) becomes a concave quarter cylinder of radius 1.usecrate::shared::offset::l_plate;
use kentron::offset::{self, Join};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let plate = l_plate(m)?;
offset::shape(m, plate, -1.0, 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.
Time
48 ms; CPU time 47 ms; peak memory 50.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.
//! The L-shaped plate (the polygon through (0, 0), (20, 0), (20, 5), (5, 5), (5, 15) and (0, 15),//! extruded 8 along +z) shrunk by 1: every point at least 1 from its outside, its convex edges//! sharp and its concave edge a concave quarter cylinder, SolidCraft's offset of the whole solid//! inward (`offset_solid`), rounded where the moved faces part.usesuper::l_block_grown::l_block;
usecrate::solids::*;
pubfnbuild() -> R<Body> {
solidcraft_kernel::offset_solid(&l_block()?, -1.0, true)
}
Time
1.8 ms; CPU time 1.6 ms; peak memory 7.2 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no rounded offset
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 L-shaped plate (its outline through (0, 0), (20, 0), (20, 5), (5, 5), (5, 15) and (0, 15),//! extruded 8 along +z) shrunk by 1, its convex edges sharp and its concave one rounded.//!//! brepkit's rounded offset (`offset_solid_arc_v2`) does not build its arc joints yet, so the//! plate is offset 1 inward with sharp joints and the shrunk plate's concave edge, along x = 4,//! y = 4, is then rounded to radius 1: the round lies 1 from both moved faces, on the cylinder of//! radius 1 about the plate's own concave edge.use brepkit_operations::blend_ops::{all_blended, fillet_v2};
use brepkit_operations::offset_v2::offset_solid_v2;
use brepkit_topology::solid::SolidId;
use brepkit_topology::Topology;
usecrate::solids::offset::l_block;
usecrate::solids::{edges_where, near};
usecrate::Refusal;
pubfnbuild(topo: &mutTopology) -> Result<SolidId, Refusal> {
let plate = l_block(topo)?;
let shrunk = offset_solid_v2(topo, plate, -1.0)?;
let concave = edges_where(topo, shrunk, |q| near(q.x(), 4.0) && near(q.y(), 4.0))?;
Ok(all_blended(fillet_v2(topo, shrunk, &concave, 1.0)?)?)
}
Time
7.4 ms; CPU time 8.5 ms; peak memory 22.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.
// The L-shaped plate: the outline through (0, 0), (20, 0), (20, 5), (5, 5), (5, 15), (0, 15),// extruded 8 up, shrunk by 1.let m = model();
let l = m.profile(xy())
.polygon([[0.0, 0.0], [20.0, 0.0], [20.0, 5.0], [5.0, 5.0], [5.0, 15.0], [0.0, 15.0]])
.sketch("outline").extrude(blind(8.0));
l = l.offset_solid(-1.0, #{ 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
14 ms; CPU time 14 ms; peak memory 24.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.
//! The L through (0, 0), (20, 0), (20, 5), (5, 5), (5, 15), (0, 15), extruded 8 along +z, shrunk//! by 1: every point at least 1 from its outside, its convex edges sharp and its inside corner's//! concave edge a concave quarter cylinder of radius 1.usecrate::solids::offset::parallel;
usecrate::solids::{p, polygon};
usecrate::Refusal;
use brep_kernel::{extrude_profile_brep, BrepSolid};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let l = polygon(&[
p(0.0, 0.0, 0.0), p(20.0, 0.0, 0.0), p(20.0, 5.0, 0.0),
p(5.0, 5.0, 0.0), p(5.0, 15.0, 0.0), p(0.0, 15.0, 0.0),
])?;
let block = extrude_profile_brep(&l, p(0.0, 0.0, 1.0), 8.0)?;
Ok(parallel(&block, -1.0)?)
}
Time
257 ms; CPU time 257 ms; peak memory 20.3 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no rounded offset of a solid
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 L-shaped plate, the polygon (0, 0), (20, 0), (20, 5), (5, 5), (5, 15), (0, 15) extruded//! 8 up, shrunk by 1: every point at least 1 from its outside. Each face moves 1 inward and the//! convex edges stay sharp; the concave edge along (5, 5) becomes a concave quarter cylinder of//! radius 1 about it.//!//! geop has no offset of a solid that rounds where moved faces part: its face offset moves the//! faces and meets them sharp everywhere, the two beside the concave edge in the line x = 4,//! y = 4. So the plate is shrunk that way, and that edge then rounded to radius 1: the round//! tangent to x = 4 and y = 4 on the material's side is the cylinder of radius 1 about the line//! x = 5, y = 5, the concave edge itself.usecrate::shared::hollow::{offset_faces, prism};
usecrate::{Bench, Refusal};
use geop_ops_fillet::FilletArgs;
pubfnbuild(b: &mutBench) -> Result<(), Refusal> {
let outline = [[0.0, 0.0], [20.0, 0.0], [20.0, 5.0], [5.0, 5.0], [5.0, 15.0], [0.0, 15.0]];
prism(b, "plate", &outline, 8.0)?;
let faces = [
[2.0, 2.0, 0.0],
[2.0, 2.0, 8.0],
[10.0, 0.0, 4.0],
[20.0, 2.0, 4.0],
[10.0, 5.0, 4.0],
[5.0, 10.0, 4.0],
[2.0, 15.0, 4.0],
[0.0, 7.0, 4.0],
];
offset_faces(b, "shrink", &faces, -1.0)?;
let corner = b.edge([4.0, 4.0, 4.0])?;
b.step("round", FilletArgs::constant(vec![corner], 1.0))
}
Time
2.2 ms; CPU time 2 ms; peak memory 6.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.
//! The L-shaped plate whose outline is the polygon through (0, 0), (20, 0), (20, 5), (5, 5),//! (5, 15) and (0, 15), extruded 8 along +z, shrunk by 1: the solid of every point at least 1//! from its outside. Each face moves 1 in, the convex edges stay sharp, and the concave edge//! along (5, 5) becomes a concave quarter cylinder of radius 1 about it.//!//! The outline extruded, then cadrs's offset inward with rounded edges.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(&[[0.0, 0.0], [20.0, 0.0], [20.0, 5.0], [5.0, 5.0], [5.0, 15.0], [0.0, 15.0]]);
let plate = extrude(k, &Profile::of(Plane::xy(0.0), vec![outline]), 8.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
2.3 ms; CPU time 2 ms; peak memory 8.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.
// An L-shaped plate shrunk by 1: its outline drawn in the top plane (x, y) through (0, 0), (20, 0),// (20, 5), (5, 5), (5, 15) and (0, 15), the prism over it to z = 8, and the points of it at least 1// from its outside, `std.rounds.Grown`'s body for a negative reach: the convex edges stay sharp,// the inside corner's concave edge is rounded.unit mm
use std
use std.solids
use std.rounds
in std.top {
a := point
b := point hint((20, 0))
c := point hint((20, 5))
d := point hint((5, 5))
e := point hint((5, 15))
f := point hint((0, 15))
outline := horizontal line(a, b) -> vertical line(b, c) -> horizontal line(c, d) ->
vertical line(d, e) -> horizontal line(e, f) -> vertical line(f, a) -> close
fix((0, 0)) a
a distance(20) b
b distance(5) c
c distance(15) d
f distance(15) a
}
plate := solid(std.solids.Prism(outline, from: 0mm, to: 8mm))
shrunk := std.rounds.Grown(plate, d: -1mm)
part := solid(shrunk.body)
anvilcad left no solid to show.
Time
1.1 ms; CPU time 950 µ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
//! An L-shaped plate shrunk by 1, 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())
}