The solid of swept/ball-screwed-round-a-tight-helix, turned rigidly about the origin so that its axis is no longer a coordinate axis. Write u = (2, −2, 1)/3, v = (2, 1, −2)/3 and w = (1, 2, 2)/3: three unit vectors square to one another, right-handed (u × v = w). The point that case puts at (x, y, z) is here at x·u + y·v + z·w.
So: a ball of radius 2 whose center runs along a helix about the line through the origin along w. The center starts at 1.5u = (1, −1, 1/2) and runs along the helix of radius 1.5 about that line that turns right-handed about w (from u toward v) and rises 3 along w every turn, for two whole turns, ending at 1.5u + 6w = (3, 3, 9/2). 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: swept/ball-screwed-round-a-tight-helix's answer (the mean of cad-kernel's and cadrs's values, which agree to 5e-10), the solid being that one turned rigidly
area
220.3147393
no closed form: swept/ball-screwed-round-a-tight-helix's answer (the mean of cad-kernel's and cadrs's values, which agree to 3e-10), the solid being that one turned rigidly
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
7.76 s; CPU time 12.1 s; peak memory 40.3 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.4493712
253.4493737
9.9e-09
area
220.3147377
220.3147393
7.1e-09
agrees with
cadrs
mesh
64362 triangles, closed, 12 degenerate
centre of gravity
(1.10871, 1.89129, 2.05436) its STEP's solid
inertia
about it, of unit density: Ixx 1962.58; Iyy 1738.15; Izz 1529.34; Ixy -27.644; Iyz -324.045; Izx -124.805
//! The solid of `swept/ball-screwed-round-a-tight-helix` turned rigidly so that its axis is//! w = (1, 2, 2)/3: a ball of radius 2 whose centre runs from 1.5u, u = (2, −2, 1)/3, along the helix//! of radius 1.5 about w, rising 3 a turn, for two turns.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 cad_kernel::util::space::scale;
use std::f64::consts::TAU;
/// The turned frame: u where the case before it had x, w where it had z.constU: V = [2. / 3., -2. / 3., 1. / 3.];
constW: V = [1. / 3., 2. / 3., 2. / 3.];
constRADIUS: f64 = 2.;
/// How far the helix stands from its axis, how far the screw rises a whole turn, and how many/// turns it makes.constHELIX_RADIUS: f64 = 1.5;
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(scale(U, HELIX_RADIUS), W, RADIUS)?;
// the screw about w: a radian a radian of the roll, rising `RISE` a turnlet path = Trajectory::Twist(Screw { origin: [0.; 3], axis: W, ratio: 1., advance: RISE });
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
623 ms; CPU time 622 ms; peak memory 356.5 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, about a tilted axis. The solid of
swept/ball-screwed-round-a-tight-helix, turned rigidly about the origin so that its axis is
w = (1, 2, 2)/3: a ball of radius 2 whose center runs along the helix of radius 1.5 about the line
through the origin along w, from 1.5u = (1, −1, 1/2), turning right-handed about w (from u toward
v) and rising 3 along w every turn, for two whole turns, where u = (2, −2, 1)/3 and
v = (2, 1, −2)/3. Make the solid of everything the ball passes through.
The helix's radius of curvature, about 1.65, is less than the ball's radius, so the envelope of
the balls folds, and the turns, 3 apart, overlap."""from bench importRefuseddefbuild():
# As for swept/ball-screwed-round-a-tight-helix, of which this is a rigid motion: the ball's# sweep is the tube about the helix with a ball at each end, but the pipe of a circle along# the helix (BRepOffsetAPI_MakePipeShell) folds through itself where the helix turns tighter# than the ball, and its turns 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. Turning the axis changes none# of that.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
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
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.6 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, as `swept/ball-screwed-round-a-tight-helix` is: turning the solid rigidly so that the//! helix's axis is (1, 2, 2)/3 changes nothing of why. 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. 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
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
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
96 ms; CPU time 96 ms; peak memory 12.3 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.4493737
253.4493737
2.7e-10
area
220.3147393
220.3147393
1.5e-10
agrees with
cadrs
mesh
59232 triangles, closed
centre of gravity
(1.10871, 1.89129, 2.05436) its STEP's solid
inertia
about it, of unit density: Ixx 1962.58; Iyy 1738.15; Izz 1529.34; Ixy -27.644; Iyz -324.045; Izx -124.805
//! `swept/ball-screwed-round-a-tight-helix` turned rigidly so that its axis runs along//! w = (1, 2, 2)/3, with u = (2, −2, 1)/3 and v = (2, 1, −2)/3: the solid a ball of radius 2 fills//! as its centre runs two turns of the helix of radius 1.5 about the line through the origin along//! w, from 1.5u, rising 3 a turn. Built as the original is (see it for the argument), every point//! and direction it places at (x, y, z) placed at x·u + y·v + z·w: the kernel's sweep of the ball//! by the screw about w where it builds it; else the cut discs lofted by eighths, the end balls and//! the cylinder of radius 0.5 about the axis from the origin to 6w, united.usecrate::solids::p;
usecrate::solids::swept::{planar, revolved_tool, Piece};
usecrate::Refusal;
use brep_kernel::{boolean_operation_nary, loft_profile_brep, make_cylinder_brep, make_sphere_brep, sweep_solid, BooleanOperation, BrepSolid, NurbsCurve, ScrewStep, SolidMotion, Vec3};
use std::f64::consts::{PI, TAU};
constRADIUS: f64 = 1.5;
constBALL: f64 = 2.0;
constCUT: f64 = 1.6;
/// The point the upright case puts at (x, y, z), here at x·u + y·v + z·w.fnat(x: f64, y: f64, z: f64) -> Vec3 {
let (u, v, w) = (p(2.0, -2.0, 1.0).scale(1.0 / 3.0), p(2.0, 1.0, -2.0).scale(1.0 / 3.0),
p(1.0, 2.0, 2.0).scale(1.0 / 3.0));
u.scale(x).add(v.scale(y)).add(w.scale(z))
}
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(at(RADIUS, 0.0, -BALL), at(0.0, 0.0, 1.0), at(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] },
]);
// the screw about the line through the origin along w, rising 3 a turnlet screw = SolidMotion {
steps: vec![ScrewStep { axis_origin: p(0.0, 0.0, 0.0), axis_direction: at(0.0, 0.0, 1.0), turn: 1.0, advance: 3.0 / TAU }],
from: 0.0,
to: 2.0 * TAU,
};
ifletOk(solid) = sweep_solid(&ball, &screw) {
returnOk(solid);
}
let rise = 3.0 / TAU;
let speed = (RADIUS * RADIUS + rise * rise).sqrt();
let centre = |t: f64| at(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 = at(-RADIUS * t.sin(), RADIUS * t.cos(), rise).scale(1.0 / speed);
let normal = at(-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 = at(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
336 ms; CPU time 1.13 s; peak memory 19.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.
Data
its STEP's
expected
rel. error
volume
253.4493736
253.4493737
3.1e-10
area
220.3147393
220.3147393
1.8e-10
agrees with
cad-kernel, next.BREP
mesh
72470 triangles, closed, 2 degenerate
centre of gravity
(1.10871, 1.89129, 2.05436) its STEP's solid
inertia
about it, of unit density: Ixx 1962.58; Iyy 1738.15; Izz 1529.34; Ixy -27.644; Iyz -324.045; Izx -124.805
//! `swept/ball-screwed-round-a-tight-helix` turned rigidly so that its axis runs along//! w = (1, 2, 2)/3, with u = (2, −2, 1)/3 and v = (2, 1, −2)/3: the solid a ball of radius 2,//! its centre starting at 1.5u = (1, −1, 1/2), fills as it is screwed about the line through the//! origin along w, rising 3 a turn, for two whole turns.//!//! cadrs's sweep of a solid (a turn about the axis and a slide along it at once: a screw).usecrate::bench::{ball, p3, v3};
usecrate::shared::swept::screwed;
usecrate::Refusal;
use cadrs_kernel::{Axis, BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let w = v3(1.0, 2.0, 2.0) / 3.0;
let b = ball(k, p3(1.0, -1.0, 0.5), 2.0)?;
screwed(k, b, Axis::new(p3(0.0, 0.0, 0.0), w), 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.1 ms; CPU time 950 µs; peak memory 3.5 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
//! A variant of `swept/ball-screwed-round-a-tight-helix` (scaled or rigidly turned; see the case)://! the solid a ball fills as its center runs two turns of a helix tighter than the ball. Refused//! for the original's reason.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
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
anvilcad left no solid to show.
Time
1.2 ms; CPU time 970 µ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, about a tilted axis.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())
}