A ball of radius 5 centered on the origin, its whole surface one rational B-spline surface (a NURBS), the standard biquadratic sphere of geometry/nurbs-sphere: a 9 × 5 net whose first and last rows each collapse to a single point, a pole.
The surface is the tensor product of two rational quadratic curves. Around the axis (u), the unit circle of nine control points cᵢ = (1, 0), (1, 1), (0, 1), (−1, 1), (−1, 0), (−1, −1), (0, −1), (1, −1), (1, 0), with weights wᵢ = 1, √2/2, 1, √2/2, 1, √2/2, 1, √2/2, 1, on the knots (0, 0, 0, ¼, ¼, ½, ½, ¾, ¾, 1, 1, 1). Along the meridian (v), the semicircle from the south pole to the north of five control points (ρⱼ, zⱼ) = (0, −5), (5, −5), (5, 0), (5, 5), (0, 5), with weights vⱼ = 1, √2/2, 1, √2/2, 1, on the knots (0, 0, 0, ½, ½, 1, 1, 1). The net's control point (i, j) is (ρⱼ·cᵢ, zⱼ) = (ρⱼ cᵢₓ, ρⱼ cᵢᵧ, zⱼ), with weight wᵢvⱼ. Build the ball from that one face, closed on its seam and at its poles; do not use a sphere.
Then grow the ball by 2: offset its NURBS face outward along its normal by 2, the offset running through the poles, where the face's parameters pinch. Do not replace the face by a sphere before offsetting it.
The result is the ball of radius 7 centered on the origin.
expected
closed form
volume
1436.75504
4π(r + d)³/3, r = 5, d = 2
area
615.7521601
4π(r + 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.
Time
105 ms; CPU time 122 ms; peak memory 12.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.
Data
its STEP's
expected
rel. error
volume
1436.75504
1436.75504
1.6e-16
area
615.7521601
615.7521601
3.7e-16
agrees with
kentron, popkern, next.BREP, cadrs, springrep
mesh
29408 triangles, closed, 4 degenerate
centre of gravity
(2.87896e-15, -3.47186e-16, 3.1651e-16) its STEP's solid
inertia
about it, of unit density: Ixx 28160.4; Iyy 28160.4; Izz 28160.4; Ixy -1.13687e-12; Iyz 2.27374e-12; Izx 5.87499e-13
//! The ball of radius 5 about the origin bounded by the one NURBS face of `geometry/nurbs-sphere`//! (a 9 × 5 rational net, its first and last rows each collapsed to a pole), grown by 2: its face//! offset out along its normal through the poles, the ball of radius 7.//!//! Refused, by the kernel: "`east` (bspline) is not swept along its normal: a bspline has no//! offset in closed form". `offset::grown` sweeps a face along its normal only on a plane,//! cylinder, cone, sphere or torus (`offset::normal_sweep`), and does not read the rational net as the//! sphere it is. 0.21.0 reads a B-spline sheet's offset exactly (`Surface::parallel`, a//! `Surface::Offset` of the net), but the offset's sweep does not use it yet.usecrate::cases::geometry::nurbs_sphere;
use cad_kernel::offset::{grown, Join};
use cad_kernel::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
grown(&nurbs_sphere::build()?, 2., Join::Round)
}
occt left no solid to show.
Time
624 ms; CPU time 623 ms; peak memory 363.1 MB
Notes
refused BRepOffsetAPI_MakeOffsetShape declined to offset the solid by 2
"""A NURBS ball grown. The ball of radius 5 about the origin bounded by one rational B-spline face,
the standard biquadratic sphere of geometry/nurbs-sphere, grown by 2: its face offset outward along
its normal, through its poles, which leaves the ball of radius 7."""from bench import other_case
from offset import offset
defbuild():
# The offset by join, as the other offset cases make theirs, declines this face. OCCT's# simple offset (PerformBySimple) does build a solid, but approximates the offset surface:# its volume is 1442.67, against 1436.76.returnoffset(other_case("geometry/nurbs-sphere").build(), 2)
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
7.3 ms; CPU time 7.1 ms; peak memory 9.7 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no face closed on the seam of a clamped surface
Data
measured
expected
rel. error
volume
1436.75504
1436.75504
2.2e-15
area
615.7521601
615.7521601
4.2e-14
agrees with
cad-kernel, popkern, next.BREP, cadrs, springrep
faces
1 other
mesh
119840 triangles, closed
centre of gravity
(-6.67943e-06, 1.28905e-06, -6.95724e-07) its triangles
inertia
about it, of unit density: Ixx 28141.1; Iyy 28141.1; Izz 28136.4; Ixy 0.0123799; Iyz 0.000285175; Izx -0.00145219
//! The ball of radius 5 about the origin whose whole surface is the standard biquadratic NURBS sphere//! of `geometry/nurbs-sphere`, grown by 2: every point within 2 of it, the ball of radius 7.usecrate::Refusal;
usecrate::cases::geometry::nurbs_sphere;
use kentron::offset::{self, Join};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> Result<Shape, Refusal> {
let ball = nurbs_sphere::build(m)?;
Ok(offset::shape(m, ball, 2.0, Join::Arc)?)
}
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.90 s; CPU time 3.90 s; peak memory 531.5 MB
Notes
refused 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 0 by 2 is neither proved regular nor proved to fold, so no size is named
//! The ball of radius 5 of `geometry/nurbs-sphere`, its whole surface one NURBS face, grown by 2://! its one face moved 2 out along its normal, through the poles, onto the surface's offset. The//! ball has no edge to round. ops's offset of a body's faces, `offset_sheet` (the kernel's offset//! with the convex edges extended), fails on it with the kernel's bare status 1001, so this is the//! kernel's offset with them rounded.//!//! It stays on raw solidcore's offset (`offset_rounded`, the operation solidcraft-kernel's//! `offset_solid` runs) because solidcraft-kernel cannot build the input: it has no face on a//! given NURBS net (its freeform sheets are T-splines, odd degree only, and this net is//! biquadratic), and its `sew` takes planes, surfaces of revolution and of extrusion, and ruled//! surfaces, not a NURBS face sewn to itself along a seam and pinched at its poles. (Handing the ops-built//! ball over as a record, through `solidcraft_smlib::Brep::from_record` and//! `solidcraft_kernel::body_from_smlib`, would still build it on the lower layers.)usecrate::cases::geometry::nurbs_sphere;
usecrate::shared::offset::offset_rounded;
usecrate::Refusal;
use solidcore_ops::Body;
pubfnbuild() -> Result<Body, Refusal> {
offset_rounded(&nurbs_sphere::build()?, 2.0)
}
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.
Time
1.03 s; CPU time 1.03 s; peak memory 21.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
1436.75504
1436.75504
1.6e-16
area
615.7521601
615.7521601
1.8e-16
agrees with
cad-kernel, kentron, next.BREP, cadrs, springrep
mesh
69888 triangles, closed, 2 degenerate
centre of gravity
(-8.88178e-16, -4.04895e-33, -7.84588e-17) its STEP's solid
inertia
about it, of unit density: Ixx 28160.4; Iyy 28160.4; Izz 28160.4; Ixy -0; Iyz 7.27903e-15; Izx 7.91132e-14
// The NURBS ball of radius 5 (the standard biquadratic sphere, one face closed on its seam and at// its poles) grown by 2: its face offset outward along its normal.// The standard biquadratic sphere of radius `r` about `c`, scaled by `s` along each axis: the// tensor of the rational quadratic circle (nine points, weights 1, √2/2, ...) and the rational// quadratic semicircle from the south pole to the north (five points).fnball_net(c, r, s) {
let w = sqrt(0.5);
let ci = [[1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [-1.0, 1.0], [-1.0, 0.0], [-1.0, -1.0], [0.0, -1.0], [1.0, -1.0], [1.0, 0.0]];
let cw = [1.0, w, 1.0, w, 1.0, w, 1.0, w, 1.0];
let mer = [[0.0, -r], [r, -r], [r, 0.0], [r, r], [0.0, r]];
let mw = [1.0, w, 1.0, w, 1.0];
let net = [];
let wts = [];
for i in0..9 {
let row = [];
let wr = [];
for j in0..5 {
row.push([c[0] + s[0] * mer[j][0] * ci[i][0], c[1] + s[1] * mer[j][0] * ci[i][1], c[2] + s[2] * mer[j][1]]);
wr.push(cw[i] * mw[j]);
}
net.push(row);
wts.push(wr);
}
#{ net: net, weights: wts }
}
fnball(m, c, r, s) {
let b = ball_net(c, r, s);
m.sheet_nurbs(b.net, #{ degree: [2, 2], weights: b.weights,
knots: [[0.0, 0.0, 0.0, 0.25, 0.25, 0.5, 0.5, 0.75, 0.75, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.5, 0.5, 1.0, 1.0, 1.0]] })
}
let m = model();
let b = ball(m, [0.0, 0.0, 0.0], 5.0, [1.0, 1.0, 1.0]);
b = b.offset_solid(2.0, #{ label: "grown" });
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
2.8 ms; CPU time 2.5 ms; peak memory 13.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.
Data
its STEP's
expected
rel. error
volume
1436.75504
1436.75504
1.6e-16
area
615.7521601
615.7521601
3.7e-16
agrees with
cad-kernel, kentron, popkern, cadrs, springrep
mesh
29086 triangles, closed, 2 degenerate
centre of gravity
(0, -1.58255e-16, -2.17505e-16) its STEP's solid
inertia
about it, of unit density: Ixx 28160.4; Iyy 28160.4; Izz 28160.4; Ixy 7.95808e-13; Iyz -1.07111e-13; Izx 1.16247e-12
//! The ball of radius 5 about the origin bounded by one NURBS face, the standard biquadratic//! sphere of `geometry/nurbs-sphere`, grown by 2 by the kernel's offset of that face along its//! normal, through its poles.usecrate::cases::geometry::r#nurbs_sphere;
usecrate::solids::offset::parallel;
usecrate::Refusal;
use brep_kernel::BrepSolid;
pubfnbuild() -> Result<BrepSolid, Refusal> {
Ok(parallel(&nurbs_sphere::build()?, 2.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
7.2 ms; CPU time 11 ms; peak memory 9.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 ball of radius 5 about the origin bounded by one rational B-spline surface (the standard//! biquadratic sphere of `geometry/nurbs-sphere`) grown by 2: its face offset out along its//! normal, through its poles, to the ball of radius 7.//!//! The ball as `geometry/nurbs-sphere` makes it (cadrs's sphere primitive healed with//! `HealOp::ToBSpline`), then offset outward by 2 (cadrs's offset of a solid).usecrate::bench::{ball, p3};
usecrate::shared::offset::grown;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, HealOp, Kernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let b = ball(k, p3(0.0, 0.0, 0.0), 5.0)?;
let spline = Kernel::heal(k, b, &[HealOp::ToBSpline])?.first()?;
grown(k, spline, 2.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.
Time
4.20 s; CPU time 4.20 s; peak memory 396.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
1436.75504
1436.75504
4.2e-10
area
615.7521599
615.7521601
2.8e-10
agrees with
cad-kernel, kentron, popkern, next.BREP, cadrs
centre of gravity
(4.44089e-16, -4.44089e-17, 1.16094e-15) its STEP's solid
inertia
about it, of unit density: Ixx 28160.4; Iyy 28160.4; Izz 28160.4; Ixy -3.63798e-12; Iyz 6.05966e-14; Izx 2.96902e-13
STEP
B-rep advanced faces, each on a surface AUTOMOTIVE_DESIGN
//! A ball of radius 5 bounded by one biquadratic rational B-spline face with a pole at each end,//! grown by 2.use springrep::edit::offset;
use springrep::topo::Brep;
usecrate::shared::e;
usecrate::shared::nurbs::nurbs_ball;
pubfnbuild() -> Result<Brep, String> {
offset(&nurbs_ball(0., "ball")?, 2., "grow").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 spline surface to make the face from, and no spline but a cubic one. A `spline` is a curve of degree 3 only (`knots` for the five-point rational quadratic semicircle are "a curve needs more than 3 control points and a matching knot vector"), and every surface comes of sweeping a curve, so the case's 9 × 5 biquadratic net cannot be written. The nearest solid Solvent builds — a meridian of two rational cubic quarter circles turned about the axis — is a surface of revolution, not the NURBS face the case asks for, and its `std.rounds.Grown` body is not built exactly either ("a face on a revolution: read by the field").
// A NURBS ball of radius 5, its whole surface one biquadratic rational B-spline face (a 9 × 5 net// with a pole at each end of its meridians), grown by 2 by offsetting that face along its normal.//// Refused: Solvent has no spline surface to make the face from, and no spline but a cubic one. A// `spline` is a curve of degree 3 only (`knots` for the five-point rational quadratic semicircle// are "a curve needs more than 3 control points and a matching knot vector"), and every surface// comes of sweeping a curve, so the case's 9 × 5 biquadratic net cannot be written. The nearest// solid Solvent builds — a meridian of two rational cubic quarter circles turned about the axis —// is a surface of revolution, not the NURBS face the case asks for, and its `std.rounds.Grown`// body is not built exactly either ("a face on a revolution: read by the field").
anvilcad left no solid to show.
Time
1.1 ms; CPU time 950 µs; peak memory 3.4 MB
Notes
refused anvil-brep has no way to build a solid bounded by a given B-spline surface: its B-spline faces come only from its own lofts and blends
//! A ball whose surface is one given NURBS, grown by 2.use anvil_brep::Solid;
pubfnbuild() -> Result<Solid, String> {
Err("anvil-brep has no way to build a solid bounded by a given B-spline surface: its B-spline faces come only from its own lofts and blends".into())
}