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. Grow it by 1: the solid of every point within 1 of the plate.
Each face moves 1 outward. Each convex edge becomes a quarter of a cylinder of radius 1 about it, and each corner where three convex edges meet an eighth of a ball. The inside corner's edge, the concave one along (5, 5), stays sharp: the two faces beside it, moved out, meet along the line x = 6, y = 6. Where that edge meets the top and bottom faces, the rounds of the top or bottom edges beside it meet in a sharp concave crease.
The grown plate's section at any height from z = 0 to z = 8 is the outline grown by 1 (its sides moved out 1, its five convex corners rounded to radius 1, its inside corner sharp), of area A + Pd + kd², where A and P are the outline's area and perimeter.
† works around a missing feature. ✦ an elegant solution. 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
100 ms; CPU time 166 ms; peak memory 14.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 through (0, 0), (20, 0), (20, 5), (5, 5), (5, 15), (0, 15), 8 thick, grown//! by 1.usecrate::sketch::l_block;
use cad_kernel::offset::{grown, Join};
use cad_kernel::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
grown(&l_block()?, 1., Join::Round)
}
Time
647 ms; CPU time 646 ms; peak memory 370 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) and (0, 15), extruded 8//! along +z, grown by 1: its convex edges rounded, its concave edge 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 at a convex edge of an outward offset the join is sharp. Growing by//! every point within 1 rounds each convex edge and corner, 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, where they meet".into())
}
Time
4.4 ms; CPU time 4.2 ms; peak memory 9.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) and (0, 15)//! extruded 8 along +z, grown by 1: every point within 1 of it. Its convex edges become quarter//! cylinders and its convex corners eighth balls; the concave edge along (5, 5) stays sharp.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
1.30 s; CPU time 1.30 s; peak memory 57.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) grown by 1: every point within 1 of it, its convex edges rounded and its//! concave one sharp, SolidCraft's offset of the whole solid (`offset_solid`), its convex edges//! rounded.usecrate::solids::*;
/// The L-shaped plate.pubfnl_block() -> R<Body> {
let outline = 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)]);
extrude(&Plane::XY, outline, 0.0, 8.0)
}
pubfnbuild() -> R<Body> {
solidcraft_kernel::offset_solid(&l_block()?, 1.0, true)
}
Time
13 ms; CPU time 13 ms; peak memory 8.1 MB
Notes
wrong its STEP is no solid: face #923: a face whose loops bound no region of its surface
Workaround † no rounded offset
Data
No measures: it built no solid to measure.
STEP
B-rep advanced faces, each on a surface CONFIG_CONTROL_DESIGN
//! The L-shaped plate (its outline through (0, 0), (20, 0), (20, 5), (5, 5), (5, 15) and (0, 15),//! extruded 8 along +z) grown by 1, its convex edges rounded and its concave one sharp.//!//! brepkit's rounded offset (`offset_solid_arc_v2`) does not build its arc joints yet, so the//! plate is offset with sharp joints and the grown plate's convex edges, all but the concave//! one along x = 6, y = 6, are then rounded to radius 1: each round lies 1 from both moved//! faces, on the cylinder of radius 1 about the plate's own edge, and closes at a convex corner//! on the ball of radius 1 about the plate's corner.use brepkit_operations::blend_ops::{all_blended, fillet_v2};
use brepkit_operations::offset_v2::offset_solid_v2;
use brepkit_topology::explorer::solid_edges;
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 grown = offset_solid_v2(topo, plate, 1.0)?;
let concave = edges_where(topo, grown, |q| near(q.x(), 6.0) && near(q.y(), 6.0))?;
let convex: Vec<_> = solid_edges(topo, grown)?
.into_iter()
.filter(|e| !concave.contains(e))
.collect();
Ok(all_blended(fillet_v2(topo, grown, &convex, 1.0)?)?)
}
Time
32 ms; CPU time 62 ms; peak memory 23.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), (0, 15),// extruded 8 up, grown by 1 with rounded edges.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: "grown" });
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
93 ms; CPU time 92 ms; peak memory 28.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 L through (0, 0), (20, 0), (20, 5), (5, 5), (5, 15), (0, 15), extruded 8 along +z, grown by//! 1 to its parallel body: convex edges quarter cylinders, convex corners eighth balls, the inside//! corner's concave edge sharp.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)?)
}
geop left no solid to show.
Time
250 ms; CPU time 250 ms; peak memory 19.5 MB
Notes
refused edges "extrude(plate,plate_base,c8,start)" and "extrude(plate,plate_base,c9,start)" are blended together, joined at a corner, and both end on their own at vertex VertexId(83), where their blends would overlap in one tool: only blends joined at one end and apart at the other are built — round the third edge at vertex VertexId(83) too, or blend them one at a time (in step "rounds")
//! The L-shaped plate, the polygon (0, 0), (20, 0), (20, 5), (5, 5), (5, 15), (0, 15) extruded//! 8 up, grown by 1: every point within 1 of it. Each face moves 1 outward, each convex edge//! becomes a quarter cylinder of radius 1 about it and each convex corner an eighth of a ball;//! the concave edge stays sharp, and the rounds of the top and bottom edges beside it meet in a//! sharp crease.//!//! geop has no offset of a solid that rounds where moved faces part: its face offset moves the//! faces and meets them sharp. So the plate's faces are offset 1 out, and then its convex edges//! (all but the one along (6, 6)) rounded to radius 1: each round is tangent to two moved//! faces, so it lies about the plate's own edge.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, "grow", &faces, 1.0)?;
// The grown outline: (−1, −1), (21, −1), (21, 6), (6, 6), (6, 16), (−1, 16).letmut edges = Vec::new();
for z in [-1.0, 9.0] {
edges.extend([
[10.0, -1.0, z],
[21.0, 2.0, z],
[12.0, 6.0, z],
[6.0, 10.0, z],
[2.0, 16.0, z],
[-1.0, 7.0, z],
]);
}
edges.extend([
[-1.0, -1.0, 4.0],
[21.0, -1.0, 4.0],
[21.0, 6.0, 4.0],
[6.0, 16.0, 4.0],
[-1.0, 16.0, 4.0],
]);
let edges = b.edges(&edges)?;
b.step("rounds", FilletArgs::constant(edges, 1.0))
}
Time
12 ms; CPU time 16 ms; peak memory 9.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 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, grown by 1: the solid of every point within 1 of it.//! Convex edges become quarter cylinders and corners eighths of balls; the concave edge along//! (5, 5) stays sharp.//!//! The outline extruded, then cadrs's offset with rounded edges.usecrate::bench::extrude;
usecrate::shared::offset::grown;
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)?;
grown(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
9 ms; CPU time 8.8 ms; peak memory 9.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 L-shaped plate on the outline (0, 0), (20, 0), (20, 5), (5, 5), (5, 15), (0, 15), 8 thick,//! grown by 1: its convex edges rounded, the inside corner's edge sharp.use springrep::topo::Brep;
usecrate::shared::offset::{grown, l_block};
pubfnbuild() -> Result<Brep, String> {
grown(&l_block()?, 1.)
}
Time
63 ms; CPU time 83 ms; peak memory 30.7 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Elegant ✦ one Grown word over an L: convex edges rounded, the concave edge left sharp, exact
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 grown 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 within 1 of it,// `std.rounds.Grown`'s body: the convex edges rounded, the inside corner's concave edge left sharp.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))
grown := std.rounds.Grown(plate, d: 1mm)
part := solid(grown.body)
anvilcad left no solid to show.
Time
1.1 ms; CPU time 960 µ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
//! An L-shaped plate grown by 1, grown with its convex edges rounded.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())
}