A curved block with a helical groove milled into it by a ball-end mill screwed across it.
The block is a sector of a ring about the z axis: everything with distance from the z axis between 8 and 12, with z between −2 and 2, and with polar angle between −30° and 30° (measured from +x toward +y).
The mill is a solid of revolution about the vertical line through (10, 0): the lower half of the ball of radius 1 centered at (10, 0, 0), under a cylinder of radius 1 from z = 0 up to z = 3, flat on top.
It is carried along a screw about the z axis: it turns right-handed about it (from +x toward +y) and rises 3 for every whole turn, rigidly, from a turn of −60° (lowered 0.5) to one of +60° (raised 0.5). It starts clear of the block, passes wholly through it, and ends clear of it; its top stands out above the block all the way. Cut from the block everything the mill passes through.
The ball sweeps the pipe about its center's helix, which touches what the side sweeps along the helix of the ball's widest circle.
expected
closed form
volume
109.1956263
no closed form: OCCT and cadrs agree to 2e-9; the mean of their values
area
242.2865388
no closed form: OCCT and cadrs agree to 2e-9; the mean of their values
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
4.83 s; CPU time 8.01 s; peak memory 24.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.
//! A ring sector (radii 8 to 12 about z, z from −2 to 2, polar angle −30° to 30°) with a helical//! groove milled across it by a ball-end mill about the vertical line through (10, 0) — the lower//! half of the ball of radius 1 about (10, 0, 0) under the cylinder of radius 1 from z = 0 to 3,//! flat on top — screwed about z, right-handed and rising 3 a turn, from a turn of −60° to +60°.//!//! Refused by the kernel: the closed sweep's arrangement fails to close the pieces of a sphere face//! (`Unbuilt::Failed`: "a sphere's pieces do not close").usecrate::sketch::polygon;
use cad_kernel::build::{revolve, Profile, ProfileEdge};
use cad_kernel::geom::{tolerance, Frame, V};
use cad_kernel::swept::closed::cut_from;
use cad_kernel::topo::Brep;
use cad_kernel::trajectory::{Screw, Trajectory};
use std::f64::consts::{FRAC_PI_2, TAU};
constUP: V = [0., 0., 1.];
/// The sector: its radii, its half-height and its half-angle (degrees) about +x.constRADII: [f64; 2] = [8., 12.];
constHALF_HEIGHT: f64 = 2.;
constHALF_ANGLE: f64 = 30.;
/// The ball's centre, on the mill's axis, the cylinder's radius and its top.constCENTRE: V = [10., 0., 0.];
constRADIUS: f64 = 1.;
constTOP: f64 = 3.;
/// How far the screw rises a whole turn.constRISE: f64 = 3.;
/// How far the screw turns each way from where the mill is drawn, in degrees.constTURN: f64 = 60.;
/// How closely the mill is meshed for the sweep's membership reads: a five-hundredth of its radius.constBAR: f64 = 0.002;
/// The ring sector: its section in the half-plane at −30° turned 60° about z.fnsector() -> Result<Brep, String> {
let (s, c) = (-HALF_ANGLE).to_radians().sin_cos();
let at = |r: f64, z: f64| [r * c, r * s, z];
let [inner, outer] = RADII;
let section = polygon(&[at(inner, -HALF_HEIGHT), at(outer, -HALF_HEIGHT),
at(outer, HALF_HEIGHT), at(inner, HALF_HEIGHT)]);
revolve(§ion, [0.; 3], UP, 2. * HALF_ANGLE.to_radians())
}
/// The mill: its meridian in the half-plane y = 0 beyond its axis — from the ball's lowest point/// round a quarter circle to its widest, up the side, back across the top and down the axis —/// turned once about the axis.fnmill() -> Result<Brep, String> {
let at = |x: f64, z: f64| [CENTRE[0] + x, 0., z];
let ball = Frame::new(CENTRE, [0., -1., 0.], [1., 0., 0.]);
let edges = vec![
ProfileEdge::Arc { frame: ball, r: RADIUS, span: Some([-FRAC_PI_2, 0.]) },
ProfileEdge::Line { a: at(RADIUS, CENTRE[2]), b: at(RADIUS, TOP) },
ProfileEdge::Line { a: at(RADIUS, TOP), b: at(0., TOP) },
ProfileEdge::Line { a: at(0., TOP), b: at(0., CENTRE[2] - RADIUS) },
];
let meridian = Profile { origin: CENTRE, normal: [0., 1., 0.], loops: vec![edges],
names: Vec::new() };
revolve(&meridian, CENTRE, UP, TAU)
}
pubfnbuild() -> Result<Brep, String> {
let blank = sector()?;
let tool = mill()?;
// 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 });
// the kernel's closed swept solid cut from the sector on one arrangement: the ball's great// circle square to its centre's velocity screwed into the pipe about the centre's helix, the// side's generators in the plane through both axes into coaxial cylinders, the top's rim's// disc into its ramplet size = blank.size().max(tool.size());
let turn = TURN.to_radians();
cut_from(&blank, &tool, &path, [-turn, turn], BAR, tolerance(size))
.map_err(|why| format!("the mill's sweep not built: {why:?}"))
}
Time
1.05 s; CPU time 1.05 s; peak memory 379.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 helical groove milled by a ball-end mill screwed across a block. A curved block with a helical
groove milled into it by a ball-end mill screwed across it.
The block is a sector of a ring about the z axis: everything with distance from the z axis between
8 and 12, with z between −2 and 2, and with polar angle between −30° and 30° (measured from +x
toward +y).
The mill is a solid of revolution about the vertical line through (10, 0): the lower half of the
ball of radius 1 centered at (10, 0, 0), under a cylinder of radius 1 from z = 0 up to z = 3, flat
on top.
It is carried along a screw about the z axis: it turns right-handed about it (from +x toward +y)
and rises 3 for every whole turn, rigidly, from a turn of −60° (lowered 0.5) to one of +60° (raised
0.5). It starts clear of the block, passes wholly through it, and ends clear of it; its top stands
out above the block all the way. Cut from the block everything the mill passes through.
The ball sweeps the pipe about its center's helix, which touches what the side sweeps along the
helix of the ball's widest circle."""import math
fromOCP.BRepBuilderAPIimport (BRepBuilderAPI_MakeEdge, BRepBuilderAPI_MakeFace,
BRepBuilderAPI_MakeWire)
fromOCP.BRepPrimAPIimportBRepPrimAPI_MakeRevolfromOCP.GCimportGC_MakeArcOfCirclefromOCP.gp import gp, gp_Ax1, gp_Pnt
from sweep import cut, plane, ring_sector, screw, screwed
BLOCK = (8, 12, -2, 2, -30, 30) # radii, heights and polar anglesAXIS = 10# the mill's axis is the vertical line through (10, 0)RADIUS, TOP = 1, 3LEAD = 3# rise per whole turnSTART, STOP = -60, 60# degreesdefmill():
"""The mill's half-section beside its axis, in the plane y = 0, turned about the axis: a
quarter circle from the ball's lowest point to its widest, the side and the flat top."""
p = [gp_Pnt(AXIS, 0, -RADIUS), gp_Pnt(AXIS + RADIUS, 0, 0), gp_Pnt(AXIS + RADIUS, 0, TOP),
gp_Pnt(AXIS, 0, TOP)]
middle = gp_Pnt(AXIS + RADIUS * math.sqrt(0.5), 0, -RADIUS * math.sqrt(0.5))
wire = BRepBuilderAPI_MakeWire()
wire.Add(BRepBuilderAPI_MakeEdge(GC_MakeArcOfCircle(p[0], middle, p[1]).Value()).Edge())
for i, j in ((1, 2), (2, 3), (3, 0)):
wire.Add(BRepBuilderAPI_MakeEdge(p[i], p[j]).Edge())
half = BRepBuilderAPI_MakeFace(wire.Wire()).Face()
returnBRepPrimAPI_MakeRevol(half, gp_Ax1(gp_Pnt(AXIS, 0, 0), gp.DZ_s())).Shape()
defbuild():
tool = screw(mill(), LEAD, START)
# A point p of the ball, centre c, moves with velocity ẑ × p + kẑ (k = 3/2π), square to# its normal p − c where (p − c)·(ẑ × c + kẑ) = 0: the great circle square to the centre's# own velocity, (0, 10, k) where the mill is drawn. The side, upright, meets the screw# square-on where it meets the turn, along its lines in the plane through both axes. The# flat top rises all over.
k = LEAD / (2 * math.pi)
cuts = [screw(plane((AXIS, 0, 0), (0, AXIS, k)), LEAD, START),
screw(plane((0, 0, 0), (0, 1, 0)), LEAD, START)]
returncut(ring_sector(*BLOCK), screwed(tool, LEAD, START, STOP, cuts))
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
115 ms; CPU time 138 ms; peak memory 57 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 curved block, the sector of the ring about the z axis between radii 8 and 12, z from −2 to 2//! and polar angle from −30° to 30°, with a helical groove milled into it by a ball-end mill: about//! the vertical line through (10, 0), the lower half of the ball of radius 1 about (10, 0, 0) under//! a cylinder of radius 1 up to z = 3, carried along the screw about the z axis, right-handed,//! rising 3 a turn, from a turn of −60° to +60°. Everything the mill passes through, cut.//!//! The mill is its half section revolved about its axis; its sweep is kentron's sweep of a solid//! (`sweep::solid`, one screw), cut from the block.usecrate::bench::p;
usecrate::shared::parts::xz_plane;
usecrate::shared::primitives::rectangle_xz;
use kentron::math::{Axis, Direction, Transform};
use kentron::modify::{self, TransformOptions};
use kentron::sketch::{self, Outcome, Step};
use kentron::sweep::{self, RigidMotion};
use kentron::topology::{Model, Shape};
use std::f64::consts::{FRAC_PI_3, TAU};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
useStep::{Arc, Heading, Start, To};
let section = rectangle_xz(m, (8.0, -2.0), (12.0, 2.0))?;
let section = modify::transform(m, section, &Transform::rotation(Axis::Z, -FRAC_PI_3 / 2.0), TransformOptions::default())?;
let block = sweep::revolve(m, section, Axis::Z, FRAC_PI_3)?.shape;
// The mill: its half section, out from its axis (the ball's quarter circle from its lowest// point up to its equator, the side up to the top), turned whole about it.let half = [Start(10.0, -1.0), Heading(0.0), Arc { radius: 1.0, angle: 90.0 }, To(11.0, 3.0), To(10.0, 3.0)];
let half = sketch::profile(m, xz_plane(0.0), &half, Outcome::Face)?;
let mill = sweep::revolve(m, half, Axis::new(p(10.0, 0.0, 0.0), Direction::Z), TAU)?.shape;
let screw = RigidMotion::Screw { axis: Axis::Z, lead: 3.0, from: (-60f64).to_radians(), to: 60f64.to_radians() };
let swept = sweep::solid(m, mill, &screw)?;
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
290 ms; CPU time 290 ms; peak memory 55.1 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.
Data
its STEP's
expected
rel. error
volume
109.1956028
109.1956263
2.1e-07
area
242.2866201
242.2865388
3.4e-07
agrees with
no other kernel
mesh
19484 triangles, closed
centre of gravity
(9.72886, 0.0816908, -0.317526) its STEP's solid
inertia
about it, of unit density: Ixx 1149.21; Iyy 354.31; Izz 1199.37; Ixy 4.21765; Iyz 4.1757; Izx -4.95422
//! A sector of a ring about the z axis (radii 8 to 12, z from −2 to 2, polar angles −30° to 30°)//! with a helical groove milled by a ball-end mill about the upright line through (10, 0): the//! lower half of the ball of radius 1 about (10, 0, 0) under the cylinder of radius 1 from z = 0//! to z = 3, carried along the screw about the z axis that rises 3 a turn, from a turn of −60° to//! one of +60°.//!//! solidcraft-kernel has no sweep of a solid, so the mill's sweep is built by elementary geometry//! from the kernel's helical sweep of planar regions (`sweep_helix`). Below its flat top, the//! mill is every point within 1 of the upright segment from its ball's centre c to 3 above it;//! screwed, those segments fill the strip of the cylinder of radius 10 from c's helix to 3 above//! it, and the mill's top stays above the block. A point within 1 of the strip lies between radii//! 9 and 11, and is within 1 either of the point of the cylinder straight out from the axis//! through it, when that lies in the strip, or of the strip's edge, which in the block is c's//! helix (the strip's top and ends stay clear of it). So in the block the sweep is the pipe of//! radius 1 about c's helix, the ball's great disc square to it carried along it (the helix turns//! no tighter than radius 10, so the pipe does not fold), with what lies between radii 9 and 11//! from that helix to 3 above it: the screw sweep of the mill's section, from z = 0 to z = 3, in//! the plane y = 0 through both axes.usesuper::square_bar_screwed_through_rod::{screw, screwed};
usecrate::solids::*;
use solidcraft_kernel::revolve;
use std::f64::consts::TAU;
pubfnbuild() -> R<Body> {
let (lead, start, stop) = (3.0, -60.0, 60.0);
// the sector: its section from radius 8 to 12 turned from −30° through 60°let sector = screwed(&xz(), 0.0, -30.0);
letmut block = one(revolve(§or, &[rect(8.0, -2.0, 12.0, 2.0)], Vec2::ZERO, Vec2::Y, -60f64.to_radians())?)?;
// the ball's great disc square to its centre's helix where the screw starts it at (10, 0, 0)let along = v3(0.0, TAU * 10.0, lead);
let disc_plane = Plane::from_normal(v3(10.0, 0.0, 0.0), along)
.ok_or_else(|| KernelError::Invalid("the disc's plane".into()))?;
block = cut(&block, &screw(&disc_plane, &disc((0.0, 0.0), 1.0), lead, start, stop)?)?;
block = cut(&block, &screw(&xz(), &rect(9.0, 0.0, 11.0, 3.0), lead, start, stop)?)?;
Ok(block)
}
brepkit left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
popkern left no solid to show.
Time
3.9 ms; CPU time 3.6 ms; peak memory 11.7 MB
Notes
refused popkern has no sweep of a solid, and this motion's envelope is not one its extrudes, revolves and booleans make exactly
// A helical groove milled by a ball-end mill screwed across a block.//// Refused: popkern has no sweep of a solid (its sweeps carry a profile along a path), and the// envelope this motion leaves is not one its extrudes, revolves and booleans make exactly: the// tool is not symmetric about the planes of its motion, or the motion is a screw or a curve.throw"popkern has no sweep of a solid, and this motion's envelope is not one its extrudes, revolves and booleans make exactly";
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
77 ms; CPU time 77 ms; peak memory 25 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 ring sector grooved by a ball-end mill screwed across it.//!//! The kernel's whole sweep of a solid (`sweep_solid`): the mill is a solid of revolution about//! the vertical line through (10, 0), its meridian the quarter circle of radius 1 below its centre//! (10, 0, 0), the side up to z = 3 and the flat top; swept by the screw about the z axis that//! rises 3 a turn, from −60° to +60° (its back at the start, its front at the end and the walls its//! grazing curve sweeps between); cut from the block, the rectangle 8 ≤ x ≤ 12, |z| ≤ 2 revolved//! from −30° to 30°.usecrate::solids::sweep::{moved, turn_z};
usecrate::solids::{p, polygon};
usecrate::Refusal;
use brep_kernel::{
boolean_operation_nary, revolve_profile_brep, sweep_solid, BooleanOperation, BrepSolid,
OutlinePiece, ScrewStep, SolidMotion, SolidTool,
};
use std::f64::consts::{FRAC_PI_2, TAU};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let z = p(0.0, 0.0, 1.0);
let section = [p(8.0, 0.0, -2.0), p(12.0, 0.0, -2.0), p(12.0, 0.0, 2.0), p(8.0, 0.0, 2.0)];
let sector = revolve_profile_brep(&polygon(§ion)?, p(0.0, 0.0, 0.0), z, 60f64.to_radians())?;
let block = moved(§or, turn_z(-30f64.to_radians(), p(0.0, 0.0, 0.0))?)?;
let mill = SolidTool::Revolved {
axis_origin: p(10.0, 0.0, 0.0),
axis_direction: z,
radial: p(1.0, 0.0, 0.0),
meridian: vec![
OutlinePiece::Arc { centre: [0.0, 0.0], radius: 1.0, start: -FRAC_PI_2, end: 0.0 },
OutlinePiece::Line { from: [1.0, 0.0], to: [1.0, 3.0] },
OutlinePiece::Line { from: [1.0, 3.0], to: [0.0, 3.0] },
OutlinePiece::Line { from: [0.0, 3.0], to: [0.0, -1.0] },
],
};
let screw = SolidMotion {
steps: vec![ScrewStep { axis_origin: p(0.0, 0.0, 0.0), axis_direction: z, turn: 1.0, advance: 3.0 / TAU }],
from: (-60f64).to_radians(),
to: 60f64.to_radians(),
};
letmut operands = vec![block];
operands.push(sweep_solid(&mill, &screw)?);
Ok(boolean_operation_nary(&operands, BooleanOperation::Subtract)?)
}
geop left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
45 ms; CPU time 86 ms; peak memory 12.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.
//! A curved block (the ring sector between radii 8 and 12, heights ±2, polar angles −30° to 30°)//! with a helical groove milled by a ball-end mill (about the upright through (10, 0): the lower//! half of the ball of radius 1 about (10, 0, 0) under a cylinder of radius 1 from z = 0 to 3)//! screwed about the z axis, rising 3 a turn, from a turn of −60° to +60°.//!//! The mill is its half section (a quarter circle and three lines) turned about its axis (cadrs's//! Revolve); what it passes through is cadrs's sweep of a solid (a turn and a slide along its axis//! at once: a screw), cut from the block (cadrs's cylindrical box).usecrate::bench::{cut, p3, v3};
usecrate::shared::geometry::Section;
usecrate::shared::swept::{ring_sector, screwed, z_axis};
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, Plane};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let block = ring_sector(k, (8.0, 12.0), (-2.0, 2.0), (-30.0, 30.0))?;
let w = 2f64.sqrt() / 2.0;
let section = Section::on(Plane::xz(0.0))
.line((10.0, -1.0), (10.0, 3.0))
.line((10.0, 3.0), (11.0, 3.0))
.line((11.0, 3.0), (11.0, 0.0))
.conic((11.0, 0.0), (11.0, -1.0), w, (10.0, -1.0));
let mill = section.turned(k, p3(10.0, 0.0, 0.0), v3(0.0, 0.0, 1.0))?;
let swept = screwed(k, mill, z_axis(), 3.0, -60.0, 60.0)?;
cut(k, block, 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
85 ms; CPU time 83 ms; peak memory 9.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.
//! The ring sector (radii 8 to 12, heights −2 to 2, angles −30° to 30°) less everything a ball-//! end mill (radius 1 about the upright line through (10, 0), its ball centered at (10, 0, 0))//! passes through as it is screwed about the z axis, rising 3 a turn, from −60° to 60°.use std::f64::consts::PI;
use springrep::boolean::difference;
use springrep::sweep::solid;
use springrep::topo::Brep;
usecrate::shared::e;
usecrate::shared::swept::{arc, deg, line, outline, ring_sector, screwing, upright};
pubfnbuild() -> Result<Brep, String> {
let block = ring_sector(8.0, 12.0, -2.0, 2.0, deg(-30.0), deg(30.0))?;
// the ball's quarter arc from the tip out to the side, the side up to z = 3, the flat toplet meridian = outline(vec![
arc((0.0, 0.0), 1.0, -PI / 2.0, PI / 2.0, "ball"),
line((1.0, 0.0), (1.0, 3.0), "side"),
line((1.0, 3.0), (0.0, 3.0), "top"),
line((0.0, 3.0), (0.0, -1.0), "axis"),
]);
let mill = upright(&meridian, 10.0, 0.0, "mill")?;
let swept = solid(&mill, &screwing(3.0, deg(-60.0), deg(60.0)), "screw").map_err(e)?;
difference(&block, &swept).map_err(e)
}
Time
4.14 s; CPU time 6.45 s; peak memory 47.2 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 curved block, the ring sector between radii 8 and 12 about the z axis, z within 2, polar angle// from -30 to +30 degrees: its section in the front plane (x, z) turned about the z axis from -30// to +30 degrees.// A ball-end mill about the upright line through (10, 0): the lower half of the ball of radius 1// about (10, 0, 0) under a cylinder of radius 1 up to z = 3, a turn of its half-section in the// front plane. It is carried by a screw about the z axis that turns right-handed (from +x toward// +y) and rises 3 a turn, from a turn of -60 degrees to one of +60, and everything it passes// through cut from the block.unit mm
use std
use std.solids
use std.solids (cut)
use std.motion (screws)
in std.front {
a := point
b := point hint((12, -2))
c := point hint((12, 2))
d := point hint((8, 2))
meridian := horizontal line(a, b) -> vertical line(b, c) ->
horizontal line(c, d) -> vertical line(d, a) -> close
fix((8, -2)) a
a distance(4) b
b distance(4) c
}
part := solid(std.solids.Revolution(meridian, about: std.z, from: -30deg, to: 30deg))
in std.front {
tip := point
k := point
lip := point hint((11, 0))
e2 := point hint((11, 3))
e3 := point hint((10, 3))
fix((10, -1)) tip
fix((10, 0)) k
fix((10, 3)) e3
// the half ball, from its lowest point round to its widest circle, where the side goes on
half := (ball := arc(center: k, start: tip, end: lip)) -> tangent vertical line(lip, e2) ->
horizontal line(e2, e3) -> vertical (spindle := line(e3, tip)) -> close
radius(1) ball
}
mill := solid(std.solids.Revolution(half, about: spindle))
climb := frame
climb screws(3mm) std.z
groove := solid({ p | some t in (-60deg, 60deg): p in mill at(under: climb) t })
groove cut part
anvilcad left no solid to show.
Time
1.2 ms; CPU time 980 µs; peak memory 3.5 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 helical groove milled by a ball-end mill screwed across a block.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())
}