A curved block with a helical groove milled through it by a drum leaning to the screw that carries it.
The block is a sector of a ring about the z axis: everything with distance from the z axis between 8 and 12, with z between −1 and 1, and with polar angle between 0° and 60° (measured from +x toward +y).
The drum is a solid cylinder of radius 0.8 and length 3, its ends flat, whose axis runs through (10, 0, 0), its middle, along the direction (0, sin 25°, cos 25°): leaning 25° from upright toward +y. It stands out above and below the block.
It is carried along a screw about the z axis: it turns right-handed about it (from +x toward +y) and rises 1 for every whole turn, rigidly, from a turn of −140° to one of +140°. It starts clear of the block, passes wholly through it, and ends clear of it. Cut from the block everything the drum passes through.
expected
closed form
volume
50.25001869
no closed form: cad-kernel, next.BREP and cadrs agree to 1e-9; the mean of their values
area
143.6145449
no closed form: cad-kernel, next.BREP and cadrs agree to 7e-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
2.99 s; CPU time 9.51 s; peak memory 25.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
50.25001872
50.25001869
5.8e-10
area
143.6145448
143.6145449
4.4e-10
agrees with
kentron, next.BREP, cadrs, springrep
mesh
2414 triangles, closed
centre of gravity
(8.43993, 4.87275, 4.9883e-05) its STEP's solid
inertia
about it, of unit density: Ixx 388.423; Iyy 208.623; Izz 563.554; Ixy 155.725; Iyz -0.0163045; Izx -0.0127326
//! A ring sector (radii 8 to 12 about z, z from −1 to 1, polar angle 0° to 60°) with a helical//! groove milled through it by a drum — the cylinder of radius 0.8 and length 3 whose middle is//! (10, 0, 0) and whose axis runs along (0, sin 25°, cos 25°) — screwed about z, right-handed and//! rising 1 a turn, from a turn of −140° to +140°.//!//! The kernel's closed sweep (`swept::closed::cut_from`) takes the drum whole: its closed class//! refuses a cylinder about an axis leaning to the screw (`Unbuilt::Curved`), and since 0.9.0 such//! a tool goes the contact's road — the side's contact and each sharp rim's fan carried over the//! roll as sheets, given their meetings and the end poses, trimmed by membership in the sweep, and//! the result cut from the sector.usecrate::sketch::polygon;
use cad_kernel::build::{disc, prism, revolve};
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::{scale, sub};
use std::f64::consts::FRAC_PI_3;
constUP: V = [0., 0., 1.];
constMIDDLE: V = [10., 0., 0.];
constRADIUS: f64 = 0.8;
constLENGTH: f64 = 3.;
/// How far the drum's axis leans from upright toward +y, in degrees.constLEAN: f64 = 25.;
/// How far the screw rises a whole turn.constRISE: f64 = 1.;
/// How far the screw turns each way from where the drum is drawn, in degrees.constTURN: f64 = 140.;
/// How closely the drum is meshed for the sweep's membership reads.constBAR: f64 = 0.002;
/// The ring sector: its section in the half-plane at 0° turned 60° about z.fnsector() -> Result<Brep, String> {
let section = polygon(&[[8., 0., -1.], [12., 0., -1.], [12., 0., 1.], [8., 0., 1.]]);
revolve(§ion, [0.; 3], UP, FRAC_PI_3)
}
pubfnbuild() -> Result<Brep, String> {
let blank = sector()?;
let lean = LEAN.to_radians();
let along = [0., lean.sin(), lean.cos()];
let drum = prism(&disc(sub(MIDDLE, scale(along, LENGTH / 2.)), along, RADIUS), 0., LENGTH)?;
// 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 });
let size = blank.size().max(drum.size());
let turn = TURN.to_radians();
cut_from(&blank, &drum, &path, [-turn, turn], BAR, tolerance(size))
.map_err(|why| format!("the drum's sweep not built: {why:?}"))
}
occt left no solid to show.
Time
611 ms; CPU time 610 ms; peak memory 356.6 MB
Notes
refused occt has no sweep of a solid: it carries faces along a screw, and the leaning drum's side touches what it sweeps along curves that are no plane sections of it, which occt has no operation to find
"""A helical groove milled by a drum leaning to the screw's axis. A curved block with a helical
groove milled through it by a drum leaning to the screw that carries it.
The block is a sector of a ring about the z axis: everything with distance from the z axis between
8 and 12, with z between −1 and 1, and with polar angle between 0° and 60° (measured from +x toward
+y).
The drum is a solid cylinder of radius 0.8 and length 3, its ends flat, whose axis runs through
(10, 0, 0), its middle, along the direction (0, sin 25°, cos 25°): leaning 25° from upright toward
+y. It stands out above and below the block.
It is carried along a screw about the z axis: it turns right-handed about it (from +x toward +y)
and rises 1 for every whole turn, rigidly, from a turn of −140° to one of +140°. It starts clear of
the block, passes wholly through it, and ends clear of it. Cut from the block everything the drum
passes through."""from bench importRefuseddefbuild():
# The drum's axis leans across the screw's and runs past it without meeting it. At the# point of its side at height s along its axis and angle t round it, the normal is square# to the screw's velocity where a relation in s and t holds that is no plane section, no# line and no circle of the cylinder. OCCT sweeps no solid, and a face it carries along the# screw sweeps to a solid only once split along its contact: finding that curve would be# computing the envelope outside the kernel.raiseRefused("occt has no sweep of a solid: it carries faces along a screw, and the ""leaning drum's side touches what it sweeps along curves that are no plane ""sections of it, 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
104 ms; CPU time 129 ms; peak memory 24.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
50.25001868
50.25001869
3.3e-10
area
143.6145449
143.6145449
2.7e-10
agrees with
cad-kernel, next.BREP, cadrs, springrep
mesh
2268 triangles, closed
centre of gravity
(8.43993, 4.87275, 4.98831e-05) its STEP's solid
inertia
about it, of unit density: Ixx 388.423; Iyy 208.623; Izz 563.554; Ixy 155.725; Iyz -0.0163045; Izx -0.0127326
//! A curved block, the sector of the ring about the z axis between radii 8 and 12, z from −1 to 1//! and polar angle from 0° to 60°, with a helical groove milled through it by a drum leaning to//! the screw: the solid cylinder of radius 0.8 and length 3 whose axis runs along//! (0, sin 25°, cos 25°) through its middle (10, 0, 0), carried along the screw about the z axis,//! right-handed, rising 1 a turn, from a turn of −140° to +140°. Everything the drum passes//! through, cut.//!//! The drum's sweep is kentron's sweep of a solid (`sweep::solid`, one screw), cut from the block.usecrate::bench::{frame, p};
usecrate::shared::swept::ring_sector;
use kentron::math::{Axis, Direction, Vector};
use kentron::primitives::Cylinder;
use kentron::sweep::{self, RigidMotion};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let block = ring_sector(m)?;
let lean = 25f64.to_radians();
let axis = Vector::new(0.0, lean.sin(), lean.cos());
let drum = Cylinder::new(0.8, 3.0).with_frame(frame(p(10.0, 0.0, 0.0) - axis * 1.5, Direction::from_vector(axis))).build(m)?;
let screw = RigidMotion::Screw { axis: Axis::new(p(0.0, 0.0, 0.0), Direction::Z), lead: 1.0, from: (-140f64).to_radians(), to: 140f64.to_radians() };
let swept = sweep::solid(m, drum, &screw)?;
kentron::boolean::difference(m, block, 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.4 ms; CPU time 1.2 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 leaning drum's side meets the screw square-on along a space curve, in no plane, so no planar section screwed by either layer's screw sweep (`sweep_helix`, `screw_sweep`) makes the groove's walls
//! Refused. The drum leans 25° to the screw's axis, so its side meets the screw's motion square-on//! along a curve that runs along the drum as it goes round it (the side's line at angle ψ about the//! drum's axis touches at a distance along it proportional to tan ψ), no line of the side and in no//! plane. So no section of the drum screwed by the kernel's helical sweep (`sweep_helix`) carries//! it. solidcraft-kernel has no sweep of a solid and no envelope, and that curve 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 leaning drum's side \
meets the screw square-on along a space curve, in no plane, so no planar section \
screwed by either layer's screw sweep (`sweep_helix`, `screw_sweep`) makes the groove's walls"
.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.2 ms; peak memory 11.6 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 helical groove milled by a drum leaning to the screw's axis.//// 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
964 ms; CPU time 958 ms; peak memory 315 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
50.25001866
50.25001869
7.0e-10
area
143.6145449
143.6145449
2.1e-10
agrees with
cad-kernel, kentron, cadrs, springrep
mesh
8912 triangles, closed
centre of gravity
(8.43993, 4.87275, 4.98832e-05) its STEP's solid
inertia
about it, of unit density: Ixx 388.423; Iyy 208.623; Izz 563.554; Ixy 155.725; Iyz -0.0163045; Izx -0.0127326
//! A ring sector grooved by a drum leaning to the screw that carries it.//!//! Through the kernel's whole sweep of a solid (`sweep_solid`): the drum is a solid of revolution//! about the line through (10, 0, 0) along (0, sin 25°, cos 25°), its meridian the rectangle out to//! radius 0.8 from 1.5 below its middle to 1.5 above, swept by the screw about the z axis that//! rises 1 a turn, from −140° to +140°; cut from the block (the rectangle 8 ≤ x ≤ 12, |z| ≤ 1//! revolved from 0° to 60°).usecrate::solids::swept::{less_all, revolved_tool, turn_about_z, Piece};
usecrate::solids::{p, polygon};
usecrate::Refusal;
use brep_kernel::{revolve_profile_brep, sweep_solid, BrepSolid};
use std::f64::consts::TAU;
pubfnbuild() -> Result<BrepSolid, Refusal> {
let z = p(0.0, 0.0, 1.0);
let section = [p(8.0, 0.0, -1.0), p(12.0, 0.0, -1.0), p(12.0, 0.0, 1.0), p(8.0, 0.0, 1.0)];
let block = revolve_profile_brep(&polygon(§ion)?, p(0.0, 0.0, 0.0), z, 60f64.to_radians())?;
let lean = 25f64.to_radians();
let drum = revolved_tool(p(10.0, 0.0, 0.0), p(0.0, lean.sin(), lean.cos()), p(1.0, 0.0, 0.0), &[
Piece::Line { from: [0.0, -1.5], to: [0.8, -1.5] },
Piece::Line { from: [0.8, -1.5], to: [0.8, 1.5] },
Piece::Line { from: [0.8, 1.5], to: [0.0, 1.5] },
Piece::Line { from: [0.0, 1.5], to: [0.0, -1.5] },
]);
let groove = sweep_solid(&drum, &turn_about_z((-140f64).to_radians(), 140f64.to_radians(), 1.0 / TAU))?;
less_all(block, vec![groove])
}
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
77 ms; CPU time 189 ms; peak memory 13.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
50.2500187
50.25001869
1.6e-10
area
143.6145449
143.6145449
2.3e-10
agrees with
cad-kernel, kentron, next.BREP, springrep
mesh
2052 triangles, closed
centre of gravity
(8.43993, 4.87275, 4.9883e-05) its STEP's solid
inertia
about it, of unit density: Ixx 388.423; Iyy 208.623; Izz 563.554; Ixy 155.725; Iyz -0.0163045; Izx -0.0127326
//! A curved block (the ring sector between radii 8 and 12, heights ±1, polar angles 0° to 60°)//! with a helical groove milled by a drum (radius 0.8, length 3, its axis through its middle//! (10, 0, 0) along (0, sin 25°, cos 25°)) screwed about the z axis, rising 1 a turn, from a turn//! of −140° to +140°.//!//! What the drum passes through is cadrs's sweep of a solid (a turn and a slide along its axis at//! once: a screw), cut from the block (cadrs's cylindrical box).usecrate::bench::{cut, cylinder, p3, v3};
usecrate::shared::swept::{ring_sector, screwed, z_axis};
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let block = ring_sector(k, (8.0, 12.0), (-1.0, 1.0), (0.0, 60.0))?;
let a = 25f64.to_radians();
let dir = v3(0.0, a.sin(), a.cos());
let drum = cylinder(k, p3(10.0, 0.0, 0.0) - dir * 1.5, dir, 0.8, 3.0)?;
let swept = screwed(k, drum, z_axis(), 1.0, -140.0, 140.0)?;
cut(k, block, 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
451 ms; CPU time 446 ms; peak memory 23.2 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
50.25001864
50.25001869
1.1e-09
area
143.6145449
143.6145449
4.1e-11
agrees with
cad-kernel, kentron, next.BREP, cadrs
mesh
3176 triangles, closed
centre of gravity
(8.43993, 4.87275, 4.98831e-05) its STEP's solid
inertia
about it, of unit density: Ixx 388.423; Iyy 208.623; Izz 563.554; Ixy 155.725; Iyz -0.0163045; Izx -0.0127326
//! The ring sector (radii 8 to 12, heights −1 to 1, angles 0° to 60°) less everything a drum//! leaning 25° toward +y about (10, 0, 0) passes through as it is screwed about the z axis,//! rising 1 a turn, from −140° to 140°.use springrep::boolean::difference;
use springrep::math::{Frame, Vec3};
use springrep::primitive::cylinder;
use springrep::sweep::solid;
use springrep::topo::Brep;
usecrate::shared::e;
usecrate::shared::swept::{deg, screwing, sector_block, v3};
pubfnbuild() -> Result<Brep, String> {
let lean = deg(25.0);
let axis = v3(0.0, lean.sin(), lean.cos());
let end = Frame::new(v3(10.0, 0.0, 0.0) - axis * 1.5, axis, Vec3::X).map_err(e)?;
let drum = cylinder(&end, 0.8, 3.0, "drum").map_err(e)?;
let swept = solid(&drum, &screwing(1.0, deg(-140.0), deg(140.0)), "screw").map_err(e)?;
difference(§or_block()?, &swept).map_err(e)
}
geomsolver left no solid to show.
Time
198 ms; CPU time 413 ms; peak memory 37.8 MB
Notes
refused error[E080]: `groove` is outside the constant-twist class (S2: the characteristic reaches the blank in one stretch, one point a ring): the characteristic reaches the blank in more than one stretch (again on `drum.rim`) at (9.2101, 0.0983, 0.9904)
// A curved block, the ring sector between radii 8 and 12 about the z axis, z within 1, polar angle// from 0 to 60 degrees: its section in the front plane (x, z) turned 60 degrees about the z axis. A// drum, the cylinder of radius 0.8 and length 3 whose axis runs through its middle (10, 0, 0) along// (0, sin 25, cos 25), leaning 25 degrees from upright toward +y: its end disc drawn in the plane// through its middle whose u is x and v is y turned -25 degrees about x, carried 1.5 either way// along that plane's normal. It is carried by a screw about the z axis that turns right-handed// (from +x toward +y) and rises 1 a turn, from a turn of -140 degrees to one of +140, and// everything it passes through cut from the block.unit mm
use std
use std.solids
use std.solids (cut)
use std.motion (screws)
in std.front {
a := point
b := point hint((12, -1))
c := point hint((12, 1))
d := point hint((8, 1))
meridian := horizontal line(a, b) -> vertical line(b, c) ->
horizontal line(c, d) -> vertical line(d, a) -> close
fix((8, -1)) a
a distance(4) b
b distance(2) c
}
part := solid(std.solids.Revolution(meridian, about: std.z, to: 60deg))
across := axis hint(dir: (1, 0, 0))
across parallel(sense: same) std.x
along := axis hint(dir: (0, 0.9, -0.42))
along perpendicular std.x
std.y angle(-25deg, about: std.x) along
waist := plane(u: across, v: along)
fix(origin == (10, 0, 0)) waist
in waist {
o := point
fix((0, 0)) o
rim := circle(center: o) hint(r: 0.8)
radius(0.8) rim
}
drum := solid(std.solids.Prism(face(rim), from: -1.5mm, to: 1.5mm))
climb := frame
climb screws(1mm) std.z
groove := solid({ p | some t in (-140deg, 140deg): p in drum at(under: climb) t })
groove cut part
anvilcad left no solid to show.
Time
1.1 ms; CPU time 960 µs; peak memory 3.6 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 helical groove milled by a drum leaning to the screw's 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())
}