A rod, the cylinder of radius 5 about the z axis from z = 0 to z = 20, with a helical V groove ground around it by a wheel with a sharp V rim, carried along a screw, as a thread is ground.
The wheel's axis passes through (14, 0, 0), square to the x axis, leaning from the y axis down toward −z by the helix angle h = atan(2π·4.5 / 30) ≈ 43.30°: its direction is (0, cos h, −sin h). Call the direction (1, 0, 0) "out" and the axis's direction "along". The wheel is the solid of revolution, about this axis, of a triangle in the plane through the axis and the point (4, 0, 0):
its tip is at (4, 0, 0), 10 from the axis on the rod's side, and 1 inside the rod;
its other two corners are 2.5 further from the rod, at (4, 0, 0) + 2.5·out ± 2.5·tan 30°·along.
So the wheel is a ring 2.89 thick at its bore (radius 7.5) whose rim narrows to a sharp edge of radius 10, each flank 30° from the wheel's mid-plane (a 60° V).
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 −144° (the wheel lowered 12, wholly below the rod) to a turn of +384° (raised 32, wholly above it). Cut from the rod everything the wheel passes through.
expected
closed form
volume
1554.380966
no closed form: cad-kernel, next.BREP and cadrs agree to 7e-10; the mean of their values
area
812.5215053
no closed form: cad-kernel, next.BREP and cadrs agree to 6e-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.35 s; CPU time 4.61 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
1554.380962
1554.380966
2.6e-09
area
812.5215027
812.5215053
3.2e-09
agrees with
kentron, next.BREP, cadrs, springrep
mesh
12932 triangles, closed
centre of gravity
(0.0101747, -0.017623, 10) its STEP's solid
inertia
about it, of unit density: Ixx 61468.4; Iyy 61432; Izz 19275; Ixy 31.539; Iyz -166.822; Izx -288.944
//! A rod, the cylinder of radius 5 about z from z = 0 to 20, with a helical V groove ground round//! it by a wheel with a sharp 60° V rim — the triangle (4, 0, 0), (6.5, 0, 0) ± 2.5·tan 30°·along//! turned about the axis through (14, 0, 0) along (0, cos h, −sin h), h = atan(2π·4.5 / 30) —//! screwed about z, rising 30 a turn, from a turn of −144° to +384°.//!//! The kernel's closed sweep (`swept::closed::cut_from`) takes the wheel whole: its closed class//! refuses cones about an axis leaning to the screw (`Unbuilt::Curved`), and since 0.9.0 such a//! tool goes the contact's road — each flank's contact carried over the roll as a sheet, the sharp//! rim's fan (where the two flanks face either way along the motion) as a sheet of its own, given//! their meetings and the end poses, trimmed by membership in the sweep, and the result cut from//! the rod. No envelope is computed here.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::{add, scale, sub};
use std::f64::consts::TAU;
constUP: V = [0., 0., 1.];
/// The wheel's axis passes through here.constHUB: V = [14., 0., 0.];
/// The rim's sharp edge, nearest the rod.constTIP: V = [4., 0., 0.];
/// 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] = [-144., 384.];
/// 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 (4.5, 0, 0) alonglet h = (TAU * 4.5 / RISE).atan();
let along = [0., h.cos(), -h.sin()];
let half = scale(along, 2.5 * 30f64.to_radians().tan());
let back = add(TIP, [2.5, 0., 0.]);
let wheel = revolve(&polygon(&[TIP, add(back, half), sub(back, half)]), HUB, along, TAU)?;
// 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
633 ms; CPU time 633 ms; peak memory 356.6 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 wheel's conical faces (BRepFill_Sweep::BuildEdge), and the groove's flanks are the envelopes of the screwed cones, along characteristic curves that are none of the wheel's edges, which occt has no operation to find
"""A rod threaded by a V wheel. A rod, the cylinder of radius 5 about the z axis from z = 0 to
z = 20, with a helical V groove ground round it by a wheel with a sharp V rim, carried along a
screw, as a thread is ground.
The wheel's axis passes through (14, 0, 0), square to the x axis, leaning from the y axis down
towards −z by the helix angle h = atan(2π·4.5 / 30) ≈ 43.30°: its direction is
(0, cos h, −sin h). Call the direction (1, 0, 0) "out" and the axis's direction "along". The wheel
is the solid of revolution, about this axis, of a triangle in the plane through the axis and the
point (4, 0, 0):
- its tip is at (4, 0, 0), 10 from the axis on the rod's side, and 1 inside the rod;
- its other two corners are 2.5 further from the rod, at (4, 0, 0) + 2.5·out ± 2.5·tan 30°·along.
So the wheel is a ring 2.89 thick at its bore (radius 7.5) whose rim narrows to a sharp edge of
radius 10, each flank 30° from the wheel's mid-plane (a 60° V).
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 −144° (the wheel lowered 12, wholly
below the rod) to a turn of +384° (raised 32, wholly above it). Cut from the rod everything the
wheel passes through."""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 its conical faces# (Standard_ConstructionError, "BRepFill_Sweep::BuildEdge"). Only the sharp rim's sweep is a# helicoid of the wheel's own edge; each flank meets the groove along the cone's# characteristic curve, where the screw runs along the cone, which is none of the wheel's# edges. The groove's flanks are the envelopes those curves sweep out, and finding them 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 wheel's conical faces ""(BRepFill_Sweep::BuildEdge), and the groove's flanks are the envelopes of the ""screwed cones, along characteristic curves that are none of the wheel's ""edges, which occt has no operation to find")
arris left no solid to show.
Time
1.5 ms; CPU time 1.3 ms; peak memory 3.8 MB
Notes
refused arris has no sweep of a solid along a screw motion; the groove's flanks are envelopes of the screwed V wheel's cones, which it cannot build
//! A rod, the cylinder of radius 5 about the z axis from z = 0 to z = 20, with a helical V groove//! ground round it by a wheel with a sharp 60° V rim (its axis through (14, 0, 0), leaning by the//! helix angle) carried along a screw about the z axis that rises 30 a turn, from −144° to +384°.//!//! Refused: arris has no sweep of a solid, and none along a screw motion. The groove's flanks are//! the envelopes of the wheel's two conical flanks screwed, each swept along the screw from the//! curve where the screw's velocity is tangent to the cone, and its root the helix-like trace of//! the rim's edge; none is a surface arris builds from a profile, a path or a revolution, so the//! groove could only be made by computing those characteristic curves outside the kernel.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 flanks are envelopes of \
the screwed V wheel's cones, which it cannot build"
.into())
}
Time
20 ms; CPU time 22 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
1554.380966
1554.380966
1.0e-10
area
812.5215052
812.5215053
1.4e-10
agrees with
cad-kernel, next.BREP, cadrs, springrep
mesh
196018 triangles, closed
centre of gravity
(0.0101747, -0.017623, 10) its STEP's solid
inertia
about it, of unit density: Ixx 61468.4; Iyy 61432; Izz 19275; Ixy 31.539; Iyz -166.822; Izx -288.944
//! A rod, the cylinder of radius 5 about the z axis from z = 0 to z = 20, with a helical V groove//! ground by a wheel with a sharp 60° V rim carried along a screw. The wheel: the solid of//! revolution, about the axis through (14, 0, 0) along (0, cos h, −sin h) with//! h = atan(2π·4.5 / 30), of the triangle with its tip at (4, 0, 0) and its other corners 2.5//! further out, ±2.5·tan 30° along the axis. The screw: about the z axis, right-handed, rising 30//! a turn, from a turn of −144° to +384°. 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 triangle, (10, 0) its tip and (7.5, ±2.5·tan 30°) its other corners in (distance from//! the wheel's axis, height along it), 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 bounded where the flanks'//! characteristic curves (where the screw runs along the cones) and the sharp rim project along//! the helices. 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::{PI, TAU};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let rod = Blank::Disc { frame: Frame::WORLD, radius: 5.0, height: 20.0 };
let h = (TAU * 4.5 / 30.0).atan();
let frame = Frame::new(p(14.0, 0.0, 0.0), Direction::new(0.0, h.cos(), -h.sin()), Direction::X);
let half = 2.5 * (PI / 6.0).tan();
let (tip, near, far) = (Point2::new(10.0, 0.0), Point2::new(7.5, half), Point2::new(7.5, -half));
let meridian = vec![
MeridianPiece::Line { from: far, to: tip },
MeridianPiece::Line { from: tip, to: near },
MeridianPiece::Line { from: near, to: far },
];
let wheel = Tool::Revolved { frame, meridian };
// 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: (-144f64).to_radians(), to: 384f64.to_radians() };
sweep::cut_by_motion(m, &rod, &wheel, &motion)
}
vcad left no solid to show.
Time
1.3 ms; CPU time 1.2 ms; peak memory 4.8 MB
Notes
refused vcad has no sweep of a solid along a screw motion; the groove's flanks are envelopes of the wheel's conical flanks screwed, which 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 V groove//! ground round it by a wheel with a sharp 60° V rim (its axis through (14, 0, 0), leaning by the//! helix angle) carried along a screw about the z axis that rises 30 a turn, from −144° to +384°.//!//! 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 flanks are the envelopes of//! the wheel's two conical flanks screwed, each swept along the screw from the curve where the//! screw's velocity is tangent to the cone, and its root the trace of the rim's edge; their//! section is not the wheel's, so the groove could only be made by computing those characteristic//! curves 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 flanks are envelopes of \
the wheel's conical flanks screwed, which would have to be computed outside the kernel"
.into())
}
solidcraft left no solid to show.
Time
1.8 ms; CPU time 1.5 ms; peak memory 4.5 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 V groove's flanks are the envelope of the leaning wheel's cones over the screw, which is no plane section of it
//! Refused. The V groove is what a wheel with a sharp V rim, 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 wheel is the groove's section: the//! groove's flanks are the envelope of the wheel's conical flanks over the screw. 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 V groove's flanks are the envelope of the leaning wheel's cones over \
the screw, which is no plane section of it"
.into())
}
brepkit left no solid to show.
Time
1.1 ms; CPU time 920 µs; peak memory 3.6 MB
Notes
refused brepkit has no sweep of a solid (its helical sweep carries a flat face), and the groove the V wheel screws is bounded by its envelope, which brepkit cannot compute
//! A rod threaded by a V wheel 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 flanks are the envelope//! of the leaning wheel's conical flanks over the screw motion, 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 V wheel screws is bounded by its envelope, which brepkit cannot compute"
.into(),
)
}
popkern left no solid to show.
Time
4.2 ms; CPU time 3.9 ms; peak memory 11.4 MB
Notes
refused popkern has no sweep of a solid, and this sweep's wall is an envelope: the thread's flanks are the envelope of the wheel's cones along the screw
// A rod threaded by a sharp V wheel 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 thread's flanks// are the envelope of the wheel's cones along the screw. 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 thread's flanks \
are the envelope of the wheel's cones along the screw";
aetheris left no solid to show.
Time
51 ms; CPU time 51 ms; peak memory 47.1 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 flanks are none of the wheel's own cones. Its Thread cuts only the metric 60° profile, about the axis, not by a leaning wheel.
// A rod with a helical V groove ground by a V-rimmed wheel 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 flanks are none of the wheel's// own cones. Its Thread cuts only the metric 60° profile, about the axis, not by a leaning wheel.
Time
190 ms; CPU time 190 ms; peak memory 14.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
1554.380966
1554.380966
2.4e-10
area
812.5215052
812.5215053
6.2e-11
agrees with
cad-kernel, kentron, cadrs, springrep
mesh
185614 triangles, closed
centre of gravity
(0.0101747, -0.017623, 10) its STEP's solid
inertia
about it, of unit density: Ixx 61468.4; Iyy 61432; Izz 19275; Ixy 31.539; Iyz -166.822; Izx -288.944
//! A rod threaded by a wheel with a sharp V rim, carried along a screw about its axis.//!//! The kernel's sweep of a solid (`sweep_solid_within`): the wheel is the solid of revolution of//! its triangle (tip 10 from its axis, the other corners at 7.5 and ±2.5·tan 30° along it), swept//! by the screw about the z axis that rises 30 a turn, from a turn of −144° to +384°. 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::{PI, 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 * 4.5 / 30.0).atan();
let flank = 2.5 * (PI / 6.0).tan();
let (tip, upper, lower) = ([10.0, 0.0], [7.5, flank], [7.5, -flank]);
let wheel = SweptTool::Revolved {
axis_origin: p(14.0, 0.0, 0.0),
axis_direction: p(0.0, h.cos(), -h.sin()),
radial: p(-1.0, 0.0, 0.0),
meridian: vec![
OutlinePiece::Line { from: tip, to: upper },
OutlinePiece::Line { from: upper, to: lower },
OutlinePiece::Line { from: lower, to: tip },
],
};
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: (-144.0f64).to_radians(),
to: 384.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
2.1 ms; CPU time 1.9 ms; peak memory 9.8 MB
Notes
refused geop has no sweep of a solid: what a V wheel screwed along the rod passes through is bounded by the envelope of its flanks, which geop cannot build
//! A rod with a helical V groove ground by a sharp-rimmed wheel carried along a screw about the z//! axis, its axis leaning by the helix angle.//!//! geop sweeps a profile along a path; it has no sweep of a solid, and what the wheel passes//! through is bounded by the envelope of its conical flanks along the screw, 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 V wheel screwed along the rod passes through is \
bounded by the envelope of its flanks, which geop cannot build"
.into())
}
Time
88 ms; CPU time 143 ms; peak memory 11.8 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
1554.380966
1554.380966
1.1e-10
area
812.5215051
812.5215053
1.7e-10
agrees with
cad-kernel, kentron, next.BREP, springrep
mesh
193400 triangles, closed
centre of gravity
(0.0101747, -0.017623, 10) its STEP's solid
inertia
about it, of unit density: Ixx 61468.4; Iyy 61432; Izz 19275; Ixy 31.539; Iyz -166.822; Izx -288.944
//! A rod, the cylinder of radius 5 about the z axis from z = 0 to z = 20, with a helical V groove//! ground by a wheel with a sharp 60° V rim (its axis through (14, 0, 0) leaning by the helix//! angle) carried along the screw about the z axis that rises 30 a turn, from a turn of −144° to//! +384°.//!//! The wheel is its triangle (tip 10 from its axis, the other corners 7.5 from it and 2.5 tan 30°//! either side of its mid-plane) sketched on the plane through its axis and the point (4, 0, 0),//! revolved; its screw is cadrs's sweep of a solid over part of a screw (`Kernel::cut_swept`://! turned about the z axis from −144° to +384° while rising 30 a turn), cut from the rod.usecrate::bench::{p3, revolve, v3};
usecrate::shared::swept::{cut_swept, rod, screw, z_axis};
usecrate::Refusal;
use cadrs_kernel::{Axis, BodyId, DefaultKernel, Loop, Plane, Profile};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let h = (std::f64::consts::TAU * 4.5 / 30.0).atan();
let along = v3(0.0, h.cos(), -h.sin());
let centre = p3(14.0, 0.0, 0.0);
// The plane through the wheel's axis: sketch x from the axis toward the rod, y along it.let on = Plane::new(centre, v3(-1.0, 0.0, 0.0), v3(-1.0, 0.0, 0.0).cross(&along));
let w = 2.5 * 30f64.to_radians().tan();
let section = Profile::of(on, vec![Loop::polygon(&[[10.0, 0.0], [7.5, w], [7.5, -w]])]);
let wheel = revolve(k, §ion, Axis::new(centre, along), None)?;
let r = rod(k)?;
cut_swept(k, r, wheel, &screw(z_axis(), 30.0, -144.0, 384.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
879 ms; CPU time 879 ms; peak memory 23.8 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
1554.380966
1554.380966
2.2e-10
area
812.5215052
812.5215053
8.2e-11
agrees with
cad-kernel, kentron, next.BREP, cadrs
mesh
13844 triangles, closed
centre of gravity
(0.0101747, -0.017623, 10) its STEP's solid
inertia
about it, of unit density: Ixx 61468.4; Iyy 61432; Izz 19275; Ixy 31.539; Iyz -166.822; Izx -288.944
//! The rod of radius 5 about the z axis from z = 0 to 20 less everything a V wheel (a sharp rim//! of radius 10 about (14, 0, 0), leaning 43.30°) 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::profile::Profile;
use springrep::sweep::solid;
use springrep::topo::Brep;
usecrate::shared::e;
usecrate::shared::swept::{deg, polygon, revolved, rod, screwing, v3, within};
/// The V wheel's rim in (distance from its axis, along it): its tip 10 out, the V 2.5 deep with/// flanks at 30° to the wheel's plane.fnv_rim() -> Profile {
let flank = 2.5 * deg(30.0).tan();
polygon(&[(7.5, -flank), (10.0, 0.0), (7.5, flank)], "rim")
}
pubfnbuild() -> Result<Brep, String> {
let h = (2.0 * PI * 4.5 / 30.0).atan();
let along = v3(0.0, h.cos(), -h.sin());
let wheel = revolved(
&v_rim(),
v3(14.0, 0.0, 0.0),
along,
v3(-1.0, 0.0, 0.0),
"wheel",
)?;
// 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(-144.0), deg(384.0)), "screw").map_err(e)?;
difference(&rod()?, &swept).map_err(e)
}
Time
298 ms; CPU time 543 ms; peak memory 35.5 MB
Notes
wrong volume 1554.37914619 against 1554.38096569 (its STEP's); area 812.520662825 against 812.521505271 (its STEP's)
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
1554.379146
1554.380966
1.2e-06
area
812.5206628
812.5215053
1.0e-06
agrees with
no other kernel
mesh
121416 triangles, closed
centre of gravity
(0.0101757, -0.0176248, 10) its STEP's solid
inertia
about it, of unit density: Ixx 61468.4; Iyy 61431.9; Izz 19275; Ixy 31.5416; Iyz -166.838; Izx -288.972
// A rod threaded by a V wheel carried along a screw, as a thread is ground. The rod is the// cylinder of radius 5 about z from z = 0 to 20. The wheel's axis runs through (14, 0, 0) along// (0, cos h, -sin h), h = atan(2 pi 4.5 / 30): in the plane through that axis and x, the wheel is// the triangle with its tip at (4, 0, 0) and its other corners 2.5 further out, 2.5 tan 30// either side along the axis, 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 -144 to 384 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 * 4.5 / 30) // the helix angle half a millimetre inside the rodin 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 x: the V's tip toward the rodprivate 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: 14mm, dv: -1mm) bench
a1 coords(du: 14mm, dv: 1mm) bench
private wheel_axis := line(a0, a1)
private v0 := point
private v1 := point
private v2 := point
v0 on_u(d: 4mm) bench
v1 coords(du: 6.5mm, dv: -2.5mm * tan(30deg)) bench
v2 coords(du: 6.5mm, dv: 2.5mm * tan(30deg)) bench
private lower := line(v0, v1)
private bore := line(v1, v2)
private upper := line(v2, v0)
}
construction vwheel := solid(std.solids.Revolution(face(lower, bore, upper), about: wheel_axis))
grind := frame
grind screws(30mm) std.z
construction groove := solid({ p | some t in (-144deg, 384deg): p in vwheel at(under: grind) t })
groove cut part
anvilcad left no solid to show.
Time
1.2 ms; CPU time 1 ms; 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 a V wheel.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())
}