A block, the box from (−8, −8, −8) to (8, 8, 0), with a hole bored into its top by a ring pushed straight down into it at a lean, stopping wholly inside it.
The ring is a torus centered at (0, 0, 4), its axis leaning 35° from upright toward +x, along the direction (sin 35°, 0, cos 35°): the circle through its tube's centers has radius 3, and its tube has radius 1. As placed it is wholly above the block.
It slides without turning straight down by 8, so that its center ends at (0, 0, −4), the whole ring under the block's top. Cut from the block everything the ring passes through.
The ring touches what it sweeps along two closed curves, the outer and the inner, where its normal is level. Each is carried down into an upright wall: the hole's, and the wall of the core the ring's own hole leaves standing in the middle.
expected
closed form
volume
1880.891254
no closed form: cad-kernel and cadrs agree to 5e-11; the mean of their values
area
1186.342576
no closed form: cad-kernel and cadrs agree to 6e-11; the mean of their values
Drawing
TopIsometricFrontRight
Third-angle projection, the three views at one scale. Drawn from next.BREP's result, which passed.
† 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
247 ms; CPU time 688 ms; peak memory 24.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.
Data
its STEP's
expected
rel. error
volume
1880.891252
1880.891254
9.5e-10
area
1186.342575
1186.342576
7.5e-10
agrees with
kentron, next.BREP, cadrs, springrep, geomsolver
mesh
50392 triangles, closed
centre of gravity
(-0.0421983, 3.61398e-13, -4.12477) its STEP's solid
inertia
about it, of unit density: Ixx 52993.7; Iyy 53194.5; Izz 85973; Ixy -3.12698e-09; Iyz 7.15147e-10; Izx -54.4384
//! A block, the box (−8, −8, −8)–(8, 8, 0), with a hole bored into its top by a ring — the torus//! centred at (0, 0, 4) about (sin 35°, 0, cos 35°), of radii 3 and 1 — slid straight down 8//! without turning, stopping wholly inside the block. The ring leans 35° from upright,//! below tan² β = (R − r)/r, its inner outline's fold.//!//! Sweep the torus along the path into a closed solid, then subtract that solid from the block.usecrate::sketch::block;
use cad_kernel::boolean::{combined, Op};
use cad_kernel::build::torus;
use cad_kernel::geom::V;
use cad_kernel::swept::closed::closed;
use cad_kernel::topo::Brep;
use cad_kernel::trajectory::{Screw, Trajectory};
use std::f64::consts::TAU;
constCENTRE: V = [0., 0., 4.];
constLEAN: f64 = 35f64.to_radians();
constMAJOR: f64 = 3.;
constMINOR: f64 = 1.;
constPUSH: f64 = 8.;
/// How closely the ring is meshed for the sweep's membership reads: a hundredth of its tube's/// radius.constBAR: f64 = 0.01;
/// The sweep and Boolean tolerance: a hundred-thousandth of the tube's radius.constTOL: f64 = 1e-5;
pubfnbuild() -> Result<Brep, String> {
let stock = block([-8., -8., -8.], [8., 8., 0.])?;
let ring = torus(CENTRE, [LEAN.sin(), 0., LEAN.cos()], MAJOR, MINOR)?;
// the push down: a screw that does not turn, advancing its whole length over a roll of τlet path = Trajectory::Twist(Screw {
origin: CENTRE, axis: [0., 0., -1.], ratio: 0., advance: PUSH,
});
let swept = closed(&ring, &path, [0., TAU], BAR, TOL)
.map_err(|why| format!("the ring's sweep not built: {why:?}"))?;
Ok(combined(&stock, &swept, Op::Cut, TOL)?)
}
occt left no solid to show.
Time
612 ms; CPU time 611 ms; peak memory 356.6 MB
Notes
refused occt has no sweep of a solid: it slides faces, and the leaning ring touches what it sweeps along curves that are none of its circles and no plane sections of it, which occt has no operation to find
"""A ring pushed straight down into a block at a lean. A block, the box from (−8, −8, −8) to (8, 8,
0), with a hole bored into its top by a ring pushed straight down into it at a lean, stopping
wholly inside it.
The ring is a torus centered at (0, 0, 4), its axis leaning 35° from upright toward +x, along the
direction (sin 35°, 0, cos 35°): the circle through its tube's centers has radius 3, and its tube
has radius 1. As placed it is wholly above the block.
It slides without turning straight down by 8, so that its center ends at (0, 0, −4), the whole ring
under the block's top. Cut from the block everything the ring passes through.
The ring touches what it sweeps along two closed curves, the outer and the inner, where its normal
is level. Each is carried down into an upright wall: the hole's, and the wall of the core the
ring's own hole leaves standing in the middle."""from bench importRefuseddefbuild():
# Pushed straight down, the ring touches what it sweeps where its normal is level. Its axis# leans 35° to the push: at the point of its tube's circle at angle u about its axis and v# round the tube, that is where tan v depends on u, two closed curves that are none of the# torus's circles and no plane sections of it. OCCT sweeps no solid, and a face it slides# sweeps to a solid only once split along its contact: finding those curves would be# computing the envelope outside the kernel.raiseRefused("occt has no sweep of a solid: it slides faces, and the leaning ring touches ""what it sweeps along curves that are none of its circles and no plane ""sections of it, which occt has no operation to find")
arris 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
153 ms; CPU time 159 ms; peak memory 17.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.
//! A block, the box from (−8, −8, −8) to (8, 8, 0), with a hole bored by a ring pushed straight//! down 8 into it at a lean: the torus centred at (0, 0, 4), its axis (sin 35°, 0, cos 35°), radii//! 3 and 1.//!//! The ring's sweep is kentron's sweep of a solid (`sweep::solid`, one slide), cut from the block.usecrate::bench::{d, frame, p, v};
use kentron::primitives::{Cuboid, Torus};
use kentron::sweep::{self, RigidMotion};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let block = Cuboid::new(16.0, 16.0, 8.0).with_frame(frame(p(-8.0, -8.0, -8.0), d(0.0, 0.0, 1.0))).build(m)?;
let lean = 35f64.to_radians();
let ring = Torus::new(3.0, 1.0).with_frame(frame(p(0.0, 0.0, 4.0), d(lean.sin(), 0.0, lean.cos()))).build(m)?;
let swept = sweep::solid(m, ring, &RigidMotion::Slide { by: v(0.0, 0.0, -8.0) })?;
kentron::boolean::difference(m, block, swept)
}
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.
solidcraft left no solid to show.
Time
1.7 ms; CPU time 1.5 ms; peak memory 4.6 MB
Notes
refused no layer (solidcraft-kernel, solidcore-ops, solidcore) has a sweep of a solid or an envelope: the walls are the leaning torus's outlines along the push, the curves where its normal is level, none of its circles
//! Refused. The ring, its axis leaning 35° from upright, slides straight down: the hole's wall and//! the core's are the torus's outer and inner outlines seen from above carried down, the curves//! where its normal is level, which are none of its circles. solidcraft-kernel has no sweep of a//! solid and no envelope, and its sweeps carry plane profiles only, so those outlines computed//! here would be geometry made outside the kernel.usecrate::Refusal;
usecrate::solids::Body;
pubfnbuild() -> Result<Body, Refusal> {
Err("no layer (solidcraft-kernel, solidcore-ops, solidcore) has a sweep of a solid or an envelope: the walls are the leaning torus's \
outlines along the push, the curves where its normal is level, none of its circles"
.into())
}
brepkit 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.
popkern left no solid to show.
Time
3.9 ms; CPU time 3.7 ms; peak memory 11.5 MB
Notes
refused popkern has no sweep of a solid, and this motion's envelope is not one its extrudes, revolves and booleans make exactly
// A ring pushed straight down into a block at a lean.//// Refused: popkern has no sweep of a solid (its sweeps carry a profile along a path), and the// envelope this motion leaves is not one its extrudes, revolves and booleans make exactly: the// tool is not symmetric about the planes of its motion, or the motion is a screw or a curve.throw"popkern has no sweep of a solid, and this motion's envelope is not one its extrudes, revolves and booleans make exactly";
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
268 ms; CPU time 267 ms; peak memory 64.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.
Data
its STEP's
expected
rel. error
volume
1880.891254
1880.891254
3.9e-11
area
1186.342576
1186.342576
1.3e-10
agrees with
cad-kernel, kentron, cadrs, springrep, geomsolver
mesh
20364 triangles, closed
centre of gravity
(-0.0421983, -2.2746e-10, -4.12477) its STEP's solid
inertia
about it, of unit density: Ixx 52993.7; Iyy 53194.5; Izz 85973; Ixy -1.37464e-07; Iyz -6.86157e-08; Izx -54.4384
//! A block bored into by a ring leaning 35° pushed straight down, stopping inside it.//!//! Through the kernel's whole sweep of a solid (`sweep_solid`): the ring is a solid of revolution//! about the line through (0, 0, 4) along (sin 35°, 0, cos 35°), its meridian the circle of radius 1//! at 3 from that axis; slid 8 down the z axis; cut from the block.usecrate::solids::p;
usecrate::Refusal;
#[allow(unused_imports)]use brep_kernel::{
boolean_operation_nary, make_box_brep, make_cylinder_brep, revolve_profile_brep,
sweep_solid, BooleanOperation, BrepSolid, OutlinePiece, ScrewStep, SolidMotion,
SolidTool, Vec3,
};
#[allow(unused_imports)]use std::f64::consts::{FRAC_PI_2, PI, TAU};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let block = make_box_brep(p(-8.0, -8.0, -8.0), 16.0, 16.0, 8.0)?;
letmut operands = vec![block];
let tool0 = SolidTool::Revolved {
axis_origin: p(0.0, 0.0, 4.0),
axis_direction: p(35f64.to_radians().sin(), 0.0, 35f64.to_radians().cos()),
radial: p(35f64.to_radians().cos(), 0.0, -(35f64.to_radians().sin())),
meridian: vec![OutlinePiece::Arc { centre: [3.0, 0.0], radius: 1.0, start: 0.0, end: TAU }],
};
let motion0 = SolidMotion {
steps: vec![
ScrewStep { axis_origin: p(0.0, 0.0, 0.0), axis_direction: p(0.0, 0.0, 1.0), turn: 0.0, advance: -8.0 },
],
from: 0.0,
to: 1.0,
};
operands.push(sweep_solid(&tool0, &motion0)?);
Ok(boolean_operation_nary(&operands, BooleanOperation::Subtract)?)
}
geop 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
213 ms; CPU time 411 ms; peak memory 17.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.
//! A block (the box from (−8, −8, −8) to (8, 8, 0)) bored by a ring (the torus about (0, 0, 4), its//! axis leaning 35° from upright toward +x, radii 3 and 1) pushed straight down 8, stopping wholly//! inside it.//!//! The ring is cadrs's torus primitive; what it passes through is cadrs's sweep of a solid (one//! slide), cut from the block.usecrate::bench::{block, cut, p3, torus, v3};
usecrate::shared::swept::slid;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let b = block(k, p3(-8.0, -8.0, -8.0), p3(8.0, 8.0, 0.0))?;
let lean = 35f64.to_radians();
let ring = torus(k, p3(0.0, 0.0, 4.0), v3(lean.sin(), 0.0, lean.cos()), 3.0, 1.0)?;
let swept = slid(k, ring, v3(0.0, 0.0, -8.0))?;
cut(k, b, swept)
}
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
72 ms; CPU time 71 ms; peak memory 10.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.
Data
its STEP's
expected
rel. error
volume
1880.891254
1880.891254
3.5e-11
area
1186.342576
1186.342576
1.2e-11
agrees with
cad-kernel, kentron, next.BREP, cadrs, geomsolver
mesh
92578 triangles, closed
centre of gravity
(-0.0421983, 1.5309e-17, -4.12477) its STEP's solid
inertia
about it, of unit density: Ixx 52993.7; Iyy 53194.5; Izz 85973; Ixy 3.13053e-13; Iyz 1.87805e-14; Izx -54.4384
//! The box (−8, −8, −8)–(8, 8, 0) less everything a torus (radii 3 and 1, its axis leaning 35°)//! passes through as it slides straight down by 8.use springrep::boolean::difference;
use springrep::math::{Frame, Vec3};
use springrep::primitive::torus;
use springrep::sweep::{Motion, solid};
use springrep::topo::Brep;
usecrate::shared::e;
usecrate::shared::swept::{boxed, deg, v3};
pubfnbuild() -> Result<Brep, String> {
let stock = boxed([-8.0, -8.0, -8.0], [8.0, 8.0, 0.0], "block")?;
let lean = deg(35.0);
let axis =
Frame::new(v3(0.0, 0.0, 4.0), v3(lean.sin(), 0.0, lean.cos()), Vec3::X).map_err(e)?;
let ring = torus(&axis, 3.0, 1.0, "ring").map_err(e)?;
let swept = solid(&ring, &Motion::Slide(v3(0.0, 0.0, -8.0)), "push").map_err(e)?;
difference(&stock, &swept).map_err(e)
}
Time
345 ms; CPU time 777 ms; peak memory 42.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.
Data
its STEP's
expected
rel. error
volume
1880.891252
1880.891254
1.0e-09
area
1186.342575
1186.342576
9.2e-10
agrees with
cad-kernel, kentron, next.BREP, cadrs, springrep
mesh
50392 triangles, closed
centre of gravity
(-0.0421983, 3.61334e-13, -4.12477) its STEP's solid
inertia
about it, of unit density: Ixx 52993.7; Iyy 53194.5; Izz 85973; Ixy -3.12692e-09; Iyz 7.1536e-10; Izx -54.4384
// A block, the box from (-8, -8, -8) to (8, 8, 0), bored by a ring pushed straight down into it at// a lean. The ring is a torus centred at (0, 0, 4), its axis leaning 35 degrees from upright toward// +x, its tube (radius 1) 3 from that axis: drawn as the tube's circle in a plane through the// axis and turned about it. It slides 8 straight down, and the kernel's sweep of it under that// slide is cut from the block.unit mm
use std
use std.solids (cut)
use std.place (coords, on_u)
use std.shapes
use std.motion (slides)
lean := 35deg// how far the ring's axis leans from upright, toward +xin std.top {
private mid := point
fix((0, 0)) mid
private outline := std.shapes.CenteredRectangle(mid, w: 16mm, h: 16mm)
}
part := solid(std.solids.Prism(outline.loop, from: -8mm, to: 0mm))
// the ring, drawn in the plane through its axis and the x axis, its centre 4 above the topprivate along := axis
fix(dir == (sin(lean), 0, cos(lean))) along
private across := axis
fix(dir == (cos(lean), 0, -sin(lean))) across
bench := plane(u: across, v: along)
fix(origin == (0, 0, 4)) bench
in bench {
private a0 := point
private a1 := point
a0 coords(du: 0mm, dv: -1mm) bench
a1 coords(du: 0mm, dv: 1mm) bench
private ring_axis := line(a0, a1)
private tc := point
tc on_u(d: 3mm) bench
private tube := circle(center: tc) hint(r: 1)
radius(1mm) tube
}
constructionring := solid(std.solids.Revolution(face(tube), about: ring_axis))
// the push: 8 straight down, the ring's centre ending at (0, 0, -4)private down := axis
fix(dir == (0, 0, -1)) down
ram := frame
ram slides(8mm) down
construction bore := solid({ p | some t in (0deg, 360deg): p inringat(under: ram) t })
bore cut part
anvilcad left no solid to show.
Time
1.3 ms; CPU time 1.1 ms; peak memory 3.5 MB
Notes
refused anvil-brep has no sweep of a solid, and what this motion sweeps is bounded by envelopes of the body's surfaces under it (a rim or a face leaning to the motion) that follow from no elementary construction, which it would have to compute itself
//! A ring pushed straight down into a block at a lean.use anvil_brep::Solid;
pubfnbuild() -> Result<Solid, String> {
Err("anvil-brep has no sweep of a solid, and what this motion sweeps is bounded by envelopes of the body's surfaces under it (a rim or a face leaning to the motion) that follow from no elementary construction, which it would have to compute itself".into())
}