A plate, the box from (−15, −15, 0) to (15, 15, 4), with a hole punched through it by an ellipsoid pushed aslant wholly through it.
The ellipsoid has semi-axes 3, 2 and 1.5 along x, y and z: everything with ((x + 2)/3)² + ((y + 1.5)/2)² + ((z + 4)/1.5)² ≤ 1, centered at (−2, −1.5, −4), wholly below the plate.
It slides without turning along the vector (4, 3, 12), ending centered at (2, 1.5, 8), wholly above the plate. Cut from the plate everything the ellipsoid passes through.
The ellipsoid touches what it sweeps along one smooth closed curve, where its normal is square to the push. That curve's path is the hole's wall, an oblique elliptic cylinder: every level of the plate loses the same ellipse.
3600 − 4·π√(b²c²u₁² + a²c²u₂² + a²b²u₃²)·|d|/|d_z|, (a, b, c) = (3, 2, 1.5), u = d/|d|, d = (4, 3, 12): each level loses the ellipsoid's shadow along the push
area
2307.984296
2280 − 2·(that shadow) + 4|d|/|d_z|·4p E(1 − q²/p²), p, q the semi-axes of the ellipsoid's shadow on the plane square to d (the square roots of the eigenvalues of P diag(a², b², c²) P, P the projection across d) and E the complete elliptic integral of the second kind (parameter m)
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
18 ms; CPU time 19 ms; peak memory 11.8 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no sweep of an ellipsoid (a ball's sweep, stretched)
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 plate, the box (−15, −15, 0)–(15, 15, 4), with a hole punched through it by the ellipsoid of//! semi-axes 3, 2 and 1.5 along x, y and z centred at (−2, −1.5, −4), wholly below it, slid without//! turning along (4, 3, 12) to centre (2, 1.5, 8), wholly above it.//!//! cad-kernel's sweep of a solid (`swept::closed::cut_from`) refuses the ellipsoid under a slide//! (`Unbuilt::Curved` at its pole): it takes a face that is a plane, a cylinder, a cone, a ball or//! a torus, and an ellipsoid's is a ball's affine image. So the sweep is built through that image://! an affine map carries everything a solid passes through under a slide to everything its image//! passes through under the image of the slide. The unit ball about the centre, slid along the push//! read back through the stretch, is swept by the kernel's own sweep of a ball (`build::canal`: its//! disc square to the slide carried along it, a half ball beyond each end), and the stretch that//! makes the ball the ellipsoid (`Affine::stretch`, `build::ellipsoid`'s) carries that sweep onto//! the ellipsoid's.usecrate::sketch::block;
use cad_kernel::affine::Affine;
use cad_kernel::boolean::{combined, Op};
use cad_kernel::build::canal;
use cad_kernel::geom::{Frame, V};
use cad_kernel::topo::Brep;
use cad_kernel::util::space::{norm, unit};
constCENTRE: V = [-2., -1.5, -4.];
constSEMI: [f64; 3] = [3., 2., 1.5];
constPUSH: V = [4., 3., 12.];
pubfnbuild() -> Result<Brep, String> {
let plate = block([-15., -15., 0.], [15., 15., 4.])?;
// the stretch carrying the unit ball about the centre onto the ellipsoid, along the world's// axeslet frame = Frame::new(CENTRE, [0., 0., 1.], [1., 0., 0.]);
let stretch = Affine::stretch(&frame, SEMI)?;
// the push read back through the stretch: what the unit ball slides alonglet back = stretch.inverse().vector(PUSH);
let ball = canal(CENTRE, 1., CENTRE, unit(back), 0., norm(back), "hole")?;
let swept = ball.mapped(&stretch);
Ok(combined(&plate, &swept, Op::Cut, 0.)?)
}
Time
770 ms; CPU time 769 ms; peak memory 370 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no sweep of a solid, no ellipsoid
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.
"""An ellipsoid pushed aslant wholly through a plate. A plate, the box from (−15, −15, 0) to (15,
15, 4), with a hole punched through it by an ellipsoid pushed aslant wholly through it.
The ellipsoid has semi-axes 3, 2 and 1.5 along x, y and z: everything with ((x + 2)/3)² + ((y +
1.5)/2)² + ((z + 4)/1.5)² ≤ 1, centered at (−2, −1.5, −4), wholly below the plate.
It slides without turning along the vector (4, 3, 12), ending centered at (2, 1.5, 8), wholly above
the plate. Cut from the plate everything the ellipsoid passes through.
The ellipsoid touches what it sweeps along one smooth closed curve, where its normal is square to
the push. That curve's path is the hole's wall, an oblique elliptic cylinder: every level of the
plate loses the same ellipse."""fromOCP.BRepBuilderAPIimportBRepBuilderAPI_GTransform, BRepBuilderAPI_NurbsConvertfromOCP.BRepPrimAPIimportBRepPrimAPI_MakeBox, BRepPrimAPI_MakeSpherefromOCP.gp import gp_GTrsf, gp_Mat, gp_XYZ, gp_Pnt
from sweep import cut, plane, slid, split_solid
PLATE = ((-15, -15, 0), (15, 15, 4))
CENTRE = (-2, -1.5, -4)
SEMI = (3, 2, 1.5) # the semi-axes along x, y and zPUSH = (4, 3, 12)
defbuild():
# At a point p of the ellipsoid, the image of the point q of the unit ball, p = c + Aq with# A = diag(3, 2, 1.5), the normal is along A⁻¹q, square to the push v where q·A⁻¹v = 0: the# image of the unit ball's great circle square to A⁻¹v. Split the ball along that circle,# where the plane meets it exactly, before stretching it.
ball = split_solid(BRepPrimAPI_MakeSphere(1).Shape(),
[plane((0, 0, 0), tuple(v / a for v, a inzip(PUSH, SEMI)))])
# OCCT has no ellipsoid: the ball stretched by a non-uniform scale and moved to the centre,# which GTransform carries out exactly, as a rational B-spline
stretch = gp_GTrsf(gp_Mat(SEMI[0], 0, 0, 0, SEMI[1], 0, 0, 0, SEMI[2]), gp_XYZ(*CENTRE))
ellipsoid = BRepBuilderAPI_GTransform(ball, stretch, True).Shape()
# The hole's wall is the slide of the ellipse, a surface of linear extrusion of a rational# B-spline curve, which OCCT's integration of area and volume (BRepGProp) gets wrong by 4e-4# once the plate trims it; the same surface written as a NURBS (an exact conversion) it# integrates right.
swept = [BRepBuilderAPI_NurbsConvert(piece, True).Shape() for piece inslid(ellipsoid, PUSH)]
returncut(BRepPrimAPI_MakeBox(gp_Pnt(*PLATE[0]), gp_Pnt(*PLATE[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
248 ms; CPU time 252 ms; peak memory 19.6 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no ellipsoid
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 plate, the box from (−15, −15, 0) to (15, 15, 4), with a hole punched by an ellipsoid pushed//! aslant through it: semi-axes 3, 2 and 1.5 along x, y and z, centred at (−2, −1.5, −4), slid//! without turning along (4, 3, 12), from wholly below the plate to wholly above it. Everything the//! ellipsoid passes through, cut.//!//! kentron has no ellipsoid, so it is the unit ball stretched by 3, 2 and 1.5 along x, y and z and//! moved to its centre, a general affine map that `modify::transform_affine` carries out exactly,//! as a rational B-spline. Its sweep is kentron's sweep of a solid (`sweep::solid`, one slide),//! cut from the plate.usecrate::bench::{p, v};
use kentron::math::{AffineTransform, Matrix3};
use kentron::modify;
use kentron::primitives::{Cuboid, Sphere};
use kentron::sweep::{self, RigidMotion};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let plate = Cuboid::from_corners(p(-15.0, -15.0, 0.0), p(15.0, 15.0, 4.0)).build(m)?;
let ball = Sphere::new(1.0).build(m)?;
let stretch = Matrix3::from_rows([[3.0, 0.0, 0.0], [0.0, 2.0, 0.0], [0.0, 0.0, 1.5]]);
let ellipsoid = modify::transform_affine(m, ball, &AffineTransform::new(stretch, v(-2.0, -1.5, -4.0)))?;
let swept = sweep::solid(m, ellipsoid, &RigidMotion::Slide { by: v(4.0, 3.0, 12.0) })?;
kentron::boolean::difference(m, plate, 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
203 ms; CPU time 203 ms; peak memory 48.7 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no sweep of a solid, no ellipsoid
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 plate, the box from (−15, −15, 0) to (15, 15, 4), with a hole punched through it by an//! ellipsoid, semi-axes 3, 2 and 1.5 along x, y and z about (−2, −1.5, −4), slid without turning//! along (4, 3, 12).//!//! solidcraft-kernel has no sweep of a solid and no ellipsoid, so the sweep is built by elementary//! geometry. The ellipsoid is the ball of radius 1 stretched by S = diag(3, 2, 1.5) and moved to//! its centre, and a linear map carries a slide onto a slide: the ellipsoid slid along (4, 3, 12)//! is the ball slid along S⁻¹(4, 3, 12) = (4/3, 1.5, 8), stretched. The ball's slide is the//! cylinder of radius 1 about its centre's path with the ball at each end. The cylinder's ends,//! and the balls, stretched, lie within the ellipsoid where it starts and where it stops, wholly//! below z = −2.5 and above z = 6.5, clear of the plate; so the stretched cylinder, an oblique//! elliptic one, is what the sweep takes from the plate. The kernel's `transform_matrix` scales.usecrate::solids::*;
pubfnbuild() -> R<Body> {
let plate = block((-15.0, -15.0, 0.0), (15.0, 15.0, 4.0))?;
let path = v3(4.0 / 3.0, 1.5, 8.0);
let tube = solidcraft_kernel::cylinder(Vec3::ZERO, path, 1.0, path.len())?;
// column by column: x, y and z stretched, then moved to the ellipsoid's centrelet stretch = [
[3.0, 0.0, 0.0, 0.0],
[0.0, 2.0, 0.0, 0.0],
[0.0, 0.0, 1.5, 0.0],
[-2.0, -1.5, -4.0, 1.0],
];
cut(&plate, &solidcraft_kernel::transform_matrix(&tube, stretch)?)
}
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
4 ms; CPU time 3.7 ms; peak memory 11.6 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
// An ellipsoid pushed aslant wholly through a plate.//// 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
15 ms; CPU time 14 ms; peak memory 18.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.
//! The plate from (−15, −15, 0) to (15, 15, 4), less everything the ellipsoid of semi-axes 3, 2//! and 1.5 centred at (−2, −1.5, −4) passes through as it slides without turning along (4, 3, 12).//!//! The kernel's whole sweep of an ellipsoid slid along a line (`sweep_ellipsoid_along_line`), cut//! from the plate.usecrate::solids::p;
usecrate::solids::swept::less_all;
usecrate::Refusal;
use brep_kernel::{make_box_brep, sweep_ellipsoid_along_line, BrepSolid};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let plate = make_box_brep(p(-15.0, -15.0, 0.0), 30.0, 30.0, 4.0)?;
let (x, y) = (p(1.0, 0.0, 0.0), p(0.0, 1.0, 0.0));
let swept =
sweep_ellipsoid_along_line(p(-2.0, -1.5, -4.0), x, y, [3.0, 2.0, 1.5], p(4.0, 3.0, 12.0))?;
less_all(plate, vec![swept])
}
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
34 ms; CPU time 70 ms; peak memory 11.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.
//! A plate (the box from (−15, −15, 0) to (15, 15, 4)) holed by an ellipsoid (semi-axes 3, 2 and//! 1.5 along x, y and z, centered at (−2, −1.5, −4)) pushed along (4, 3, 12), wholly through it.//!//! The ellipsoid is a unit ball (cadrs's sphere primitive) stretched along the axes (as//! `geometry/ellipsoid`) and moved; what it passes through is cadrs's sweep of a solid (one//! slide), cut from the plate.usecrate::bench::{ball, block, cut, moved, p3, v3};
usecrate::shared::swept::slid;
use cadrs_kernel::Kernel;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let plate = block(k, p3(-15.0, -15.0, 0.0), p3(15.0, 15.0, 4.0))?;
let unit = ball(k, p3(0.0, 0.0, 0.0), 1.0)?;
let stretched = k.scale_axes(unit, p3(0.0, 0.0, 0.0), v3(3.0, 2.0, 1.5))?.first()?;
let e = moved(k, stretched, v3(-2.0, -1.5, -4.0))?;
let swept = slid(k, e, v3(4.0, 3.0, 12.0))?;
cut(k, plate, 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
213 ms; CPU time 212 ms; peak memory 9.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 plate (−15, −15, 0)–(15, 15, 4) less everything an ellipsoid passes through as it slides//! along (4, 3, 12): semi-axes 3, 2 and 1.5 along x, y and z about (−2, −1.5, −4).use springrep::boolean::difference;
use springrep::primitive::ellipsoid;
use springrep::sweep::{Motion, solid};
use springrep::topo::Brep;
usecrate::shared::swept::{boxed, v3};
usecrate::shared::{at, e};
pubfnbuild() -> Result<Brep, String> {
let plate = boxed([-15.0, -15.0, 0.0], [15.0, 15.0, 4.0], "plate")?;
let ball = ellipsoid(&at([-2.0, -1.5, -4.0]), v3(3.0, 2.0, 1.5), "ball").map_err(e)?;
let hole = solid(&ball, &Motion::Slide(v3(4.0, 3.0, 12.0)), "hole").map_err(e)?;
difference(&plate, &hole).map_err(e)
}
geomsolver left no solid to show.
Time
27 ms; CPU time 27 ms; peak memory 12.5 MB
Notes
refused Solvent has no ellipsoid with three unequal semi-axes that a sweep can carry. Its sets are balls, cylinders, cones and half-spaces (a bound on summed distances from two foci gives only a spheroid), a set body cannot bound a quadratic form in the point's coordinates, and no word scales a solid affinely. The one way to state the ellipsoid, a face family lofting its elliptic sections (`std.shapes.Ellipse` traced at each station), is a solid the sweep refuses: sliding a lofted body is E080, "material fields currently require prisms, revolutions, Boolean bodies or named motions".
// A plate punched by an ellipsoid of semi-axes 3, 2 and 1.5 pushed aslant wholly through it.//// Refused: Solvent has no ellipsoid with three unequal semi-axes that a sweep can carry. Its sets// are balls, cylinders, cones and half-spaces (a bound on summed distances from two foci gives// only a spheroid), a set body cannot bound a quadratic form in the point's coordinates, and no// word scales a solid affinely. The one way to state the ellipsoid, a face family lofting its// elliptic sections (`std.shapes.Ellipse` traced at each station), is a solid the sweep refuses:// sliding a lofted body is E080, "material fields currently require prisms, revolutions, Boolean// bodies or named motions".
anvilcad left no solid to show.
Time
1.2 ms; CPU time 1 ms; peak memory 3.6 MB
Notes
refused anvil-brep has no ellipsoid (its revolve takes no ellipse, and its scale refuses to stretch a sphere), and no sweep of a solid
//! An ellipsoid pushed aslant wholly through a plate.use anvil_brep::Solid;
pubfnbuild() -> Result<Solid, String> {
Err("anvil-brep has no ellipsoid (its revolve takes no ellipse, and its scale refuses to stretch a sphere), and no sweep of a solid".into())
}