A rod, the cylinder of radius 5 about the z axis from z = 0 to z = 20, threaded by the flat end of an end mill that points at the rod's axis, carried along a screw.
The mill is a solid cylinder of radius 1.2 whose axis is the x axis, from x = 4 to x = 12: its flat end, the disc of radius 1.2 in the plane x = 4, is 1 inside the rod.
The screw is about the z axis: the tool turns right-handed about it (from +x toward +y) and rises 6 for every whole turn, rigidly. It runs from a turn of −90° (lowered 1.5, the tool wholly below the rod) to a turn of 1350° (raised 22.5, wholly above it). Cut from the rod everything the mill passes through.
The flat end touches along a line across it and its round rim, a sharp circle, carries the contact round to the side: the groove's floor is cut by the end and its walls by the rim and the side.
expected
closed form
volume
1339.548902
no closed form: cad-kernel, next.BREP and cadrs agree to 1e-10; the mean of their values
area
904.7974927
no closed form: cad-kernel, next.BREP and cadrs agree to 1e-9; the mean of their values
Drawing
TopIsometricFrontRight
Third-angle projection, the three views at one scale. Drawn from cadrs'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.03 s; CPU time 5.15 s; peak memory 30 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
1339.54889
1339.548902
9.4e-09
area
904.7974854
904.7974927
8.0e-09
agrees with
kentron, next.BREP, cadrs, geomsolver
mesh
166008 triangles, closed
centre of gravity
(-0.0240841, -0.0417149, 10) its STEP's solid
inertia
about it, of unit density: Ixx 52087; Iyy 52109.2; Izz 14892.9; Ixy 19.2569; Iyz -155.456; Izx 269.257
//! A rod, the cylinder of radius 5 about z from z = 0 to 20, threaded by the flat end of an end//! mill — the cylinder of radius 1.2 about the x axis from x = 4 to 12 — screwed about z,//! right-handed and rising 6 a turn, from a turn of −90° to 1350°.//!//! The kernel's closed sweep (`swept::closed::cut_from`) takes the mill whole: its closed class//! takes under a screw a cylinder only about an axis along the screw's, and a circle only square//! to it, and refuses this mill, which stands square to it (`Unbuilt::Curved`: its side's contact//! and its rims screwed are curved past what the candidates hold); since 0.10.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 rod.use cad_kernel::build::{disc, prism};
use cad_kernel::geom::{tolerance, V};
use cad_kernel::swept::closed::cut_from;
use cad_kernel::topo::Brep;
use cad_kernel::trajectory::{Screw, Trajectory};
constROD_RADIUS: f64 = 5.;
constROD_LENGTH: f64 = 20.;
constEND: V = [4., 0., 0.];
constRADIUS: f64 = 1.2;
constLENGTH: f64 = 8.;
/// How far the screw rises a whole turn, and its start and stop, in degrees.constRISE: f64 = 6.;
constFROM: f64 = -90.;
constTO: f64 = 1350.;
/// How closely the mill is meshed for the sweep's membership reads.constBAR: f64 = 0.002;
pubfnbuild() -> Result<Brep, String> {
let up = [0., 0., 1.];
let rod = prism(&disc([0.; 3], up, ROD_RADIUS), 0., ROD_LENGTH)?;
let mill = prism(&disc(END, [1., 0., 0.], 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 = rod.size().max(mill.size());
cut_from(&rod, &mill, &path, [FROM.to_radians(), TO.to_radians()], BAR, tolerance(size))
.map_err(|why| format!("the mill's sweep not built: {why:?}"))
}
occt left no solid to show.
Time
627 ms; CPU time 626 ms; peak memory 356.6 MB
Notes
refused occt has no sweep of a solid: it carries faces along a screw, and the mill's side touches what it sweeps where tan t = −x/k, a curve winding round the cylinder that is no plane section of it, which occt has no operation to find
"""A rod threaded by an end mill's flat end. A rod, the cylinder of radius 5 about the z axis from
z = 0 to z = 20, threaded by the flat end of an end mill that points at the rod's axis, carried
along a screw.
The mill is a solid cylinder of radius 1.2 whose axis is the x axis, from x = 4 to x = 12: its flat
end, the disc of radius 1.2 in the plane x = 4, is 1 inside the rod.
The screw is about the z axis: the tool turns right-handed about it (from +x toward +y) and rises 6
for every whole turn, rigidly. It runs from a turn of −90° (lowered 1.5, the tool wholly below the
rod) to a turn of 1350° (raised 22.5, wholly above it). Cut from the rod everything the mill passes
through.
The flat end touches along a line across it and its round rim, a sharp circle, carries the contact
round to the side: the groove's floor is cut by the end and its walls by the rim and the side."""from bench importRefuseddefbuild():
# The mill's axis meets the screw's, but the screw also rises. At the point (x, 1.2 cos t,# 1.2 sin t) of its side, the normal (0, cos t, sin t) is square to the velocity# ẑ × p + kẑ where x cos t + k sin t = 0: tan t = −x/k, a curve winding round the cylinder,# no plane section and none of its lines. 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 mill's ""side touches what it sweeps where tan t = −x/k, a curve winding round the ""cylinder that is no plane section 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
78 ms; CPU time 86 ms; peak memory 34.9 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
1339.548902
1339.548902
3.5e-10
area
904.797492
904.7974927
7.6e-10
agrees with
cad-kernel, next.BREP, cadrs, geomsolver
centre of gravity
(-0.0240841, -0.0417149, 10) its STEP's solid
inertia
about it, of unit density: Ixx 52087; Iyy 52109.2; Izz 14892.9; Ixy 19.2569; Iyz -155.456; Izx 269.257
STEP
B-rep advanced faces, each on a surface AUTOMOTIVE_DESIGN
//! A rod, the cylinder of radius 5 about the z axis from z = 0 to z = 20, threaded by the flat end//! of an end mill carried along a screw: the solid cylinder of radius 1.2 about the x axis from//! x = 4 to 12, screwed about the z axis, right-handed, rising 6 a turn, from a turn of −90° to//! +1350°. Everything the mill passes through, cut.//!//! kentron's cut by a motion (`sweep::cut_by_motion`) takes the mill as the solid of revolution of//! its meridian rectangle and the screw as one step: the mill, 2.4 across, is wholly below the rod//! where the screw starts (lowered 1.5) and wholly above it where it ends.usecrate::bench::p;
use kentron::math::{Axis, Direction, Frame, Point2};
use kentron::sweep::{self, Blank, MeridianPiece, Motion, MotionStep, Tool};
use kentron::topology::{Model, Shape};
use std::f64::consts::TAU;
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let rod = Blank::Disc { frame: Frame::WORLD, radius: 5.0, height: 20.0 };
// The meridian in (distance from the x axis, x): the rectangle from the axis out to 1.2,// from x = 4 to 12.let corners = [Point2::new(0.0, 4.0), Point2::new(1.2, 4.0), Point2::new(1.2, 12.0), Point2::new(0.0, 12.0)];
let meridian = (0..4).map(|i| MeridianPiece::Line { from: corners[i], to: corners[(i + 1) % 4] }).collect();
let mill = Tool::Revolved { frame: Frame::new(p(0.0, 0.0, 0.0), Direction::X, Direction::Z), meridian };
// The screw, t its turn in radians: rising 6 a turn.let screw = MotionStep { axis: Axis::new(p(0.0, 0.0, 0.0), Direction::Z), turn: 1.0, advance: 6.0 / TAU };
let motion = Motion { steps: vec![screw], from: (-90f64).to_radians(), to: 1350f64.to_radians() };
sweep::cut_by_motion(m, &rod, &mill, &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.8 ms; CPU time 1.5 ms; peak memory 4.4 MB
Notes
refused no layer (solidcraft-kernel, solidcore-ops, solidcore) has a sweep of a solid or an envelope: the mill's side meets the screw square-on along the space curve x·y = −(6/2π)·z, 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 mill's axis runs across the screw's, so its side, a cylinder about the x axis,//! meets the screw's motion square-on where x·y = −(6/2π)·z: a curve on the side that is no line of//! it and in no plane, and the groove's walls near the rod's surface are what that curve sweeps. So//! no section of the mill 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 mill's side meets the \
screw square-on along the space curve x·y = −(6/2π)·z, 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.8 ms; CPU time 3.6 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 rod threaded by an end mill's flat end.//// 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
216 ms; CPU time 216 ms; peak memory 21.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
1339.548902
1339.548902
1.7e-11
area
904.7974928
904.7974927
7.6e-11
agrees with
cad-kernel, kentron, cadrs, geomsolver
centre of gravity
(-0.0240841, -0.0417149, 10) its STEP's solid
inertia
about it, of unit density: Ixx 52087; Iyy 52109.2; Izz 14892.9; Ixy 19.2569; Iyz -155.456; Izx 269.257
STEP
B-rep advanced faces, each on a surface AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF
//! A rod threaded by the flat end of an end mill carried along a screw about its axis.//!//! The kernel's sweep of a solid (`sweep_solid_within`): the mill is a solid of revolution about//! the x axis, its meridian the rectangle out to radius 1.2 from x = 4 to x = 12, swept by the//! screw about the z axis that rises 6 a turn, from −90° to +1350°. Asked for within 5.2 of the z//! axis from z = −0.2 to 20.2, which holds the rod and which neither end position reaches (lowered//! 1.5, the mill reaches up to z = −0.3); cut from the rod.usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{
boolean_operation_nary, make_cylinder_brep, sweep_clip_less, sweep_solid_within, BooleanOperation, BrepSolid,
OutlinePiece, ScrewStep, SolidMotion, SweepClip, SweptTool,
};
#[allow(unused_imports)]use std::f64::consts::{PI, TAU};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let z = p(0.0, 0.0, 1.0);
let rod = make_cylinder_brep(p(0.0, 0.0, 0.0), z, 5.0, 20.0)?;
let tool = SweptTool::Revolved {
axis_origin: p(4.0, 0.0, 0.0),
axis_direction: p(1.0, 0.0, 0.0),
radial: p(0.0, 0.0, 1.0),
meridian: vec![
OutlinePiece::Line { from: [0.0, 0.0], to: [1.2, 0.0] },
OutlinePiece::Line { from: [1.2, 0.0], to: [1.2, 8.0] },
OutlinePiece::Line { from: [1.2, 8.0], to: [0.0, 8.0] },
OutlinePiece::Line { from: [0.0, 8.0], to: [0.0, 0.0] },
],
};
let screw = SolidMotion {
steps: vec![ScrewStep { axis_origin: p(0.0, 0.0, 0.0), axis_direction: z, turn: 1.0, advance: 6.0 / TAU }],
from: (-90f64).to_radians(),
to: 1350f64.to_radians(),
};
let around_rod = SweepClip {
axis_origin: p(0.0, 0.0, 0.0),
axis_direction: z,
reference: p(1.0, 0.0, 0.0),
radius: [0.0, 5.2],
axial: [-0.2, 20.2],
angle: None,
};
letmut operands = vec![rod];
// The rod less the sweep, built directly where the kernel can (its clip// the rod itself); else the sweep within the larger clip, subtracted.let rod_clip = SweepClip { radius: [0.0, 5.0], axial: [0.0, 20.0], ..around_rod.clone() };
ifletSome(mut bodies) = sweep_clip_less(&tool, &screw, &rod_clip)? {
if bodies.len() == 1 {
returnOk(bodies.remove(0));
}
}
operands.extend(sweep_solid_within(&tool, &screw, &around_rod)?);
Ok(boolean_operation_nary(&operands, 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
272 ms; CPU time 636 ms; peak memory 28 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
1339.548902
1339.548902
3.7e-11
area
904.7974933
904.7974927
6.0e-10
agrees with
cad-kernel, kentron, next.BREP, geomsolver
mesh
201000 triangles, closed
centre of gravity
(-0.0240841, -0.0417149, 10) its STEP's solid
inertia
about it, of unit density: Ixx 52087; Iyy 52109.2; Izz 14892.9; Ixy 19.2569; Iyz -155.456; Izx 269.258
//! A rod (the cylinder of radius 5 about the z axis from z = 0 to z = 20) threaded by the flat end//! of an end mill (a cylinder of radius 1.2 along the x axis from x = 4 to 12) screwed about the z//! axis, rising 6 a turn, from a turn of −90° to 1350°.//!//! What the mill passes through is cadrs's sweep of a solid (a turn and a slide along its axis at//! once: a screw), cut from the rod; of the mill, its part within 5.5 of the axis (the screw maps//! the cylinder about its axis onto itself, so only that part reaches the rod).usecrate::bench::{cut, cylinder, p3, v3};
usecrate::shared::swept::{near_axis, rod, screwed, z_axis};
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let mill = cylinder(k, p3(4.0, 0.0, 0.0), v3(1.0, 0.0, 0.0), 1.2, 8.0)?;
let mill = near_axis(k, mill, 5.5)?;
let swept = screwed(k, mill, z_axis(), 6.0, -90.0, 1350.0)?;
let r = rod(k)?;
cut(k, r, 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.
springrep left no solid to show.
Time
983 ms; CPU time 983 ms; peak memory 22 MB
Notes
refused numerical failure: intersection point did not converge, on the cylinder face 2 of solid 0 of input 0 about (0.0000, -8.0000, -1.5000) and nurbs face 2 of solid 0 of input 1 about (-0.0000, -0.0000, 10.5000)
//! The rod of radius 5 about the z axis from z = 0 to 20 less everything a cylinder of radius//! 1.2 along the x axis from x = 4 to 12 passes through as it is screwed about the z axis,//! rising 6 a turn.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, rod, screwing, v3};
pubfnbuild() -> Result<Brep, String> {
let end = Frame::new(v3(4.0, 0.0, 0.0), Vec3::X, Vec3::Y).map_err(e)?;
let mill = cylinder(&end, 1.2, 8.0, "mill").map_err(e)?;
let swept = solid(&mill, &screwing(6.0, deg(-90.0), deg(1350.0)), "screw").map_err(e)?;
difference(&rod()?, &swept).map_err(e)
}
Time
25.6 s; CPU time 88.3 s; peak memory 95.9 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
1339.548896
1339.548902
5.0e-09
area
904.7974939
904.7974927
1.3e-09
agrees with
cad-kernel, kentron, next.BREP, cadrs
mesh
181164 triangles, closed
centre of gravity
(-0.0240841, -0.0417149, 10) its STEP's solid
inertia
about it, of unit density: Ixx 52087; Iyy 52109.2; Izz 14892.9; Ixy 19.2569; Iyz -155.456; Izx 269.257
// A rod, the cylinder of radius 5 about the z axis from z = 0 to z = 20; an end mill, the cylinder// of radius 1.2 about the x axis from x = 4 to x = 12 (its end disc drawn in the side plane and// carried along x), carried by a screw about the z axis that turns right-handed (from +x toward// +y) and rises 6 a turn, from a turn of -90 degrees to one of 1350, and everything it passes// through cut from the rod.unit mm
use std
use std.solids
use std.solids (cut)
use std.motion (screws)
in std.top {
centreline := point
fix((0, 0)) centreline
skin := circle(center: centreline) hint(r: 5)
radius(5) skin
}
part := solid(std.solids.Prism(face(skin), from: 0mm, to: 20mm))
in std.side {
o := point
fix((0, 0)) o
rim := circle(center: o) hint(r: 1.2)
radius(1.2) rim
}
mill := solid(std.solids.Prism(face(rim), from: 4mm, to: 12mm))
climb := frame
climb screws(6mm) std.z
groove := solid({ p | some t in (-90deg, 1350deg): p in mill at(under: climb) t })
groove cut part
anvilcad left no solid to show.
Time
1.2 ms; CPU time 980 µ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 rod threaded by an end mill's flat end.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())
}