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 65° from upright toward +x, along the direction (sin 65°, 0, cos 65°): 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.
Leaning past tan² β = (R − r)/r (here 54.7°), the curve along which the ring's normal is level, seen from above, cusps: the inner outline folds back on itself, and the wall it sweeps down is cut where it folds.
expected
closed form
volume
1907.002118
no closed form: cad-kernel and cadrs agree to 2e-9; the mean of their values
area
1164.568667
no closed form: cad-kernel and cadrs agree to 8e-10; 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. ✦ 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
6.30 s; CPU time 7.21 s; peak memory 25 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Data
measured
expected
rel. error
volume
1907.002115
1907.002118
1.2e-09
area
1164.568666
1164.568667
4.0e-10
agrees with
next.BREP, cadrs, geomsolver
faces
13 other, 7 plane, 2 torus
mesh
15118 triangles, closed
centre of gravity
(-0.0315014, -2.41845e-07, -4.07647) its triangles
inertia
about it, of unit density: Ixx 53273.4; Iyy 53703.5; Izz 86579.9; Ixy -0.000898253; Iyz 0.000815744; Izx -47.7593
not by the harness, which graded the runner's own measures instead: cannot measure: face #16550: a loop whose path on its surface breaks (an edge laid across a place where its surface meets itself?)
//! 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 65°, 0, cos 65°), of radii 3 and 1 — slid straight down 8//! without turning, stopping wholly inside the block. The ring leans 65° from upright,//! past tan² β = (R − r)/r, so its inner outline folds.//!//! Leaning past tan² β = (R − r)/r the apparent contour of the ring's inner contact cusps, and the//! sheet it sweeps doubles back on itself. The kernel's closed sweep refused that by name//! (`Unbuilt::Folded`) until 0.14.0, which takes a folded sheet the contact's road, as it does a//! curved one: its trim keeps of each folded sheet what bounds the sweep.usecrate::sketch::block;
use cad_kernel::build::torus;
use cad_kernel::geom::{tolerance, V};
use cad_kernel::swept::closed::cut_from;
use cad_kernel::topo::Brep;
use cad_kernel::trajectory::{Screw, Trajectory};
use std::f64::consts::TAU;
constCENTRE: V = [0., 0., 4.];
constLEAN: f64 = 65f64.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;
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,
});
// the kernel's swept solid cut from the block on one arrangement: a whole ring slid at a lean// to its axis, each of its two contacts swept along the push into the cylinder over its// apparent contourlet size = stock.size().max(ring.size());
cut_from(&stock, &ring, &path, [0., TAU], BAR, tolerance(size))
.map_err(|why| format!("the ring's sweep not built: {why:?}"))
}
occt left no solid to show.
Time
613 ms; CPU time 613 ms; peak memory 356.7 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 into a block at so steep a lean its inner outline folds. 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 65° from upright toward +x, along the
direction (sin 65°, 0, cos 65°): 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.
Leaning past tan² β = (R − r)/r (here 54.7°), the curve along which the ring's normal is level,
seen from above, cusps: the inner outline folds back on itself, and the wall it sweeps down is cut
where it folds."""from bench importRefuseddefbuild():
# Pushed straight down, the ring touches what it sweeps where its normal is level. Its axis# leans 65° 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, the inner one cusped seen from above. 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.
kentron left no solid to show.
Time
21 ms; CPU time 21 ms; peak memory 10.3 MB
Notes
refused operation failed: a sweep folding over itself (4 folds where the motion turns past a sharp edge or characteristic curve of the tool): its sheets meet tangent along the fold, and are not parted
//! 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 so steep a lean that its inner outline folds: the torus centred at (0, 0, 4),//! its axis (sin 65°, 0, cos 65°), 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 = 65f64.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.5 ms; CPU time 1.3 ms; peak memory 4.7 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 (the inner one folded), none of its circles
//! Refused. The ring, its axis leaning 65° from upright, slides straight down: the walls are the//! torus's outlines seen from above carried down, the curves where its normal is level, which are//! none of its circles (and the inner one, past this lean, cusps and folds). 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 (the inner one folded), \
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.6 ms; CPU time 3.4 ms; peak memory 11.4 MB
Notes
refused popkern has no sweep of a solid, and this sweep's wall is an envelope its other operations do not make
// A ring pushed into a block at so steep a lean its inner outline folds.//// Refused: popkern has no sweep of a solid (its sweeps carry a profile along a path), and this// one's boundary is an envelope of the moving solid that its other operations do not make.throw"popkern has no sweep of a solid, and this sweep's wall is an envelope its other operations do not make";
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
482 ms; CPU time 481 ms; peak memory 81.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.
Data
its STEP's
expected
rel. error
volume
1907.002115
1907.002118
1.3e-09
area
1164.568666
1164.568667
2.3e-10
agrees with
cad-kernel, cadrs, geomsolver
mesh
22632 triangles, closed
centre of gravity
(-0.0315315, 2.43858e-10, -4.07648) its STEP's solid
inertia
about it, of unit density: Ixx 53272.2; Iyy 53702.8; Izz 86578.9; Ixy 7.11763e-09; Iyz -1.43717e-08; Izx -47.8512
//! A block bored into by a ring leaning 65° 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 65°, 0, cos 65°), its meridian the circle of radius 1//! at 3 from that axis; slid 8 down the z axis; cut from the block. Past the lean at which the ring's//! inner outline folds, the kernel builds the sweep with its steps (where the leading side folds//! away) only where its ring-fold construction is switched on, and refuses otherwise.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(65f64.to_radians().sin(), 0.0, 65f64.to_radians().cos()),
radial: p(65f64.to_radians().cos(), 0.0, -(65f64.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
439 ms; CPU time 959 ms; peak memory 19.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
1907.00212
1907.002118
1.2e-09
area
1164.568667
1164.568667
3.0e-10
agrees with
cad-kernel, next.BREP, geomsolver
mesh
41100 triangles, closed, 2 degenerate
centre of gravity
(-0.0315315, -4.18747e-10, -4.07648) its STEP's solid
inertia
about it, of unit density: Ixx 53272.2; Iyy 53702.8; Izz 86578.9; Ixy -6.2059e-08; Iyz 3.7554e-07; Izx -47.8512
//! 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 65° 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 (one slide) is cut from//! the block by cadrs's cut by a swept solid (the torus's exact sweep, its envelope trimmed where//! it folds, cut from it).usecrate::bench::{block, p3, torus, v3};
usecrate::shared::swept::{cut_swept, slide};
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 = 65f64.to_radians();
let ring = torus(k, p3(0.0, 0.0, 4.0), v3(lean.sin(), 0.0, lean.cos()), 3.0, 1.0)?;
cut_swept(k, b, ring, &slide(v3(0.0, 0.0, -8.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
3.31 s; CPU time 3.31 s; peak memory 15.9 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Data
measured
expected
rel. error
volume
1907.002122
1907.002118
2.4e-09
area
1164.56868
1164.568667
1.1e-08
agrees with
no other kernel
faces
6 other, 7 plane, 1 torus
mesh
12172 triangles, closed
centre of gravity
(-0.0315028, 1.28894e-06, -4.07647) its triangles
inertia
about it, of unit density: Ixx 53273.3; Iyy 53703.4; Izz 86579.8; Ixy -0.00381167; Iyz -0.00333003; Izx -47.7621
not by the harness, which graded the runner's own measures instead: cannot measure: face #5683: a loop that does not join up on its surface ((6.201877536445961, 5.997862400553685) to (4.051571173587775, 4.000000001063718))
//! The box (−8, −8, −8)–(8, 8, 0) less everything a torus (radii 3 and 1, its axis leaning 65°)//! 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(65.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
2.31 s; CPU time 4.91 s; peak memory 41.3 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Elegant ✦ the same document as the shallower lean with one number changed; the fold is built without being stated
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
1907.002116
1907.002118
8.2e-10
area
1164.568666
1164.568667
5.5e-10
agrees with
cad-kernel, next.BREP, cadrs
mesh
37464 triangles, closed
centre of gravity
(-0.0315315, -1.89749e-10, -4.07648) its STEP's solid
inertia
about it, of unit density: Ixx 53272.2; Iyy 53702.8; Izz 86578.9; Ixy -5.7284e-07; Iyz -7.80598e-08; Izx -47.8512
// 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 65 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. Leaning past tan^2 = (R - r)/r, its inner outline seen// along the push folds.unit mm
use std
use std.solids (cut)
use std.place (coords, on_u)
use std.shapes
use std.motion (slides)
lean := 65deg// 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.2 ms; CPU time 950 µs; peak memory 3.4 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 into a block at so steep a lean its inner outline folds.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())
}