† 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
10 ms; CPU time 14 ms; peak memory 11.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), shrunk by 1: every point at least 1 inside it.usecrate::sketch::block;
use cad_kernel::offset::{shrunk, Join};
use cad_kernel::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
shrunk(&block([0., 0., 0.], [10., 8., 6.])?, 1., Join::Round)
}
Time
628 ms; CPU time 627 ms; peak memory 367.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.
"""A box shrunk by 1. The box from the origin to (10, 8, 6), shrunk by 1: every point at least 1
from its outside."""fromOCP.BRepPrimAPIimportBRepPrimAPI_MakeBoxfrom offset import offset
SIZE = (10, 8, 6)
SHRINKAGE = 1defbuild():
returnoffset(BRepPrimAPI_MakeBox(*SIZE).Shape(), -SHRINKAGE)
Time
2.2 ms; CPU time 2 ms; peak memory 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), shrunk by 1: every point at least 1 from its outside.use arris::math::{Control, Point3};
use arris::ops::{offset_faces, primitive_box, OpError};
use arris::topo::{Body, Model};
constSIZE: (f64, f64, f64) = (10.0, 8.0, 6.0);
constSHRINKAGE: f64 = 1.0;
pubfnbuild(m: &mutModel) -> Result<Body, OpError> {
let (block, _) =
primitive_box(m, Point3::origin(), Point3::new(SIZE.0, SIZE.1, SIZE.2), &Control::NONE)?;
// every face moved in along its normal; a box's edges are all convex, so shrunk they stay// sharp, the moved faces meeting, as `offset_faces` joins themlet faces = m.faces(block)?;
let (shrunk, _) = offset_faces(m, block, &faces, -SHRINKAGE, &Control::NONE)?;
Ok(shrunk)
}
Time
2.3 ms; CPU time 2.1 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.
//! The box from the origin to (10, 8, 6), shrunk by 1: every point at least 1 from its outside,//! the box from (1, 1, 1) to (9, 7, 5).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
61 ms; CPU time 61 ms; peak memory 47.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.
//! SolidCraft's Offset Face (`offset_faces`) moves the faces picked along their outward normals,//! keeping the body's topology: each edge goes to where its two faces, moved, meet. Every edge of//! a box is convex, and shrunk a convex edge stays sharp, so the box with all six faces moved 1//! inward is the box shrunk by 1.usecrate::solids::*;
pubfnbuild() -> R<Body> {
let b = block((0.0, 0.0, 0.0), (10.0, 8.0, 6.0))?;
// the middle of each face, picking itlet faces = [
v3(0.0, 4.0, 3.0),
v3(10.0, 4.0, 3.0),
v3(5.0, 0.0, 3.0),
v3(5.0, 8.0, 3.0),
v3(5.0, 4.0, 0.0),
v3(5.0, 4.0, 6.0),
];
solidcraft_kernel::offset_faces(&b, &faces, -1.0)
}
Time
1.4 ms; CPU time 1.2 ms; peak memory 4.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) shrunk by 1: every face moved 1 inward by brepkit's//! offset, whose default joint extends the moved faces until they meet, so the edges stay sharp.use brepkit_operations::offset_v2::offset_solid_v2;
use brepkit_operations::primitives::make_box;
use brepkit_operations::OperationsError;
use brepkit_topology::solid::SolidId;
use brepkit_topology::Topology;
pubfnbuild(topo: &mutTopology) -> Result<SolidId, OperationsError> {
let block = make_box(topo, 10.0, 8.0, 6.0)?;
offset_solid_v2(topo, block, -1.0)
}
Time
6.2 ms; CPU time 7.2 ms; peak memory 21.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 box from the origin to (10, 8, 6), shrunk by 1: every face moved in 1.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: "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
8.1 ms; CPU time 7.9 ms; peak memory 18.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), shrunk by 1: every point at least 1 from its outside,//! the box from (1, 1, 1) to (9, 7, 5).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
21 ms; CPU time 21 ms; peak memory 19 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), shrunk by 1: each face moves 1 inward and the edges//! stay sharp, leaving the box from (1, 1, 1) to (9, 7, 5). The box is extruded from its//! rectangle and its six faces offset 1 into it by geop's face offset, which rebuilds the solid//! where the moved faces meet; each face is picked by a point on it.usecrate::shared::hollow::{block, offset_faces};
usecrate::{Bench, Refusal};
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, "shrink", &faces, -1.0)
}
Time
2.1 ms; CPU time 1.9 ms; peak memory 6.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 box from the origin to (10, 8, 6), shrunk by 1: the solid of every point at least 1 from//! the box's outside. Each face moves 1 in and the edges stay sharp: the box from (1, 1, 1) to//! (9, 7, 5).//!//! The rectangle extruded, then cadrs's offset inward.usecrate::bench::{block, p3};
usecrate::shared::offset::shrunk;
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))?;
shrunk(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
1.7 ms; CPU time 1.5 ms; peak memory 7.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 box from the origin to (10, 8, 6), shrunk by 1: every point at least 1 from its outside,//! the box from (1, 1, 1) to (9, 7, 5).use springrep::edit::offset;
use springrep::math::Vec3;
use springrep::primitive::block;
use springrep::topo::Brep;
usecrate::shared::{at, e};
pubfnbuild() -> Result<Brep, String> {
let b = block(&at([0., 0., 0.]), Vec3::new(10., 8., 6.), "box").map_err(e)?;
offset(&b, -1., "shrunk").map_err(e)
}
geomsolver left no solid to show.
Time
48 ms; CPU time 48 ms; peak memory 25.2 MB
Notes
refused error[E080]: `shrunk.body`: a body shelled that is no body of terms
// The box from the origin to (10, 8, 6), shrunk by 1: its footprint drawn in the top plane (x, y),// the prism over it to z = 6, and the points at least 1 from its outside, `std.rounds.Grown`'s body// for a negative reach.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))
shrunk := std.rounds.Grown(box, d: -1mm)
part := solid(shrunk.body)
Time
1.4 ms; CPU time 1.2 ms; peak memory 4.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) shrunk by 1: every face moved 1 inward.use anvil_brep::Solid;
usecrate::shared::{block, offset};
pubfnbuild() -> Result<Solid, String> {
offset(&block([0., 0., 0.], [10., 8., 6.])?, -1.)
}