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. Shrink it by 1: keep every point of it at least 1 from its boundary.
Outside, the cube shrinks to the cube from (−9, −9, −9) to (9, 9, 9), its edges sharp. Inside, the cavity grows to the spheroid's parallel body at distance 1: every point within 1 of the spheroid, bounded by the spheroid's surface moved 1 outward along its normals, its equator at radius 7 and its poles at z = ±4. That surface is smooth and is not an ellipsoid. It stays 2 from the shrunk cube's faces, so the result is one solid with one closed cavity.
The volume and area of the grown cavity are Steiner's polynomials of the spheroid at d, as in offset/oblate-spheroid-grown, with V = 144π, S and M the spheroid's volume, area and integral of mean curvature.
(a − 2d)³ − (V + Sd + Md² + 4πd³/3): the cube shrunk less the cavity grown (Steiner), a = 20, d = 1, V = 144π, S = 72π + 12√3π ln(2 + √3), M = 6π + 8√3π²/3
area
2397.62476
6(a − 2d)² + (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.6 ms; peak memory 10.6 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, shrunk by 1: the cube shrinks to (−9, −9, −9)–(9, 9, 9), and the//! cavity grows to the spheroid's parallel body at distance 1.usecrate::cases::geometry::oblate_spheroid;
usecrate::sketch::block;
use cad_kernel::boolean::{combined, Op};
use cad_kernel::offset::{shrunk, 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.)?;
shrunk(&hollow, 1., Join::Round)
}
occt left no solid to show.
Time
636 ms; CPU time 635 ms; peak memory 365.1 MB
Notes
refused BRepOffsetAPI_MakeOffsetShape declined to offset the solid by -1
"""A box with a spheroidal cavity shrunk 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. Shrunk by 1, the cube shrinks to the cube from
(−9, −9, −9) to (9, 9, 9) and the cavity grows to the spheroid's 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 = 10SHRINKAGE = 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"), -SHRINKAGE)
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.86 s; CPU time 3.86 s; peak memory 539.5 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,//! shrunk by 1: every point at least 1 from its outside, SolidCraft's offset of the whole solid//! inward (`offset_solid`, rounded), the cavity's surface moved 1 out into it.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
148 ms; CPU time 148 ms; peak memory 40.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.
Data
its STEP's
expected
rel. error
volume
4998.798787
4998.798784
4.3e-10
area
2397.624758
2397.62476
9.1e-10
agrees with
cadrs
mesh
57622 triangles, closed, 2 degenerate
centre of gravity
(7.27771e-16, 2.72914e-16, 1.16949e-15) its STEP's solid
inertia
about it, of unit density: Ixx 303997; Iyy 303997; Izz 298480; Ixy 2.59206e-11; Iyz 2.18655e-11; Izx 2.51244e-11
//! The cube from (−10, −10, −10) to (10, 10, 10) less the oblate spheroid of//! `geometry/oblate-spheroid`, a closed cavity at its middle, shrunk by 1 to its inner 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
20 ms; CPU time 46 ms; peak memory 10 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
4998.798785
4998.798784
1.2e-10
area
2397.62476
2397.62476
7.3e-11
agrees with
next.BREP
mesh
44282 triangles, closed, 2 degenerate
centre of gravity
(9.09713e-17, -4.54857e-17, -1.67087e-17) its STEP's solid
inertia
about it, of unit density: Ixx 303997; Iyy 303997; Izz 298480; Ixy -2.6148e-12; Iyz 3.38153e-14; Izx 1.5201e-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, shrunk by 1://! every point of it at least 1 from its boundary.//!//! 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 inward.usecrate::bench::{block, cut, p3};
usecrate::cases::geometry::r#oblate_spheroid;
usecrate::shared::offset::shrunk;
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)?;
shrunk(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
8.65 s; CPU time 8.65 s; peak memory 16.5 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, shrunk by 1: springrep's own offset//! by −1.use springrep::boolean::difference;
use springrep::topo::Brep;
usecrate::cases::geometry::r#oblate_spheroid;
usecrate::shared::boolean::between;
usecrate::shared::e;
usecrate::shared::offset::shrunk;
pubfnbuild() -> Result<Brep, String> {
let cube = between([-10., -10., -10.], [10., 10., 10.], "cube")?;
let hollow = difference(&cube, &oblate_spheroid::build()?).map_err(e)?;
shrunk(&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 960 µs; peak memory 3.5 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 shrunk 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())
}