A rod, the cylinder of radius 5 about the z axis from z = 0 to z = 20, with a helical groove ground around it by a wheel carried along a screw, as a thread is ground.
The wheel is a torus: the circle through its tube's centers has radius 6, and its tube has radius 2. As placed, its center is (11.5, 0, 0), so the part of its tube nearest the rod is centered at (5.5, 0, 0) and reaches 1.5 into the rod. Its axis passes through its center square to the x axis, leaning from the y axis down toward −z by the helix angle h = atan(2π·5.5 / 30) ≈ 49.04°: the axis's direction is (0, cos h, −sin h). The wheel then lies along the helix that the screw below carries the point (5.5, 0, 0) along, as a grinding wheel is set.
The screw is about the z axis: the wheel turns right-handed about it (from +x toward +y) and rises 30 for every whole turn, rigidly. It runs from a turn of −108° (the wheel lowered 9, wholly below the rod) to a turn of +348° (raised 29, wholly above it). Cut from the rod everything the wheel passes through.
The groove's section square to the axis is the same at every height, turned.
expected
closed form
volume
1460.630003
no closed form: cad-kernel, next.BREP and cadrs agree to 7e-10; the mean of their values
area
791.5632226
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 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
1.45 s; CPU time 3.34 s; peak memory 20.4 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
1460.630002
1460.630003
6.8e-10
area
791.5632221
791.5632226
5.6e-10
agrees with
kentron, next.BREP, cadrs, springrep
mesh
8706 triangles, closed
centre of gravity
(0.0660622, -0.114423, 10) its STEP's solid
inertia
about it, of unit density: Ixx 57504.7; Iyy 57328.1; Izz 17457.4; Ixy 152.94; Iyz -1017.82; Izx -1762.91
//! A rod, the cylinder of radius 5 about z from z = 0 to 20, with a helical groove ground round it//! by a torus of radii 6 and 2, centred at (11.5, 0, 0) with its axis (0, cos h, −sin h), h =//! atan(2π·5.5 / 30), screwed about z — rising 30 a turn — from a turn of −108° to +348°.//!//! The kernel's closed sweep (`swept::closed::cut_from`) takes the torus whole: its closed class//! refuses a torus under a screw (`Unbuilt::Curved`), and since 0.9.0 such a tool goes the//! contact's road — the torus's contact with the screw carried over the roll as sheets, given their//! meetings with one another and with the end poses, trimmed by membership in the sweep, and the//! result cut from the rod. No envelope is computed here.use cad_kernel::build::{disc, prism, torus};
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 std::f64::consts::TAU;
constUP: V = [0., 0., 1.];
/// How far the screw rises a whole turn.constRISE: f64 = 30.;
/// How far the screw turns from where the wheel is drawn, in degrees: down to, and up to.constTURNS: [f64; 2] = [-108., 348.];
/// How closely the wheel is meshed for the sweep's membership reads.constBAR: f64 = 0.01;
pubfnbuild() -> Result<Brep, String> {
let rod = prism(&disc([0.; 3], UP, 5.), 0., 20.)?;
// the wheel set along the helix the screw carries (5.5, 0, 0) alonglet h = (TAU * 5.5 / RISE).atan();
let wheel = torus([11.5, 0., 0.], [0., h.cos(), -h.sin()], 6., 2.)?;
// 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(wheel.size());
cut_from(&rod, &wheel, &path, TURNS.map(f64::to_radians), BAR, tolerance(size))
.map_err(|why| format!("the wheel's sweep not built: {why:?}"))
}
occt left no solid to show.
Time
638 ms; CPU time 637 ms; peak memory 356.5 MB
Notes
refused occt has no sweep of a solid along a screw motion: BRepOffsetAPI_MakePipe along a helix takes no solid and stops on the torus's face (BRepFill_Sweep::BuildEdge), and the groove's wall is the envelope of the screwed torus, along a characteristic curve that is none of its circles, which occt has no operation to find
"""A rod grooved by a wheel screwed along it. A rod, the cylinder of radius 5 about the z axis from
z = 0 to z = 20, with a helical groove ground round it by a wheel carried along a screw, as a
thread is ground.
The wheel is a torus: the circle through its tube's centres has radius 6, and its tube has radius
2. As placed, its centre is (11.5, 0, 0), so the part of its tube nearest the rod is centred at
(5.5, 0, 0) and reaches 1.5 into the rod. Its axis passes through its centre square to the x
axis, leaning from the y axis down towards −z by the helix angle h = atan(2π·5.5 / 30) ≈ 49.04°:
the axis's direction is (0, cos h, −sin h). The wheel then lies along the helix that the screw
below carries the point (5.5, 0, 0) along, as a grinding wheel is set.
The screw is about the z axis: the wheel turns right-handed about it (from +x towards +y) and
rises 30 for every whole turn, rigidly. It runs from a turn of −108° (the wheel lowered 9, wholly
below the rod) to a turn of +348° (raised 29, wholly above it). Cut from the rod everything the
wheel passes through.
The groove's section square to the axis is the same at every height, turned."""from bench importRefuseddefbuild():
# OCCT's one sweep that follows a screw is a pipe along a helix under the Frenet law# (BRepOffsetAPI_MakePipe, GeomFill_IsFrenet). It takes no solid ("BRepFill_Pipe::profile# contains solids"), and given the wheel's shell it stops on the torus's face# (Standard_ConstructionError, "BRepFill_Sweep::BuildEdge"). Nor would sweeping the faces# whole be enough: a face sweeps to what it passes through only once it is split where the# motion runs along it, and on a torus screwed about an axis it does not share that is the# characteristic curve, none of the torus's circles. The groove's wall is the envelope that# curve sweeps out, and finding it would be computing the envelope outside the kernel.raiseRefused("occt has no sweep of a solid along a screw motion: BRepOffsetAPI_MakePipe ""along a helix takes no solid and stops on the torus's face ""(BRepFill_Sweep::BuildEdge), and the groove's wall is the envelope of the ""screwed torus, along a characteristic curve that is none of its circles, ""which occt has no operation to find")
arris left no solid to show.
Time
1.2 ms; CPU time 1 ms; peak memory 3.7 MB
Notes
refused arris has no sweep of a solid along a screw motion; the groove's wall is the envelope of the screwed torus, which it cannot build
//! A rod, the cylinder of radius 5 about the z axis from z = 0 to z = 20, with a helical groove//! ground round it by a torus (radii 6 and 2, centred at (11.5, 0, 0), its axis leaning by the//! helix angle) carried along a screw about the z axis that rises 30 a turn, from −108° to +348°.//!//! Refused: arris has no sweep of a solid, and none along a screw motion. The groove's wall is the//! envelope of the screwed torus, the curve on it where the screw's velocity is tangent to it//! swept along the screw; its section is none of the torus's own circles, and arris has no//! operation that builds it. Building it would mean computing that characteristic curve outside//! the kernel and fitting a surface to it.usecrate::Refusal;
use arris::topo::{Body, Model};
pubfnbuild(_: &mutModel) -> Result<Body, Refusal> {
Err("arris has no sweep of a solid along a screw motion; the groove's wall is the envelope of \
the screwed torus, which it cannot build"
.into())
}
Time
24 ms; CPU time 24 ms; peak memory 13.4 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
1460.630003
1460.630003
3.4e-10
area
791.5632229
791.5632226
3.9e-10
agrees with
cad-kernel, next.BREP, cadrs, springrep
mesh
58452 triangles, closed
centre of gravity
(0.0660622, -0.114423, 10) its STEP's solid
inertia
about it, of unit density: Ixx 57504.7; Iyy 57328.1; Izz 17457.4; Ixy 152.94; Iyz -1017.82; Izx -1762.91
//! A rod, the cylinder of radius 5 about the z axis from z = 0 to z = 20, with a helical groove//! ground by a wheel carried along a screw. The wheel: a torus, radii 6 and 2, centred at//! (11.5, 0, 0), its axis (0, cos h, −sin h) with h = atan(2π·5.5 / 30). The screw: about the z//! axis, right-handed, rising 30 a turn, from a turn of −108° to +348°. Everything the wheel//! passes through, cut.//!//! kentron's cut by a motion (`sweep::cut_by_motion`) takes the wheel as the solid of revolution//! of its tube's circle and the screw as one step. The wheel starts wholly below the rod and ends//! wholly above it, so within the rod what it fills is screwed into itself: the groove's section//! square to the axis is the plane region the wheel's characteristic curve (where the screw runs//! along it) projects to along the helices, the whole of the tube's circle on the rod's side//! among it (set along the helix there, the wheel's surface runs along the screw all round it).//! The rod's section less that is screwed up the rod.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 };
let h = (TAU * 5.5 / 30.0).atan();
let frame = Frame::new(p(11.5, 0.0, 0.0), Direction::new(0.0, h.cos(), -h.sin()), Direction::X);
let wheel = Tool::Revolved { frame, meridian: vec![MeridianPiece::Arc { centre: Point2::new(6.0, 0.0), radius: 2.0, start: 0.0, end: TAU }] };
// The screw, t its turn in radians: rising 30 a turn.let screw = MotionStep { axis: Axis::new(p(0.0, 0.0, 0.0), Direction::Z), turn: 1.0, advance: 30.0 / TAU };
let motion = Motion { steps: vec![screw], from: (-108f64).to_radians(), to: 348f64.to_radians() };
sweep::cut_by_motion(m, &rod, &wheel, &motion)
}
vcad left no solid to show.
Time
1 ms; CPU time 900 µs; peak memory 4.7 MB
Notes
refused vcad has no sweep of a solid along a screw motion; the groove's wall is the envelope of the screwed torus, whose section is none of the torus's circles and would have to be computed outside the kernel
//! A rod, the cylinder of radius 5 about the z axis from z = 0 to z = 20, with a helical groove//! ground round it by a torus (radii 6 and 2, centred at (11.5, 0, 0), its axis leaning by the//! helix angle) carried along a screw about the z axis that rises 30 a turn, from −108° to +348°.//!//! Refused: vcad has no sweep of a solid, and none along a screw motion (`Solid::sweep` moves a//! sketch profile along a curve, a `Helix` among them). The groove's wall is the envelope of the//! screwed torus, the curve on it where the screw's velocity is tangent to it swept along the//! screw; its section is none of the torus's own circles, so no profile vcad could sweep along the//! helix is known without computing that characteristic curve outside the kernel.use vcad_kernel::Solid;
pubfnbuild() -> Result<Solid, crate::Refusal> {
Err("vcad has no sweep of a solid along a screw motion; the groove's wall is the envelope of \
the screwed torus, whose section is none of the torus's circles and would have to be \
computed outside the kernel"
.into())
}
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: no layer's screw sweep (`sweep_helix`, `screw_sweep`) does more than screw a planar profile, but the groove's section is the envelope of the leaning torus over the screw, which is no plane section of it
//! Refused. The groove is what a torus, set at the helix angle, passes through as it is screwed//! along the rod. The kernel's helical sweep (`sweep_helix`) carries a planar profile along a//! screw, but no plane section of the torus is the groove's section: the groove's wall is the//! envelope of the torus over the screw, touching it along a curve that is none of its circles.//! solidcraft-kernel has no sweep of a solid and no envelope, and that section 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: no layer's screw sweep (`sweep_helix`, `screw_sweep`) does more than screw a planar \
profile, but the groove's section is the envelope of the leaning torus over the screw, \
which is no plane section of it"
.into())
}
brepkit left no solid to show.
Time
1.1 ms; CPU time 900 µs; peak memory 3.7 MB
Notes
refused brepkit has no sweep of a solid (its helical sweep carries a flat face), and the groove the torus screws is bounded by its envelope, which brepkit cannot compute
//! A rod grooved by a torus carried along a screw. brepkit has no sweep of a solid: its helical//! sweep carries a flat profile face along a helix. The groove's wall is the envelope of the//! leaning torus over the screw motion, none of the torus's own circles, which brepkit has no//! operation to compute.use brepkit_topology::solid::SolidId;
use brepkit_topology::Topology;
usecrate::Refusal;
pubfnbuild(_topo: &mutTopology) -> Result<SolidId, Refusal> {
Err(
"brepkit has no sweep of a solid (its helical sweep carries a flat face), and the groove \
the torus screws is bounded by its envelope, which brepkit cannot compute"
.into(),
)
}
popkern left no solid to show.
Time
3.9 ms; CPU time 3.7 ms; peak memory 11.3 MB
Notes
refused popkern has no sweep of a solid, and this sweep's wall is an envelope: the groove's wall is the envelope of the torus along the screw, which no circle of the torus traces
// A rod grooved by a torus carried along a screw about the rod's axis.//// Refused: popkern has no sweep of a solid (its sweeps carry a profile along a path), and this// one's shape does not follow from its other operations by elementary geometry: the groove's wall// is the envelope of the torus along the screw, which no circle of the torus traces. A wall the// script would compute itself, fitting curves to where the tool touches its own sweep, is geometry// made outside the kernel.throw"popkern has no sweep of a solid, and this sweep's wall is an envelope: the groove's wall \
is the envelope of the torus along the screw, which no circle of the torus traces";
aetheris left no solid to show.
Time
53 ms; CPU time 53 ms; peak memory 47.4 MB
Notes
refused Aetheris has no sweep of a solid and no general subtraction, and this sweep's wall is an envelope: the wheel leans to the screw's axis, so its groove's wall is none of the torus's own circles. Its Thread cuts only the metric 60° profile.
// A rod with a helical groove ground by a torus carried along a screw.//// Refused: Aetheris has no sweep of a solid and no general subtraction, and this sweep's wall is// an envelope: the wheel leans to the screw's axis, so its groove's wall is none of the torus's// own circles. Its Thread cuts only the metric 60° profile.
Time
179 ms; CPU time 179 ms; peak memory 12.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
1460.630003
1460.630003
4.4e-10
area
791.5632229
791.5632226
4.3e-10
agrees with
cad-kernel, kentron, cadrs, springrep
mesh
93514 triangles, closed
centre of gravity
(0.0660622, -0.114423, 10) its STEP's solid
inertia
about it, of unit density: Ixx 57504.7; Iyy 57328.1; Izz 17457.4; Ixy 152.94; Iyz -1017.82; Izx -1762.91
//! A rod grooved by a torus wheel carried along a screw about its axis, as a thread is ground.//!//! The kernel's sweep of a solid (`sweep_solid_within`): the wheel is a solid of revolution (its//! meridian the tube's circle, radius 2 at 6 from its axis), swept by the screw about the z axis//! that rises 30 a turn, from a turn of −108° to +348°. Asked for inside the rod's cylinder of//! radius 5.5 from z = −1 to 21, where neither end position reaches; 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,
};
use std::f64::consts::TAU;
pubfnbuild() -> Result<BrepSolid, Refusal> {
let rod = make_cylinder_brep(p(0.0, 0.0, 0.0), p(0.0, 0.0, 1.0), 5.0, 20.0)?;
let h = (TAU * 5.5 / 30.0).atan();
let wheel = SweptTool::Revolved {
axis_origin: p(11.5, 0.0, 0.0),
axis_direction: p(0.0, h.cos(), -h.sin()),
radial: p(-1.0, 0.0, 0.0),
meridian: vec![OutlinePiece::Arc { centre: [6.0, 0.0], radius: 2.0, start: 0.0, end: TAU }],
};
let screw = SolidMotion {
steps: vec![ScrewStep {
axis_origin: p(0.0, 0.0, 0.0),
axis_direction: p(0.0, 0.0, 1.0),
turn: 1.0,
advance: 30.0 / TAU,
}],
from: (-108.0f64).to_radians(),
to: 348.0f64.to_radians(),
};
let around_rod = SweepClip {
axis_origin: p(0.0, 0.0, 0.0),
axis_direction: p(0.0, 0.0, 1.0),
reference: p(1.0, 0.0, 0.0),
radius: [0.0, 5.5],
axial: [-1.0, 21.0],
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(&wheel, &screw, &rod_clip)? {
if bodies.len() == 1 {
returnOk(bodies.remove(0));
}
}
operands.extend(sweep_solid_within(&wheel, &screw, &around_rod)?);
Ok(boolean_operation_nary(&operands, BooleanOperation::Subtract)?)
}
geop left no solid to show.
Time
1.9 ms; CPU time 1.7 ms; peak memory 9.3 MB
Notes
refused geop has no sweep of a solid: what a torus screwed along the rod passes through is bounded by the envelope of its surface, which geop cannot build
//! A rod grooved by a torus carried along a screw about the z axis, its axis leaning by the helix//! angle, as a thread is ground.//!//! geop sweeps a profile along a path; it has no sweep of a solid, and what the torus passes//! through is bounded by the envelope of its surface along the screw — a surface of no simpler//! kind, which would have to be computed here, outside geop.usecrate::{Bench, Refusal};
pubfnbuild(_: &mutBench) -> Result<(), Refusal> {
Err("geop has no sweep of a solid: what a torus screwed along the rod passes through is \
bounded by the envelope of its surface, which geop cannot build"
.into())
}
Time
29 ms; CPU time 34 ms; peak memory 9.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
1460.630003
1460.630003
1.4e-10
area
791.5632229
791.5632226
3.9e-10
agrees with
cad-kernel, kentron, next.BREP, springrep
mesh
8740 triangles, closed
centre of gravity
(0.0660622, -0.114423, 10) its STEP's solid
inertia
about it, of unit density: Ixx 57504.7; Iyy 57328.1; Izz 17457.4; Ixy 152.94; Iyz -1017.82; Izx -1762.91
//! A rod, the cylinder of radius 5 about the z axis from z = 0 to z = 20, with a helical groove//! ground by a torus (radii 6 and 2, centered (11.5, 0, 0), its axis leaning by the helix angle)//! carried along the screw about the z axis that rises 30 a turn, from a turn of −108° to +348°.//!//! The wheel is cadrs's torus primitive; its screw is cadrs's sweep of a solid over part of a//! screw (`Kernel::cut_swept`: turned about the z axis from −108° to +348° while rising 30 a//! turn), cut from the rod.usecrate::bench::{p3, torus, v3};
usecrate::shared::swept::{cut_swept, rod, screw, z_axis};
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let h = (std::f64::consts::TAU * 5.5 / 30.0).atan();
let wheel = torus(k, p3(11.5, 0.0, 0.0), v3(0.0, h.cos(), -h.sin()), 6.0, 2.0)?;
let r = rod(k)?;
cut_swept(k, r, wheel, &screw(z_axis(), 30.0, -108.0, 348.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.
Time
451 ms; CPU time 451 ms; peak memory 33.9 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no sweep of a whole tool: the tool is cut to the rod's reach before the sweep
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
1460.630003
1460.630003
5.9e-10
area
791.5632231
791.5632226
6.5e-10
agrees with
cad-kernel, kentron, next.BREP, cadrs
mesh
8282 triangles, closed
centre of gravity
(0.0660622, -0.114423, 10) its STEP's solid
inertia
about it, of unit density: Ixx 57504.7; Iyy 57328.1; Izz 17457.4; Ixy 152.94; Iyz -1017.82; Izx -1762.91
//! The rod of radius 5 about the z axis from z = 0 to 20 less everything a torus wheel (radii 6//! and 2 about (11.5, 0, 0), leaning 49.04°) passes through as it is screwed about the z axis,//! rising 30 a turn.use std::f64::consts::PI;
use springrep::boolean::difference;
use springrep::math::{Frame, Vec3};
use springrep::primitive::torus;
use springrep::sweep::solid;
use springrep::topo::Brep;
usecrate::shared::e;
usecrate::shared::swept::{deg, rod, screwing, v3, within};
pubfnbuild() -> Result<Brep, String> {
let h = (2.0 * PI * 5.5 / 30.0).atan();
let axis = Frame::new(v3(11.5, 0.0, 0.0), v3(0.0, h.cos(), -h.sin()), Vec3::X).map_err(e)?;
let wheel = torus(&axis, 6.0, 2.0, "wheel").map_err(e)?;
// No sweep of the whole tool: a screw keeps each point's distance from the z axis, so only the// tool within 5.5 of it reaches the rod, and only that part is swept.let rim = within(&wheel, 5.5)?;
let swept = solid(&rim, &screwing(30.0, deg(-108.0), deg(348.0)), "screw").map_err(e)?;
difference(&rod()?, &swept).map_err(e)
}
Time
260 ms; CPU time 347 ms; peak memory 32.1 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
1460.629615
1460.630003
2.7e-07
area
791.562841
791.5632226
4.8e-07
agrees with
no other kernel
mesh
9972 triangles, closed
centre of gravity
(0.0660625, -0.114424, 10) its STEP's solid
inertia
about it, of unit density: Ixx 57504.6; Iyy 57328; Izz 17457.4; Ixy 152.941; Iyz -1017.82; Izx -1762.92
// A rod grooved by a wheel screwed along it, as a thread is ground. The rod is the cylinder of// radius 5 about z from z = 0 to 20. The wheel is a torus centred at (11.5, 0, 0), its tube// (radius 2) 6 from its axis, which leans from y down toward -z by the helix angle// h = atan(2 pi 5.5 / 30): the tube's circle drawn in the plane through that axis and x, 5.5 out// from z, and turned about the axis. The screw is about z, right-handed, rising 30 a turn; the// kernel's sweep of the wheel from a turn of -108 to 348 degrees is cut from the rod.unit mm
use std
use std.solids (cut)
use std.place (coords, on_u)
use std.motion (screws)
h := atan(2 * pi * 5.5 / 30) // the helix angle where the tube's centre runsin std.top {
private o := point
fix((0, 0)) o
private rod_rim := circle(center: o) hint(r: 5)
radius(5mm) rod_rim
}
part := solid(std.solids.Prism(face(rod_rim), from: 0mm, to: 20mm))
// the wheel, drawn in the plane through its axis and the x axisprivate across := axis
fix(dir == (1, 0, 0)) across
private along := axis
fix(dir == (0, cos(h), -sin(h))) along
bench := plane(u: across, v: along)
fix(origin == (0, 0, 0)) bench
in bench {
private a0 := point
private a1 := point
a0 coords(du: 11.5mm, dv: -1mm) bench
a1 coords(du: 11.5mm, dv: 1mm) bench
private wheel_axis := line(a0, a1)
private tc := point
tc on_u(d: 5.5mm) bench
private tube := circle(center: tc) hint(r: 2)
radius(2mm) tube
}
construction wheel := solid(std.solids.Revolution(face(tube), about: wheel_axis))
grind := frame
grind screws(30mm) std.z
construction groove := solid({ p | some t in (-108deg, 348deg): p in wheel at(under: grind) t })
groove cut part
anvilcad left no solid to show.
Time
1.2 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 rod grooved by a wheel screwed along it.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())
}