A block, the box from (−8, −8, −8) to (8, 8, 0), with a hole bored into its top by a bull-nose mill pushed straight down into it at a lean, stopping wholly inside it.
The mill is a solid of revolution about an axis leaning 30° from upright toward +x, along the direction a = (sin 30°, 0, cos 30°), through the point c = (0, 0, 4), the middle of its flat end. Along its axis it runs from c up to c + 3a. It is a cylinder of radius 2 whose end corner is rounded to radius 0.5: its flat end is a disc of radius 1.5 about c, square to a; its side, of radius 2, runs from c + 0.5a to c + 3a, where it is flat; and the round between them is a quarter of a torus whose tube, of radius 0.5, is centered on the circle of radius 1.5 about c + 0.5a.
It slides without turning straight down by 8, so that its end's middle ends at (0, 0, −4), the whole mill under the block's top. Cut from the block everything the mill passes through.
expected
closed form
volume
1986.590223
no closed form: next.BREP and cadrs give the same volume to the twelve figures the board publishes
area
1075.288226
no closed form: next.BREP and cadrs agree to 2e-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
4.90 s; CPU time 5.66 s; peak memory 25.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
1986.590224
1986.590223
4.0e-10
area
1075.288225
1075.288226
1.5e-10
agrees with
kentron, next.BREP, cadrs, springrep, geomsolver
mesh
15212 triangles, closed
centre of gravity
(-0.0253125, 1.35244e-17, -4.06297) its STEP's solid
inertia
about it, of unit density: Ixx 54199.2; Iyy 54141.2; Izz 87193.2; Ixy 4.48738e-13; Iyz -7.62988e-14; Izx 105.978
//! A block, the box (−8, −8, −8)–(8, 8, 0), with a hole bored into its top by a bull-nose mill slid//! without turning straight down by 8, stopping wholly inside. The mill stands about the axis//! through c = (0, 0, 4) along a = (sin 30°, 0, cos 30°), from c to c + 3a: radius 2, its end//! corner rounded to 0.5 (its flat end the disc of radius 1.5 about c).//!//! Refused by the kernel: the closed sweep's arrangement fails to meet one of the mill's circles//! with the sheet its round's contact sweeps (`Unbuilt::Failed`: where a circle meets an extrusion//! was not proved, the search reading more boxes than any may).usecrate::sketch::block;
use cad_kernel::build::{revolve, Profile, ProfileEdge};
use cad_kernel::geom::{tolerance, Frame, V};
use cad_kernel::swept::closed::cut_from;
use cad_kernel::topo::Brep;
use cad_kernel::trajectory::{Screw, Trajectory};
use cad_kernel::util::space::{add, cross, scale};
use std::f64::consts::{FRAC_PI_2, TAU};
constSTOCK_LO: V = [-8., -8., -8.];
constSTOCK_HI: V = [8., 8., 0.];
/// The middle of the mill's flat end, and how far its axis leans from upright toward +x, in/// degrees.constEND: V = [0., 0., 4.];
constLEAN: f64 = 30.;
constRADIUS: f64 = 2.;
constCORNER: f64 = 0.5;
constLENGTH: f64 = 3.;
constPUSH: f64 = 8.;
/// How closely the mill is meshed for the sweep's membership reads: a two-hundred-and-fiftieth of/// its corner's radius.constBAR: f64 = 0.002;
/// The bull-nose mill about the axis through `c` along the unit `a`, `e` a unit direction square/// to it: its meridian in the half-plane from the axis toward `e` — out along its flat end, round/// the quarter circle of its corner, up its side, back across its top and down its axis — turned/// once about the axis.fnmill(c: V, a: V, e: V) -> Result<Brep, String> {
let at = |r: f64, h: f64| add(add(c, scale(e, r)), scale(a, h));
let corner = Frame::new(at(RADIUS - CORNER, CORNER), cross(e, a), e);
let edges = vec![
ProfileEdge::Line { a: at(0., 0.), b: at(RADIUS - CORNER, 0.) },
ProfileEdge::Arc { frame: corner, r: CORNER, span: Some([-FRAC_PI_2, 0.]) },
ProfileEdge::Line { a: at(RADIUS, CORNER), b: at(RADIUS, LENGTH) },
ProfileEdge::Line { a: at(RADIUS, LENGTH), b: at(0., LENGTH) },
ProfileEdge::Line { a: at(0., LENGTH), b: at(0., 0.) },
];
let meridian = Profile { origin: c, normal: cross(a, e), loops: vec![edges],
names: Vec::new() };
revolve(&meridian, c, a, TAU)
}
pubfnbuild() -> Result<Brep, String> {
let stock = block(STOCK_LO, STOCK_HI)?;
let (s, c) = LEAN.to_radians().sin_cos();
let tool = mill(END, [s, 0., c], [c, 0., -s])?;
// the slide straight down: a screw that does not turn, advancing its whole length over a roll// of τlet down = [0., 0., -1.];
let path = Trajectory::Twist(Screw { origin: END, axis: down, ratio: 0., advance: PUSH });
// the kernel's closed swept solid cut from the block on one arrangement: the round, a band of a// torus's tube leaning to the slide between smooth seams, at both end poses and its contact's// arc swept into the sheet over that arc of its contour; the side's rulings into their tangent// planes; the flat end's rim into an oblique cylinderlet size = stock.size().max(tool.size());
cut_from(&stock, &tool, &path, [0., TAU], BAR, tolerance(size))
.map_err(|why| format!("the mill's sweep not built: {why:?}"))
}
occt left no solid to show.
Time
621 ms; CPU time 620 ms; peak memory 356.7 MB
Notes
refused occt has no sweep of a solid: it slides faces, and the leaning mill's round, a torus whose axis leans to the push, touches what it sweeps along a curve that is none of its circles and no plane section of it, which occt has no operation to find
"""A bull-nose mill 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 bull-nose mill pushed straight down into it at a
lean, stopping wholly inside it.
The mill is a solid of revolution about an axis leaning 30° from upright toward +x, along the
direction a = (sin 30°, 0, cos 30°), through the point c = (0, 0, 4), the middle of its flat end.
Along its axis it runs from c up to c + 3a. It is a cylinder of radius 2 whose end corner is
rounded to radius 0.5: its flat end is a disc of radius 1.5 about c, square to a; its side, of
radius 2, runs from c + 0.5a to c + 3a, where it is flat; and the round between them is a quarter
of a torus whose tube, of radius 0.5, is centered on the circle of radius 1.5 about c + 0.5a.
It slides without turning straight down by 8, so that its end's middle ends at (0, 0, −4), the
whole mill under the block's top. Cut from the block everything the mill passes through."""from bench importRefuseddefbuild():
# Pushed straight down, the leaning mill's side, a cylinder, touches along its two lines in# the plane through its axis square to the push's part across the axis, which a plane would# cut out, and its flat end leads all over. But its round is a quarter torus whose axis# leans to the push: at the point of its tube's circle at angle u about the axis and v round# the tube, the normal is square to the push where tan v depends on u, a curve that is none# of the torus's circles and no plane section of it. OCCT sweeps no solid, and a face it# slides sweeps to a solid only once split along its contact: finding that curve would be# computing the envelope outside the kernel.raiseRefused("occt has no sweep of a solid: it slides faces, and the leaning mill's round, ""a torus whose axis leans to the push, touches what it sweeps along a curve ""that is none of its circles and no plane section 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
77 ms; CPU time 77 ms; peak memory 14.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.
//! A block, the box from (−8, −8, −8) to (8, 8, 0), bored into from its top by a leaning bull-nose//! mill pushed straight down: about the axis through c = (0, 0, 4) along a = (sin 30°, 0, cos 30°),//! from c to c + 3a, a cylinder of radius 2 whose end corner is rounded to 0.5, slid without//! turning down by 8. Everything the mill passes through, cut.//!//! The mill is its meridian revolved, leaned and placed; its sweep is kentron's sweep of a solid//! (`sweep::solid`, one slide), cut from the block.usecrate::bench::{d, frame, p, v};
usecrate::shared::swept::bull_nose;
use kentron::math::{Axis, Transform, Vector};
use kentron::primitives::Cuboid;
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 place = Transform::translation(Vector::new(0.0, 0.0, 4.0)) * Transform::rotation(Axis::Y, 30f64.to_radians());
let mill = bull_nose(m, &place)?;
let swept = sweep::solid(m, mill, &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.5 MB
Notes
refused no layer (solidcraft-kernel, solidcore-ops, solidcore) has a sweep of a solid or an envelope: the hole's wall is the leaning mill's outline along the push, which on its quarter-torus corner is the curve where the torus's normal is level, none of its circles
//! Refused. The bull-nose mill, its axis leaning 30° from upright, slides straight down: the hole's//! wall is the mill's outline seen from above carried down, and on the mill's rounded corner (a//! quarter torus) that outline runs where the torus's normal is level, a curve that is none of//! its circles. solidcraft-kernel has no sweep of a solid and no envelope, and its sweeps carry//! plane profiles only, so that outline 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 hole's wall is the leaning \
mill's outline along the push, which on its quarter-torus corner is the curve where the \
torus's 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.5 ms; CPU time 3.3 ms; peak memory 11.5 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 bull-nose mill 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 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
97 ms; CPU time 97 ms; peak memory 32.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
1986.590223
1986.590223
1.2e-11
area
1075.288226
1075.288226
6.7e-12
agrees with
cad-kernel, kentron, cadrs, springrep, geomsolver
mesh
14712 triangles, closed
centre of gravity
(-0.0253125, -2.68252e-18, -4.06297) its STEP's solid
inertia
about it, of unit density: Ixx 54199.2; Iyy 54141.2; Izz 87193.2; Ixy 2.35923e-13; Iyz 3.88828e-15; Izx 105.978
//! A block bored into by a bull-nose mill leaning 30° pushed straight down, stopping inside it.//!//! Through the kernel's whole sweep of a solid (`sweep_solid`): the mill is a solid of revolution//! about the line through (0, 0, 4) along (sin 30°, 0, cos 30°), its meridian the flat end out to//! 1.5, the quarter circle of radius 0.5 about (1.5, 0.5), the side at 2 up to 3 and the flat top;//! 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(30f64.to_radians().sin(), 0.0, 30f64.to_radians().cos()),
radial: p(30f64.to_radians().cos(), 0.0, -(30f64.to_radians().sin())),
meridian: vec![
OutlinePiece::Line { from: [0.0, 0.0], to: [1.5, 0.0] },
OutlinePiece::Arc { centre: [1.5, 0.5], radius: 0.5, start: -FRAC_PI_2, end: 0.0 },
OutlinePiece::Line { from: [2.0, 0.5], to: [2.0, 3.0] },
OutlinePiece::Line { from: [2.0, 3.0], to: [0.0, 3.0] },
OutlinePiece::Line { from: [0.0, 3.0], to: [0.0, 0.0] },
],
};
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
22 ms; CPU time 42 ms; peak memory 10.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.
//! A block (the box from (−8, −8, −8) to (8, 8, 0)) bored by a bull-nose mill leaning 30° toward +x//! (a cylinder of radius 2 along a = (sin 30°, 0, cos 30°) from c = (0, 0, 4) to c + 3a, its end//! corner rounded to radius 0.5) pushed straight down 8, stopping wholly inside it.//!//! The mill is its half section turned about its axis (the round a quarter circle, drawn as the//! rational quadratic it is); what it passes through is cadrs's sweep of a solid (one slide), cut//! from the block.usecrate::bench::{block, cut, p3, v3};
usecrate::shared::geometry::Section;
usecrate::shared::swept::slid;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, Plane};
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 a = v3(30f64.to_radians().sin(), 0.0, 30f64.to_radians().cos());
let c = p3(0.0, 0.0, 4.0);
// The half section in the plane through the axis and y = 0: sketch x along the radius// (square to a in that plane), sketch y along a.let radial = v3(1.0, 0.0, 0.0) - a * a.x;
let on = Plane::new(c, radial, radial.cross(&a));
let section = Section::on(on)
.line((0.0, 0.0), (1.5, 0.0))
.conic((1.5, 0.0), (2.0, 0.0), 2f64.sqrt() / 2.0, (2.0, 0.5))
.line((2.0, 0.5), (2.0, 3.0))
.line((2.0, 3.0), (0.0, 3.0))
.line((0.0, 3.0), (0.0, 0.0));
let mill = section.turned(k, c, a)?;
let swept = slid(k, mill, 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
27 ms; CPU time 27 ms; peak memory 9.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
1986.590223
1986.590223
4.6e-12
area
1075.288226
1075.288226
9.0e-12
agrees with
cad-kernel, kentron, next.BREP, cadrs, geomsolver
mesh
22220 triangles, closed
centre of gravity
(-0.0253125, 1.467e-18, -4.06297) its STEP's solid
inertia
about it, of unit density: Ixx 54199.2; Iyy 54141.2; Izz 87193.2; Ixy 4.51026e-13; Iyz -7.3722e-15; Izx 105.978
//! The box (−8, −8, −8)–(8, 8, 0) less everything a bull-nose mill whose axis leans 30° passes//! through as it slides straight down by 8.use std::f64::consts::PI;
use springrep::boolean::difference;
use springrep::profile::Profile;
use springrep::sweep::{Motion, solid};
use springrep::topo::Brep;
usecrate::shared::e;
usecrate::shared::swept::{arc, boxed, deg, line, outline, revolved, v3};
/// The bull-nose mill's half meridian, drawn out from its axis and along it from its flat end's/// middle: flat to 1.5, a round of radius 0.5, a side of radius 2 up to 3.fnbull_nose() -> Profile {
outline(vec![
line((0.0, 0.0), (1.5, 0.0), "end"),
arc((1.5, 0.5), 0.5, -PI / 2.0, PI / 2.0, "round"),
line((2.0, 0.5), (2.0, 3.0), "side"),
line((2.0, 3.0), (0.0, 3.0), "top"),
line((0.0, 3.0), (0.0, 0.0), "axis"),
])
}
pubfnbuild() -> Result<Brep, String> {
let stock = boxed([-8.0, -8.0, -8.0], [8.0, 8.0, 0.0], "block")?;
let (s, c) = deg(30.0).sin_cos();
let mill = revolved(
&bull_nose(),
v3(0.0, 0.0, 4.0),
v3(s, 0.0, c),
v3(c, 0.0, -s),
"mill",
)?;
let swept = solid(&mill, &Motion::Slide(v3(0.0, 0.0, -8.0)), "push").map_err(e)?;
difference(&stock, &swept).map_err(e)
}
Time
4.10 s; CPU time 4.71 s; peak memory 40.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.
Data
its STEP's
expected
rel. error
volume
1986.590224
1986.590223
4.0e-10
area
1075.288225
1075.288226
1.2e-10
agrees with
cad-kernel, kentron, next.BREP, cadrs, springrep
mesh
14954 triangles, closed
centre of gravity
(-0.0253125, 2.34721e-18, -4.06297) its STEP's solid
inertia
about it, of unit density: Ixx 54199.2; Iyy 54141.2; Izz 87193.2; Ixy 4.71916e-13; Iyz -1.15901e-14; Izx 105.978
// A block, the box from (-8, -8, -8) to (8, 8, 0), its top in the top plane; a bull-nose mill// leaning 30 degrees from upright toward +x, the middle of its flat end at (0, 0, 4), pushed// without turning 8 straight down so that it stops wholly inside the block, and everything it// passes through cut from the block. The mill is a turn of its half-section, drawn in the plane// through its axis: radius 2 from the middle of its flat end up to 3 along the axis, the corner of// its end rounded to 0.5.unit mm
use std
use std.solids
use std.solids (cut)
use std.motion (slides)
in std.top {
a := point
b := point hint((8, -8))
c := point hint((8, 8))
d := point hint((-8, 8))
outline := horizontal line(a, b) -> vertical line(b, c) ->
horizontal line(c, d) -> vertical line(d, a) -> close
fix((-8, -8)) a
a distance(16) b
b distance(16) c
}
part := solid(std.solids.Prism(outline, from: -8mm, to: 0mm))
// the mill's axis leans 30 degrees from upright, turned about y from z toward x; its section is// drawn in the plane through that axis and the x direction, square to y
axle := axis hint(dir: (0.5, 0, 0.866))
axle perpendicular std.y
std.z angle(30deg, about: std.y) axle
across := axis hint(dir: (0.866, 0, -0.5))
across perpendicular std.y
std.x angle(30deg, about: std.y) across
bench := plane(u: across, v: axle)
fix(origin == (0, 0, 4)) bench
in bench {
e0 := point
q := point hint((2, 0))
e2 := point hint((2, 3))
e3 := point hint((0, 3))
fix((0, 0)) e0
e0 distance(2) q
e0 distance(3) e3
// the side meets the flat end at q, the corner rounded to 0.5
section := horizontal line(e0, q) -> round(r: 0.5mm) vertical line(q, e2) ->
horizontal line(e2, e3) -> vertical (spindle := line(e3, e0)) -> close
}
mill := solid(std.solids.Revolution(section, about: spindle))
down := axis hint(dir: (0, 0, -1))
down parallel(sense: opposite) std.z
ram := frame
ram slides(8mm) down
hole := solid({ p | some t in (0deg, 360deg): p in mill at(under: ram) t })
hole cut part
anvilcad left no solid to show.
Time
1.2 ms; CPU time 1 ms; 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 bull-nose mill 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())
}