A ring with a channel cut inside it by a drum leaning across a turn.
The ring is everything with distance from the z axis between 3 and 8 and with z between −2.5 and 2.5, all the way round.
The drum is a solid cylinder of radius 1 and length 3, its ends flat and square to its axis. Its axis leans 25° from upright in the plane y = 1.2, along the direction (sin 25°, 0, cos 25°), and its middle is the point (5, 1.2, 0).
It turns rigidly about the z axis, right-handed (from +x toward +y), by 100°, wholly inside the ring. Cut from the ring everything the drum passes through.
The drum's side touches along two curves, each turned into a surface of revolution. Its rims are sharp circles leaning to the turn's axis; each sweeps a ring whose section is no circle, and they carry the cut past the flat ends' own contact lines. The channel is sealed inside the ring.
expected
closed form
volume
798.1420423
no closed form: cad-kernel and cadrs give the same volume to the twelve figures the board publishes
area
806.4120782
no closed form: cad-kernel and cadrs give the same area to the twelve figures the board publishes
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
2.21 s; CPU time 6.81 s; peak memory 24.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.
Data
its STEP's
expected
rel. error
volume
798.1420433
798.1420423
1.3e-09
area
806.4120771
806.4120782
1.4e-09
agrees with
kentron, next.BREP, cadrs, springrep, geomsolver
mesh
60322 triangles, closed
centre of gravity
(-0.160166, -0.321783, -0.00368218) its STEP's solid
inertia
about it, of unit density: Ixx 16285.5; Iyy 16829; Izz 29610.5; Ixy 359.78; Iyz 21.5658; Izx 11.9359
//! A ring — everything 3 to 8 from the z axis with z from −2.5 to 2.5 — with a sealed channel cut//! inside it by a drum, the cylinder of radius 1 and length 3 whose middle is (5, 1.2, 0) and whose//! axis leans 25° from upright along (sin 25°, 0, cos 25°), turned rigidly about z, right-handed,//! by 100°.use cad_kernel::build::{disc, prism, Profile};
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 cad_kernel::util::space::{scale, sub};
constUP: V = [0., 0., 1.];
/// The ring: its radii and its half-height.constRADII: [f64; 2] = [3., 8.];
constHALF_HEIGHT: f64 = 2.5;
constMIDDLE: V = [5., 1.2, 0.];
constRADIUS: f64 = 1.;
constLENGTH: f64 = 3.;
/// How far the drum's axis leans from upright toward +x, in degrees.constLEAN: f64 = 25.;
/// The turn, in degrees.constTURN: f64 = 100.;
/// How closely the drum is meshed for the sweep's membership reads: a five-hundredth of its radius.constBAR: f64 = 0.002;
pubfnbuild() -> Result<Brep, String> {
// the ring: the annulus between its radii, its outer circle and its hole, swept uplet foot = [0., 0., -HALF_HEIGHT];
let [inner, outer] = RADII;
let loops = vec![disc(foot, UP, outer).loops.remove(0), disc(foot, UP, inner).loops.remove(0)];
let annulus = Profile { origin: foot, normal: UP, loops, names: Vec::new() };
let ring = prism(&annulus, 0., 2. * HALF_HEIGHT)?;
let lean = LEAN.to_radians();
let along = [lean.sin(), 0., lean.cos()];
let drum = prism(&disc(sub(MIDDLE, scale(along, LENGTH / 2.)), along, RADIUS), 0., LENGTH)?;
// the turn about z: a screw that does not advance, a radian a radian of the rolllet path = Trajectory::Twist(Screw { origin: [0.; 3], axis: UP, ratio: 1., advance: 0. });
// the kernel's closed swept solid cut from the ring on one arrangement: the side, a cylinder// about an axis leaning to the turn's, touching along two curves each turned into a surface of// revolution, its rims sharp circles leaning to the axis each turned into its ring, the flat// ends' contact lines turnedlet size = ring.size().max(drum.size());
cut_from(&ring, &drum, &path, [0., TURN.to_radians()], BAR, tolerance(size))
.map_err(|why| format!("the drum's sweep not built: {why:?}"))
}
occt left no solid to show.
Time
616 ms; CPU time 615 ms; peak memory 356.6 MB
Notes
refused occt has no sweep of a solid: it turns faces, and the drum's side, whose axis runs past the turn's without meeting it, touches what it sweeps along curves that are no plane sections of it, which occt has no operation to find
"""A flat-end mill leaning across a turn, its rims digging past its ends. A ring with a channel cut
inside it by a drum leaning across a turn.
The ring is everything with distance from the z axis between 3 and 8 and with z between −2.5 and
2.5, all the way round.
The drum is a solid cylinder of radius 1 and length 3, its ends flat and square to its axis. Its
axis leans 25° from upright in the plane y = 1.2, along the direction (sin 25°, 0, cos 25°), and
its middle is the point (5, 1.2, 0).
It turns rigidly about the z axis, right-handed (from +x toward +y), by 100°, wholly inside the
ring. Cut from the ring everything the drum passes through.
The drum's side touches along two curves, each turned into a surface of revolution. Its rims are
sharp circles leaning to the turn's axis; each sweeps a ring whose section is no circle, and they
carry the cut past the flat ends' own contact lines. The channel is sealed inside the ring."""from bench importRefuseddefbuild():
# The drum's axis, in the plane y = 1.2, runs past the turn's axis without meeting it. At# the point of its side at height s along its axis and angle t round it, the normal is# square to the turn's velocity where a relation in s and t holds that is no plane section,# no line and no circle of the cylinder. OCCT sweeps no solid, and a face it turns 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 turns faces, and the drum's side, whose ""axis runs past the turn's without meeting it, touches what it sweeps along ""curves that are 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
20 ms; CPU time 20 ms; peak memory 11.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 ring, distance from the z axis between 3 and 8 and z between −2.5 and 2.5, with a channel cut//! inside it by a drum leaning across a turn: the solid cylinder of radius 1 and length 3 whose//! axis runs along (sin 25°, 0, cos 25°) through its middle (5, 1.2, 0), turned right-handed about//! the z axis by 100°. Everything the drum passes through, cut.//!//! The drum's sweep is kentron's sweep of a solid (`sweep::solid`, one turn), cut from the ring.usecrate::bench::{d, frame, p};
use kentron::math::{Axis, Direction, Vector};
use kentron::primitives::Cylinder;
use kentron::sweep::{self, RigidMotion};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let outer = Cylinder::new(8.0, 5.0).with_frame(frame(p(0.0, 0.0, -2.5), d(0.0, 0.0, 1.0))).build(m)?;
let inner = Cylinder::new(3.0, 5.0).with_frame(frame(p(0.0, 0.0, -2.5), d(0.0, 0.0, 1.0))).build(m)?;
let ring = kentron::boolean::difference(m, outer, inner)?;
let lean = 25f64.to_radians();
let axis = Vector::new(lean.sin(), 0.0, lean.cos());
let drum = Cylinder::new(1.0, 3.0).with_frame(frame(p(5.0, 1.2, 0.0) - axis * 1.5, Direction::from_vector(axis))).build(m)?;
let turn = RigidMotion::Turn { axis: Axis::new(p(0.0, 0.0, 0.0), Direction::Z), from: 0.0, to: 100f64.to_radians() };
let swept = sweep::solid(m, drum, &turn)?;
kentron::boolean::difference(m, ring, 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.6 MB
Notes
refused no layer (solidcraft-kernel, solidcore-ops, solidcore) has a sweep of a solid or an envelope: the drum, its axis skew to the turn's, touches its sweep along curves that are none of its lines or circles, so the channel is bounded by an envelope
//! Refused. The drum's axis leans 25° in the plane y = 1.2, a line skew to the z axis it turns//! about. Its side touches its sweep along two curves that are none of its lines or circles, and//! its rims, circles leaning to the turn's axis, sweep rings whose section is no circle: the//! channel's walls are the revolves of an envelope. solidcraft-kernel has no sweep of a solid and//! no envelope, and that contact 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 drum, its axis skew to the \
turn's, touches its sweep along curves that are none of its lines or circles, so the \
channel is bounded by an envelope"
.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.7 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 flat-end mill leaning across a turn, its rims digging past its ends.//// 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
484 ms; CPU time 483 ms; peak memory 181.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.
Data
its STEP's
expected
rel. error
volume
798.1420424
798.1420423
2.3e-10
area
806.4120777
806.4120782
7.0e-10
agrees with
cad-kernel, kentron, cadrs, springrep, geomsolver
mesh
44188 triangles, closed
centre of gravity
(-0.160166, -0.321783, -0.00368217) its STEP's solid
inertia
about it, of unit density: Ixx 16285.5; Iyy 16829; Izz 29610.5; Ixy 359.78; Iyz 21.5658; Izx 11.9359
//! A ring with a sealed channel cut inside it by a leaning drum turned 100° about its axis.//!//! The kernel's whole sweep of a solid (`sweep_solid`): the drum is a solid of revolution about the//! line through (5, 1.2, 0) along (sin 25°, 0, cos 25°), its meridian the rectangle out to radius 1//! from 1.5 below its middle to 1.5 above; turned about the z axis from 0° to 100°; cut from the ring//! (the cylinder of radius 8 less that of radius 3, from z = −2.5 to 2.5).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 outer = make_cylinder_brep(p(0.0, 0.0, -2.5), p(0.0, 0.0, 1.0), 8.0, 5.0)?;
let inner = make_cylinder_brep(p(0.0, 0.0, -3.0), p(0.0, 0.0, 1.0), 3.0, 6.0)?;
let ring = boolean_operation_nary(&[outer, inner], BooleanOperation::Subtract)?;
letmut operands = vec![ring];
let tool0 = SolidTool::Revolved {
axis_origin: p(5.0, 1.2, 0.0),
axis_direction: p(25f64.to_radians().sin(), 0.0, 25f64.to_radians().cos()),
radial: p(0.0, 1.0, 0.0),
meridian: vec![
OutlinePiece::Line { from: [0.0, -1.5], to: [1.0, -1.5] },
OutlinePiece::Line { from: [1.0, -1.5], to: [1.0, 1.5] },
OutlinePiece::Line { from: [1.0, 1.5], to: [0.0, 1.5] },
OutlinePiece::Line { from: [0.0, 1.5], to: [0.0, -1.5] },
],
};
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: 1.0, advance: 0.0 },
],
from: 0.0,
to: 100f64.to_radians(),
};
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
40 ms; CPU time 99 ms; peak memory 11.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.
//! A ring (radii 3 to 8 about the z axis, heights ±2.5) with a channel cut inside it by a drum//! (radius 1, length 3, its axis along (sin 25°, 0, cos 25°) through its middle (5, 1.2, 0)) turned//! about the z axis by 100°.//!//! The ring is a cylinder less a cylinder; what the drum passes through is cadrs's sweep of a//! solid (one turn), cut from it.usecrate::bench::{cut, cylinder, p3, v3};
usecrate::shared::swept::{swung, z_axis};
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let outer = cylinder(k, p3(0.0, 0.0, -2.5), v3(0.0, 0.0, 1.0), 8.0, 5.0)?;
let inner = cylinder(k, p3(0.0, 0.0, -2.5), v3(0.0, 0.0, 1.0), 3.0, 5.0)?;
let ring = cut(k, outer, inner)?;
let a = 25f64.to_radians();
let dir = v3(a.sin(), 0.0, a.cos());
let drum = cylinder(k, p3(5.0, 1.2, 0.0) - dir * 1.5, dir, 1.0, 3.0)?;
let swept = swung(k, drum, z_axis(), 0.0, 100.0)?;
cut(k, ring, 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
96 ms; CPU time 95 ms; peak memory 8.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
798.1420423
798.1420423
2.9e-13
area
806.4120784
806.4120782
1.5e-10
agrees with
cad-kernel, kentron, next.BREP, cadrs, geomsolver
mesh
29656 triangles, closed
centre of gravity
(-0.160166, -0.321783, -0.00368217) its STEP's solid
inertia
about it, of unit density: Ixx 16285.5; Iyy 16829; Izz 29610.5; Ixy 359.78; Iyz 21.5658; Izx 11.9359
//! The ring between radii 3 and 8 about the z axis, heights −2.5 to 2.5, less everything a drum//! (radius 1, length 3, leaning 25° in the plane y = 1.2 about (5, 1.2, 0)) passes through as it//! turns 100° about the z axis.use springrep::boolean::difference;
use springrep::math::{Frame, Vec3};
use springrep::primitive::cylinder;
use springrep::sweep::solid;
use springrep::topo::Brep;
usecrate::shared::e;
usecrate::shared::swept::{deg, turning, v3};
pubfnbuild() -> Result<Brep, String> {
let floor = crate::shared::at([0.0, 0.0, -2.5]);
let ring = difference(
&cylinder(&floor, 8.0, 5.0, "ring").map_err(e)?,
&cylinder(&floor, 3.0, 5.0, "bore").map_err(e)?,
)
.map_err(e)?;
let lean = deg(25.0);
let axis = v3(lean.sin(), 0.0, lean.cos());
let end = Frame::new(v3(5.0, 1.2, 0.0) - axis * 1.5, axis, Vec3::X).map_err(e)?;
let drum = cylinder(&end, 1.0, 3.0, "drum").map_err(e)?;
let swept = solid(&drum, &turning(0.0, deg(100.0)), "turn").map_err(e)?;
difference(&ring, &swept).map_err(e)
}
Time
4.12 s; CPU time 13.0 s; peak memory 41.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
798.1420423
798.1420423
5.2e-12
area
806.412077
806.4120782
1.5e-09
agrees with
cad-kernel, kentron, next.BREP, cadrs, springrep
mesh
60320 triangles, closed
centre of gravity
(-0.160166, -0.321783, -0.00368218) its STEP's solid
inertia
about it, of unit density: Ixx 16285.5; Iyy 16829; Izz 29610.5; Ixy 359.78; Iyz 21.5658; Izx 11.9359
// A ring, everything between radii 3 and 8 about the z axis with z within 2.5: its section in the// front plane (x, z) turned whole about the z axis. A drum, the cylinder of radius 1 and length 3// whose axis leans 25 degrees from upright in the plane y = 1.2, along (sin 25, 0, cos 25), its// middle (5, 1.2, 0): its end disc drawn in the plane through its middle whose u is x turned 25// degrees about y and v is y, carried 1.5 either way along that plane's normal. It is turned// rigidly 100 degrees about the z axis, right-handed (from +x toward +y), wholly inside the ring,// and everything it passes through cut from the ring: a sealed channel.unit mm
use std
use std.solids
use std.solids (cut)
use std.motion (turns)
in std.front {
a := point
b := point hint((8, -2.5))
c := point hint((8, 2.5))
d := point hint((3, 2.5))
meridian := horizontal line(a, b) -> vertical line(b, c) ->
horizontal line(c, d) -> vertical line(d, a) -> close
fix((3, -2.5)) a
a distance(5) b
b distance(5) c
}
part := solid(std.solids.Revolution(meridian, about: std.z))
across := axis hint(dir: (0.9, 0, -0.42))
across perpendicular std.y
std.x angle(25deg, about: std.y) across
along := axis hint(dir: (0, 1, 0))
along parallel(sense: same) std.y
waist := plane(u: across, v: along)
fix(origin == (5, 1.2, 0)) waist
in waist {
o := point
fix((0, 0)) o
rim := circle(center: o) hint(r: 1)
radius(1) rim
}
drum := solid(std.solids.Prism(face(rim), from: -1.5mm, to: 1.5mm))
swing := frame
swing turns(1) std.z
channel := solid({ p | some t in (0deg, 100deg): p in drum at(under: swing) t })
channel cut part
anvilcad left no solid to show.
Time
1.1 ms; CPU time 940 µ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 flat-end mill leaning across a turn, its rims digging past its ends.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())
}