The solid a cube fills as it tumbles: it turns about one axis while being watched from a frame that turns about another.
The cube is the box from (2.4, −0.6, 1.4) to (3.6, 0.6, 2.6): edge 1.2, centered at (3, 0, 2).
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 cube'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 cube passes through, so seen, as t runs from −75° to 75°.
No turn keeps any line of the cube fixed, and its silhouette changes from face to face as it tumbles.
As a set:
$$\bigcup_{t \in [-75^\circ,\,75^\circ]} R_B(-t)\,R_A(\tfrac t4)\,T, \quad T =
[2.4,\,3.6]\times[-0.6,\,0.6]\times[1.4,\,2.6],\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
13.4 s; CPU time 36.8 s; peak memory 38.5 MB
Notes
built A watertight, consistently oriented solid; the case has no settled answer yet to grade it against.
Data
measured
volume
11.0993198727
area
35.1652798212
agrees with
no other kernel
faces
10 cylinder, 87 other, 7 plane
mesh
12892 triangles, closed
centre of gravity
(2.98577, 0.0869965, 1.34282) its triangles
inertia
about it, of unit density: Ixx 25.1479; Iyy 8.58874; Izz 19.7453; Ixy 0.0131819; Iyz -4.05139; Izx -0.253239
not by the harness, which graded the runner's own measures instead: cannot measure: face #33923: the integral round a loop does not converge (a surface that folds or cusps there?)
//! The solid a cube — the box (2.4, −0.6, 1.4)–(3.6, 0.6, 2.6) — 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°.//!//! Refused by the kernel. Two turns about skew axes are no constant twist, 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 cube (`Unbuilt::Curved` at its corner).usecrate::sketch::block;
use cad_kernel::geom::tolerance;
use cad_kernel::swept::closed::closed;
use cad_kernel::topo::Brep;
use cad_kernel::trajectory::{Screw, Trajectory};
constROLL: [f64; 2] = [-75f64.to_radians(), 75f64.to_radians()];
pubfnbuild() -> Result<Brep, String> {
let cube = block([2.4, -0.6, 1.4], [3.6, 0.6, 2.6])?;
// the cube'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) };
// no constant twist and no path of slides and turns: the kernel's road for any other rigid// motion (K2)closed(&cube, &path, ROLL, cube.size(), tolerance(cube.size()))
.map_err(|why| format!("the cube's sweep not built: {why:?}"))
}
occt left no solid to show.
Time
624 ms; CPU time 623 ms; peak memory 356.7 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 cube, which occt has no operation to find
"""A cube tumbled through space. The solid a cube fills as it tumbles: it turns about one axis
while being watched from a frame that turns about another.
The cube is the box from (2.4, −0.6, 1.4) to (3.6, 0.6, 2.6): edge 1.2, centered at (3, 0, 2).
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 cube'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 cube passes through, so seen, as t
runs from −75° to 75°.
No turn keeps any line of the cube fixed, and its silhouette changes from face to face as it
tumbles."""from bench importRefuseddefbuild():
# The cube 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 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 its flat faces touch what# they sweep along lines that move across them, so no fixed split of them sweeps without# folding: the boundary is the envelope of the cube, 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 cube, ""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
2.5 ms; CPU time 2.3 ms; peak memory 7.9 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 cube fills as it tumbles: the box from (2.4, −0.6, 1.4) to (3.6, 0.6, 2.6), 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::p;
usecrate::shared::swept::tumble;
use kentron::math::{Axis, Direction};
use kentron::primitives::Cuboid;
use kentron::sweep;
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let tool = Cuboid::from_corners(p(2.4, -0.6, 1.4), p(3.6, 0.6, 2.6)).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
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 tumbling cube's sweep is bounded by the envelope of its places, and no sweep of a profile along a line, a screw, a revolve or a path carries even a face of it through two turns about skew axes
//! Refused. The cube moves by two turns about skew axes at once, so no line of it stays fixed and//! the faces it leads with change as it tumbles; its sweep's boundary is the envelope of its//! places. solidcraft-kernel has no sweep of a solid and no envelope, and its sweeps of a profile//! follow a line, a screw, a revolve or a path's own frame, none of which carries even one face of//! the cube through this motion; 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 cube's sweep \
is bounded by the envelope of its places, and no sweep of a profile along a line, a \
screw, a revolve or a path carries even a face of it through two turns about skew axes"
.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.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 cube tumbled through space.//// 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
2.98 s; CPU time 2.98 s; peak memory 16.5 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
11.0993193857
area
35.1652800257
agrees with
cadrs
mesh
32118 triangles, open: 1884 edges unmatched
centre of gravity
(2.9858, 0.0869621, 1.34289) its STEP's solid
inertia
about it, of unit density: Ixx 25.1539; Iyy 8.59028; Izz 19.7499; Ixy 0.0129695; Iyz -4.05229; Izx -0.25343
//! The solid a cube fills as it tumbles: 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, for t from −75° to 75°.//!//! Through the kernel's tumbled sweep (`sweep_solid_tumbled`), asked for the cube as a polyhedron//! (the box (2.4, −0.6, 1.4)..(3.6, 0.6, 2.6), its six faces as loops of its corners) along those//! two turns. The kernel sweeps a polyhedron by two turns only through its trim engine, which is//! off by default (`BREP_SWEEP_TRIM_ENGINE`); off, it refuses.usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{sweep_solid_tumbled, BrepSolid, SolidTool, TwoTurns};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let (lo, hi) = ([2.4, -0.6, 1.4], [3.6, 0.6, 2.6]);
// Corner i: x high if i & 4, y high if i & 2, z high if i & 1.let vertices = (0..8)
.map(|i| {
let pick = |k: usize, bit: usize| if i & bit != 0 { hi[k] } else { lo[k] };
p(pick(0, 4), pick(1, 2), pick(2, 1))
})
.collect();
let faces = vec![vec![4, 5, 7, 6], vec![0, 2, 3, 1], vec![2, 6, 7, 3], vec![0, 1, 5, 4], vec![1, 3, 7, 5], vec![0, 4, 6, 2]];
let cube = SolidTool::Polyhedron { vertices, faces };
let tumble = TwoTurns {
axes: [(p(2.0, 0.0, 0.0), p(0.0, 0.0, 1.0)), (p(0.0, 0.5, 0.5), p(1.0, 0.0, 0.0))],
rates: [0.25, -1.0],
from: (-75f64).to_radians(),
to: 75f64.to_radians(),
};
Ok(sweep_solid_tumbled(&cube, &tumble)?)
}
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
973 ms; CPU time 1.60 s; peak memory 29.9 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
11.0993193908
area
35.1652800761
agrees with
next.BREP
mesh
37845 triangles, closed, 17 degenerate
centre of gravity
(2.9858, 0.0869621, 1.34289) its STEP's solid
inertia
about it, of unit density: Ixx 25.1539; Iyy 8.59028; Izz 19.7499; Ixy 0.0129695; Iyz -4.05229; Izx -0.25343
//! The solid a cube (the box from (2.4, −0.6, 1.4) to (3.6, 0.6, 2.6)) fills as it turns by t/4//! about the upright 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°.//!//! cadrs's sweep of a solid (`SolidMotion::Rigid`, its two turns applied in order at each//! instant).usecrate::bench::{block, p3, v3};
usecrate::Refusal;
use cadrs_kernel::{Axis, BodyId, DefaultKernel, Kernel, RigidStep, SolidMotion};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let cube = block(k, p3(2.4, -0.6, 1.4), p3(3.6, 0.6, 2.6))?;
let t = 75f64.to_radians();
let steps = vec![
RigidStep::Turn { axis: Axis::new(p3(2.0, 0.0, 0.0), v3(0.0, 0.0, 1.0)), from: -t / 4.0, to: t / 4.0 },
RigidStep::Turn { axis: Axis::new(p3(0.0, 0.5, 0.5), v3(1.0, 0.0, 0.0)), from: t, to: -t },
];
Ok(k.sweep_solid(cube, &SolidMotion::Rigid { steps })?.first()?)
}
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.65 s; CPU time 1.65 s; peak memory 17.6 MB
Notes
refused invalid result: the edge through (3.535913, 1.039236, 1.259440) would be used by 1 faces; the edge through (3.566096, 0.868256, 1.341490) would be used by 1 faces; the edge through (3.568023, 0.746733, 1.367453) would be used by 1 faces; the edge through (3.591628, 0.561933, 1.397867) would be used by 1 faces
//! The solid the cube (2.4, −0.6, 1.4)–(3.6, 0.6, 2.6) 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::sweep::solid;
use springrep::topo::Brep;
usecrate::shared::e;
usecrate::shared::swept::{boxed, deg, tumbling};
pubfnbuild() -> Result<Brep, String> {
let cube = boxed([2.4, -0.6, 1.4], [3.6, 0.6, 2.6], "cube")?;
solid(&cube, &tumbling(deg(-75.0), deg(75.0)), "tumble").map_err(e)
}
geomsolver left no solid to show.
Time
48 ms; CPU time 48 ms; peak memory 24.2 MB
Notes
refused error[E080]: `part`: native CAD boundary construction for continuous motion sweeps is not yet supported
// A cube tumbled through space: the box from (2.4, -0.6, 1.4) to (3.6, 0.6, 2.6), its footprint// in the top plane and the prism over it, turned t/4 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 cube as t runs from -75 to 75 degrees, read as the cube turning about A seen from a frame// turning +t about B.unit mm
use std
use std.solids
use std.shapes
use std.motion (turns)
in std.top {
private mid := point
fix((3, 0)) mid
private outline := std.shapes.CenteredRectangle(mid, w: 1.2mm, h: 1.2mm)
}
construction cube := solid(std.solids.Prism(outline.loop, from: 1.4mm, to: 2.6mm))
// 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 (0, 0.5, 0.5) along xprivate q := point
fix((0, 0.5, 0.5)) q
private b := axis
fix(dir == (1, 0, 0)) b
q coincident b
private spin := frame
spin turns(0.25) a
private observer := frame
observer turns(1) b
part := solid({ p | some t in (-75deg, 75deg): p in cube at(under: spin, seen_from: observer) t })
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: 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 cube 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())
}