The solid a ball fills as its center runs along a helix whose curvature is tighter than the ball, so that the tube about the helix folds through itself.
The ball has radius 2. Its center starts at (1.5, 0, 0) and runs along the helix of radius 1.5 about the z axis that turns right-handed (from +x toward +y) and rises 3 every turn, for two whole turns, ending at (1.5, 0, 6). Make the solid of everything the ball passes through.
The helix's radius of curvature, (1.5² + (3/2π)²)/1.5 ≈ 1.65, is less than the ball's radius, so the envelope of the balls folds: its inner side is cut away by the balls themselves. And the turns, 3 apart, overlap. The solid is everything within 2 of the helix's arc.
expected
closed form
volume
253.4493737
no closed form: cad-kernel and cadrs agree to 5e-10; the mean of their values
area
220.3147393
no closed form: cad-kernel and cadrs agree to 3e-10; the mean of their values
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
6.70 s; CPU time 8.82 s; peak memory 38.5 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.
//! The solid a ball of radius 2 fills as its centre runs two right-handed turns of the helix of//! radius 1.5 about z rising 3 a turn, from (1.5, 0, 0) to (1.5, 0, 6): the ball screwed about z.//! The helix's radius of curvature, about 1.65, is less than the ball's radius, so the tube about//! it folds through itself, and the turns, 3 apart, overlap.//!//! Under a screw the kernel's closed sweep enters a ball's pipe about its centre's helix. One whose//! radius reaches the helix's radius of curvature, where the pipe folds, it refused by name//! (`Unbuilt::Folded`) until 0.14.0, which takes the folded pipe the contact's road: its trim//! keeps of the folded sheet what bounds the sweep.use cad_kernel::build::sphere;
use cad_kernel::geom::{tolerance, V};
use cad_kernel::swept::closed::closed;
use cad_kernel::topo::Brep;
use cad_kernel::trajectory::{Screw, Trajectory};
use std::f64::consts::TAU;
constUP: V = [0., 0., 1.];
constSTART: V = [1.5, 0., 0.];
constRADIUS: f64 = 2.;
/// How far the screw rises a whole turn, and how many turns it makes.constRISE: f64 = 3.;
constTURNS: f64 = 2.;
/// How closely the ball is meshed for the sweep's membership reads: a thousandth of its radius.constBAR: f64 = 0.002;
pubfnbuild() -> Result<Brep, String> {
let ball = sphere(START, UP, RADIUS)?;
// the screw about z: a radian a radian of the roll, rising `RISE` a turnlet path = Trajectory::Twist(Screw { origin: [0.; 3], axis: UP, ratio: 1., advance: RISE });
// the kernel's closed swept solid: the ball's great circle square to its centre's velocity// screwed into the pipe about the centre's helix, a pipe coming back onto itself entered in// stretches// (the sweep's reach: the ball's and its climb)let size = ball.size() + RISE * TURNS;
closed(&ball, &path, [0., TURNS * TAU], BAR, tolerance(size))
.map_err(|why| format!("the ball's sweep not built: {why:?}"))
}
occt left no solid to show.
Time
626 ms; CPU time 625 ms; peak memory 356.8 MB
Notes
refused occt has no sweep of a solid, and the tube it would pipe about the helix folds through itself where the helix turns tighter than the ball (radius 1.65 against 2); occt's Booleans take no self-intersecting solid and it has no operation to trim a sweep where it folds
"""A ball screwed round a helix tighter than itself. The solid a ball fills as its center runs
along a helix whose curvature is tighter than the ball, so that the tube about the helix folds
through itself.
The ball has radius 2. Its center starts at (1.5, 0, 0) and runs along the helix of radius 1.5
about the z axis that turns right-handed (from +x toward +y) and rises 3 every turn, for two whole
turns, ending at (1.5, 0, 6). Make the solid of everything the ball passes through.
The helix's radius of curvature, (1.5² + (3/2π)²)/1.5 ≈ 1.65, is less than the ball's radius, so
the envelope of the balls folds: its inner side is cut away by the balls themselves. And the turns,
3 apart, overlap. The solid is everything within 2 of the helix's arc."""from bench importRefuseddefbuild():
# The ball's sweep is the tube about the helix with a ball at each end, and OCCT makes the# tube as the pipe of a circle along the helix (BRepOffsetAPI_MakePipeShell). But the# helix turns on a radius of about 1.65, less than the ball's 2: the pipe's sheet folds# through itself on the inner side of every turn, and its turns, 3 apart, cross one# another. OCCT's Booleans take no solid whose boundary passes through itself, and it has no# operation that trims a sweep where it folds, nor one that gives everything within a# distance of a curve.raiseRefused("occt has no sweep of a solid, and the tube it would pipe about the helix ""folds through itself where the helix turns tighter than the ball (radius ""1.65 against 2); occt's Booleans take no self-intersecting solid and it has ""no operation to trim a sweep where it folds")
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
18 ms; CPU time 18 ms; peak memory 9.5 MB
Notes
refused operation failed: a sweep folding over itself (2 folds where the motion turns past a sharp edge or characteristic curve of the tool): its sheets meet tangent along the fold, and are not parted
//!//! The ball carried along the screw about the z axis keeps its centre on the helix; its sweep is//! kentron's sweep of a solid (`sweep::solid`, one screw), which refuses it: the helix turns on a//! radius of about 1.65, under the ball's 2, so the sweep folds over itself.usecrate::bench::{frame, p};
use kentron::math::{Axis, Direction};
use kentron::primitives::Sphere;
use kentron::sweep::{self, RigidMotion};
use kentron::topology::{Model, Shape};
use std::f64::consts::TAU;
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let ball = Sphere::new(2.0).with_frame(frame(p(1.5, 0.0, 0.0), Direction::Z)).build(m)?;
sweep::solid(m, ball, &RigidMotion::Screw { axis: Axis::Z, lead: 3.0, from: 0.0, to: 2.0 * TAU })
}
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.6 ms; CPU time 1.4 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 helix turns tighter than the ball, so the screw sweep of the ball's forward-moving great disc runs through itself, and the solid's boundary is that sweep's envelope trimmed where it meets itself
//! Refused. Split by its great disc square to the helix, the ball's back half first reaches a//! point, and its front half leaves one, only through the part of that disc moving forward, where//! 1.5x + (3/2π)² ≥ 0 (a sphere turned about any line moves along itself), so the sweep is the ball//! at its two ends with that part's screw sweep. But the helix turns tighter than the ball, and//! that sweep runs through itself: the disc reaches 3.8 along the axis against a lead of 3, and//! near the axis it passes the same points again within a fraction of a turn, so it is no solid//! the kernel's helical sweep (`sweep_helix`) makes, and the solid's boundary is that sweep's//! envelope trimmed where it meets itself. solidcraft-kernel has no sweep of a solid and no envelope, and that trimmed 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 helix turns tighter than \
the ball, so the screw sweep of the ball's forward-moving great disc runs through itself, \
and the solid's boundary is that sweep's envelope trimmed where it meets itself"
.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.1 ms; peak memory 11.4 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 ball screwed round a helix tighter than itself.//// 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
94 ms; CPU time 93 ms; peak memory 11.8 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no sweep of a solid along a helix tighter than the ball
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
253.4493737
253.4493737
2.7e-10
area
220.3147393
220.3147393
1.5e-10
agrees with
cad-kernel, cadrs
mesh
54944 triangles, closed
centre of gravity
(0.163071, -3.99751e-15, 3) its STEP's solid
inertia
about it, of unit density: Ixx 1927.82; Iyy 1987.76; Izz 1314.49; Ixy -2.91249e-13; Iyz 171.596; Izx 1.01815e-10
//! The solid a ball of radius 2 fills as its centre runs two turns of the helix of radius 1.5 about//! the z axis rising 3 a turn: everything within 2 of the helix's arc.//!//! The helix turns tighter (radius of curvature ρ = (1.5² + p²)/1.5 ≈ 1.652, p = 3/2π) than the//! ball, so the tube about it folds. Elementary geometry instead. Take a point x within 2 of the//! arc and its nearest point c(t) there. Either t is an end (x is in the ball at that end), or x lies//! in the plane square to the helix at c(t) (first order), with (x − c)·N ≤ ρ along the principal//! normal N, toward the axis (second order: 1 − (x − c)·N/ρ ≥ 0). So the solid is the union of the//! discs of radius 2 square to the helix, each cut by the chord (x − c)·N = ρ, and the balls at both//! ends. Cut at h = 1.6 instead, short of ρ, the discs sweep without folding; the points they then//! leave out, 1.6 < (x − c)·N ≤ ρ, lie within 0.45 of the axis (|x − c| ≤ 2 and the plane's tilt), and//! every point within 0.5 of the axis from z = 0 to 6 is within 2 of the arc (the helix's point at//! its height is within 1.5 + 0.5). A cylinder of radius 0.5 there covers them, but for a sliver//! near each end, just past z = 0 and 6, that the cut discs and the balls do not reach: sampled, one//! band point in 400000; built, it moves the volume by 5e-9 and the area by 8e-7 of the solid's.//! Each eighth of the two turns of cut discs is lofted through their exact sections at 33 points of//! it; the eight lofts, the balls and the cylinder are united. Where the kernel's sweep of the ball//! builds the solid itself (its tube and end balls, trimmed where the arc's own distance says), that//! is the answer instead.usecrate::solids::p;
usecrate::solids::swept::{planar, revolved_tool, turn_about_z, Piece};
usecrate::Refusal;
use brep_kernel::{boolean_operation_nary, loft_profile_brep, make_cylinder_brep, make_sphere_brep, sweep_solid, BooleanOperation, BrepSolid, NurbsCurve};
use std::f64::consts::{PI, TAU};
constRADIUS: f64 = 1.5;
constBALL: f64 = 2.0;
constCUT: f64 = 1.6;
pubfnbuild() -> Result<BrepSolid, Refusal> {
// The kernel's sweep of the ball itself, where it builds the screwed ball past its fold (its// tube and end balls, trimmed where the arc's own distance says); the union below otherwise.let ball = revolved_tool(p(RADIUS, 0.0, -BALL), p(0.0, 0.0, 1.0), p(1.0, 0.0, 0.0), &[
Piece::Arc { centre: [0.0, BALL], radius: BALL, start: -PI / 2.0, end: PI / 2.0 },
Piece::Line { from: [0.0, 2.0 * BALL], to: [0.0, 0.0] },
]);
ifletOk(solid) = sweep_solid(&ball, &turn_about_z(0.0, 2.0 * TAU, 3.0 / TAU)) {
returnOk(solid);
}
let rise = 3.0 / TAU;
let speed = (RADIUS * RADIUS + rise * rise).sqrt();
let centre = |t: f64| p(RADIUS * t.cos(), RADIUS * t.sin(), rise * t);
// The chord's ends on the disc, in (along N, along B), and the arc's angle there.let half = (BALL * BALL - CUT * CUT).sqrt();
let corner = half.atan2(CUT);
let section = |t: f64| -> Result<Vec<NurbsCurve>, Refusal> {
let tangent = p(-RADIUS * t.sin(), RADIUS * t.cos(), rise).scale(1.0 / speed);
let normal = p(-t.cos(), -t.sin(), 0.0);
Ok(planar(
&[
Piece::Arc { centre: [0.0, 0.0], radius: BALL, start: corner, end: TAU - corner },
Piece::Line { from: [CUT, -half], to: [CUT, half] },
],
centre(t),
normal,
tangent.cross(normal),
)?)
};
letmut parts = Vec::new();
for k in0..8 {
let sections: Vec<_> = (0..33).map(|i| section(PI / 2.0 * (k as f64 + i as f64 / 32.0))).collect::<Result<_, _>>()?;
parts.push(loft_profile_brep(§ions)?);
}
let up = p(0.0, 0.0, 1.0);
parts.push(make_sphere_brep(centre(0.0), BALL, up)?);
parts.push(make_sphere_brep(centre(2.0 * TAU), BALL, up)?);
parts.push(make_cylinder_brep(p(0.0, 0.0, 0.0), up, 0.5, 6.0)?);
Ok(boolean_operation_nary(&parts, BooleanOperation::Union)?)
}
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
329 ms; CPU time 1.07 s; peak memory 19.7 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
253.4493736
253.4493737
3.0e-10
area
220.3147393
220.3147393
1.7e-10
agrees with
cad-kernel, next.BREP
mesh
83492 triangles, closed, 2 degenerate
centre of gravity
(0.163071, 1.2257e-12, 3) its STEP's solid
inertia
about it, of unit density: Ixx 1927.82; Iyy 1987.76; Izz 1314.49; Ixy -4.55839e-09; Iyz 171.596; Izx 8.15713e-08
//! The solid a ball (radius 2, its centre starting at (1.5, 0, 0)) fills as it is screwed about the//! z axis, rising 3 a turn, for two whole turns: everything within 2 of its centre's helix.//!//! cadrs's sweep of a solid (a turn and a slide along its axis at once: a screw).usecrate::bench::{ball, p3};
usecrate::shared::swept::{screwed, z_axis};
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let b = ball(k, p3(1.5, 0.0, 0.0), 2.0)?;
screwed(k, b, z_axis(), 3.0, 0.0, 720.0)
}
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.5 ms; CPU time 1.3 ms; peak memory 3.6 MB
Notes
refused springrep's sweep of a ball along a helix tighter than the ball makes a face whose loops bound no region of its surface
//! The solid a ball of radius 2 fills as its center runs two turns of the helix of radius 1.5//! about the z axis rising 3 a turn, from (1.5, 0, 0).use springrep::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
// sweep::solid(ball, Motion::Screw) builds it, but the solid it makes has a face whose loops// bound no region of its surface, where the helix turns tighter than the ballErr("springrep's sweep of a ball along a helix tighter than the ball makes a face whose loops bound no region of its surface".into())
}
geomsolver left no solid to show.
Time
45 ms; CPU time 45 ms; peak memory 23.8 MB
Notes
refused error[E080]: `part`: native CAD boundary construction for continuous motion sweeps is not yet supported
// The solid a ball fills as it is screwed round a helix tighter than itself: the ball of radius 2// about (1.5, 0, 0), carried by a screw about the z axis that turns right-handed (from +x toward// +y) and rises 3 a turn, for two whole turns.unit mm
use std
use std.sets
use std.solids
use std.motion (screws)
o := point
fix((1.5, 0, 0)) o
ball := solid(std.sets.Ball(o, r: 2mm))
climb := frame
climb screws(3mm) std.z
part := solid({ p | some t in (0deg, 720deg): p in ball at(under: climb) t })
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 ball screwed round a helix tighter than itself.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())
}