A curved block with a notch cut down into it by a mill with a domed end swung partway into 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 −1 and 1, and with polar angle between 0° and 60° (measured from +x toward +y).
The mill is a solid of revolution about the vertical line through (10, 0): a cylinder of radius 1 standing up to z = 3, ended below by a cap of the sphere of radius 2 centered at (10, 0, 1.2). The cap's lowest point is (10, 0, −0.8), in the block, and it meets the cylinder in a sharp circle at z = 1.2 − √3 ≈ −0.532, where the sphere's radius 2 and the cylinder's 1 cross at 30°.
It turns rigidly about the z axis, right-handed (from +x toward +y), from −140° to +30°: it starts clear of the block and stops halfway across it. Cut from the block everything the mill passes through.
The turn carries the cap into tori about the z axis (each meridian of the cap an arc of a circle of radius 2 off the axis) and the side into cylinders, meeting along the circles the sharp rim's nearest and farthest points sweep.
expected
closed form
volume
63.21295221
80π/3 − ∫(π R(z)²/2 + (π/3)·10 R(z)) dz over −0.8 ≤ z ≤ 1, R(z) = min(√(4 − (z − 1.2)²), 1)
area
159.700968
40π + 16 − ∫2R dz (the opening at 0°) − (π/2 + 10π/3) (the opening in the top) + the walls about the axis (π/6)·2·10·ℓ, ℓ = π/3 + √3 − 0.2 the profile's length + half the mill's surface below z = 1, (4π(2 − √3) + 2π(√3 − 0.2))/2
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
1.29 s; CPU time 1.58 s; peak memory 18.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.
//! A ring sector (radii 8 to 12 about z, z from −1 to 1, polar angle 0° to 60°) notched by a mill//! about the vertical line through (10, 0): a cylinder of radius 1 up to z = 3, ended below by the//! cap of the sphere of radius 2 about (10, 0, 1.2), meeting it in a sharp circle at//! z = 1.2 − √3. It turns rigidly about z, right-handed, from −140° to +30°: it starts clear and//! stops halfway across.usecrate::sketch::polygon;
use cad_kernel::boolean::{combined, Op};
use cad_kernel::build::{disc, prism, revolve, sphere};
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::FRAC_PI_3;
constUP: V = [0., 0., 1.];
/// The dome's sphere's centre, on the mill's axis.constDOME_CENTRE: V = [10., 0., 1.2];
constDOME: f64 = 2.;
constRADIUS: f64 = 1.;
constTOP: f64 = 3.;
/// The turn's start and stop, in degrees.constFROM: f64 = -140.;
constTO: f64 = 30.;
/// 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 0° turned 60° about z.fnsector() -> Result<Brep, String> {
let section = polygon(&[[8., 0., -1.], [12., 0., -1.], [12., 0., 1.], [8., 0., 1.]]);
revolve(§ion, [0.; 3], UP, FRAC_PI_3)
}
/// The mill: the cylinder of radius 1 about its axis from below the dome's lowest point up to/// z = 3, kept where it is in the ball of radius 2 about the dome's centre or above that centre./// The ball's poles are laid square to the axis, 2 off it, so that both lie outside the cylinder/// and are cut away: the cap the mill keeps of the sphere has none (a pole is a point the/// kernel's Booleans do not split a sphere at).fnmill() -> Result<Brep, String> {
let [x0, y0, z0] = DOME_CENTRE;
let below = z0 - DOME - 1.;
let side = prism(&disc([x0, y0, below], UP, RADIUS), 0., TOP - below)?;
let ball = sphere(DOME_CENTRE, [0., 1., 0.], DOME)?;
let above = prism(&disc(DOME_CENTRE, UP, 2. * DOME), 0., TOP + 1. - z0)?;
let cap = combined(&ball, &above, Op::Union, 0.)?;
Ok(combined(&side, &cap, Op::Common, 0.)?)
}
pubfnbuild() -> Result<Brep, String> {
let blank = sector()?;
let tool = mill()?;
// the turn about z: a screw that does not advance, a radian a radian of the rolllet path = Trajectory::Twist(Screw { origin: [0.; 3], axis: UP, ratio: 1., advance: 0. });
// the kernel's closed swept solid cut from the sector on one arrangement: the cap's meridian// in the plane through both axes turned into tori about z, the side's generators into// cylinders, the sharp rim a circle square to the axis kept in its planelet size = blank.size().max(tool.size());
cut_from(&blank, &tool, &path, [FROM.to_radians(), TO.to_radians()], BAR, tolerance(size))
.map_err(|why| format!("the mill's sweep not built: {why:?}"))
}
Time
648 ms; CPU time 648 ms; peak memory 369.5 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 domed mill swung partway into a curved block. A curved block with a notch cut down into it by
a mill with a domed end swung partway into 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 −1 and 1, and with polar angle between 0° and 60° (measured from +x toward
+y).
The mill is a solid of revolution about the vertical line through (10, 0): a cylinder of radius 1
standing up to z = 3, ended below by a cap of the sphere of radius 2 centered at (10, 0, 1.2). The
cap's lowest point is (10, 0, −0.8), in the block, and it meets the cylinder in a sharp circle at z
= 1.2 − √3 ≈ −0.532, where the sphere's radius 2 and the cylinder's 1 cross at 30°.
It turns rigidly about the z axis, right-handed (from +x toward +y), from −140° to +30°: it starts
clear of the block and stops halfway across it. Cut from the block everything the mill passes
through.
The turn carries the cap into tori about the z axis (each meridian of the cap an arc of a circle of
radius 2 off the axis) and the side into cylinders, meeting along the circles the sharp rim's
nearest and farthest points sweep."""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, turn, turned
BLOCK = (8, 12, -1, 1, 0, 60) # radii, heights and polar anglesAXIS = 10# the mill's axis is the vertical line through (10, 0)RADIUS, TOP = 1, 3DOME_CENTRE, DOME_RADIUS = 1.2, 2# the cap's sphere, its centre on the axisSTART, STOP = -140, 30# degrees about the z axisdefmill():
"""The mill's half-section beside its axis, in the plane y = 0, turned about the axis: the
arc of the cap from its lowest point to the rim, the side and the flat top."""
low = DOME_CENTRE - DOME_RADIUS
rim = DOME_CENTRE - math.sqrt(DOME_RADIUS ** 2 - RADIUS ** 2)
a = math.asin(RADIUS / DOME_RADIUS) / 2# halfway round the arc
p = [gp_Pnt(AXIS, 0, low), gp_Pnt(AXIS + RADIUS, 0, rim), gp_Pnt(AXIS + RADIUS, 0, TOP),
gp_Pnt(AXIS, 0, TOP)]
middle = gp_Pnt(AXIS + DOME_RADIUS * math.sin(a), 0, DOME_CENTRE - DOME_RADIUS * math.cos(a))
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 = turn(mill(), gp.OZ_s(), START)
# The turn's axis and the mill's are parallel. A surface of revolution about the mill's axis# (the cap's sphere, its centre on that axis, among them) meets the turn square-on where its# normal lies in the plane through both axes, which cuts the cap and the side along their# contact; the flat top turns in its own plane.
through_axes = turn(plane((0, 0, 0), (0, 1, 0)), gp.OZ_s(), START)
swept = turned(tool, gp.OZ_s(), STOP - START, [through_axes])
returncut(ring_sector(*BLOCK), 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
16 ms; CPU time 16 ms; peak memory 11.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 curved block, the sector of the ring about the z axis between radii 8 and 12, z from −1 to 1//! and polar angle from 0° to 60°, notched by a domed mill swung partway into it: about the//! vertical line through (10, 0), a cylinder of radius 1 up to z = 3 ended below by the cap of the//! sphere of radius 2 about (10, 0, 1.2), meeting it at z = 1.2 − √3; turned rigidly about the z//! axis from −140° to +30°. 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 turn), cut from the block.usecrate::bench::p;
usecrate::shared::parts::xz_plane;
usecrate::shared::swept::ring_sector;
use kentron::math::{Axis, Direction};
use kentron::sketch::{self, Outcome, Step};
use kentron::sweep::{self, RigidMotion};
use kentron::topology::{Model, Shape};
use std::f64::consts::TAU;
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
useStep::{Arc, Heading, Start, To};
let block = ring_sector(m)?;
// The mill: its half section, out from its axis (the cap's arc from its lowest point round// 30° to the rim), turned whole about it.let half = [Start(10.0, -0.8), Heading(0.0), Arc { radius: 2.0, angle: 30.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 turn = RigidMotion::Turn { axis: Axis::Z, from: (-140f64).to_radians(), to: 30f64.to_radians() };
let swept = sweep::solid(m, mill, &turn)?;
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
104 ms; CPU time 104 ms; peak memory 51.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.
//! A ring sector, everything between 8 and 12 from the z axis with |z| ≤ 1 and polar angle from//! 0° to 60°, notched by a domed mill swung about the z axis from −140° to +30°: about the//! vertical line through (10, 0), a cylinder of radius 1 up to z = 3, ended below by the cap of//! the sphere of radius 2 about (10, 0, 1.2), which meets the cylinder at z = 1.2 − √3.//!//! solidcraft-kernel has no sweep of a solid, so the swing is built by elementary geometry//! ([`swung_partway`]): the mill meets each circle about the z axis in one arc holding the//! circle's point at 0°, so its section through its axis there is its shadow, revolved through//! the turn, with the mill's half ahead of that section where it stops.usesuper::drum_swung_partway_into_ring_sector::{half_ahead, swung_partway};
usecrate::solids::*;
use solidcore_record::Seg2;
use std::f64::consts::FRAC_PI_2;
pubfnbuild() -> R<Body> {
let line = |a: (f64, f64), b: (f64, f64)| Seg2::Line { a: v2(a.0, a.1), b: v2(b.0, b.1) };
let rim = 1.2 - 3f64.sqrt(); // where the cap meets the cylinder, 30° off the cap's axislet cap = |start: f64, sweep: f64| Seg2::Arc { center: v2(10.0, 1.2), radius: 2.0, start, sweep };
let sixth = FRAC_PI_2 / 3.0;
let section = vec![
cap(-FRAC_PI_2 - sixth, 2.0 * sixth),
line((11.0, rim), (11.0, 3.0)),
line((11.0, 3.0), (9.0, 3.0)),
line((9.0, 3.0), (9.0, rim)),
];
let half = vec![
cap(-FRAC_PI_2, sixth),
line((11.0, rim), (11.0, 3.0)),
line((11.0, 3.0), (10.0, 3.0)),
line((10.0, 3.0), (10.0, -0.8)),
];
let region = |segs: Vec<Seg2>| Region2 { outer: Loop2 { segs }, holes: vec![] };
swung_partway(region(section), Some(half_ahead(region(half))?))
}
// A ring sector (8 to 12 from the z axis, |z| ≤ 1, 0° to 60°) less everything a domed mill (a cylinder of radius 1 about the vertical through (10, 0) up to z = 3, ended by a cap of the sphere of radius 2 about (10, 0, 1.2)) passes through as it turns about z from -140° to 30°.//// A turn about the z axis sweeps the tool where it starts and where it stops and, between them, the// shadow of the tool on a half-plane through the axis (each point carried there round its circle// about the axis) revolved through the turn: here the tool is symmetric about its own plane through// the axis, so the shadow is its section in that plane.fnblock(m) {
m.profile(xz()).polygon([[8.0, -1.0], [12.0, -1.0], [12.0, 1.0], [8.0, 1.0]]).sketch("block")
.revolve(axis_at([0.0, 0.0, 0.0], [0.0, 0.0, 1.0]), blind(60.0))
}
fnswing(m, section, from, to) {
section.sketch("shadow").revolve(axis_at([0.0, 0.0, 0.0], [0.0, 0.0, 1.0]), blind(to - from))
.rotate(axis_at([0.0, 0.0, 0.0], [0.0, 0.0, 1.0]), from)
}
fnturned(body, angle) { body.rotate(axis_at([0.0, 0.0, 0.0], [0.0, 0.0, 1.0]), angle) }
fncutter(m) { m.profile(xz()).path(10.0, -0.8).arc_to([10.0 + 2.0 * sin(0.25), 1.2 - 2.0 * cos(0.25)], [11.0, 1.2 - sqrt(3.0)]).line_to(11.0, 3.0).line_to(10.0, 3.0).close().sketch("mill").revolve(axis_at([10.0, 0.0, 0.0], [0.0, 0.0, 1.0]), full_circle()) }
let m = model();
let b = block(m);
b = b.subtract(m.tool(|m| turned(cutter(m), -140.0)));
b = b.subtract(m.tool(|m| swing(m, m.profile(xz()).path(9.0, 1.2 - sqrt(3.0)).arc_to([10.0, -0.8], [11.0, 1.2 - sqrt(3.0)]).line_to(11.0, 3.0).line_to(9.0, 3.0).close(), -140.0, 30.0)));
b = b.subtract(m.tool(|m| turned(cutter(m), 30.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
33 ms; CPU time 32 ms; peak memory 25.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.
//! The ring sector 8 ≤ ρ ≤ 12, −1 ≤ z ≤ 1, 0° to 60° about the z axis, less everything a domed mill//! swung into it passes through as it turns rigidly about the z axis from −140° to +30°: the solid//! of revolution about the upright line through (10, 0): a cylinder of radius 1 up to z = 3, ended//! below by the cap of the sphere of radius 2 about (10, 0, 1.2).//!//! Through the kernel's whole sweep of a solid (`sweep_solid`): the mill, a solid of revolution//! about the upright line through (10, 0, 0) whose meridian is the sphere's arc from its lowest//! point out to radius 1, the side up to z = 3 and the flat top, turned about the z axis from −140°//! to +30°, its end positions included, and cut from the block.usecrate::solids::p;
usecrate::solids::swept::{less_all, revolved_tool, ring_sector, turn_about_z, Piece};
usecrate::Refusal;
use brep_kernel::{sweep_solid, BrepSolid};
use std::f64::consts::{FRAC_PI_2, PI};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let (x, z) = (p(1.0, 0.0, 0.0), p(0.0, 0.0, 1.0));
let shoulder = 1.2 - 3f64.sqrt();
let mill = revolved_tool(p(10.0, 0.0, 0.0), z, x, &[
Piece::Arc { centre: [0.0, 1.2], radius: 2.0, start: -FRAC_PI_2, end: -PI / 3.0 },
Piece::Line { from: [1.0, shoulder], to: [1.0, 3.0] },
Piece::Line { from: [1.0, 3.0], to: [0.0, 3.0] },
Piece::Line { from: [0.0, 3.0], to: [0.0, -0.8] },
]);
less_all(ring_sector(8.0, 12.0, -1.0, 1.0, 0.0, 60f64.to_radians())?, vec![sweep_solid(&mill, &turn_about_z((-140f64).to_radians(), 30f64.to_radians(), 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
20 ms; CPU time 37 ms; peak memory 11.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 ±1, polar angles 0° to 60°)//! notched by a mill with a domed end (a cylinder of radius 1 about the upright through (10, 0) up//! to z = 3, ended below by the cap of the sphere of radius 2 about (10, 0, 1.2)) turned about the//! z axis from −140° to +30°.//!//! The mill is its half section turned about its axis: the sphere's 30° arc from its lowest point//! (10, 0, −0.8) to the rim (11, 0, 1.2 − √3), drawn as the rational quadratic it is, and the//! cylinder's side up to z = 3. What it passes through is cadrs's sweep of a solid (one turn),//! cut from the block (cadrs's cylindrical box).usecrate::bench::{cut, p3, v3};
usecrate::shared::geometry::Section;
usecrate::shared::swept::{ring_sector, swung, 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), (-1.0, 1.0), (0.0, 60.0))?;
// The sphere's arc from angle −90° to −60° about (10, 1.2) in the (x, z) plane: its tangents// meet on the bisector at −75°, 2 / cos 15° out, its weight cos 15°.let half = 15f64.to_radians();
let m = (10.0 + 2.0 / half.cos() * (-75f64).to_radians().cos(), 1.2 + 2.0 / half.cos() * (-75f64).to_radians().sin());
let rim = 1.2 - 3f64.sqrt();
let section = Section::on(Plane::xz(0.0))
.conic((10.0, -0.8), m, half.cos(), (11.0, rim))
.line((11.0, rim), (11.0, 3.0))
.line((11.0, 3.0), (10.0, 3.0))
.line((10.0, 3.0), (10.0, -0.8));
let mill = section.turned(k, p3(10.0, 0.0, 0.0), v3(0.0, 0.0, 1.0))?;
let swept = swung(k, mill, z_axis(), -140.0, 30.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
17 ms; CPU time 17 ms; peak memory 9.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.
//! The ring sector (radii 8 to 12, heights −1 to 1, angles 0° to 60°) less everything a domed mill//! passes through as it turns about the z axis from −140° to 30°: a cylinder of radius 1 about the//! upright line through (10, 0) up to z = 3, ended below by a cap of the sphere of radius 2 about//! (10, 0, 1.2).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, sector_block, turning, upright};
pubfnbuild() -> Result<Brep, String> {
let rim = 1.2 - 3f64.sqrt();
// the meridian: the cap's arc from its lowest point up to the sharp rim, the side, the toplet meridian = outline(vec![
arc((0.0, 1.2), 2.0, -PI / 2.0, PI / 6.0, "cap"),
line((1.0, rim), (1.0, 3.0), "side"),
line((1.0, 3.0), (0.0, 3.0), "top"),
line((0.0, 3.0), (0.0, -0.8), "axis"),
]);
let mill = upright(&meridian, 10.0, 0.0, "mill")?;
let notch = solid(&mill, &turning(deg(-140.0), deg(30.0)), "notch").map_err(e)?;
difference(§or_block()?, ¬ch).map_err(e)
}
Time
1.29 s; CPU time 1.86 s; peak memory 36.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.
// A curved block, the ring sector between radii 8 and 12 about the z axis, z within 1, polar angle// from 0 to 60 degrees: its section in the front plane (x, z) turned 60 degrees about the z axis.// A domed mill about the upright line through (10, 0): a cylinder of radius 1 up to z = 3, ended// below by a cap of the sphere of radius 2 about (10, 0, 1.2), its lowest point (10, 0, -0.8); a// turn of its half-section in the front plane. It is turned rigidly about the z axis from -140 to// +30 degrees, and everything it passes through cut from the block.unit mm
use std
use std.solids
use std.solids (cut)
use std.motion (turns)
in std.front {
a := point
b := point hint((12, -1))
c := point hint((12, 1))
d := point hint((8, 1))
meridian := horizontal line(a, b) -> vertical line(b, c) ->
horizontal line(c, d) -> vertical line(d, a) -> close
fix((8, -1)) a
a distance(4) b
b distance(2) c
}
part := solid(std.solids.Revolution(meridian, about: std.z, to: 60deg))
in std.front {
tip := point
k := point hint((10, 1.2))
lip := point hint((11, -0.53))
e2 := point hint((11, 3))
e3 := point hint((10, 3))
fix((10, -0.8)) tip
fix((10, 3)) e3
k coincident spindle
tip distance(1, along: u) lip
// the cap, from its lowest point round to the sharp rim where it meets the side
half := (cap := arc(center: k, start: tip, end: lip)) -> vertical line(lip, e2) ->
horizontal line(e2, e3) -> vertical (spindle := line(e3, tip)) -> close
radius(2) cap
}
mill := solid(std.solids.Revolution(half, about: spindle))
swing := frame
swing turns(1) std.z
notch := solid({ p | some t in (-140deg, 30deg): p in mill at(under: swing) t })
notch cut part
anvilcad left no solid to show.
Time
1.4 ms; CPU time 1.1 ms; peak memory 3.5 MB
Notes
refused anvil-brep has no sweep of a solid, and what this motion sweeps is bounded by envelopes of the body's surfaces under it (a rim or a face leaning to the motion) that follow from no elementary construction, which it would have to compute itself
//! A domed mill swung partway into a curved block.use anvil_brep::Solid;
pubfnbuild() -> Result<Solid, String> {
Err("anvil-brep has no sweep of a solid, and what this motion sweeps is bounded by envelopes of the body's surfaces under it (a rim or a face leaning to the motion) that follow from no elementary construction, which it would have to compute itself".into())
}