A wheel cut by a plus-shaped tool that turns in mesh with it, as a gear shaper cuts.
The tool is a plus in the plane z = 0, centered on the origin: four arms along +x, +y, −x and −y, each 30 long from the center and 8 wide, joined in a square 8 by 8 at the center. It is extruded from z = −10 to z = 0.
The wheel's blank is a disk of radius 40 about the vertical line through (−50, 0), from z = −8 to z = −2.
The tool turns about the z axis while the wheel turns two thirds as fast the other way about its own axis: when the tool has turned right-handed by t (from +x toward +y), the wheel has turned by −2t/3 about the vertical line through (−50, 0). Over t from 0° to 540° the wheel makes one whole turn and the tool one and a half, after which each stands as it began. Cut from the wheel everything the tool passes through, as seen from the wheel: what is left is the material that at every instant of the motion lies outside the tool.
The tool is never clear of the wheel.
expected
closed form
volume
17485.52445
no closed form: cad-kernel and cadrs agree to 1e-11; the mean of their values (next.BREP is 7e-10 from it)
area
8193.421604
no closed form: cad-kernel and cadrs agree to 2.5e-10; the mean of their values (next.BREP is 1.0e-8 from it)
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
909 ms; CPU time 1.89 s; peak memory 39.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
17485.52445
17485.52445
7.5e-12
area
8193.421603
8193.421604
1.2e-10
agrees with
kentron, next.BREP, cadrs
mesh
451644 triangles, closed
centre of gravity
(-50, -2.49668e-15, -5) its STEP's solid
inertia
about it, of unit density: Ixx 5.64915e+06; Iyy 5.64915e+06; Izz 1.11934e+07; Ixy 1.10595e-09; Iyz 1.47778e-11; Izx 3.02862e-10
//! A wheel, the disc of radius 40 about the vertical line through (−50, 0) from z = −8 to −2, cut//! by a plus (arms 30 long and 8 wide along ±x and ±y, extruded from z = −10 to 0) turning about z//! by t while the wheel turns by −2t/3, over t from 0° to 540°: what is left is what lies outside//! the tool at every instant.//!//! The kernel's one sweep operation builds the plus's swept solid alone, as the wheel sees it, and//! the ordinary Boolean cuts it from the wheel. Seen from the wheel the plus rolls in its own plane,//! a prism square to it, so `swept::closed::closed` builds the region the plus sweeps in the plane —//! the envelopes of its sides and the trochoids of its corners, each stretch kept where it stands//! outside the plus at every pose; the roll is a whole period of the pair, so no end pose bounds it —//! fitted and carried through the plus's depth (#880 Q2), and judges it by the sweep's definition//! before returning it.usecrate::sketch::polygon;
use cad_kernel::boolean::{combined, Op};
use cad_kernel::build::{disc, prism};
use cad_kernel::geom::tolerance;
use cad_kernel::swept::closed::closed;
use cad_kernel::topo::Brep;
use cad_kernel::trajectory::{Screw, Trajectory};
use std::f64::consts::PI;
/// How closely the plus is meshed for the sweep's membership reads (its faces are flat).constBAR: f64 = 0.01;
pubfnbuild() -> Result<Brep, String> {
let up = [0., 0., 1.];
let wheel = prism(&disc([-50., 0., -8.], up, 40.), 0., 6.)?;
let (a, w) = (30., 4.);
let corners = [[a, -w], [a, w], [w, w], [w, a], [-w, a], [-w, w], [-a, w], [-a, -w], [-w, -w], [-w, -a], [w, -a], [w, -w]];
let plus = prism(&polygon(&corners.map(|[x, y]| [x, y, -10.])), 0., 10.)?;
// the plus turning by t about z, seen from the wheel turning by −2t/3 about its own axislet tool_turn = Trajectory::Twist(Screw { origin: [0.; 3], axis: up, ratio: 1., advance: 0. });
let wheel_turn = Trajectory::Twist(Screw { origin: [-50., 0., 0.], axis: up, ratio: -2. / 3., advance: 0. });
let path = Trajectory::Relative { source: Box::new(tool_turn), observer: Box::new(wheel_turn) };
let swept = closed(&plus, &path, [0., 3. * PI], BAR, tolerance(plus.size()))
.map_err(|why| format!("the plus's sweep not built: {why:?}"))?;
Ok(combined(&wheel, &swept, Op::Cut, 0.)?)
}
occt left no solid to show.
Time
623 ms; CPU time 622 ms; peak memory 356.5 MB
Notes
refused occt has no sweep of a solid along a pair of turns: it slides, turns about one axis, or follows a path with its tangent, and the plus seen from the wheel turns 5/2 as fast as the circle its centre runs on; the wheel's walls are the envelope of the plus, which occt has no operation to find
"""A wheel cut by a plus always in mesh with it. A wheel cut by a plus-shaped tool that turns in
mesh with it, as a gear shaper cuts.
The tool is a plus in the plane z = 0, centred on the origin: four arms along +x, +y, −x and −y,
each 30 long from the centre and 8 wide, joined in a square 8 by 8 at the centre. It is extruded
from z = −10 to z = 0.
The wheel's blank is a disc of radius 40 about the vertical line through (−50, 0), from z = −8
to z = −2.
The tool turns about the z axis while the wheel turns two thirds as fast the other way about its
own axis: when the tool has turned right-handed by t (from +x towards +y), the wheel has turned by
−2t/3 about the vertical line through (−50, 0). Over t from 0° to 540° the wheel makes one whole
turn and the tool one and a half, after which each stands as it began. Cut from the wheel
everything the tool passes through, as seen from the wheel: what is left is the material that at
every instant of the motion lies outside the tool.
The tool is never clear of the wheel."""from bench importRefuseddefbuild():
# Seen from the wheel, the tool turns about its own axis while that axis is carried round# the wheel's: two turns at once, in the ratio 5 : 2. OCCT's sweeps slide# (BRepPrimAPI_MakePrism), turn about one axis (BRepPrimAPI_MakeRevol) or carry a shape along# a path under a law of its trihedron (BRepOffsetAPI_MakePipe, MakePipeShell); the pair of# turns is none of them, since along the circle the tool's centre runs on, the tool turns# 5/2 as fast as the circle's own frame. And swept face by face, each flat side of the plus# would have to be split where the motion runs along it, a line that moves across it: the# wheel's walls are the envelope of the plus, which occt has no operation to find.raiseRefused("occt has no sweep of a solid along a pair of turns: it slides, turns about ""one axis, or follows a path with its tangent, and the plus seen from the ""wheel turns 5/2 as fast as the circle its centre runs on; the wheel's walls ""are the envelope of the plus, which occt has no operation to find")
arris left no solid to show.
Time
1.3 ms; CPU time 1.1 ms; peak memory 3.8 MB
Notes
refused arris has no sweep of a solid along a motion; the wheel's cut is bounded by envelopes of the plus's sides and trochoids of its corners, which it cannot build
//! A wheel, a disc of radius 40 about the vertical line through (−50, 0) from z = −8 to z = −2,//! cut by a plus-shaped tool (arms 30 long and 8 wide, from z = −10 to 0) turning about the z axis//! in mesh with it, the wheel turning −2/3 as fast about its own axis, over one turn of the wheel.//!//! Refused: arris has no sweep of a solid. Seen from the wheel the tool rolls, turning about its//! own axis while that axis goes round the wheel's, and the region it sweeps there is bounded by//! the envelopes of the arms' sides and the trochoids their corners trace; arris has no such//! curves, and computing them to build the cut would be making the envelope 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 motion; the wheel's cut is bounded by envelopes of \
the plus's sides and trochoids of its corners, which it cannot build"
.into())
}
Time
268 ms; CPU time 479 ms; peak memory 11.6 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
17485.52445
17485.52445
7.0e-12
area
8193.421603
8193.421604
1.2e-10
agrees with
cad-kernel, next.BREP, cadrs
mesh
20486 triangles, closed
centre of gravity
(-50, -1.23794e-14, -5) its STEP's solid
inertia
about it, of unit density: Ixx 5.64915e+06; Iyy 5.64915e+06; Izz 1.11934e+07; Ixy -1.20781e-09; Iyz -7.86572e-12; Izx -6.48583e-11
//! A wheel cut by a plus-shaped tool turning in mesh with it, as a gear shaper cuts. The tool: a//! plus centred on the origin, arms 30 long and 8 wide along ±x and ±y, extruded from z = −10 to//! z = 0. The blank: the disc of radius 40 about the vertical line through (−50, 0), from z = −8//! to z = −2. As the tool turns by t about the z axis the wheel turns by −2t/3 about its own axis,//! for t from 0° to 540°; cut from the wheel everything the tool passes through, seen from it.//!//! kentron's cut by a motion (`sweep::cut_by_motion`) takes the plus as a prism and the motion//! as the wheel sees it: the plus's own turn by t about the z axis, then the wheel's taken back,//! a turn by 2t/3 about its axis. Both turns are square to the wheel, and the plus runs through//! all of its height, so the cut is planar: the wheel's disc less the region the plus's outline//! sweeps (bounded by its convex corners' paths and its sides' envelopes, each kept where no pose//! of the plus covers it), extruded through the wheel.usecrate::bench::p;
use kentron::math::{Axis, Direction, Frame, Point2};
use kentron::sweep::{self, Blank, Motion, MotionStep, Tool};
use kentron::topology::{Model, Shape};
use std::f64::consts::PI;
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let wheel = Blank::Disc { frame: Frame::new(p(-50.0, 0.0, -8.0), Direction::Z, Direction::X), radius: 40.0, height: 6.0 };
let (a, w) = (30.0, 4.0);
let corners = [[a, -w], [a, w], [w, w], [w, a], [-w, a], [-w, w], [-a, w], [-a, -w], [-w, -w], [-w, -a], [w, -a], [w, -w]];
let plus = Tool::Prism { frame: Frame::WORLD, outline: corners.iter().map(|&[x, y]| Point2::new(x, y)).collect(), from: -10.0, to: 0.0 };
// The plus's turn about the z axis, then the wheel's (−2t/3 about its axis) taken back.let tool_turn = MotionStep { axis: Axis::new(p(0.0, 0.0, 0.0), Direction::Z), turn: 1.0, advance: 0.0 };
let wheel_turn_back = MotionStep { axis: Axis::new(p(-50.0, 0.0, 0.0), Direction::Z), turn: 2.0 / 3.0, advance: 0.0 };
let motion = Motion { steps: vec![tool_turn, wheel_turn_back], from: 0.0, to: 3.0 * PI };
sweep::cut_by_motion(m, &wheel, &plus, &motion)
}
vcad left no solid to show.
Time
1.1 ms; CPU time 990 µs; peak memory 4.8 MB
Notes
refused vcad has no sweep of a solid along a motion (its sweeps move a sketch profile along a curve); the wheel's cut is bounded by envelopes of the rolling tool's sides and the trochoids of its corners, which vcad cannot build
//! A wheel, a disc of radius 40 about the vertical line through (−50, 0) from z = −8 to z = −2,//! cut by a plus-shaped tool (arms 30 long and 8 wide, from z = −10 to 0) turning about the z axis//! in mesh with it, the wheel turning −2/3 as fast about its own axis, over one turn of the wheel.//!//! Refused: vcad has no sweep of a solid (`Solid::sweep`, `sweep_cylindrical` and `loft` move a//! sketch profile, not a solid along a motion). Seen from the wheel the tool rolls, turning about//! its own axis while that axis goes round the wheel's, and the region it sweeps there is bounded//! by the envelopes of the arms' sides and the trochoids their corners trace; vcad has no such//! curves, and computing them to build the cut would be making the envelope outside the kernel.use vcad_kernel::Solid;
pubfnbuild() -> Result<Solid, crate::Refusal> {
Err("vcad has no sweep of a solid along a motion (its sweeps move a sketch profile along a \
curve); the wheel's cut is bounded by envelopes of the rolling tool's sides and the \
trochoids of its corners, which vcad cannot build"
.into())
}
solidcraft left no solid to show.
Time
1.7 ms; CPU time 1.5 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 wheel's flanks are the envelope of the plus rolled round it, which no sweep of a profile along a path, a helix or a revolve makes
//! Refused. The wheel is cut by a plus that turns in mesh with it, as a gear shaper cuts: seen from//! the wheel, the tool rolls round it, and the faces it leaves are the envelope of the tool's//! sides over the motion. solidcraft-kernel has no sweep of a solid and no envelope, and its//! sweeps of a profile only follow a path, a helix or a revolve, none of which is this motion; an//! envelope computed here would be geometry made outside the kernel.usecrate::Refusal;
usecrate::solids::Body;
pubfnbuild() -> Result<Body, Refusal> {
Err("no layer (solidcraft-kernel, solidcore-ops, solidcore) has a sweep of a solid or an envelope: the wheel's flanks are the \
envelope of the plus rolled round it, which no sweep of a profile along a path, a helix \
or a revolve makes"
.into())
}
brepkit left no solid to show.
Time
1.1 ms; CPU time 940 µs; peak memory 3.5 MB
Notes
refused brepkit has no sweep of a solid along a motion, and the space the meshing plus cuts from the wheel is bounded by the envelope of its faces, which brepkit cannot compute
//! A wheel cut by a plus-shaped tool turning in mesh with it. brepkit sweeps a face along a path//! (sweep, pipe, revolve), but has no sweep of a solid, and none along a motion that turns the//! tool while the wheel turns too. What the tool passes through, seen from the wheel, is bounded//! by the envelope of its faces over the 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 along a motion, and the space the meshing plus cuts from \
the wheel is bounded by the envelope of its faces, which brepkit cannot compute"
.into(),
)
}
popkern left no solid to show.
Time
3.7 ms; CPU time 3.5 ms; peak memory 11.6 MB
Notes
refused popkern has no sweep of a solid, and this sweep's wall is an envelope: the tool's sweep, seen from the turning wheel, is bounded by the envelope of its sides
// A wheel cut by a plus-shaped tool that turns in mesh with it, as a gear shaper cuts.//// 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 tool's sweep,// seen from the turning wheel, is bounded by the envelope of its sides. 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 tool's sweep, \
seen from the turning wheel, is bounded by the envelope of its sides";
aetheris left no solid to show.
Time
56 ms; CPU time 56 ms; peak memory 47.3 MB
Notes
refused Aetheris has no sweep of a solid and no general subtraction, and this sweep's wall is an envelope: as seen from the wheel the tool turns about a moving axis, so its boundary is a curve Firmament has no construction for.
// A wheel cut by a plus-shaped tool turning in mesh with it.//// Refused: Aetheris has no sweep of a solid and no general subtraction, and this sweep's wall is// an envelope: as seen from the wheel the tool turns about a moving axis, so its boundary is a// curve Firmament has no construction for.
Time
219 ms; CPU time 219 ms; peak memory 35.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
17485.52445
17485.52445
3.6e-12
area
8193.421603
8193.421604
1.2e-10
agrees with
cad-kernel, kentron, cadrs
mesh
26438 triangles, closed
centre of gravity
(-50, -1.07307e-14, -5) its STEP's solid
inertia
about it, of unit density: Ixx 5.64915e+06; Iyy 5.64915e+06; Izz 1.11934e+07; Ixy 3.84171e-09; Iyz -2.41403e-11; Izx 2.7012e-10
//! A wheel cut by a plus-shaped tool turning in mesh with it, as a gear shaper cuts.//!//! The kernel's sweep of a solid (`sweep_solid_within`): the tool is the plus extruded from//! z = −10 to 0, moved, as seen from the wheel, by its own turn t about the z axis and then the//! wheel's turn taken back (+2t/3 about the vertical line through (−50, 0)), for t from 0° to//! 540°. Asked for within 40.5 of the wheel's axis from z = −8.5 to −1.5, which holds the wheel;//! cut from the wheel. The cut is made in the plane (`cut_planar_sweep_from_prism`): the wheel's//! disc less the plus's exact swept region, extruded once over the wheel's height; where the kernel//! does not draw it so, the sweep's bodies are subtracted from the wheel's cylinder.usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{
boolean_operation_nary, make_cylinder_brep, sweep_solid_within, BooleanOperation, BrepSolid,
OutlinePiece, ScrewStep, SolidMotion, SweepClip, SweptTool,
};
use std::f64::consts::PI;
pubfnbuild() -> Result<BrepSolid, Refusal> {
let z = p(0.0, 0.0, 1.0);
let wheel = make_cylinder_brep(p(-50.0, 0.0, -8.0), z, 40.0, 6.0)?;
let corners = [
[4.0, -4.0], [30.0, -4.0], [30.0, 4.0], [4.0, 4.0], [4.0, 30.0], [-4.0, 30.0],
[-4.0, 4.0], [-30.0, 4.0], [-30.0, -4.0], [-4.0, -4.0], [-4.0, -30.0], [4.0, -30.0],
];
let outline = (0..12)
.map(|k| OutlinePiece::Line { from: corners[k], to: corners[(k + 1) % 12] })
.collect();
let plus = SweptTool::Prism {
origin: p(0.0, 0.0, 0.0),
normal: z,
x_axis: p(1.0, 0.0, 0.0),
outline,
from: -10.0,
to: 0.0,
};
let in_mesh = SolidMotion {
steps: vec![
ScrewStep { axis_origin: p(0.0, 0.0, 0.0), axis_direction: z, turn: 1.0, advance: 0.0 },
ScrewStep { axis_origin: p(-50.0, 0.0, 0.0), axis_direction: z, turn: 2.0 / 3.0, advance: 0.0 },
],
from: 0.0,
to: 3.0 * PI,
};
let around_wheel = SweepClip {
axis_origin: p(-50.0, 0.0, 0.0),
axis_direction: z,
reference: p(1.0, 0.0, 0.0),
radius: [10.0, 40.5],
axial: [-8.5, -1.5],
angle: None,
};
let blank = SweptTool::Prism {
origin: p(-50.0, 0.0, -8.0),
normal: z,
x_axis: p(1.0, 0.0, 0.0),
outline: vec![OutlinePiece::Arc { centre: [0.0, 0.0], radius: 40.0, start: 0.0, end: 2.0 * PI }],
from: 0.0,
to: 6.0,
};
ifletSome(mut cut) = brep_kernel::cut_planar_sweep_from_prism(&blank, &plus, &in_mesh, &around_wheel)? {
if cut.len() == 1 {
returnOk(cut.remove(0));
}
}
letmut operands = vec![wheel];
operands.extend(sweep_solid_within(&plus, &in_mesh, &around_wheel)?);
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.9 MB
Notes
refused geop has no sweep of a solid through a motion: the tool's sweep as both it and the wheel turn is bounded by an envelope geop cannot build
//! A wheel cut by a plus-shaped tool turning in mesh with it, as a gear shaper cuts: the tool//! turning about the z axis while the wheel turns two thirds as fast the other way about its own.//!//! geop sweeps a profile along a path, turning it with the path; it has no sweep of a solid//! through a motion, and what the tool passes through, seen from the wheel, is bounded by the//! envelope of its faces as both turn — a curve that would have to be computed here, outside//! geop.usecrate::{Bench, Refusal};
pubfnbuild(_: &mutBench) -> Result<(), Refusal> {
Err("geop has no sweep of a solid through a motion: the tool's sweep as both it and the wheel \
turn is bounded by an envelope geop cannot build"
.into())
}
Time
307 ms; CPU time 975 ms; peak memory 19.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
17485.52445
17485.52445
5.1e-11
area
8193.421605
8193.421604
9.2e-11
agrees with
cad-kernel, kentron, next.BREP
mesh
20298 triangles, closed
centre of gravity
(-50, 1.46052e-11, -5) its STEP's solid
inertia
about it, of unit density: Ixx 5.64915e+06; Iyy 5.64915e+06; Izz 1.11934e+07; Ixy -1.37138e-05; Iyz -9.57253e-12; Izx 4.09273e-12
//! A wheel, the disk of radius 40 about the vertical line through (−50, 0) from z = −8 to −2,//! cut by a plus (arms 30 long and 8 wide along ±x and ±y, from z = −10 to 0) turning about the//! z axis by t while the wheel turns by −2t/3 about its own axis, over t from 0° to 540°.//!//! The wheel is a circle extruded. Seen from it, the plus turns by t about the z axis and then,//! with the frame, by 2t/3 about the wheel's axis: cadrs's `Kernel::sweep_solid` with that planar//! motion (its sides' envelopes and its corners' paths, the region they bound extruded through//! the plus's height) gives what the plus fills, cut from the wheel.usecrate::bench::{cut, extrude, p3};
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, Kernel, Loop, PlanarStep, Plane, Profile, SolidMotion};
use std::f64::consts::PI;
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let wheel = extrude(k, &Profile::of(Plane::xy(-8.0), vec![Loop::circle([-50.0, 0.0], 40.0)]), 6.0)?;
let plus = [
(30.0, -4.0), (30.0, 4.0), (4.0, 4.0), (4.0, 30.0), (-4.0, 30.0), (-4.0, 4.0),
(-30.0, 4.0), (-30.0, -4.0), (-4.0, -4.0), (-4.0, -30.0), (4.0, -30.0), (4.0, -4.0),
];
let tool = extrude(k, &Profile::of(Plane::xy(-10.0), vec![Loop::polygon(&plus.map(|(x, y)| [x, y]))]), 10.0)?;
let motion = SolidMotion::Planar {
normal: crate::bench::unit(crate::bench::v3(0.0, 0.0, 1.0)),
steps: vec![
PlanarStep::Turn { about: p3(0.0, 0.0, 0.0), from: 0.0, to: 3.0 * PI },
PlanarStep::Turn { about: p3(-50.0, 0.0, 0.0), from: 0.0, to: 2.0 * PI },
],
};
let swept = k.sweep_solid(tool, &motion)?;
let swept = swept.bodies.first().copied().ok_or_else(|| Refusal::from("the sweep made no body"))?;
cut(k, wheel, 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
1.4 ms; CPU time 1.1 ms; peak memory 3.5 MB
Notes
refused springrep's sweep of a solid is exact only under a slide, a turn or a screw. Seen from the wheel the tool turns about one axis while being carried about another, so the wheel's teeth are bounded by envelopes of the plus's sides and the trochoids its corners trace, which it cannot make exactly
//! A disc of radius 40 about the upright line through (−50, 0) cut by a plus-shaped prism//! turning in mesh with it, as a gear shaper cuts.use springrep::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
Err("springrep's sweep of a solid is exact only under a slide, a turn or a screw. Seen from the wheel the tool turns about one axis while being carried about another, so the wheel's teeth are bounded by envelopes of the plus's sides and the trochoids its corners trace, which it cannot make exactly".into())
}
Time
836 ms; CPU time 2.00 s; peak memory 49.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
17485.52496
17485.52445
2.9e-08
area
8193.422109
8193.421604
6.2e-08
agrees with
no other kernel
mesh
11170 triangles, closed
centre of gravity
(-50, 3.06212e-15, -5) its STEP's solid
inertia
about it, of unit density: Ixx 5.64915e+06; Iyy 5.64915e+06; Izz 1.11934e+07; Ixy 7.30438e-10; Iyz -2.77314e-12; Izx -2.03727e-10
// A wheel cut by a plus always in mesh with it, as a gear shaper cuts. The plus, four arms 30 long// and 8 wide about the origin, is drawn in the top plane and extruded from z = -10 to 0; the wheel// is the disc of radius 40 about the vertical through (-50, 0), z from -8 to -2. The plus turns// about z while the wheel turns two thirds as fast the other way about its own axis; the kernel's// sweep of the plus over 0..540 degrees of that motion, seen from the wheel, is cut from it.unit mm
use std
use std.solids (cut)
use std.place (vertical, coords)
use std.motion (turns)
in std.front {
construction stem := vertical line(std.origin, hint((0, 10)))
length(10mm) stem
wc := point hint((-50, 0))
std.origin distance(-50mm, along: u) wc
construction spindle := vertical line(wc, hint((-50, 10)))
length(10mm) spindle
}
// the plus: each arm k, along the direction 90k degrees, ends in corners a and b 30 out and 4 to// either side, and meets the next arm at the central square's corner cin std.top {
repeat4as k {
a := point hint((30 * cos(90deg * k) - 4 * sin(90deg * k), 30 * sin(90deg * k) + 4 * cos(90deg * k)))
b := point hint((30 * cos(90deg * k) + 4 * sin(90deg * k), 30 * sin(90deg * k) - 4 * cos(90deg * k)))
c := point hint((4 * sqrt(2) * cos(90deg * k - 45deg), 4 * sqrt(2) * sin(90deg * k - 45deg)))
a coords(du: 30mm * cos(90deg * k) - 4mm * sin(90deg * k), dv: 30mm * sin(90deg * k) + 4mm * cos(90deg * k)) std.top
b coords(du: 30mm * cos(90deg * k) + 4mm * sin(90deg * k), dv: 30mm * sin(90deg * k) - 4mm * cos(90deg * k)) std.top
c coords(du: 4mm * sqrt(2) * cos(90deg * k - 45deg), dv: 4mm * sqrt(2) * sin(90deg * k - 45deg)) std.top
}
plus := face(c[0], b[0], a[0], c[1], b[1], a[1], c[2], b[2], a[2], c[3], b[3], a[3], -> close)
wo := point
wo coincident wc
rim := circle(center: wo) hint(r: 40)
radius(40mm) rim
}
construction tool := solid(std.solids.Prism(plus, from: -10mm, to: 0mm))
part := solid(std.solids.Prism(face(rim), from: -8mm, to: -2mm))
// the plus turning about its stem, the wheel two thirds as fast the other way about its spindle,// and what the plus passes through as the wheel sees it over a whole period of the pair
tool_turn := frame
tool_turn turns(1) stem
wheel_turn := frame
wheel_turn turns(-2 / 3) spindle
construction space := solid({ p | some t in (0deg, 540deg): p in tool at(under: tool_turn, seen_from: wheel_turn) t })
space cut part
anvilcad left no solid to show.
Time
1.4 ms; CPU time 1.2 ms; peak memory 3.5 MB
Notes
refused anvil-brep has no sweep of a solid: the cutter, carried by two motions at once relative to the blank, sweeps envelopes of its faces that it would have to compute itself
//! A wheel cut by a plus always in mesh with it.use anvil_brep::Solid;
pubfnbuild() -> Result<Solid, String> {
Err("anvil-brep has no sweep of a solid: the cutter, carried by two motions at once relative to the blank, sweeps envelopes of its faces that it would have to compute itself".into())
}