The cube from (−10, −10, −10) to (10, 10, 10) with a closed cavity at its middle, the oblate spheroid of geometry/oblate-spheroid, (x² + y²)/36 + z²/9 ≤ 1, taken out of it: a solid bounded by the cube's six faces outside and the spheroid's surface inside, facing into the cavity. Grow it by 1: the solid of every point within 1 of it.
Outside, the cube grows as a box does: each face moves 1 outward, each edge becomes a quarter of a cylinder of radius 1, each corner an eighth of a ball. Inside, every point of the cavity within 1 of its wall is filled, so the cavity shrinks to the spheroid's inner parallel body at distance 1: the points of the spheroid more than 1 from its surface, bounded by the spheroid's surface moved 1 inward along its normals, its equator at radius 5 and its poles at z = ±2. The spheroid's surface curves most tightly at its equator, where its radius of curvature is 3/2, more than 1, so that moved surface is smooth; it is not an ellipsoid. The grown solid is still one solid with one closed cavity, which no face of the cube's comes near.
The volume and area of the cavity left are Steiner's polynomials of the spheroid at −d, as in shell/oblate-spheroid-hollowed, with V = 144π, S and M the spheroid's volume, area and integral of mean curvature.
(a³ + 6a²d + 3πad² + 4πd³/3) − (V − Sd + Md² − 4πd³/3): the cube grown less the cavity shrunk (Steiner), a = 20, d = 1, V = 144π, S = 72π + 12√3π ln(2 + √3), M = 6π + 8√3π²/3
area
2985.441025
(6a² + 6πad + 4πd²) + (S − 2Md + 4πd²)
Drawing
TopIsometricFrontRight
Third-angle projection, the three views at one scale. Drawn from next.BREP'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.
cad-kernel left no solid to show.
Time
2.5 ms; CPU time 2.8 ms; peak memory 10.2 MB
Notes
refused face 6 (revolution) is not swept along its normal: a revolution has no offset in closed form (at Some([0.0, 0.0, -3.0]))
//! The cube from (−10, −10, −10) to (10, 10, 10) less the oblate spheroid (x² + y²)/36 + z²/9 ≤ 1,//! a closed cavity at its middle, grown by 1: the cube grows as a box does, and the cavity shrinks//! to the spheroid's inner parallel body at distance 1.usecrate::cases::geometry::oblate_spheroid;
usecrate::sketch::block;
use cad_kernel::boolean::{combined, Op};
use cad_kernel::offset::{grown, Join};
use cad_kernel::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
let cube = block([-10., -10., -10.], [10., 10., 10.])?;
let hollow = combined(&cube, &oblate_spheroid::build()?, Op::Cut, 0.)?;
grown(&hollow, 1., Join::Round)
}
occt left no solid to show.
Time
622 ms; CPU time 621 ms; peak memory 365 MB
Notes
refused BRepOffsetAPI_MakeOffsetShape declined to offset the solid by 1
"""A box with a spheroidal cavity grown by 1. The cube from (−10, −10, −10) to (10, 10, 10)
with a closed cavity at its middle, the oblate spheroid (x² + y²)/36 + z²/9 ≤ 1
(geometry/oblate-spheroid), taken out of it. Grown by 1, the cube grows as a box does and the
cavity shrinks to the spheroid's inner parallel body at distance 1.
BRepOffsetAPI_MakeOffsetShape declines a solid with a cavity, a second shell, whatever its join."""fromOCP.BRepPrimAPIimportBRepPrimAPI_MakeBoxfromOCP.gp import gp_Pnt
from bench import other_case
from offset import less, offset
HALF_SIDE = 10GROWTH = 1defbuild():
cube = BRepPrimAPI_MakeBox(gp_Pnt(-HALF_SIDE, -HALF_SIDE, -HALF_SIDE),
gp_Pnt(HALF_SIDE, HALF_SIDE, HALF_SIDE)).Shape()
cavity = other_case("geometry/oblate-spheroid").build()
returnoffset(less(cube, cavity, "the spheroidal cavity"), GROWTH)
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.
kentron 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.
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.
solidcraft left no solid to show.
Time
3.79 s; CPU time 3.79 s; peak memory 539.9 MB
Notes
refused the operation failed: SMLib offset: operation: solidcore: offset::offset_executive::p2::offset_brep: the offset could not be built; caused by offset::offset_executive::p2::do_solid_offset: the offset of face 6 by -1 is neither proved regular nor proved to fold, so no size is named
//! The cube from (−10, −10, −10) to (10, 10, 10) with the oblate spheroid of//! `geometry/oblate-spheroid`, (x² + y²)/36 + z²/9 ≤ 1, cut out of its middle, a closed cavity,//! grown by 1: every point within 1 of it, SolidCraft's offset of the whole solid//! (`offset_solid`), its convex edges rounded.usesuper::oblate_spheroid_grown::oblate_spheroid;
usecrate::solids::*;
pubfnbuild() -> R<Body> {
let cube = block((-10.0, -10.0, -10.0), (10.0, 10.0, 10.0))?;
let hollow = cut(&cube, &oblate_spheroid()?)?;
solidcraft_kernel::offset_solid(&hollow, 1.0, true)
}
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
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
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
171 ms; CPU time 170 ms; peak memory 35.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.
Data
its STEP's
expected
rel. error
volume
10392.23627
10392.23627
1.3e-10
area
2985.441027
2985.441025
5.0e-10
agrees with
cadrs
mesh
50356 triangles, closed, 10 degenerate
centre of gravity
(-1.01256e-15, -1.53082e-15, -1.23477e-15) its STEP's solid
inertia
about it, of unit density: Ixx 847822; Iyy 847822; Izz 847000; Ixy -3.89946e-11; Iyz -1.26477e-10; Izx -1.52681e-10
//! The cube from (−10, −10, −10) to (10, 10, 10) less the oblate spheroid of//! `geometry/oblate-spheroid`, a closed cavity at its middle, grown by 1 to its parallel body.usecrate::cases::geometry::r#oblate_spheroid;
usecrate::solids::boolean::cut;
usecrate::solids::offset::parallel;
usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{make_box_brep, BrepSolid};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let cube = make_box_brep(p(-10.0, -10.0, -10.0), 20.0, 20.0, 20.0)?;
Ok(parallel(&cut(&cube, &oblate_spheroid::build()?)?, 1.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
21 ms; CPU time 48 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.
Data
its STEP's
expected
rel. error
volume
10392.23627
10392.23627
2.0e-11
area
2985.441025
2985.441025
2.7e-11
agrees with
next.BREP
mesh
38708 triangles, closed, 10 degenerate
centre of gravity
(4.58095e-17, -4.37584e-17, 3.6104e-18) its STEP's solid
inertia
about it, of unit density: Ixx 847822; Iyy 847822; Izz 847000; Ixy 3.72324e-12; Iyz 4.78885e-15; Izx -3.6924e-12
//! The cube from (−10, −10, −10) to (10, 10, 10) less the oblate spheroid of//! `geometry/oblate-spheroid`, (x² + y²)/36 + z²/9 ≤ 1, a closed cavity at its middle, grown by 1://! the solid of every point within 1 of it.//!//! The cube is a square extruded, the spheroid as `geometry/oblate-spheroid` makes it (the half//! ellipse revolved) and cut out of it; then cadrs's offset with rounded edges.usecrate::bench::{block, cut, p3};
usecrate::cases::geometry::r#oblate_spheroid;
usecrate::shared::offset::grown;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let cube = block(k, p3(-10.0, -10.0, -10.0), p3(10.0, 10.0, 10.0))?;
let spheroid = oblate_spheroid::build(k)?;
let hollow = cut(k, cube, spheroid)?;
grown(k, hollow, 1.0)
}
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.
springrep left no solid to show.
Time
19.5 s; CPU time 19.5 s; peak memory 16.4 MB
Notes
refused unsupported: offsetting a face whose offset no spline holds to the tolerance
//! The cube from (−10, −10, −10) to (10, 10, 10) less the oblate spheroid of//! `geometry/oblate-spheroid`, a closed cavity at its middle, grown by 1: springrep's own offset.use springrep::boolean::difference;
use springrep::topo::Brep;
usecrate::cases::geometry::r#oblate_spheroid;
usecrate::shared::boolean::between;
usecrate::shared::e;
usecrate::shared::offset::grown;
pubfnbuild() -> Result<Brep, String> {
let cube = between([-10., -10., -10.], [10., 10., 10.], "cube")?;
let hollow = difference(&cube, &oblate_spheroid::build()?).map_err(e)?;
grown(&hollow, 1.)
}
geomsolver 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.
anvilcad left no solid to show.
Time
1.1 ms; CPU time 970 µs; peak memory 3.6 MB
Notes
refused anvil-brep has no ellipsoid surface, its revolve takes no ellipse, and its scale refuses to stretch a sphere, which it would make elliptic
//! A box with a spheroidal cavity grown by 1.use anvil_brep::Solid;
pubfnbuild() -> Result<Solid, String> {
Err("anvil-brep has no ellipsoid surface, its revolve takes no ellipse, and its scale refuses to stretch a sphere, which it would make elliptic".into())
}