A block, the box from (0, −5, 0) to (20, 5, 10), with a V groove cut across its top by a wheel with a sharp rim.
The wheel's axis is the line through (−8, 0, 14) parallel to the y axis. The wheel is the solid of revolution, about that axis, of the triangle in the plane x = −8 with corners, in (y, z), at (0, 8), (−3 tan 30°, 11) and (3 tan 30°, 11): its rim is a sharp circle of radius 6 whose lowest point, (−8, 0, 8), is 2 below the block's top, and its flanks lean 30° either side of its mid-plane (a 60° V), back to its bore of radius 3.
It slides without turning along the x axis by 36, from clear before the block to clear past it. Cut from the block everything the wheel passes through.
Each flank touches along its line square to the slide, and the two lines meet at the rim's lowest point, where every normal between the flanks is the wheel's. The groove is the V of those lines carried along the block: two planes meeting in a sharp edge 2 deep, the rim's lowest point's path.
expected
closed form
volume
1953.811978
2000 − 20·2²·tan 30°
area
1041.569219
1000 − 20·4 tan 30° − 2·4 tan 30° + 2·20·2/cos 30°
Drawing
TopIsometricFrontRight
Third-angle projection, the three views at one scale. Drawn from occt'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
88 ms; CPU time 121 ms; peak memory 17 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.
//! A block, the box (0, −5, 0)–(20, 5, 10), with a V groove cut across its top by a wheel — the//! triangle (0, 8), (∓3 tan 30°, 11) in (y, z) in the plane x = −8, turned about the line through//! (−8, 0, 14) along y: a sharp rim of radius 6, flanks leaning 30° either side, a bore of radius//! 3 — slid without turning 36 along x.usecrate::sketch::{block, polygon};
use cad_kernel::build::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 std::f64::consts::TAU;
constCENTRE: V = [-8., 0., 14.];
constSLIDE: f64 = 36.;
/// How closely the wheel is meshed for the sweep's membership reads.constBAR: f64 = 0.01;
pubfnbuild() -> Result<Brep, String> {
let stock = block([0., -5., 0.], [20., 5., 10.])?;
let half = 3. * 30f64.to_radians().tan();
let triangle = polygon(&[[-8., 0., 8.], [-8., half, 11.], [-8., -half, 11.]]);
// the wheel: the triangle turned once about its axis, two cones meeting in the sharp rim and// the bore's cylinderlet wheel = revolve(&triangle, CENTRE, [0., 1., 0.], TAU)?;
// the slide along x: a screw that does not turn, advancing its whole length over a roll of τlet path = Trajectory::Twist(Screw {
origin: CENTRE, axis: [1., 0., 0.], ratio: 0., advance: SLIDE,
});
// the kernel's swept solid cut from the block on one arrangement: each flank's ruling square// to the slide swept into a plane, the rim's circle swept into an oblique cylinderlet size = stock.size().max(wheel.size());
cut_from(&stock, &wheel, &path, [0., TAU], BAR, tolerance(size))
.map_err(|why| format!("the wheel's sweep not built: {why:?}"))
}
Time
652 ms; CPU time 651 ms; peak memory 368.4 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no sweep of a solid
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.
"""A V groove cut by a sharp V wheel slid across a block. A block, the box from (0, −5, 0) to (20,
5, 10), with a V groove cut across its top by a wheel with a sharp rim.
The wheel's axis is the line through (−8, 0, 14) parallel to the y axis. The wheel is the solid of
revolution, about that axis, of the triangle in the plane x = −8 with corners, in (y, z), at (0,
8), (−3 tan 30°, 11) and (3 tan 30°, 11): its rim is a sharp circle of radius 6 whose lowest point,
(−8, 0, 8), is 2 below the block's top, and its flanks lean 30° either side of its mid-plane (a 60°
V), back to its bore of radius 3.
It slides without turning along the x axis by 36, from clear before the block to clear past it. Cut
from the block everything the wheel passes through.
Each flank touches along its line square to the slide, and the two lines meet at the rim's lowest
point, where every normal between the flanks is the wheel's. The groove is the V of those lines
carried along the block: two planes meeting in a sharp edge 2 deep, the rim's lowest point's
path."""import math
fromOCP.BRepBuilderAPIimportBRepBuilderAPI_MakeFace, BRepBuilderAPI_MakePolygonfromOCP.BRepPrimAPIimportBRepPrimAPI_MakeBox, BRepPrimAPI_MakeRevolfromOCP.gp import gp, gp_Ax1, gp_Pnt
from sweep import cut, plane, slid
BLOCK = ((0, -5, 0), (20, 5, 10))
CENTRE = (-8, 0, 14) # on the wheel's axis, parallel to ySECTION = [(0, 8), (-3 * math.tan(math.radians(30)), 11), (3 * math.tan(math.radians(30)), 11)]
SLIDE = (36, 0, 0)
defbuild():
x = CENTRE[0]
corners = [gp_Pnt(x, y, z) for y, z inSECTION]
triangle = BRepBuilderAPI_MakeFace(BRepBuilderAPI_MakePolygon(*corners, True).Wire()).Face()
wheel = BRepPrimAPI_MakeRevol(triangle, gp_Ax1(gp_Pnt(*CENTRE), gp.DY_s())).Shape()
# The wheel's flanks are cones and its bore a cylinder, all about an axis square to the# slide (x): each meets the slide square-on along its lines through the axis's plane x = −8,# where its normal is square to x, and leads on one side of it and trails on the other.
swept = slid(wheel, SLIDE, [plane(CENTRE, (1, 0, 0))])
returncut(BRepPrimAPI_MakeBox(gp_Pnt(*BLOCK[0]), gp_Pnt(*BLOCK[1])).Shape(), swept)
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
14 ms; CPU time 14 ms; peak memory 11.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.
//! A block, the box from (0, −5, 0) to (20, 5, 10), V-grooved across its top by a wheel with a//! sharp rim: the solid of revolution, about the line through (−8, 0, 14) along y, of the//! triangle in the plane x = −8 with corners (y, z) = (0, 8) and (±3 tan 30°, 11), slid without//! turning along x by 36. Everything the wheel passes through, cut.//!//! The wheel is the triangle revolved; its sweep is kentron's sweep of a solid (`sweep::solid`,//! one slide), cut from the block.usecrate::bench::{p, v};
usecrate::shared::sweep::polyline;
use kentron::make;
use kentron::math::{Axis, Direction};
use kentron::primitives::Cuboid;
use kentron::sweep::{self, RigidMotion};
use kentron::topology::{Model, Shape};
use std::f64::consts::{PI, TAU};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let block = Cuboid::from_corners(p(0.0, -5.0, 0.0), p(20.0, 5.0, 10.0)).build(m)?;
let half = 3.0 * (PI / 6.0).tan();
let outline = polyline(m, &[p(-8.0, 0.0, 8.0), p(-8.0, half, 11.0), p(-8.0, -half, 11.0)], true)?;
let triangle = make::planar_face(m, outline)?;
let wheel = sweep::revolve(m, triangle, Axis::new(p(-8.0, 0.0, 14.0), Direction::Y), TAU)?.shape;
let swept = sweep::solid(m, wheel, &RigidMotion::Slide { by: v(36.0, 0.0, 0.0) })?;
kentron::boolean::difference(m, block, swept)
}
vcad left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
11 ms; CPU time 11 ms; peak memory 42.3 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no sweep of a solid
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.
//! A block, the box from (0, −5, 0) to (20, 5, 10), with a V groove cut across its top by a wheel//! with a sharp rim: the solid of revolution about the line through (−8, 0, 14) along y of the//! triangle with corners (y, z) = (0, 8), (−3 tan 30°, 11) and (3 tan 30°, 11) on x = −8, slid//! without turning along x by 36.//!//! solidcraft-kernel has no sweep of a solid, so the wheel's sweep is built by elementary//! geometry. Split by the plane x = −8 through its axis, square to the slide, the wheel's back//! half leads with its flat cut faces and its bore (whose normals point to the axis, forward);//! its flanks face back. So it sweeps itself, its section through the axis slid 36 and its bore//! slid 36; the front half likewise sweeps the section and its bore slid, and itself where it//! stops. The halves lie wholly before x = −8 and past x = 28, the bore slid at z ≥ 11 and the//! section's upper triangle above z = 17, all clear of the block; so the section's lower triangle//! extruded along x by 36 is what the sweep takes from the block.usecrate::solids::*;
pubfnbuild() -> R<Body> {
let stock = block((0.0, -5.0, 0.0), (20.0, 5.0, 10.0))?;
let w = 3.0 * 30f64.to_radians().tan();
let triangle = polygon(&[(0.0, 8.0), (w, 11.0), (-w, 11.0)]);
let plane = Plane { origin: v3(-8.0, 0.0, 0.0), x: Vec3::Y, y: Vec3::Z };
cut(&stock, &extrude(&plane, triangle, 0.0, 36.0)?)
}
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.
Time
11 ms; CPU time 12 ms; peak memory 24.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.
// A block from (0, -5, 0) to (20, 5, 10), less everything a V wheel passes through as it slides// along x by 36: about the line through (-8, 0, 14) parallel to y, the triangle (y, z) = (0, 8),// (∓3 tan 30°, 11) in the plane x = -8 revolved.//// Sliding square to its axis, the wheel sweeps itself where it starts and stops and, between them,// its section through the axis square to the slide (the triangle and its mirror above the axis)// carried along it.let m = model();
let pi = 3.141592653589793;
let h = 3.0 * tan(30.0 * pi / 180.0);
let block = m.box(20.0, 10.0, 10.0, #{ at: [0.0, -5.0, 0.0] });
for x in [-8.0, 28.0] {
block = block.subtract(m.tool(|m| m.profile(yz_at(x)).polygon([[0.0, 8.0], [h, 11.0], [-h, 11.0]])
.sketch("wheel_section").revolve(axis_at([x, 0.0, 14.0], [0.0, 1.0, 0.0]), full_circle())));
}
for tri in [[[0.0, 8.0], [h, 11.0], [-h, 11.0]], [[0.0, 20.0], [-h, 17.0], [h, 17.0]]] {
block = block.subtract(m.tool(|m| m.profile(yz_at(-8.0)).polygon(tri).sketch("v_section").extrude(blind(36.0))));
}
m
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
15 ms; CPU time 15 ms; peak memory 17 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.
//! The block from (0, −5, 0) to (20, 5, 10), less everything a V wheel passes through as it slides//! without turning by 36 along x: the solid of revolution, about the line through (−8, 0, 14)//! along y, of the triangle with corners (y, z) = (0, 8) and (±3 tan 30°, 11).//!//! Through the kernel's whole sweep of a solid (`sweep_solid`): the wheel, a solid of revolution//! about the line through (−8, 0, 14) along y whose meridian is the triangle with its point 6 from//! the axis and its base 3 from it, slid 36 along x, and cut from the block.usecrate::solids::p;
usecrate::solids::swept::{less_all, revolved_tool, slide_by, Piece};
usecrate::Refusal;
use brep_kernel::{make_box_brep, sweep_solid, BrepSolid};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let block = make_box_brep(p(0.0, -5.0, 0.0), 20.0, 10.0, 10.0)?;
let r3 = 3f64.sqrt();
// the triangle in (distance from the axis, toward −z; place along y)let wheel = revolved_tool(p(-8.0, 0.0, 14.0), p(0.0, 1.0, 0.0), p(0.0, 0.0, -1.0), &[
Piece::Line { from: [3.0, -r3], to: [6.0, 0.0] },
Piece::Line { from: [6.0, 0.0], to: [3.0, r3] },
Piece::Line { from: [3.0, r3], to: [3.0, -r3] },
]);
less_all(block, vec![sweep_solid(&wheel, &slide_by(p(36.0, 0.0, 0.0)))?])
}
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
5.7 ms; CPU time 5.4 ms; peak memory 9.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.
//! A block (the box from (0, −5, 0) to (20, 5, 10)) grooved across its top by a wheel with a sharp//! V rim (the triangle (0, 8), (−3 tan 30°, 11), (3 tan 30°, 11) of the plane x = −8, in (y, z),//! turned about the line through (−8, 0, 14) along y) slid 36 along x.//!//! The wheel is its triangle turned about its axis; what it passes through is cadrs's sweep of a//! solid (one slide), cut from the block.usecrate::bench::{block, cut, p3, v3};
usecrate::shared::geometry::Section;
usecrate::shared::swept::slid;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, Plane};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let b = block(k, p3(0.0, -5.0, 0.0), p3(20.0, 5.0, 10.0))?;
let t = 3.0 * 30f64.to_radians().tan();
let section = Section::on(Plane::yz(-8.0))
.line((0.0, 8.0), (t, 11.0))
.line((t, 11.0), (-t, 11.0))
.line((-t, 11.0), (0.0, 8.0));
let wheel = section.turned(k, p3(-8.0, 0.0, 14.0), v3(0.0, 1.0, 0.0))?;
let swept = slid(k, wheel, v3(36.0, 0.0, 0.0))?;
cut(k, b, swept)
}
smlib left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
33 ms; CPU time 33 ms; peak memory 9.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.
//! The block (0, −5, 0)–(20, 5, 10) less everything a V wheel passes through as it slides along//! the x axis by 36: the solid of revolution about the line through (−8, 0, 14) along y of the//! triangle (0, 8), (−3 tan 30°, 11), (3 tan 30°, 11) in (y, z) on the plane x = −8.use std::f64::consts::TAU;
use springrep::boolean::difference;
use springrep::math::Vec3;
use springrep::sweep::{Motion, revolve, solid};
use springrep::topo::Brep;
usecrate::shared::swept::{boxed, polygon, v3};
usecrate::shared::{e, frame};
pubfnbuild() -> Result<Brep, String> {
let block = boxed([0.0, -5.0, 0.0], [20.0, 5.0, 10.0], "block")?;
let t = 3.0 * 30f64.to_radians().tan();
// sketch (y, z) on the plane x = −8, which holds the wheel's axis z = 14let plane = frame([-8.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0])?;
let triangle = polygon(&[(0.0, 8.0), (t, 11.0), (-t, 11.0)], "wheel");
let wheel = revolve(
&triangle,
&plane,
v3(-8.0, 0.0, 14.0),
Vec3::Y,
TAU,
"wheel",
)
.map_err(e)?;
let groove = solid(&wheel, &Motion::Slide(v3(36.0, 0.0, 0.0)), "groove").map_err(e)?;
difference(&block, &groove).map_err(e)
}
Time
135 ms; CPU time 254 ms; peak memory 38 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.
// A block, the box from (0, -5, 0) to (20, 5, 10), with a V groove cut across its top by a sharp// V wheel slid along it. The wheel's axis is the line through (-8, 0, 14) along y: in the plane// through that axis and z, the wheel is the triangle with its tip 6 below the axis (2 into the// block) and its other corners 3 above the tip, 3 tan 30 either side along the axis, turned about// the axis. It slides 36 along x, and the kernel's sweep of it is cut from the block.unit mm
use std
use std.solids (cut)
use std.place (coords, on_u)
use std.shapes
use std.motion (slides)
in std.top {
private mid := point
fix((10, 0)) mid
private outline := std.shapes.CenteredRectangle(mid, w: 20mm, h: 10mm)
}
part := solid(std.solids.Prism(outline.loop, from: 0mm, to: 10mm))
// the wheel, drawn in the plane through its axis, out from the axis downwardprivate down := axis
fix(dir == (0, 0, -1)) down
private along := axis
fix(dir == (0, 1, 0)) along
bench := plane(u: down, v: along)
fix(origin == (-8, 0, 14)) bench
in bench {
private a0 := point
private a1 := point
a0 coords(du: 0mm, dv: -1mm) bench
a1 coords(du: 0mm, dv: 1mm) bench
private wheel_axis := line(a0, a1)
private v0 := point
private v1 := point
private v2 := point
v0 on_u(d: 6mm) bench
v1 coords(du: 3mm, dv: -3mm * tan(30deg)) bench
v2 coords(du: 3mm, dv: 3mm * 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))
feed := frame
feed slides(36mm) std.x
construction groove := solid({ p | some t in (0deg, 360deg): p in vwheel at(under: feed) t })
groove cut part
anvilcad left no solid to show.
Time
8.1 ms; CPU time 7.8 ms; peak memory 5.2 MB
Notes
refused boolean operation failed: the result is not a closed solid (edge DVec3(28.0, -1.7320508075688772, 11.0) -> DVec3(28.0, 0.0, 8.0) used 1/0 by ["s1f2"])
//! A block from (0, −5, 0) to (20, 5, 10) less what a sharp V wheel (the triangle (0, 8),//! (∓3 tan 30°, 11) in (y, z) turned about the line through (−8, 0, 14) along y) passes through,//! slid 36 along x.use anvil_brep::{Solid, extrude};
usecrate::shared::{block, e, frame, polygon, region, subtract, turned, union};
pubfnbuild() -> Result<Solid, String> {
let t = 3. * 30f64.to_radians().tan();
// the wheel: its section, as (distance from its axis, along its axis), turned about the axislet wheel = |x: f64| turned(&frame([x, 0., 14.], [0., 1., 0.], [0., 0., -1.])?, polygon(&[(6., 0.), (3., -t), (3., t)]));
// anvil-brep has no sweep of a solid. Slid in its own plane the wheel fills itself at each end// and the prism of its shadow along the slide between: at each y the wheel reaches 6 − √3|y|// above and below its axis, so the shadow is the hexagon through (0, 8), (±√3, 11), (±√3, 17)// and (0, 20), in (y, z)let side = frame([-8., 0., 0.], [1., 0., 0.], [0., 1., 0.])?;
let s3 = 3f64.sqrt();
let shadow = region(&[polygon(&[(0., 8.), (s3, 11.), (s3, 17.), (0., 20.), (-s3, 17.), (-s3, 11.)])])?;
let between = extrude::extrude(&side, &shadow, 0., 36.).map_err(e)?;
let swept = union(&union(&wheel(-8.)?, &between)?, &wheel(28.)?)?;
subtract(&block([0., -5., 0.], [20., 5., 10.])?, &swept)
}