The box from the origin to (10, 8, 6), grown by 1: the solid of every point within 1 of the box.
Each face moves 1 outward, each edge becomes a quarter of a cylinder of radius 1 about it, and each corner an eighth of a ball of radius 1 about it. The grown box runs from (−1, −1, −1) to (11, 9, 7).
† 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
70 ms; CPU time 118 ms; peak memory 13.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 box from the origin to (10, 8, 6), grown by 1: every point within 1 of it.usecrate::sketch::block;
use cad_kernel::offset::{grown, Join};
use cad_kernel::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
grown(&block([0., 0., 0.], [10., 8., 6.])?, 1., Join::Round)
}
Time
636 ms; CPU time 635 ms; peak memory 365.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 box grown by 1. The box from the origin to (10, 8, 6), grown by 1: every point within 1 of
it."""fromOCP.BRepPrimAPIimportBRepPrimAPI_MakeBoxfrom offset import offset
SIZE = (10, 8, 6)
GROWTH = 1defbuild():
returnoffset(BRepPrimAPI_MakeBox(*SIZE).Shape(), GROWTH)
arris left no solid to show.
Time
1.3 ms; CPU time 1.1 ms; peak memory 3.7 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 box from the origin to (10, 8, 6), grown by 1: every point within 1 of it.//!//! 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
3.2 ms; CPU time 3 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 box from the origin to (10, 8, 6), grown by 1: every point within 1 of it, its edges//! quarter cylinders and its corners eighth balls.usecrate::bench::p;
use kentron::offset::{self, Join};
use kentron::primitives::Cuboid;
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let block = Cuboid::from_corners(p(0.0, 0.0, 0.0), p(10.0, 8.0, 6.0)).build(m)?;
offset::shape(m, block, 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
943 ms; CPU time 943 ms; peak memory 54.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 box from the origin to (10, 8, 6) grown by 1: every point within 1 of it, its faces moved//! out, its edges quarter cylinders and its corners eighths of a ball, SolidCraft's offset of the//! whole solid (`offset_solid`), its convex edges rounded.usecrate::solids::*;
pubfnbuild() -> R<Body> {
let block = block((0.0, 0.0, 0.0), (10.0, 8.0, 6.0))?;
solidcraft_kernel::offset_solid(&block, 1.0, true)
}
Time
3.1 ms; CPU time 2.9 ms; peak memory 7.6 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 box from the origin to (10, 8, 6) grown by 1, its edges and corners rounded.//!//! brepkit's rounded offset (`offset_solid_arc_v2`) does not build its arc joints yet, so the box//! is offset with sharp joints, every face moved 1 outward and extended to meet, and the grown//! box's twelve edges are then rounded to radius 1 in one fillet: each round lies 1 from both//! moved faces, on the cylinder of radius 1 about the box's own edge, and the three rounds at a//! corner close on the ball of radius 1 about the box's corner.use brepkit_operations::blend_ops::{all_blended, fillet_v2};
use brepkit_operations::offset_v2::offset_solid_v2;
use brepkit_operations::primitives::make_box;
use brepkit_topology::explorer::solid_edges;
use brepkit_topology::solid::SolidId;
use brepkit_topology::Topology;
usecrate::Refusal;
pubfnbuild(topo: &mutTopology) -> Result<SolidId, Refusal> {
let block = make_box(topo, 10.0, 8.0, 6.0)?;
let grown = offset_solid_v2(topo, block, 1.0)?;
let edges = solid_edges(topo, grown)?;
Ok(all_blended(fillet_v2(topo, grown, &edges, 1.0)?)?)
}
Time
26 ms; CPU time 49 ms; peak memory 23.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.
// The box from the origin to (10, 8, 6), grown by 1: every face moved out 1, its edges rounded to// quarter cylinders and its corners to eighth balls (the default arc join).let m = model();
let b = m.profile(xy()).rect(10.0, 8.0).at(5.0, 4.0).sketch("box").extrude(blind(6.0));
b = b.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
7.2 ms; CPU time 7 ms; peak memory 11.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 box from the origin to (10, 8, 6), grown by 1 to its parallel body: every point within 1 of//! it, its edges quarter cylinders and its corners eighth balls of radius 1.usecrate::solids::offset::parallel;
usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{make_box_brep, BrepSolid};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let block = make_box_brep(p(0.0, 0.0, 0.0), 10.0, 8.0, 6.0)?;
Ok(parallel(&block, 1.0)?)
}
Time
966 ms; CPU time 965 ms; peak memory 21.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 box from the origin to (10, 8, 6), grown by 1: every point within 1 of it. Each face//! moves 1 outward, each edge becomes a quarter cylinder of radius 1 about it and each corner an//! eighth of a ball 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 box's six faces are offset 1 out, to the box from//! (−1, −1, −1) to (11, 9, 7), and its twelve edges then rounded to radius 1: each round is//! tangent to two moved faces, so it is the quarter cylinder of radius 1 about the box's own//! edge, and where three meet, the eighth of a ball about the box's corner.usecrate::shared::hollow::{block, offset_faces};
usecrate::{Bench, Refusal};
use geop_ops_fillet::FilletArgs;
pubfnbuild(b: &mutBench) -> Result<(), Refusal> {
block(b, "box", [0.0, 0.0], [10.0, 8.0], 6.0)?;
let faces = [
[5.0, 4.0, 0.0],
[5.0, 4.0, 6.0],
[5.0, 0.0, 3.0],
[5.0, 8.0, 3.0],
[0.0, 4.0, 3.0],
[10.0, 4.0, 3.0],
];
offset_faces(b, "grow", &faces, 1.0)?;
letmut edges = Vec::new();
for z in [-1.0, 7.0] {
edges.extend([[5.0, -1.0, z], [11.0, 4.0, z], [5.0, 9.0, z], [-1.0, 4.0, z]]);
}
edges.extend([[-1.0, -1.0, 3.0], [11.0, -1.0, 3.0], [11.0, 9.0, 3.0], [-1.0, 9.0, 3.0]]);
let edges = b.edges(&edges)?;
b.step("rounds", FilletArgs::constant(edges, 1.0))
}
Time
3 ms; CPU time 2.7 ms; peak memory 7.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 box from the origin to (10, 8, 6), grown by 1: the solid of every point within 1 of the//! box. Each face moves 1 out, each edge becomes a quarter cylinder of radius 1, each corner an//! eighth of a ball.//!//! The rectangle extruded, then cadrs's offset with rounded edges.usecrate::bench::{block, p3};
usecrate::shared::offset::grown;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let b = block(k, p3(0.0, 0.0, 0.0), p3(10.0, 8.0, 6.0))?;
grown(k, b, 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
4.3 ms; CPU time 4 ms; peak memory 8.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 box from the origin to (10, 8, 6), grown by 1: every point within 1 of it, its edges//! quarter cylinders and its corners eighths of a ball.use springrep::math::Vec3;
use springrep::primitive::block;
use springrep::topo::Brep;
usecrate::shared::offset::grown;
usecrate::shared::{at, e};
pubfnbuild() -> Result<Brep, String> {
let b = block(&at([0., 0., 0.]), Vec3::new(10., 8., 6.), "box").map_err(e)?;
grown(&b, 1.)
}
Time
50 ms; CPU time 65 ms; peak memory 28.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 box from the origin to (10, 8, 6), grown by 1: its footprint drawn in the top plane (x, y),// the prism over it to z = 6, and the points within 1 of it, `std.rounds.Grown`'s body.unit mm
use std
use std.solids
use std.rounds
in std.top {
a := point
b := point hint((10, 0))
c := point hint((10, 8))
d := point hint((0, 8))
footprint := horizontal line(a, b) -> vertical line(b, c) ->
horizontal line(c, d) -> vertical line(d, a) -> close
fix((0, 0)) a
a distance(10) b
b distance(8) c
}
box := solid(std.solids.Prism(footprint, from: 0mm, to: 6mm))
grown := std.rounds.Grown(box, d: 1mm)
part := solid(grown.body)
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 box 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())
}