The solid a torus fills as it tumbles: it turns about one axis while being watched from a frame that turns about another.
The torus has its center at (3, 0, 2) and its axis parallel to the z axis; the circle through its tube's centers has radius 1, and its tube has radius 0.5.
It moves by two turns at once, both driven by one parameter t:
it turns by t/4 about the vertical line through (2, 0, 0), right-handed (from +x toward +y);
the frame it is seen from turns by t about the line through (0, 0.5, 0.5) parallel to the x axis, right-handed (from +y toward +z).
Seen from that frame, the torus's place at t is its place turned by t/4 about the first line and then by −t about the second. Make the solid of everything the torus passes through, so seen, as t runs from −75° to 75°.
No turn keeps any line of the torus fixed, so the boundary is an envelope of no simpler kind.
As a set:
$$\bigcup_{t \in [-75^\circ,\,75^\circ]} R_B(-t)\,R_A(\tfrac t4)\,T, \quad T =
\bigl\{\,\bigl(\sqrt{(x-3)^2 + y^2} - 1\bigr)^2 + (z-2)^2 \le 0.5^2\,\bigr\},\quad A,\ B \text{ the
two lines above, in that order}$$
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
5.67 s; CPU time 12.0 s; peak memory 32.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
25.2750394063
area
59.1801685598
agrees with
no other kernel
mesh
128834 triangles, closed
centre of gravity
(2.97449, 0.02553, 1.20883) its STEP's solid
inertia
about it, of unit density: Ixx 71.7778; Iyy 37.7875; Izz 62.7229; Ixy 0.184079; Iyz -9.62989; Izx -0.369694
//! The solid a torus (centre (3, 0, 2), axis along z, radii 1 and 0.5) fills as it turns by t/4//! about the vertical line through (2, 0, 0) and then by −t about the line through (0, 0.5, 0.5)//! along x, as t runs from −75° to 75°.//!//! Built by the kernel's sweep of a ring under any rigid motion (`swept::closed::ring`): a torus is//! a tool of revolution whose meridian is a loop clear of its axis, so its contact under the//! instant's twist is read meridian by meridian in closed form — here two curves at every//! instant, the outer touching all round and the inner folding four times. Each curve sweeps a//! tube, fitted; the inner one is dipped into the tool between its touching pieces and entered//! only where it stands outside the torus at both end poses. The box is split by the tubes and the//! torus where it starts and stops at once, its cells classified by membership, and the result//! judged by the sweep's definition before it is returned.use cad_kernel::build::torus;
use cad_kernel::swept::closed::ring;
use cad_kernel::topo::Brep;
use cad_kernel::trajectory::{Screw, Trajectory};
constROLL: [f64; 2] = [-75f64.to_radians(), 75f64.to_radians()];
/// How closely the torus is meshed for the sweep's membership reads: a two-hundred-fiftieth of its/// tube's radius.constBAR: f64 = 0.002;
/// The tolerance the tubes are fitted and met to: a fiftieth of a thousandth of the tube's radius.constTOL: f64 = 1e-5;
pubfnbuild() -> Result<Brep, String> {
let tool = torus([3., 0., 2.], [0., 0., 1.], 1., 0.5)?;
// the torus's own turn and the frame's, each a screw that does not advance; the motion is the// first seen from the second (`Relative`: at each t the source's pose, then the observer's// undone — turned by t/4 about the first line, then by −t about the second)let own = Trajectory::Twist(Screw {
origin: [2., 0., 0.], axis: [0., 0., 1.], ratio: 0.25, advance: 0.,
});
let frame = Trajectory::Twist(Screw {
origin: [0., 0.5, 0.5], axis: [1., 0., 0.], ratio: 1., advance: 0.,
});
let path = Trajectory::Relative { source: Box::new(own), observer: Box::new(frame) };
ring(&tool, &path, ROLL, BAR, TOL).map_err(|why| format!("the torus's sweep not built: {why:?}"))
}
occt left no solid to show.
Time
630 ms; CPU time 630 ms; peak memory 356.8 MB
Notes
refused occt has no sweep of a solid along a pair of turns about skew axes: it slides, turns about one axis, or follows a path with a trihedron law, none of which is this tumble; the boundary is the envelope of the tumbling torus, which occt has no operation to find
"""A torus tumbled through space. The solid a torus fills as it tumbles: it turns about one axis
while being watched from a frame that turns about another.
The torus has its centre at (3, 0, 2) and its axis parallel to the z axis; the circle through its
tube's centres has radius 1, and its tube has radius 0.5.
It moves by two turns at once, both driven by one parameter t:
- it turns by t/4 about the vertical line through (2, 0, 0), right-handed (from +x towards +y);
- the frame it is seen from turns by t about the line through (0, 0.5, 0.5) parallel to the
x axis, right-handed (from +y towards +z).
Seen from that frame, the torus's place at t is its place turned by t/4 about the first line and
then by −t about the second. Make the solid of everything the torus passes through, so seen, as t
runs from −75° to 75°.
No turn keeps any line of the torus fixed, so the boundary is an envelope of no simpler kind."""from bench importRefuseddefbuild():
# The torus moves by a turn about a vertical line followed by a turn about a line along x,# both driven by t: its axis of turning changes from instant to instant. OCCT's sweeps slide# (BRepPrimAPI_MakePrism), turn about one fixed axis (BRepPrimAPI_MakeRevol) or carry a shape# along a path under a law of its trihedron (BRepOffsetAPI_MakePipe, MakePipeShell), and none# of their laws turns a shape like this along its centre's path. And the solid's boundary is# the envelope of the torus under the motion, along characteristic curves that are none of# its circles, which occt has no operation to find.raiseRefused("occt has no sweep of a solid along a pair of turns about skew axes: it ""slides, turns about one axis, or follows a path with a trihedron law, none ""of which is this tumble; the boundary is the envelope of the tumbling torus, ""which occt has no operation to find")
arris left no solid to show.
Time
1.2 ms; CPU time 1 ms; peak memory 3.6 MB
Notes
refused arris has no sweep of a solid along a motion; the tumbling torus's boundary is its envelope, which it cannot build
//! The solid a torus (centred at (3, 0, 2), axis along z, radii 1 and 0.5) fills as it turns by//! t/4 about the vertical line through (2, 0, 0) while seen from a frame turning by t about the//! line through (0, 0.5, 0.5) along x, for t from −75° to 75°.//!//! Refused: arris has no sweep of a solid. The motion keeps no line of the torus fixed, so the//! sweep is neither a revolution nor a slide of it, and its boundary is the envelope of the//! torus's places, the curves on it where the motion's velocity is tangent to it; arris has no//! operation that builds that surface, and it would have to be computed outside the kernel.usecrate::Refusal;
use arris::topo::{Body, Model};
pubfnbuild(_: &mutModel) -> Result<Body, Refusal> {
Err("arris has no sweep of a solid along a motion; the tumbling torus's boundary is its \
envelope, which it cannot build"
.into())
}
kentron left no solid to show.
Time
2.1 ms; CPU time 1.9 ms; peak memory 8.3 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 solid a torus fills as it tumbles: the torus centred at (3, 0, 2), axis parallel to the//! z axis, radii 1 and 0.5, turned by t/4 about the vertical line through (2, 0, 0) and then by//! −t about the line through (0, 0.5, 0.5) parallel to the x axis, for t from −75° to 75°.//!//! The motion is given by its places (`shared::swept::tumble`, a `sweep::RigidMotion::Carried`)//! for kentron's sweep of a solid (`sweep::solid`), which refuses it: the curves where the motion grazes the tool move over it, so its envelope is//! no product of a fixed curve and the motion, and kentron's sweep builds only those.usecrate::bench::{frame, p};
usecrate::shared::swept::tumble;
use kentron::math::{Axis, Direction};
use kentron::primitives::Torus;
use kentron::sweep;
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let tool = Torus::new(1.0, 0.5).with_frame(frame(p(3.0, 0.0, 2.0), Direction::Z)).build(m)?;
let first = Axis::new(p(2.0, 0.0, 0.0), Direction::Z);
let motion = tumble(first, 0.25, Axis::new(p(0.0, 0.5, 0.5), Direction::X), -1.0, -75.0, 75.0);
sweep::solid(m, tool, &motion)
}
vcad left no solid to show.
Time
1.1 ms; CPU time 1 ms; peak memory 4.8 MB
Notes
refused vcad has no sweep of a solid along a motion; the tumbling torus's boundary is its envelope, which would have to be computed outside the kernel
//! The solid a torus (centred at (3, 0, 2), axis along z, radii 1 and 0.5) fills as it turns by//! t/4 about the vertical line through (2, 0, 0) while seen from a frame turning by t about the//! line through (0, 0.5, 0.5) along x, for t from −75° to 75°.//!//! Refused: vcad has no sweep of a solid. The motion keeps no line of the torus fixed, so the//! sweep is neither a revolution nor a slide of it, and its boundary is the envelope of the//! torus's places, the curves on it where the motion's velocity is tangent to it; vcad has no//! operation that builds that surface, and it would have to be computed outside the kernel.use vcad_kernel::Solid;
pubfnbuild() -> Result<Solid, crate::Refusal> {
Err("vcad has no sweep of a solid along a motion; the tumbling torus's boundary is its \
envelope, which would have to be computed outside the kernel"
.into())
}
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 tumbling torus's sweep is bounded by the envelope of its places, which no sweep of a profile makes
//! Refused. The torus moves by two turns about skew axes at once, so no line of it stays fixed and//! its sweep's boundary is an envelope of no simpler kind. solidcraft-kernel has no sweep of a//! solid and no envelope, and an envelope 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 tumbling torus's sweep is \
bounded by the envelope of its places, which no sweep of a profile makes"
.into())
}
brepkit left no solid to show.
Time
1.1 ms; CPU time 910 µs; peak memory 3.7 MB
Notes
refused brepkit has no sweep of a solid along a motion, and the tumbling torus's sweep is bounded by its envelope, which brepkit cannot compute
//! A torus tumbled through space by two turns at once. brepkit has no sweep of a solid, and none//! along a motion compounded of two turns; the solid's boundary is the envelope of the torus over//! the motion, of no simpler kind, which brepkit has no operation to compute.use brepkit_topology::solid::SolidId;
use brepkit_topology::Topology;
usecrate::Refusal;
pubfnbuild(_topo: &mutTopology) -> Result<SolidId, Refusal> {
Err(
"brepkit has no sweep of a solid along a motion, and the tumbling torus's sweep is \
bounded by its envelope, which brepkit cannot compute"
.into(),
)
}
popkern left no solid to show.
Time
3.4 ms; CPU time 3.2 ms; peak memory 11.5 MB
Notes
refused popkern has no sweep of a solid, and this sweep's wall is an envelope: no line of the torus stays fixed, so its boundary is an envelope of no simpler kind
// The solid a torus fills as it turns about one axis, seen from a frame turning about another.//// Refused: popkern has no sweep of a solid (its sweeps carry a profile along a path), and this// one's shape does not follow from its other operations by elementary geometry: no line of the// torus stays fixed, so its boundary is an envelope of no simpler kind. A wall the script would// compute itself, fitting curves to where the tool touches its own sweep, is geometry made outside// the kernel.throw"popkern has no sweep of a solid, and this sweep's wall is an envelope: no line of the \
torus stays fixed, so its boundary is an envelope of no simpler kind";
aetheris left no solid to show.
Time
52 ms; CPU time 52 ms; peak memory 47.1 MB
Notes
refused Aetheris has no sweep of a solid, and this sweep's wall is an envelope: no line of the torus stays fixed, so its boundary is an envelope of no simpler kind.
// The solid a torus fills as it turns about one axis, seen from a frame turning about another.//// Refused: Aetheris has no sweep of a solid, and this sweep's wall is an envelope: no line of the// torus stays fixed, so its boundary is an envelope of no simpler kind.
Time
8.60 s; CPU time 8.60 s; peak memory 28 MB
Notes
built A watertight, consistently oriented solid; the case has no settled answer yet to grade it against.
Data
measured
volume
25.2750757373
area
59.1796095679
agrees with
no other kernel
faces
6 bspline, 4 other
mesh
19102 triangles, closed
centre of gravity
(2.97327, 0.0257287, 1.20897) its triangles
inertia
about it, of unit density: Ixx 71.0494; Iyy 37.424; Izz 62.123; Ixy 0.178909; Iyz -9.57335; Izx -0.343589
//! The solid a torus fills as it tumbles, through the kernel's sweep of a solid of revolution//! tumbled by two turns about skew axes (`sweep_solid_tumbled`): the torus centred at (3, 0, 2),//! axis along z, the circle through its tube's centres of radius 1, tube radius 0.5; at t turned by//! t/4 about the vertical line through (2, 0, 0), then by −t about the line through (0, 0.5, 0.5)//! along x; t from −75° to 75°.usecrate::solids::swept::tumbled_torus;
usecrate::Refusal;
use brep_kernel::BrepSolid;
pubfnbuild() -> Result<BrepSolid, Refusal> {
tumbled_torus(0.5, 0.25, -1.0, 0.5f64.sqrt(), 45.0, 0.0, -75.0, 75.0)
}
geop left no solid to show.
Time
1.9 ms; CPU time 1.7 ms; peak memory 9.6 MB
Notes
refused geop has no sweep of a solid through a motion: the tumbling torus's sweep is bounded by an envelope geop cannot build
//! The solid a torus fills as it turns about one axis while watched from a frame turning about//! another.//!//! geop sweeps a profile along a path; it has no sweep of a solid through a motion, and this one//! is bounded by an envelope of no simpler kind, which would have to be computed here, outside//! geop.usecrate::{Bench, Refusal};
pubfnbuild(_: &mutBench) -> Result<(), Refusal> {
Err("geop has no sweep of a solid through a motion: the tumbling torus's sweep is bounded by \
an envelope geop cannot build"
.into())
}
Time
545 ms; CPU time 1.89 s; peak memory 18.6 MB
Notes
built A watertight, consistently oriented solid; the case has no settled answer yet to grade it against.
Data
measured
volume
25.2750727387
area
59.1796086441
agrees with
no other kernel
faces
10 bspline, 2 torus
mesh
12744 triangles, closed
centre of gravity
(2.97447, 0.0255155, 1.20852) its triangles
inertia
about it, of unit density: Ixx 71.3382; Iyy 37.5395; Izz 62.3702; Ixy 0.184047; Iyz -9.58857; Izx -0.367902
not by the harness, which graded the runner's own measures instead: cannot measure: face #2629: a loop whose path on its surface breaks (an edge laid across a place where its surface meets itself?)
//! The solid a torus (center (3, 0, 2), axis along z, radii 1 and 0.5) fills as it turns by t/4//! about the vertical line through (2, 0, 0), seen from a frame turning by t about the line//! through (0, 0.5, 0.5) along x, as t runs from −75° to 75°.//!//! The torus is cadrs's torus primitive; cadrs's `Kernel::sweep_solid` with the rigid motion of//! its two turns (by t/4 about the first line, then by −t about the second) gives what it fills.//! The kernel builds it exactly: the sheets of the torus's envelope (its core circle's sweep, a//! tube radius either side), trimmed where the motion covers them and fitted as B-spline faces,//! closed by the torus where the motion starts and where it stops.usecrate::bench::{p3, torus, v3};
usecrate::Refusal;
use cadrs_kernel::{Axis, BodyId, DefaultKernel, Kernel, RigidStep, SolidMotion};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let t = torus(k, p3(3.0, 0.0, 2.0), v3(0.0, 0.0, 1.0), 1.0, 0.5)?;
let (a0, a1) = ((-75f64).to_radians(), 75f64.to_radians());
let motion = SolidMotion::Rigid {
steps: vec![
RigidStep::Turn { axis: Axis::new(p3(2.0, 0.0, 0.0), v3(0.0, 0.0, 1.0)), from: a0 / 4.0, to: a1 / 4.0 },
RigidStep::Turn { axis: Axis::new(p3(0.0, 0.5, 0.5), v3(1.0, 0.0, 0.0)), from: -a0, to: -a1 },
],
};
let swept = k.sweep_solid(t, &motion)?;
swept.bodies.first().copied().ok_or_else(|| Refusal::from("the sweep made no body"))
}
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
1.3 ms; CPU time 1.1 ms; peak memory 3.4 MB
Notes
refused springrep's sweep of a solid is exact only under a slide, a turn or a screw. Under two turns about skew axes no line of the torus stays in contact, so the swept solid's boundary is an envelope of the torus's poses of no simpler kind, which it cannot make exactly
//! The solid the torus about (3, 0, 2) (radii 1 and 0.5) fills as it turns by t/4 about the//! upright line through (2, 0, 0) and by −t about the line through (0, 0.5, 0.5) along x, for t//! from −75° to 75°.use springrep::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
Err("springrep's sweep of a solid is exact only under a slide, a turn or a screw. Under two turns about skew axes no line of the torus stays in contact, so the swept solid's boundary is an envelope of the torus's poses of no simpler kind, which it cannot make exactly".into())
}
geomsolver left no solid to show.
Time
46 ms; CPU time 46 ms; peak memory 24.1 MB
Notes
refused error[E080]: `part`: native CAD boundary construction for continuous motion sweeps is not yet supported
// A torus tumbled through space: the torus centred at (3, 0, 2), its axis along z, its tube// (radius 0.5) 1 from that axis, turned 0.25 t about A, the upright line through (2, 0, 0), and// then -t about B, the line through (0, 0.5, 0.5) along x. The part is the kernel's sweep of the// torus as t runs from -75 to 75 degrees, read as the torus turning about A seen from a frame// turning +t about B.unit mm
use std
use std.solids
use std.place (above, right_of)
use std.motion (turns)
// the torus: its tube's circle drawn in the front plane, 1 out from its upright axis through// (3, 0, 2), turned about that axisin std.front {
private c := point
fix((3, 2)) c
private c_up := point
c_up above(d: 1mm) c
construction centerline torus_axis := line(c, c_up)
private tc := point
tc right_of(d: 1mm) c
private tube := circle(center: tc) hint(r: 0.5)
radius(0.5mm) tube
}
construction torus := solid(std.solids.Revolution(face(tube), about: torus_axis))
// A: the upright line through (2, 0, 0)private a_foot := point
fix((2, 0, 0)) a_foot
private a := axis
fix(dir == (0, 0, 1)) a
a_foot coincident a
// B: the line through q = (0, 0.5, 0.5)// along u = (1, 0, 0)private q := point
fix((0, 0.5, 0.5)) q
private b := axis
fix(dir == (1, 0, 0)) b
q coincident b
// the torus turns 0.25 t about A while the frame it is seen from turns t about B, so seen from// that frame it is turned 0.25 t about A and then -t about Bprivate spin := frame
spin turns(0.25) a
private observer := frame
observer turns(1) b
part := solid({ p | some t in (-75deg, 75deg): p in torus at(under: spin, seen_from: observer) t })
anvilcad left no solid to show.
Time
1.2 ms; CPU time 990 µs; peak memory 3.4 MB
Notes
refused anvil-brep has no sweep of a solid: a body tumbled by two turns at once sweeps envelopes of its surfaces that follow from no elementary construction, which it would have to compute itself
//! A torus tumbled through space.use anvil_brep::Solid;
pubfnbuild() -> Result<Solid, String> {
Err("anvil-brep has no sweep of a solid: a body tumbled by two turns at once sweeps envelopes of its surfaces that follow from no elementary construction, which it would have to compute itself".into())
}