A plate, the box from (−15, −15, 0) to (15, 15, 4), with a hole punched through it by a coil spring pushed aslant wholly through it. The tool is itself a swept solid.
The spring is everything a ball of radius 0.4 passes through as its center runs along the helix of radius 2 about the z axis that starts at (2, 0, −12), turns right-handed (from +x toward +y) and rises 1.5 every turn, for three whole turns, ending at (2, 0, −7.5). Its coils are 1.5 apart and 0.8 thick, so they do not touch, and its ends are half balls.
It slides without turning along the vector (3, 1, 18), from wholly below the plate to wholly above it. Cut from the plate everything the spring passes through.
Every level of the plate loses the spring's shadow along the push, a region bounded by curves the coils' silhouettes draw, whose loops overlap one another.
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
596 ms; CPU time 1.58 s; peak memory 38.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
3541.93797024
area
2353.69272035
agrees with
next.BREP, springrep
mesh
40160 triangles, closed
centre of gravity
(-0.0324725, -0.0109402, 2) its STEP's solid
inertia
about it, of unit density: Ixx 274581; Iyy 274349; Izz 539485; Ixy 92.1251; Iyz 4.30089; Izx 12.9027
//! A plate, the box (−15, −15, 0)–(15, 15, 4), with a hole punched through it by a coil spring slid//! without turning along (3, 1, 18), from wholly below it to wholly above it. The spring is what a//! ball of radius 0.4 fills as its centre runs three right-handed turns of the helix of radius 2//! about z rising 1.5 a turn, from (2, 0, −12) to (2, 0, −7.5).//!//! The spring is the kernel's own sweep of the ball (`build::canal`: its disc screwed along the//! helix, a half ball at each end), and the push the kernel's closed sweep of that solid//! (`swept::closed::cut_from`), which takes the spring whole: under a slide its closed class takes//! faces that are planes, cylinders, cones, balls and tori and refuses the spring's coil, a//! screwed sheet (`Unbuilt::Curved`), and since 0.12.0 such a tool goes the contact's road — the//! coil's contact with the slide, read on its free-form face, and the half balls' carried over the//! roll as sheets that meet where the coil runs on tangent into a ball, given their meetings and//! the end poses, trimmed by membership in the sweep, and the result cut from the plate.usecrate::sketch::block;
use cad_kernel::build::canal;
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::{norm, unit};
use std::f64::consts::TAU;
constPLATE_LO: V = [-15., -15., 0.];
constPLATE_HI: V = [15., 15., 4.];
constWIRE: f64 = 0.4;
constSTART: V = [2., 0., -12.];
/// How far the coil rises a whole turn, and how many turns it makes.constRISE: f64 = 1.5;
constTURNS: f64 = 3.;
constPUSH: V = [3., 1., 18.];
/// How closely the spring is meshed for the sweep's membership reads: a two-hundredth of its/// wire's radius.constBAR: f64 = 0.002;
pubfnbuild() -> Result<Brep, String> {
let plate = block(PLATE_LO, PLATE_HI)?;
let up = [0., 0., 1.];
let spring = canal(START, WIRE, [0.; 3], up, TURNS * TAU, TURNS * RISE, "spring")?;
// the slide along (3, 1, 18): a screw that does not turn, advancing its whole length over a// roll of τlet path = Trajectory::Twist(Screw { origin: START, axis: unit(PUSH), ratio: 0.,
advance: norm(PUSH) });
let size = plate.size().max(spring.size());
cut_from(&plate, &spring, &path, [0., TAU], BAR, tolerance(size))
.map_err(|why| format!("the spring's sweep not built: {why:?}"))
}
occt left no solid to show.
Time
635 ms; CPU time 634 ms; peak memory 356.7 MB
Notes
refused occt has no sweep of a solid: it slides faces, and the spring's pipe surface touches what it sweeps along its silhouette seen along the push, a curve on the B-spline sheet with no closed form, which occt has no operation to find
"""A coil spring pushed aslant through a plate. A plate, the box from (−15, −15, 0) to (15, 15, 4),
with a hole punched through it by a coil spring pushed aslant wholly through it. The tool is itself
a swept solid.
The spring is everything a ball of radius 0.4 passes through as its center runs along the helix of
radius 2 about the z axis that starts at (2, 0, −12), turns right-handed (from +x toward +y) and
rises 1.5 every turn, for three whole turns, ending at (2, 0, −7.5). Its coils are 1.5 apart and
0.8 thick, so they do not touch, and its ends are half balls.
It slides without turning along the vector (3, 1, 18), from wholly below the plate to wholly above
it. Cut from the plate everything the spring passes through.
Every level of the plate loses the spring's shadow along the push, a region bounded by curves the
coils' silhouettes draw, whose loops overlap one another."""from bench importRefuseddefbuild():
# The spring itself OCCT can make, as the pipe of a circle along the helix with a ball at# each end. But pushed aslant, its coils touch what they sweep along the silhouette of the# pipe's surface seen along the push: a curve on that B-spline sheet with no closed form,# where its normal is square to the push. OCCT sweeps no solid, and the sheet slid whole# folds; split along that curve it would not, but OCCT has no operation that draws a# surface's silhouette as a curve on it (HLRBRep projects outlines for drawings), so# finding it would be computing the envelope outside the kernel.raiseRefused("occt has no sweep of a solid: it slides faces, and the spring's pipe surface ""touches what it sweeps along its silhouette seen along the push, a curve on ""the B-spline sheet with no closed form, 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
10.2 s; CPU time 17.3 s; peak memory 967.7 MB
Notes
wrong its STEP's faces do not close into a solid
Data
No measures: it built no solid to measure.
STEP
open advanced faces, each on a surface AUTOMOTIVE_DESIGN
STEP faces
6: 6 plane
STEP edges
54: 42 bspline, 12 line; 42 not bounding exactly two sides of faces, so the shell is open
//!//! The spring is the ball carried along the screw about the z axis, its centre on the helix, and//! the spring is pushed along the slide: each kentron's sweep of a solid (`sweep::solid`, a screw//! and then a slide), cut from the plate.usecrate::bench::{frame, p, v};
use kentron::math::{Axis, Direction};
use kentron::primitives::{Cuboid, Sphere};
use kentron::sweep::{self, RigidMotion};
use kentron::topology::{Model, Shape};
use std::f64::consts::TAU;
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let plate = Cuboid::from_corners(p(-15.0, -15.0, 0.0), p(15.0, 15.0, 4.0)).build(m)?;
let ball = Sphere::new(0.4).with_frame(frame(p(2.0, 0.0, -12.0), Direction::Z)).build(m)?;
let spring = sweep::solid(m, ball, &RigidMotion::Screw { axis: Axis::Z, lead: 1.5, from: 0.0, to: 3.0 * TAU })?;
let swept = sweep::solid(m, spring, &RigidMotion::Slide { by: v(3.0, 1.0, 18.0) })?;
kentron::boolean::difference(m, plate, 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.8 ms; CPU time 1.6 ms; peak memory 4.8 MB
Notes
refused no layer (solidcraft-kernel, solidcore-ops, solidcore) has a sweep of a solid or an envelope: the hole is the spring's shadow along the push, bounded by the silhouettes of its helical coils, which no sweep of a profile makes
//! Refused. The spring is itself a swept solid, a ball's sweep along a helix, and pushed aslant it//! cuts from each level of the plate its shadow along the push: a region bounded by the//! silhouettes of its coils, the curves where the tube's normal is square to the push, whose//! loops overlap. solidcraft-kernel has no sweep of a solid and no envelope; the spring's sweep is//! everything within 0.4 of the helix slid along the push, a ruled sheet grown by a ball, which//! none of its sweeps of a profile makes, and those silhouettes 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 is the spring's shadow \
along the push, bounded by the silhouettes of its helical coils, which no sweep of a \
profile 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
4.1 ms; CPU time 3.8 ms; peak memory 11.7 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 coil spring pushed aslant through a plate.//// 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
893 ms; CPU time 893 ms; peak memory 51.3 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
3541.93797023
area
2353.69272036
agrees with
cad-kernel, springrep
mesh
129896 triangles, closed
centre of gravity
(-0.0324725, -0.0109402, 2) its STEP's solid
inertia
about it, of unit density: Ixx 274581; Iyy 274349; Izz 539485; Ixy 92.1251; Iyz 4.30089; Izx 12.9027
//! A plate with a hole punched through it by a coil spring pushed aslant wholly through it, through//! the kernel's sweep of a tube slid across a slab (`sweep_tube_slid_across`): the spring is the//! ball of radius 0.4 swept along the helix of radius 2 about the z axis from (2, 0, −12), turning//! right-handed and rising 1.5 a turn for three turns (its ends half balls); it slides by//! (3, 1, 18), wholly below the plate to wholly above it, and the plate (z from 0 to 4) loses//! everything the spring passes through.usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{boolean_operation_nary, make_box_brep, sweep_tube_slid_across, BooleanOperation, BrepSolid};
use std::f64::consts::TAU;
pubfnbuild() -> Result<BrepSolid, Refusal> {
let plate = make_box_brep(p(-15.0, -15.0, 0.0), 30.0, 30.0, 4.0)?;
let helix = |s: f64| {
let angle = 3.0 * TAU * s;
p(2.0 * angle.cos(), 2.0 * angle.sin(), -12.0 + 4.5 * s)
};
let hole = sweep_tube_slid_across(&helix, 0.4, p(3.0, 1.0, 18.0), p(0.0, 0.0, 0.0), p(0.0, 0.0, 1.0), [0.0, 4.0])?;
Ok(boolean_operation_nary(&[plate, hole], 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
1.85 s; CPU time 6.30 s; peak memory 33.4 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
3541.93793634
area
2353.69275233
agrees with
no other kernel
mesh
178638 triangles, closed
centre of gravity
(-0.0324725, -0.0109402, 2) its STEP's solid
inertia
about it, of unit density: Ixx 274581; Iyy 274349; Izz 539485; Ixy 92.1252; Iyz 4.30089; Izx 12.9027
//! A plate (the box from (−15, −15, 0) to (15, 15, 4)) with a hole punched through it by a coil//! spring (what a ball of radius 0.4 fills as its centre runs three turns of the helix of radius 2//! about the z axis from (2, 0, −12), rising 1.5 a turn) slid along (3, 1, 18).//!//! The spring is its circular section swept along the helix (cadrs's Sweep) with a ball at each//! end (united); what it passes through is cadrs's sweep of a solid (one slide), cut from the//! plate.usecrate::bench::{ball, block, cut, p3, union_each, v3};
usecrate::shared::sweep::{helix, helix_at, sweep};
usecrate::shared::swept::slid;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, Loop, Plane, Profile};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let plate = block(k, p3(-15.0, -15.0, 0.0), p3(15.0, 15.0, 4.0))?;
let o = p3(0.0, 0.0, -12.0);
let (start, tangent) = helix_at(o, 2.0, 1.5, 0.0, 0.0);
let section = Profile::of(Plane::square_to(start, tangent), vec![Loop::circle([0.0, 0.0], 0.4)]);
let coil = sweep(k, §ion, helix(o, 2.0, 1.5, 0.0, 3.0))?;
let first = ball(k, p3(2.0, 0.0, -12.0), 0.4)?;
let last = ball(k, p3(2.0, 0.0, -7.5), 0.4)?;
let spring = union_each(k, coil, &[first, last])?;
let swept = slid(k, spring, v3(3.0, 1.0, 18.0))?;
cut(k, plate, 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
8.31 s; CPU time 8.30 s; peak memory 16.1 MB
Notes
built A watertight, consistently oriented solid; the case has no settled answer yet to grade it against.
Workaround † no sweep of a whole spring: the spring is swept in six half-turn pieces
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
3541.93797034
area
2353.69272021
agrees with
cad-kernel, next.BREP
mesh
27338 triangles, closed
centre of gravity
(-0.0324725, -0.0109402, 2) its STEP's solid
inertia
about it, of unit density: Ixx 274581; Iyy 274349; Izz 539485; Ixy 92.1251; Iyz 4.30089; Izx 12.9027
//! The plate (−15, −15, 0)–(15, 15, 4) less everything a coil spring (a ball of radius 0.4 swept//! three turns along the helix of radius 2 rising 1.5 a turn) passes through as it slides along//! (3, 1, 18).use std::f64::consts::PI;
use springrep::boolean::difference;
use springrep::primitive::sphere;
use springrep::sweep::{Motion, solid};
use springrep::topo::Brep;
usecrate::shared::e;
usecrate::shared::swept::{boxed, screwing, v3};
pubfnbuild() -> Result<Brep, String> {
let ball = sphere(&crate::shared::at([2.0, 0.0, -12.0]), 0.4, "ball").map_err(e)?;
letmut plate = boxed([-15.0, -15.0, 0.0], [15.0, 15.0, 4.0], "plate")?;
// No sweep of the whole spring: it is swept in six half turns, each of whose shadows along the// push does not overlap itself, and the plate loses what each of them sweeps.for k in0..6 {
let from = PI * k as f64;
let half = solid(&ball, &screwing(1.5, from, from + PI), "coil").map_err(e)?;
let hole = solid(&half, &Motion::Slide(v3(3.0, 1.0, 18.0)), "push").map_err(e)?;
plate = difference(&plate, &hole).map_err(e)?;
}
Ok(plate)
}
geomsolver left no solid to show.
Time
27 ms; CPU time 27 ms; peak memory 12.4 MB
Notes
refused geomsolver sweeps no swept solid. Written as it reads, `spring := solid({ p | some t in (0deg, 1080deg): p in ball at(under: coil) t })` and then `hole := solid({ p | some t in (0deg, 360deg): p in spring at(under: ram) t })`, the document is refused at `hole` (E080: "a continuous sweep cannot be used as a static source; nested continuous sweeps are not yet supported"), so it is neither built nor measured. Solvent has no motion of two rolls (the ball screwed and slid at once) to say it as one sweep of the ball, and the spring's shadow along the push is an envelope an implementation would have to compute itself.
// A plate punched by a coil spring pushed aslant through it: the tool is itself a swept solid (a// ball screwed three turns about the z axis), and the hole is everything that spring passes through// as it slides along (3, 1, 18).//// Refused: geomsolver sweeps no swept solid. Written as it reads, `spring := solid({ p | some t in// (0deg, 1080deg): p in ball at(under: coil) t })` and then `hole := solid({ p | some t in (0deg,// 360deg): p in spring at(under: ram) t })`, the document is refused at `hole` (E080: "a// continuous sweep cannot be used as a static source; nested continuous sweeps are not yet// supported"), so it is neither built nor measured. Solvent has no motion of two rolls (the ball// screwed and slid at once) to say it as one sweep of the ball, and the spring's shadow along the// push is an envelope an implementation would have to compute itself.
anvilcad left no solid to show.
Time
1.2 ms; CPU time 990 µs; peak memory 3.5 MB
Notes
refused anvil-brep has no sweep of a solid and no helical curve: a body screwed along an axis sweeps envelopes of its surfaces under the screw, which it cannot make from its profile sweeps
//! A coil spring pushed aslant through a plate.use anvil_brep::Solid;
pubfnbuild() -> Result<Solid, String> {
Err("anvil-brep has no sweep of a solid and no helical curve: a body screwed along an axis sweeps envelopes of its surfaces under the screw, which it cannot make from its profile sweeps".into())
}