A block, the box from (−6, −6, −8) to (36, 26, 0), with a groove cut into its top by a ring carried along a spline, standing up like a wheel across it.
The curve is the cubic Bézier curve in the plane z = 0 whose control points are (0, 0, 0), (10, 0, 0), (20, 20, 0) and (30, 20, 0), run from its first end to its last.
A frame rides along the curve: at each point its origin is the curve's point, its x axis the curve's tangent there (pointing the way the curve runs), its z axis straight up and its y axis to the left, so that at the curve's start it is the world's own frame. The tool is drawn in that starting frame and carried rigidly by the frame as it runs the whole curve.
The ring, so drawn, is a torus centered at (0, 0, 0.5) whose axis is the y axis direction: the circle through its tube's centers has radius 1.5, and its tube has radius 0.5. So it stands upright across the curve like a wheel, its lowest point 1.5 below the block's top.
Cut from the block everything the ring passes through as the frame runs the whole curve.
The ring is no convex solid: as the curve bends, its inner side comes into contact too.
Unsettled. This solid has no closed form, and no two kernels yet agree on it to 1e-8, so it has no answer to grade against. Below is what each kernel builds: built means a watertight, consistently oriented solid, whatever its measures; the table says which kernels agree with which.
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.82 s; CPU time 4.64 s; peak memory 29 MB
Notes
built A watertight, consistently oriented solid; the case has no settled answer yet to grade it against.
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
volume
10696.4617695
area
3974.43860055
agrees with
no other kernel
mesh
141230 triangles, closed, 12 degenerate
centre of gravity
(15, 10, -4.01718) its STEP's solid
inertia
about it, of unit density: Ixx 971515; Iyy 1.63283e+06; Izz 2.4909e+06; Ixy 3432.29; Iyz -0.00022531; Izx 1.7735e-05
//! A block, the box (−6, −6, −8)–(36, 26, 0), with a groove cut into its top by a ring standing up//! like a wheel — the torus centred at (0, 0, 0.5) about the y direction, of radii 1.5 and 0.5 —//! drawn in a frame that rides along the cubic Bézier curve (0, 0, 0), (10, 0, 0), (20, 20, 0),//! (30, 20, 0) — its x axis the curve's tangent, its z axis up — and carried rigidly by it over the//! whole curve.//!//! Refused by the kernel. A frame along a path is no constant twist and no path of slides and//! turns, so the sweep takes the kernel's road for any other rigid motion (K2), which reads the//! tool as a convex solid of revolution and refuses the ring, a torus about an axis it does not//! cross (`Unbuilt::Curved`).usecrate::sketch::block;
use cad_kernel::build::torus;
use cad_kernel::geom::{tolerance, V};
use cad_kernel::nurbs::BSpline;
use cad_kernel::swept::closed::cut_from;
use cad_kernel::topo::Brep;
use cad_kernel::trajectory::{Motion, Path, Trajectory};
use cad_kernel::KernelError;
use std::sync::Arc;
constCONTROL: [V; 4] = [[0., 0., 0.], [10., 0., 0.], [20., 20., 0.], [30., 20., 0.]];
/// How closely the ring is meshed for the sweep's membership reads: a hundredth of its tube's/// radius.constBAR: f64 = 0.005;
/// The frame riding along a curve in the plane z = 0: its origin the curve's point, its x axis the/// curve's unit tangent, its z axis up; at each parameter its pose (a turn about z by the/// tangent's angle, then the curve's point) and that pose's rate, the turn's by the tangent's/// rate of turning, read off the kernel's own B-spline.#[derive(Debug)]structAlong(BSpline);
implPathforAlong {
fnat(&self, t: f64) -> Result<Motion, KernelError> {
let (point, d, dd) = self.0.d2(t);
let speed2 = d[0] * d[0] + d[1] * d[1];
let (c, s) = (d[0] / speed2.sqrt(), d[1] / speed2.sqrt());
let turning = (d[0] * dd[1] - d[1] * dd[0]) / speed2;
let r = [[c, -s, 0.], [s, c, 0.], [0., 0., 1.]];
let dr = [[-s * turning, -c * turning, 0.], [c * turning, -s * turning, 0.], [0.; 3]];
Ok(Motion::of_parts(r, dr, point, d))
}
}
pubfnbuild() -> Result<Brep, String> {
let stock = block([-6., -6., -8.], [36., 26., 0.])?;
let ring = torus([0., 0., 0.5], [0., 1., 0.], 1.5, 0.5)?;
// the curve as cad-kernel holds a Bézier segment: a cubic B-spline on clamped knots, run over// [0, 1]; at its start the riding frame is the world's ownlet curve = BSpline::new(3, vec![0., 0., 0., 0., 1., 1., 1., 1.], CONTROL.to_vec())?;
// a frame along a path is no constant twist and no path of slides and turns: the motion as the// kernel reads any other, by evaluating it (K2)let path = Trajectory::General(Arc::new(Along(curve)));
let size = stock.size().max(ring.size());
cut_from(&stock, &ring, &path, [0., 1.], BAR, tolerance(size))
.map_err(|why| format!("the ring's sweep not built: {why:?}"))
}
occt left no solid to show.
Time
614 ms; CPU time 614 ms; peak memory 356.6 MB
Notes
refused occt has no sweep of a solid, and the curve along which the ring touches what it sweeps moves over it as the curve's curvature changes, so no fixed split of its torus sweeps without folding; the groove's wall is the envelope of the ring, which occt cannot find
"""A wheel carried along a spline, cutting with its rim. A block, the box from (−6, −6, −8) to (36,
26, 0), with a groove cut into its top by a ring carried along a spline, standing up like a wheel
across it.
The curve is the cubic Bézier curve in the plane z = 0 whose control points are (0, 0, 0), (10, 0,
0), (20, 20, 0) and (30, 20, 0), run from its first end to its last.
A frame rides along the curve: at each point its origin is the curve's point, its x axis the
curve's tangent there (pointing the way the curve runs), its z axis straight up and its y axis to
the left, so that at the curve's start it is the world's own frame. The tool is drawn in that
starting frame and carried rigidly by the frame as it runs the whole curve.
The ring, so drawn, is a torus centered at (0, 0, 0.5) whose axis is the y axis direction: the
circle through its tube's centers has radius 1.5, and its tube has radius 0.5. So it stands upright
across the curve like a wheel, its lowest point 1.5 below the block's top.
Cut from the block everything the ring passes through as the frame runs the whole curve.
The ring is no convex solid: as the curve bends, its inner side comes into contact too."""from bench importRefuseddefbuild():
# The frame turns the ring as the curve turns: at each instant it moves by a slide along the# curve's tangent and a turn about the upright line through the curve's point, at the# curve's curvature. The ring's normal is square to that velocity on curves that depend on# the curvature: they move over the ring from instant to instant, and its inner side comes# into contact where the curve bends. OCCT sweeps a face along a path# (BRepOffsetAPI_MakePipeShell) only whole, and no fixed split of the torus sweeps without# folding; the groove's wall is the envelope of the ring, which occt has no operation to# find.raiseRefused("occt has no sweep of a solid, and the curve along which the ring touches ""what it sweeps moves over it as the curve's curvature changes, so no fixed ""split of its torus sweeps without folding; the groove's wall is the envelope ""of the ring, which occt cannot 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
2.5 ms; CPU time 2.3 ms; peak memory 8.6 MB
Notes
refused invalid input: a motion under which where it grazes the tool moves over it: its envelope is no product of a curve and the motion
//!//! The motion is given by its places (`sweep::RigidMotion::Carried`, the frame riding the curve,//! `shared::swept::bezier_frame`) for kentron's sweep of a solid (`sweep::solid`), cut from the//! block. kentron's sweep refuses it: the curves where the motion grazes the ring move over it, so//! its envelope is no product of a fixed curve and the motion.usecrate::bench::{frame, p};
usecrate::shared::swept::bezier_frame;
use kentron::math::Direction;
use kentron::primitives::{Cuboid, Torus};
use kentron::sweep::{self, Carriage, RigidMotion};
use kentron::topology::{Model, Shape};
use std::sync::Arc;
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let block = Cuboid::from_corners(p(-6.0, -6.0, -8.0), p(36.0, 26.0, 0.0)).build(m)?;
let ring = Torus::new(1.5, 0.5).with_frame(frame(p(0.0, 0.0, 0.5), Direction::Y)).build(m)?;
let swept = sweep::solid(m, ring, &RigidMotion::Carried(Carriage(Arc::new(bezier_frame))))?;
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.4 ms; CPU time 1.2 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 wheel-like ring turns with the curve, so the groove's walls are the envelope of the torus over the motion, which no plane section of it swept along the curve makes
//! Refused. The ring stands across the curve like a wheel, reaching 2 ahead of and behind the//! frame's origin, and turns with the curve's tangent, so as the curve bends its rim and its inner//! side come into contact: the groove's walls are the envelope of the torus over the motion, none//! of its circles. solidcraft-kernel has no sweep of a solid and no envelope, and its sweeps of a//! profile carry a plane section along the path, which is not that envelope; computed here it//! 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 wheel-like ring turns with the \
curve, so the groove's walls are the envelope of the torus over the motion, which no \
plane section of it swept along the curve makes"
.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.4 ms; CPU time 3.2 ms; peak memory 11.3 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 wheel carried along a spline, cutting with its rim.//// 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
8.27 s; CPU time 8.26 s; peak memory 1024.8 MB
Notes
built A watertight, consistently oriented solid; the case has no settled answer yet to grade it against.
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
volume
10696.4620421
area
3974.43955545
agrees with
no other kernel
mesh
18110 triangles, closed
centre of gravity
(15, 10, -4.01718) its STEP's solid
inertia
about it, of unit density: Ixx 971515; Iyy 1.63283e+06; Izz 2.4909e+06; Ixy 3432.25; Iyz -1.63685e-08; Izx -1.0913e-07
//! A wheel carried along a cubic Bezier by its moving frame, cut from a block.//! Uses the kernel's continuous solid sweep and boolean subtraction.usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{boolean_operation_nary, make_box_brep, sweep_solid_along,
BooleanOperation, BrepSolid, FrameCurve, OutlinePiece, SolidTool};
use std::f64::consts::TAU;
pubfnbuild() -> Result<BrepSolid, Refusal> {
let ring = SolidTool::Revolved {
axis_origin: p(0.0, 0.0, 0.5),
axis_direction: p(0.0, 1.0, 0.0),
radial: p(1.0, 0.0, 0.0),
meridian: vec![OutlinePiece::Arc {
centre: [1.5, 0.0], radius: 0.5, start: 0.0, end: TAU,
}],
};
let path = FrameCurve {
control: [p(0.0, 0.0, 0.0), p(10.0, 0.0, 0.0),
p(20.0, 20.0, 0.0), p(30.0, 20.0, 0.0)],
up: p(0.0, 0.0, 1.0),
};
let swept = sweep_solid_along(&ring, &path)?;
let block = make_box_brep(p(-6.0, -6.0, -8.0), 42.0, 32.0, 8.0)?;
Ok(boolean_operation_nary(&[block, swept], 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
533 ms; CPU time 1.97 s; peak memory 14.2 MB
Notes
built A watertight, consistently oriented solid; the case has no settled answer yet to grade it against.
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
volume
10696.4617716
area
3974.43724031
agrees with
no other kernel
mesh
155554 triangles, closed
centre of gravity
(15, 10, -4.01718) its STEP's solid
inertia
about it, of unit density: Ixx 971515; Iyy 1.63283e+06; Izz 2.4909e+06; Ixy 3432.29; Iyz -7.60412e-05; Izx -1.01969e-05
//! A block (the box from (−6, −6, −8) to (36, 26, 0)) grooved by a ring (the torus about (0, 0, 0.5)//! along the y axis, radii 1.5 and 0.5, in the frame riding the curve) carried along the cubic//! Bézier curve on (0, 0, 0), (10, 0, 0), (20, 20, 0), (30, 20, 0) by a frame along its tangent,//! upright.//!//! What the ring passes through is cadrs's sweep of a solid along a path (exact: the envelope of//! the torus, trimmed along the folds a wheel's sweep has), cut from the block.usecrate::bench::{block, cut, p3, torus, v3};
usecrate::shared::swept::{bezier_path, carried};
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let b = block(k, p3(-6.0, -6.0, -8.0), p3(36.0, 26.0, 0.0))?;
let ring = torus(k, p3(0.0, 0.0, 0.5), v3(0.0, 1.0, 0.0), 1.5, 0.5)?;
let path = bezier_path([(0.0, 0.0), (10.0, 0.0), (20.0, 20.0), (30.0, 20.0)]);
let swept = carried(k, ring, path)?;
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.
springrep left no solid to show.
Time
47 ms; CPU time 47 ms; peak memory 8.9 MB
Notes
refused unsupported: a sweep along a motion whose velocity changes on the body, of a torus that grazes along a whole meridian
//! The box (−6, −6, −8)–(36, 26, 0) less everything an upright ring (a torus about the frame's y//! axis) passes through as a frame riding a cubic Bézier curve carries it, turning with the//! curve's tangent.use springrep::boolean::difference;
use springrep::math::{Frame, Vec3};
use springrep::primitive::torus;
use springrep::sweep::solid;
use springrep::topo::Brep;
usecrate::shared::e;
usecrate::shared::swept::{boxed, carried, v3};
pubfnbuild() -> Result<Brep, String> {
let stock = boxed([-6.0, -6.0, -8.0], [36.0, 26.0, 0.0], "block")?;
let wheel = Frame::new(v3(0.0, 0.0, 0.5), Vec3::Y, Vec3::X).map_err(e)?;
let ring = torus(&wheel, 1.5, 0.5, "ring").map_err(e)?;
let swept = solid(&ring, &carried()?, "carried").map_err(e)?;
difference(&stock, &swept).map_err(e)
}
geomsolver left no solid to show.
Time
67 ms; CPU time 68 ms; peak memory 28.4 MB
Notes
refused error[E080]: `groove` is outside the generating-sweep class (M1: the motion is rotations about fixed axes at constant ratios, or one screw, turn or slide (a joint driven by a law alone read as its joint over the values the law reaches)): temporal contacts are read of constant rates, and a frame along a path turns as its path does (#398)
// A block, the box from (-6, -6, -8) to (36, 26, 0), grooved by a ring carried along a spline.// The path is the cubic Bezier in the block's top through the control points (0, 0), (10, 0),// (20, 20), (30, 20); `std.stations.Along` is the frame riding it, x along its tangent and z up,// the world's own frame at its start. The ring is drawn in that starting frame: a torus about the// line through (0, 0, 0.5) along y, its tube (radius 0.5) 1.5 from that line, standing across// the path like a wheel. The kernel's sweep of the ring as the frame runs the whole path (the// spline's own parameter, 0 to 1) is cut from the block.unit mm
use std
use std.solids (cut)
use std.place (coords, on_u)
use std.shapes
use std.stations
in std.top {
private k0 := point
private k1 := point
private k2 := point
private k3 := point
fix((0, 0)) k0
fix((10, 0)) k1
fix((20, 20)) k2
fix((30, 20)) k3
route := spline(k0, k1, k2, k3)
private mid := point
fix((15, 10)) mid
private outline := std.shapes.CenteredRectangle(mid, w: 42mm, h: 32mm)
}
part := solid(std.solids.Prism(outline.loop, from: -8mm, to: 0mm))
along := std.stations.Along(route, up: std.z)
// the ring, drawn in the level plane through its centre (0, 0, 0.5), its axis along yprivate east := axis
fix(dir == (1, 0, 0)) east
private north := axis
fix(dir == (0, 1, 0)) north
bench := plane(u: east, v: north)
fix(origin == (0, 0, 0.5)) 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: 1.5mm) bench
private tube := circle(center: tc) hint(r: 0.5)
radius(0.5mm) tube
}
constructionring := solid(std.solids.Revolution(face(tube), about: ring_axis))
construction groove := solid({ p | some t in (0rad, 1rad): p inringat(under: along.f) t })
groove cut part
anvilcad left no solid to show.
Time
1.2 ms; CPU time 1000 µs; peak memory 3.5 MB
Notes
refused anvil-brep has no sweep of a solid, and no spline curve to carry anything along: its sweeps follow lines and arcs only
//! A wheel carried along a spline, cutting with its rim.use anvil_brep::Solid;
pubfnbuild() -> Result<Solid, String> {
Err("anvil-brep has no sweep of a solid, and no spline curve to carry anything along: its sweeps follow lines and arcs only".into())
}