The plate from (−10, −10, 0) to (10, 10, 4), with a hole of radius 3 drilled through it along the z axis. Grow it by 1: the solid of every point within 1 of the drilled plate.
The plate grows as a box does: each face moves 1 outward, each outer edge becomes a quarter of a cylinder of radius 1, each corner an eighth of a ball. The hole narrows to radius 2, and each of its rims becomes the inner quarter of a torus's tube: a tube of radius 1 about the rim's circle, of radius 3, on the side toward the axis, a saddle. So the hole flares from radius 2 out to radius 3 at the grown plate's faces, z = −1 and z = 5, meeting them tangentially.
† 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
84 ms; CPU time 137 ms; peak memory 14.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 plate from (−10, −10, 0) to (10, 10, 4) drilled through along z with a hole of radius 3,//! grown by 1.usecrate::sketch::block;
use cad_kernel::boolean::{combined, Op};
use cad_kernel::build::{disc, prism};
use cad_kernel::offset::{grown, Join};
use cad_kernel::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
let plate = block([-10., -10., 0.], [10., 10., 4.])?;
let drill = prism(&disc([0., 0., -1.], [0., 0., 1.], 3.), 0., 6.)?;
grown(&combined(&plate, &drill, Op::Cut, 0.)?, 1., Join::Round)
}
Time
649 ms; CPU time 648 ms; peak memory 368.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.
"""A drilled plate grown by 1. The plate from (−10, −10, 0) to (10, 10, 4), with a hole of radius 3
through it along the z axis, grown by 1."""fromOCP.BRepAlgoAPIimportBRepAlgoAPI_CutfromOCP.BRepPrimAPIimportBRepPrimAPI_MakeBox, BRepPrimAPI_MakeCylinderfromOCP.gp import gp, gp_Ax2, gp_Pnt
from bench importRefusedfrom offset import offset
HALF_SIDE = 10THICKNESS = 4HOLE_RADIUS = 3GROWTH = 1defbuild():
plate = BRepPrimAPI_MakeBox(gp_Pnt(-HALF_SIDE, -HALF_SIDE, 0),
gp_Pnt(HALF_SIDE, HALF_SIDE, THICKNESS)).Shape()
# The drill runs 1 past both faces of the plate.
drill = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, 0, -1), gp.DZ_s()), HOLE_RADIUS,
THICKNESS + 2).Shape()
cut = BRepAlgoAPI_Cut(plate, drill)
ifnot cut.IsDone():
raiseRefused("BRepAlgoAPI_Cut declined the hole")
returnoffset(cut.Shape(), GROWTH)
arris left no solid to show.
Time
1.1 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, where they meet
//! The plate from (−10, −10, 0) to (10, 10, 4), with a hole of radius 3 through it along the z//! axis, grown by 1.//!//! 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
48 ms; CPU time 48 ms; peak memory 16.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.
//! The plate from (−10, −10, 0) to (10, 10, 4) with a hole of radius 3 drilled through it along//! the z axis, grown by 1: every point within 1 of it. The hole narrows to radius 2 and flares to//! radius 3 at the grown faces, its rims saddles. The drill runs 1 past both faces.usecrate::bench::{frame, p};
use kentron::boolean;
use kentron::math::Direction;
use kentron::offset::{self, Join};
use kentron::primitives::{Cuboid, Cylinder};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let plate = Cuboid::from_corners(p(-10.0, -10.0, 0.0), p(10.0, 10.0, 4.0)).build(m)?;
let drill = Cylinder::new(3.0, 6.0).with_frame(frame(p(0.0, 0.0, -1.0), Direction::Z)).build(m)?;
let drilled = boolean::difference(m, plate, drill)?;
offset::shape(m, drilled, 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.03 s; CPU time 1.03 s; peak memory 55 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 plate from (−10, −10, 0) to (10, 10, 4) with a hole of radius 3 drilled through it along//! the z axis, grown by 1: every point within 1 of it, SolidCraft's offset of the whole solid//! (`offset_solid`), its convex edges rounded. The plate grows as a box does, and the hole narrows//! to radius 2, flaring at its rims into the inner quarters of tori.usecrate::solids::*;
pubfnbuild() -> R<Body> {
let plate = block((-10.0, -10.0, 0.0), (10.0, 10.0, 4.0))?;
// the drill runs past both faceslet drill = zcyl(0.0, 0.0, 3.0, -1.0, 5.0)?;
let drilled = cut(&plate, &drill)?;
solidcraft_kernel::offset_solid(&drilled, 1.0, true)
}
Time
16 ms; CPU time 15 ms; peak memory 11.6 MB
Notes
wrong its STEP is no solid: face #1182: 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 plate from (−10, −10, 0) to (10, 10, 4), drilled through along the z axis by a hole of//! radius 3, grown by 1 with its edges rounded.//!//! brepkit's rounded offset (`offset_solid_arc_v2`) does not build its arc joints yet, so the//! drilled plate is offset with sharp joints (the plate grown to (−11, −11, −1)–(11, 11, 5), the//! hole narrowed to radius 2) and the grown plate's edges are then rounded to radius 1. Each//! round lies 1 from the two moved faces beside it: the outer edges' rounds on the cylinders of//! radius 1 about the plate's own edges, closing at its corners on the balls about them, and the//! hole's rims, concave, filled by the inner quarters of the tubes of radius 1 about the plate's//! own rims.use brepkit_operations::blend_ops::{all_blended, fillet_v2};
use brepkit_operations::offset_v2::offset_solid_v2;
use brepkit_operations::primitives::{make_box, make_cylinder};
use brepkit_topology::solid::SolidId;
use brepkit_topology::Topology;
usecrate::solids::{cut, edges_where, moved, near};
usecrate::Refusal;
pubfnbuild(topo: &mutTopology) -> Result<SolidId, Refusal> {
let plate = make_box(topo, 20.0, 20.0, 4.0)?;
let plate = moved(topo, plate, -10.0, -10.0, 0.0)?;
// the drill runs past both faceslet drill = make_cylinder(topo, 3.0, 6.0)?;
let drill = moved(topo, drill, 0.0, 0.0, -1.0)?;
let drilled = cut(topo, plate, drill)?;
let grown = offset_solid_v2(topo, drilled, 1.0)?;
// the edges round the grown plate's two faces, the hole's rims among them, and its four// upright corners (not the bore's seam)letmut edges = edges_where(topo, grown, |q| near(q.z(), -1.0) || near(q.z(), 5.0))?;
edges.extend(edges_where(topo, grown, |q| {
near(q.x().abs(), 11.0) && near(q.y().abs(), 11.0)
})?);
Ok(all_blended(fillet_v2(topo, grown, &edges, 1.0)?)?)
}
Time
102 ms; CPU time 127 ms; peak memory 27.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 plate from (-10, -10, 0) to (10, 10, 4), drilled through along the z axis by a hole of// radius 3, grown by 1.let m = model();
let plate = m.profile(xy()).rect(20.0, 20.0).sketch("plate").extrude(blind(4.0));
let drill = m.tool(|m| m.profile(xy_at(-1.0)).circle(3.0).sketch("drill").extrude(blind(6.0)));
plate = plate.subtract(drill, #{ label: "hole" });
plate = plate.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
62 ms; CPU time 61 ms; peak memory 26.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 plate from (−10, −10, 0) to (10, 10, 4) with a hole of radius 3 drilled through it along//! the z axis, grown by 1 to its parallel body: the plate grown as a box is, the hole narrowed to//! radius 2 and flaring out at each rim through the inner quarter of a torus's tube.//!//! The hole is cut by a cylinder running past both faces of the plate.usecrate::solids::offset::{parallel, subtract};
usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{make_box_brep, make_cylinder_brep, BrepSolid};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let plate = make_box_brep(p(-10.0, -10.0, 0.0), 20.0, 20.0, 4.0)?;
let drill = make_cylinder_brep(p(0.0, 0.0, -1.0), p(0.0, 0.0, 1.0), 3.0, 6.0)?;
let drilled = subtract(&plate, &drill)?;
Ok(parallel(&drilled, 1.0)?)
}
Time
12.9 s; CPU time 12.9 s; peak memory 42.1 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 plate from (−10, −10, 0) to (10, 10, 4) with a hole of radius 3 drilled through it along//! the z axis, grown by 1: every point within 1 of it. The faces move 1 outward (the hole's//! wall to radius 2), each outer edge becomes a quarter cylinder, each corner an eighth of a//! ball, and each of the hole's rims the inner quarter of a torus's tube 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. So the drilled plate's faces are offset 1 out, to the plate from//! (−11, −11, −1) to (11, 11, 5) with a hole of radius 2, and its edges then rounded to radius//! 1: each round is tangent to two moved faces, so it lies about the plate's own edge or rim.usecrate::shared::hollow::{block, offset_faces, round, whole_edges};
usecrate::shared::{Drawing, extrude_symmetric, sketch, xy};
usecrate::{Bench, Refusal};
use geop_ops_fillet::FilletArgs;
use geop_ops_model::Combine;
pubfnbuild(b: &mutBench) -> Result<(), Refusal> {
let plate = block(b, "plate", [-10.0, -10.0], [10.0, 10.0], 4.0)?;
letmut bore = Drawing::new();
bore.circle([0.0, 0.0], 3.0);
sketch(b, "bore", xy(), bore)?;
extrude_symmetric(b, "hole", "bore", 20.0, Combine::cut(plate))?;
letmut faces = vec![
[5.0, 5.0, 0.0],
[5.0, 5.0, 4.0],
[0.0, -10.0, 2.0],
[10.0, 0.0, 2.0],
[0.0, 10.0, 2.0],
[-10.0, 0.0, 2.0],
];
faces.extend(round(3.0, 2.0));
offset_faces(b, "grow", &faces, 1.0)?;
letmut edges = Vec::new();
for z in [-1.0, 5.0] {
edges.extend([[0.0, -11.0, z], [11.0, 0.0, z], [0.0, 11.0, z], [-11.0, 0.0, z]]);
edges.extend(round(2.0, z));
}
edges.extend([[-11.0, -11.0, 2.0], [11.0, -11.0, 2.0], [11.0, 11.0, 2.0], [-11.0, 11.0, 2.0]]);
let edges = whole_edges(b, &edges)?;
b.step("rounds", FilletArgs::constant(edges, 1.0))
}
Time
4 ms; CPU time 5.1 ms; peak memory 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 plate from (−10, −10, 0) to (10, 10, 4), with a hole of radius 3 drilled through it along//! the z axis, grown by 1: the solid of every point within 1 of it. The plate grows as a box does;//! the hole narrows to radius 2 and each of its rims becomes the inner quarter of a torus's tube//! (a saddle), flaring to radius 3 at the grown plate's faces.//!//! The rectangle extruded, the hole a circle extruded through it and cut; then cadrs's offset//! with rounded edges.usecrate::bench::{block, cut, cylinder, p3, v3};
usecrate::shared::offset::grown;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let plate = block(k, p3(-10.0, -10.0, 0.0), p3(10.0, 10.0, 4.0))?;
let drill = cylinder(k, p3(0.0, 0.0, -1.0), v3(0.0, 0.0, 1.0), 3.0, 6.0)?;
let drilled = cut(k, plate, drill)?;
grown(k, drilled, 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
5.8 ms; CPU time 5.6 ms; peak memory 9.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.
//! The plate from (−10, −10, 0) to (10, 10, 4) with a hole of radius 3 drilled through it along the//! z axis, grown by 1: the hole narrows to radius 2 and flares to its rims through saddles.use springrep::boolean::difference;
use springrep::math::Vec3;
use springrep::primitive::{block, cylinder};
use springrep::topo::Brep;
usecrate::shared::offset::grown;
usecrate::shared::{at, e};
pubfnbuild() -> Result<Brep, String> {
let plate = block(&at([-10., -10., 0.]), Vec3::new(20., 20., 4.), "plate").map_err(e)?;
let drill = cylinder(&at([0., 0., -1.]), 3., 6., "hole").map_err(e)?;
let drilled = difference(&plate, &drill).map_err(e)?;
grown(&drilled, 1.)
}
Time
61 ms; CPU time 86 ms; peak memory 29.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 plate from (−10, −10, 0) to (10, 10, 4), drilled through along the z axis by a hole of// radius 3, grown by 1: the points within 1 of the drilled plate, `std.rounds.Grown`'s body.unit mm
use std
use std.solids
use std.solids (cut)
use std.rounds
in std.top {
a := point
b := point hint((10, -10))
c := point hint((10, 10))
d := point hint((-10, 10))
outline := horizontal line(a, b) -> vertical line(b, c) ->
horizontal line(c, d) -> vertical line(d, a) -> close
fix((-10, -10)) a
a distance(20) b
b distance(20) c
o := point
fix((0, 0)) o
hole := circle(center: o) hint(r: 3)
radius(3) hole
drill := solid(std.solids.Through(face(hole)))
drill cut plate
}
plate := solid(std.solids.Prism(outline, from: 0mm, to: 4mm))
grown := std.rounds.Grown(plate, d: 1mm)
part := solid(grown.body)
anvilcad left no solid to show.
Time
1.1 ms; CPU time 940 µs; peak memory 3.6 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 drilled 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())
}