A curved block with a notch cut down into it by a drill 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 drill is a solid of revolution about the vertical line through (10, 0): a cylinder of radius 1 from z = −0.8 + 1/tan 59° up to z = 3, ended below in a cone of 118° (each side 59° from the axis) whose point is (10, 0, −0.8). The point is in the block; the drill stands out through its top.
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 drill passes through.
The rim where the cone meets the cylinder is a sharp circle. The turn carries the cone's side and the cylinder's into cones and cylinders about the z axis, which meet along the circles the rim's nearest and farthest points sweep.
40π + 16 − ∫2R dz (the opening at 0°) − (π/2 + 10π/3) (the opening in the top) + the walls about the axis (π/6)·2·10·ℓ, ℓ = 1/sin 59° + 1.8 − 1/tan 59° the profile's length + half the drill's surface below z = 1, (π/sin 59° + 2π(1.8 − 1/tan 59°))/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
4.23 s; CPU time 8.14 s; peak memory 37.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 ring sector (radii 8 to 12 about z, z from −1 to 1, polar angle 0° to 60°) notched by a drill//! about the vertical line through (10, 0): a cylinder of radius 1 up to z = 3, ended below by a//! cone of 118° whose point is (10, 0, −0.8). It turns rigidly about z, right-handed, from −140° to//! +30°: it starts clear and stops halfway across.//!//! Refused by the kernel: the closed sweep's arrangement fails to close the pieces of a cone face//! (`Unbuilt::Failed`: "a cone's pieces do not close").usecrate::sketch::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::{FRAC_PI_3, TAU};
constUP: V = [0., 0., 1.];
constPOINT: V = [10., 0., -0.8];
constRADIUS: f64 = 1.;
constTOP: f64 = 3.;
/// Each side of the point's cone from its axis, in degrees.constHALF_ANGLE: f64 = 59.;
/// The turn's start and stop, in degrees.constFROM: f64 = -140.;
constTO: f64 = 30.;
/// How closely the drill 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)
}
pubfnbuild() -> Result<Brep, String> {
let blank = sector()?;
// the drill: its meridian in the half-plane y = 0 beyond its axis — from the point up the// cone to the rim, up the side, back across the top and down the axis — turned oncelet [x0, _, z0] = POINT;
let rim = z0 + RADIUS / HALF_ANGLE.to_radians().tan();
let meridian = polygon(&[POINT, [x0 + RADIUS, 0., rim], [x0 + RADIUS, 0., TOP], [x0, 0., TOP]]);
let drill = revolve(&meridian, POINT, UP, TAU)?;
// 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 cone's and the// side's generators in the plane through both axes turned into a cone and cylinders about z,// the sharp rim a circle square to the axis kept in its planelet size = blank.size().max(drill.size());
cut_from(&blank, &drill, &path, [FROM.to_radians(), TO.to_radians()], BAR, tolerance(size))
.map_err(|why| format!("the drill's sweep not built: {why:?}"))
}
Time
673 ms; CPU time 672 ms; peak memory 370.2 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 pointed drill swung partway into a curved block. A curved block with a notch cut down into it
by a drill 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 drill is a solid of revolution about the vertical line through (10, 0): a cylinder of radius 1
from z = −0.8 + 1/tan 59° up to z = 3, ended below in a cone of 118° (each side 59° from the axis)
whose point is (10, 0, −0.8). The point is in the block; the drill stands out through its top.
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 drill passes
through.
The rim where the cone meets the cylinder is a sharp circle. The turn carries the cone's side and
the cylinder's into cones and cylinders about the z axis, which meet along the circles the rim's
nearest and farthest points sweep."""import math
fromOCP.BRepBuilderAPIimportBRepBuilderAPI_MakeFace, BRepBuilderAPI_MakePolygonfromOCP.BRepPrimAPIimportBRepPrimAPI_MakeRevolfromOCP.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 drill's axis is the vertical line through (10, 0)POINT, TOP = -0.8, 3# heights of its point and its flat topRADIUS = 1HALF_ANGLE = 59# of the point, from the axisSTART, STOP = -140, 30# degrees about the z axisdefbuild():
shoulder = POINT + RADIUS / math.tan(math.radians(HALF_ANGLE))
# the drill's half-section beside its axis, turned about the axis: a cone and a cylinder
profile = [gp_Pnt(AXIS, 0, POINT), gp_Pnt(AXIS + RADIUS, 0, shoulder),
gp_Pnt(AXIS + RADIUS, 0, TOP), gp_Pnt(AXIS, 0, TOP)]
half = BRepBuilderAPI_MakeFace(BRepBuilderAPI_MakePolygon(*profile, True).Wire()).Face()
drill = BRepPrimAPI_MakeRevol(half, gp_Ax1(gp_Pnt(AXIS, 0, 0), gp.DZ_s())).Shape()
tool = turn(drill, gp.OZ_s(), START)
# The turn's axis and the drill's are parallel: its cone and its cylinder meet the turn# square-on where their normals lie in the plane through both axes, which cuts them 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
15 ms; CPU time 15 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 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 drill swung partway into it: about the vertical//! line through (10, 0), a cylinder of radius 1 up to z = 3 ended below by a cone of 118° whose//! point is (10, 0, −0.8), turned rigidly about the z axis from −140° to +30°. Everything the//! drill passes through, cut.//!//! The drill 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::{Start, To};
let block = ring_sector(m)?;
// Where the cone meets the cylinder.let rim = -0.8 + 1.0 / 59f64.to_radians().tan();
let half = [Start(10.0, -0.8), To(11.0, rim), To(11.0, 3.0), To(10.0, 3.0)];
let half = sketch::profile(m, xz_plane(0.0), &half, Outcome::Face)?;
let drill = 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, drill, &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
112 ms; CPU time 111 ms; peak memory 50.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 ring sector, everything between 8 and 12 from the z axis with |z| ≤ 1 and polar angle from//! 0° to 60°, notched by a drill 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 in a cone of 118° whose//! point is (10, 0, −0.8).//!//! solidcraft-kernel has no sweep of a solid, so the swing is built by elementary geometry//! ([`swung_partway`]): the drill 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 drill's half ahead of that section where it stops.usesuper::drum_swung_partway_into_ring_sector::{half_ahead, swung_partway};
usecrate::solids::*;
pubfnbuild() -> R<Body> {
// the rim where the cone, each side 59° from the axis, reaches the cylinder's radius 1let rim = -0.8 + 1.0 / 59f64.to_radians().tan();
let section = polygon(&[(10.0, -0.8), (11.0, rim), (11.0, 3.0), (9.0, 3.0), (9.0, rim)]);
let half = polygon(&[(10.0, -0.8), (11.0, rim), (11.0, 3.0), (10.0, 3.0)]);
swung_partway(section, Some(half_ahead(half)?))
}
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
1.98 s; CPU time 2.56 s; peak memory 67.6 MB
Notes
refused FeatureFailed at drill_swung_partway_into_ring_sector.rhai:21:7: feature 'boolean-3' (boolean) failed: result validation failed: cellular result invalid: Half-edge HalfEdgeHandle(31v1) in loop LoopHandle(7v1) ends at VertexHandle(14v1) but its successor HalfEdgeHandle(25v1) starts at VertexHandle(9v1)
// A ring sector (8 to 12 from the z axis, |z| ≤ 1, 0° to 60°) less everything a drill (a cylinder of radius 1 about the vertical through (10, 0) up to z = 3, ended in a cone of 118° whose point is (10, 0, -0.8)) 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()).polygon([[10.0, -0.8], [11.0, -0.8 + 1.0 / tan(59.0 * 3.141592653589793 / 180.0)], [11.0, 3.0], [10.0, 3.0]]).sketch("drill").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()).polygon([[10.0, -0.8], [11.0, -0.8 + 1.0 / tan(59.0 * 3.141592653589793 / 180.0)], [11.0, 3.0], [9.0, 3.0], [9.0, -0.8 + 1.0 / tan(59.0 * 3.141592653589793 / 180.0)]]), -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
28 ms; CPU time 27 ms; peak memory 25.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 ring sector 8 ≤ ρ ≤ 12, −1 ≤ z ≤ 1, 0° to 60° about the z axis, less everything a drill//! 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 from z = −0.8 +//! 1/tan 59° to 3, ended below by a cone of 118° with its point at (10, 0, −0.8).//!//! Through the kernel's whole sweep of a solid (`sweep_solid`): the drill, a solid of revolution//! about the upright line through (10, 0, 0) whose meridian is the cone's side from its point, the//! cylinder's side 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};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let (x, z) = (p(1.0, 0.0, 0.0), p(0.0, 0.0, 1.0));
let shoulder = -0.8 + 1.0 / 59f64.to_radians().tan();
let drill = revolved_tool(p(10.0, 0.0, 0.0), z, x, &[
Piece::Line { from: [0.0, -0.8], to: [1.0, shoulder] },
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(&drill, &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
16 ms; CPU time 31 ms; peak memory 11.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, heights ±1, polar angles 0° to 60°)//! notched by a drill (a cylinder of radius 1 about the upright through (10, 0) up to z = 3, ended//! below by a cone of 118° with its point at (10, 0, −0.8)) turned about the z axis from −140° to//! +30°.//!//! The drill is its half section turned about its axis; 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))?;
let shoulder = -0.8 + 1.0 / 59f64.to_radians().tan();
let section = Section::on(Plane::xz(0.0))
.line((10.0, -0.8), (11.0, shoulder))
.line((11.0, shoulder), (11.0, 3.0))
.line((11.0, 3.0), (10.0, 3.0))
.line((10.0, 3.0), (10.0, -0.8));
let drill = section.turned(k, p3(10.0, 0.0, 0.0), v3(0.0, 0.0, 1.0))?;
let swept = swung(k, drill, 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
24 ms; CPU time 24 ms; peak memory 9 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! The ring sector (radii 8 to 12, heights −1 to 1, angles 0° to 60°) less everything a drill//! passes through as it turns about the z axis from −140° to 30°: the drill is a cylinder of radius//! 1 about the upright line through (10, 0) up to z = 3, ended below in a 118° cone pointed at//! (10, 0, −0.8).use springrep::boolean::difference;
use springrep::sweep::solid;
use springrep::topo::Brep;
usecrate::shared::e;
usecrate::shared::swept::{deg, polygon, sector_block, turning, upright};
pubfnbuild() -> Result<Brep, String> {
let rim = -0.8 + 1.0 / deg(59.0).tan();
// the drill's meridian, out from its axislet meridian = polygon(&[(0.0, -0.8), (1.0, rim), (1.0, 3.0), (0.0, 3.0)], "drill");
let drill = upright(&meridian, 10.0, 0.0, "drill")?;
let notch = solid(&drill, &turning(deg(-140.0), deg(30.0)), "notch").map_err(e)?;
difference(§or_block()?, ¬ch).map_err(e)
}
geomsolver left no solid to show.
Time
382 ms; CPU time 726 ms; peak memory 33 MB
Notes
refused error[E080]: `part`: the exported surface disagrees with the material field at 24 of 554 probes; nothing was written
// 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 drill about the upright line through (10, 0): a cylinder of radius 1 up to z = 3, ended below// in a cone of 118 degrees, each side 59 degrees from the axis, its 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
lip := point hint((11, -0.2))
e2 := point hint((11, 3))
e3 := point hint((10, 3))
fix((10, -0.8)) tip
fix((10, 3)) e3
tip distance(1, along: u) lip
// the cone's side, 59 degrees from the axis, to the sharp rim where it meets the side
half := (cone := line(tip, lip)) -> vertical line(lip, e2) ->
horizontal line(e2, e3) -> vertical (spindle := line(e3, tip)) -> close
cone angle(59deg) std.z
}
drill := solid(std.solids.Revolution(half, about: spindle))
swing := frame
swing turns(1) std.z
notch := solid({ p | some t in (-140deg, 30deg): p in drill at(under: swing) t })
notch cut part
anvilcad left no solid to show.
Time
1.2 ms; CPU time 1000 µs; peak memory 3.4 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 pointed drill 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())
}