A solid torus about the z axis, centered on the origin, whose tube has radius 2 about a middle circle of radius 4. Grow it by 3: the solid of every point within 3 of the torus.
That is every point within 5 of the middle circle. The grown tube's radius, 5, is more than the middle circle's, 4, so the grown torus closes over its hole: the tube, offset, would pass through the z axis and cross itself, and the part of it that crosses the axis lies inside the solid and is no part of its boundary. The grown solid is an apple: a single face, the outer part of the self-crossing torus of radius 5 about the circle of radius 4, which meets the z axis at (0, 0, 3) and (0, 0, −3) in two dimples, each a point where the face comes to the axis at an angle, as a cone does at its apex.
Its section through the axis, on one side of it, is the disk of radius 5 about (4, 0) less the part of that disk beyond the axis.
† 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
3.5 ms; CPU time 4.6 ms; peak memory 10.7 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
1984.287439
1984.287439
1.1e-16
area
816.3344428
816.3344428
0.0e+00
agrees with
kentron, brepkit, next.BREP, cadrs, springrep
mesh
45370 triangles, closed, 2 degenerate
centre of gravity
(-8.88178e-16, -4.58348e-16, 2.21948e-16) its STEP's solid
inertia
about it, of unit density: Ixx 46649.8; Iyy 46649.8; Izz 68597.7; Ixy 4.09273e-12; Iyz -3.08313e-13; Izx -8.96466e-13
//! A solid torus about z, its tube of radius 2 about a middle circle of radius 4, grown by 3: past//! its hole, an apple.use cad_kernel::build::torus;
use cad_kernel::offset::{grown, Join};
use cad_kernel::topo::Brep;
pubfnbuild() -> Result<Brep, String> {
grown(&torus([0., 0., 0.], [0., 0., 1.], 4., 2.)?, 3., Join::Round)
}
Time
640 ms; CPU time 639 ms; peak memory 363.9 MB
Notes
wrong its STEP's solid is inside out: its faces face into it (its volume -10.36655908)
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
-10.36655908
1984.287439
1.0e+00
area
26.76609074
816.3344428
9.7e-01
agrees with
no other kernel
centre of gravity
(0, -4.38668e-14, -4.89962e-14) its STEP's solid
inertia
about it, of unit density: Ixx -15.8879; Iyy -15.8879; Izz -3.98132; Ixy 1.81899e-12; Iyz 3.14194e-13; Izx 1.20309e-12
STEP
B-rep advanced faces, each on a surface AUTOMOTIVE_DESIGN
"""A torus grown past its hole. A solid torus about the z axis, centred on the origin, whose tube
has radius 2 about a middle circle of radius 4, grown by 3."""fromOCP.BRepPrimAPIimportBRepPrimAPI_MakeTorusfromOCP.gp import gp
from offset import offset
MAJOR_RADIUS = 4MINOR_RADIUS = 2GROWTH = 3defbuild():
torus = BRepPrimAPI_MakeTorus(gp.XOY_s(), MAJOR_RADIUS, MINOR_RADIUS).Shape()
returnoffset(torus, GROWTH)
arris left no solid to show.
Time
1.1 ms; CPU time 960 µs; peak memory 3.9 MB
Notes
refused arris has no offset that trims an offset that crosses itself: `offset_faces` refuses the torus's face moved past the axis ("the offset drives the face's surface through zero")
//! A solid torus about the z axis, its tube of radius 2 about a middle circle of radius 4,//! grown by 3, so that it closes over its hole.//!//! Refused: arris's `offset_faces` moves the torus's one face out 3, to a torus whose tube (radius//! 5) is wider than its middle circle (radius 4), so that it would pass through the axis, and//! refuses it ("the offset drives the face's surface through zero"); it does not trim an offset//! that crosses itself.usecrate::Refusal;
use arris::topo::{Body, Model};
pubfnbuild(_: &mutModel) -> Result<Body, Refusal> {
Err("arris has no offset that trims an offset that crosses itself: `offset_faces` refuses the torus's face moved past the axis (\"the offset drives the face's surface through zero\")".into())
}
Time
6.6 ms; CPU time 6.4 ms; peak memory 10.7 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
1984.287439
1984.287439
1.1e-16
area
816.3344428
816.3344428
0.0e+00
agrees with
cad-kernel, brepkit, next.BREP, cadrs, springrep
mesh
45798 triangles, closed, 2 degenerate
centre of gravity
(0, -1.85486e-16, -7.51334e-17) its STEP's solid
inertia
about it, of unit density: Ixx 46649.8; Iyy 46649.8; Izz 68597.7; Ixy 9.09495e-13; Iyz 1.49816e-13; Izx -3.35873e-13
//! A solid torus about the z axis, its tube of radius 2 about a middle circle of radius 4, grown//! by 3: every point within 5 of the middle circle, an apple that closes over the hole, dimpled//! where it meets the axis at z = ±3.use kentron::offset::{self, Join};
use kentron::primitives::Torus;
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let torus = Torus::new(4.0, 2.0).build(m)?;
offset::shape(m, torus, 3.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
408 ms; CPU time 408 ms; peak memory 50.5 MB
Notes
refused the operation failed: SMLib offset faces: operation: the offset is refused: the local operation's body fails its check where its input did not (2 failure lines more, the first test #1 of type 12225):
//! The kernel's offset of a solid is Offset Face (`offset_faces`): the torus's one face moved 3//! outward along its normal, to the torus of tube 5 about the same middle circle, of radius 4.//! That torus crosses itself through the axis, and the grown solid is its outer part, the apple;//! an offset that keeps the topology has no face to trim it to, and the kernel's error, if it//! declines, is the refusal.usecrate::solids::*;
pubfnbuild() -> R<Body> {
let torus = solidcraft_kernel::torus(Vec3::ZERO, 4.0, 2.0)?;
// the tube's outermost point, picking its face
solidcraft_kernel::offset_faces(&torus, &[v3(6.0, 0.0, 0.0)], 3.0)
}
Time
1.2 ms; CPU time 1000 µs; peak memory 4.5 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
1984.287439
1984.287439
1.1e-16
area
816.3344428
816.3344428
0.0e+00
agrees with
cad-kernel, kentron, next.BREP, cadrs, springrep
mesh
57714 triangles, closed
centre of gravity
(0, -3.43761e-16, 1.66509e-16) its STEP's solid
inertia
about it, of unit density: Ixx 46649.8; Iyy 46649.8; Izz 68597.7; Ixy -3.41061e-13; Iyz 1.06058e-13; Izx -1.51951e-12
//! A solid torus about the z axis, its tube of radius 2 about a middle circle of radius 4, grown//! by 3 with brepkit's offset. The torus has no edges, so there is no joint to round or keep//! sharp: the offset is the torus's one face moved 3 outward, which here passes the axis.use brepkit_operations::offset_v2::offset_solid_v2;
use brepkit_operations::primitives::make_torus;
use brepkit_operations::OperationsError;
use brepkit_topology::solid::SolidId;
use brepkit_topology::Topology;
pubfnbuild(topo: &mutTopology) -> Result<SolidId, OperationsError> {
let torus = make_torus(topo, 4.0, 2.0, 64)?;
offset_solid_v2(topo, torus, 3.0)
}
popkern left no solid to show.
Time
7.3 ms; CPU time 7.7 ms; peak memory 20.2 MB
Notes
refused FeatureFailed at torus_grown_past_its_hole.rhai:6:7: feature 'grown' (offset_solid) failed: offset 3.000000 exceeds the maximum 1.980000 supported by the geometry (the surface of face FaceHandle(1v1) degenerates at this distance)
// A torus about the z axis: a circle of radius 2 centred 4 out along x in the xz plane, revolved a// full turn about z. Grown by 3, past its hole.let m = model();
let t = m.profile(xz()).circle(2.0).at(4.0, 0.0).sketch("section")
.revolve(axis_at([0.0, 0.0, 0.0], [0.0, 0.0, 1.0]), full_circle());
t = t.offset_solid(3.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
3.8 ms; CPU time 3.6 ms; peak memory 12.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.
Data
its STEP's
expected
rel. error
volume
1984.287439
1984.287439
3.4e-16
area
816.3344428
816.3344428
4.2e-16
agrees with
cad-kernel, kentron, brepkit, cadrs, springrep
mesh
70896 triangles, closed, 2 degenerate
centre of gravity
(0, -8.88178e-16, 2.55499e-17) its STEP's solid
inertia
about it, of unit density: Ixx 46649.8; Iyy 46649.8; Izz 68597.7; Ixy -0; Iyz 8.13033e-13; Izx 1.07416e-13
//! The solid torus about the z axis whose tube has radius 2 about a middle circle of radius 4,//! grown by 3 to its parallel body: every point within 5 of the middle circle, an apple that closes//! over the hole, one face that comes to the z axis in a dimple at (0, 0, ±3).usecrate::solids::offset::parallel;
usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{make_torus_brep, BrepSolid};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let torus = make_torus_brep(p(0.0, 0.0, 0.0), p(0.0, 0.0, 1.0), 4.0, 2.0)?;
Ok(parallel(&torus, 3.0)?)
}
geop left no solid to show.
Time
30.8 s; CPU time 30.8 s; peak memory 31.8 MB
Notes
refused the offset by Scalar { lo: 3.0, hi: 3.0 } folds over itself: it is regular over u=(Scalar { lo: 0.9999999999999986, hi: 1.0000000000000024 }, Scalar { lo: 1.0625000000000004, hi: 1.0625000000000004 }), v=(Scalar { lo: 1.5625000000000013, hi: 1.5625000000000013 }, Scalar { lo: 1.6250000000000013, hi: 1.6250000000000013 }), but passes a centre of curvature over u=(Scalar { lo: 0.9999999999999986, hi: 1.0000000000000024 }, Scalar { lo: 1.5000000000000007, hi: 1.5000000000000007 }), v=(Scalar { lo: 0.9999999999999966, hi: 1.0000000000000053 }, Scalar { lo: 1.5000000000000013, hi: 1.5000000000000013 }) (in step "grow")
//! A solid torus about the z axis, its tube of radius 2 about a middle circle of radius 4, grown//! by 3: every point within 5 of the middle circle, an apple whose face crosses the axis in two//! dimples. geop has no torus: it is turned from its circular section about the z axis, and its//! face offset 3 out of it by geop's face offset.usecrate::shared::hollow::{offset_faces, on_torus};
usecrate::shared::{Drawing, axis, revolve, sketch, zx, zx_at};
usecrate::{Bench, Refusal};
use geop_core_math::primitives::FrameAxis;
use geop_ops_model::Combine;
pubfnbuild(b: &mutBench) -> Result<(), Refusal> {
letmut tube = Drawing::new();
tube.circle(zx_at(4.0, 0.0), 2.0);
sketch(b, "tube", zx(), tube)?;
revolve(b, "ring", "tube", axis(FrameAxis::Z), 360.0, Combine::NewBody)?;
// One piece of the torus picked: the face offset takes along the faces it runs smoothly// into, the rest of the torus.let on = on_torus(4.0, 2.0, 22.5, 45.0);
offset_faces(b, "grow", &[on], 3.0)
}
Time
2 ms; CPU time 1.8 ms; peak memory 6.8 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 solid torus about the z axis, centered on the origin, its tube of radius 2 about a middle//! circle of radius 4, grown by 3: every point within 5 of the middle circle. The grown tube//! would cross the axis, so the solid is an apple, one face meeting the axis in two dimples at//! (0, 0, ±3).//!//! The torus is cadrs's torus primitive. Then cadrs's offset with rounded edges.usecrate::bench::{p3, torus, v3};
usecrate::shared::offset::grown;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let t = torus(k, p3(0.0, 0.0, 0.0), v3(0.0, 0.0, 1.0), 4.0, 2.0)?;
grown(k, t, 3.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
22 ms; CPU time 22 ms; peak memory 8.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
1984.287439
1984.287439
1.1e-16
area
816.3344428
816.3344428
0.0e+00
agrees with
cad-kernel, kentron, brepkit, next.BREP, cadrs
mesh
45798 triangles, closed, 2 degenerate
centre of gravity
(0, -4.58348e-16, 2.21948e-16) its STEP's solid
inertia
about it, of unit density: Ixx 46649.8; Iyy 46649.8; Izz 68597.7; Ixy 4.09273e-12; Iyz -3.08313e-13; Izx -1.00355e-12
//! The torus about the z axis of middle radius 4 and tube radius 2, grown by 3: the grown tube, of//! radius 5, closes over the hole, leaving an apple with a dimple above and below.//! springrep 1.0.1 builds the grown torus's face off its own edges (1.1 mm) where it crosses the//! axis, which its checker refuses.use springrep::primitive::torus;
use springrep::topo::Brep;
usecrate::shared::offset::grown;
usecrate::shared::{at, e};
pubfnbuild() -> Result<Brep, String> {
let ring = torus(&at([0., 0., 0.]), 4., 2., "ring").map_err(e)?;
grown(&ring, 3.)
}
geomsolver left no solid to show.
Time
46 ms; CPU time 47 ms; peak memory 24 MB
Notes
refused error[E080]: `grown.body`: a face on a torus: read by the field
// A torus grown by 3: the tube's circle, radius 2, drawn in the front plane (x, z) 4 out along// x and turned a whole turn about the z axis; and the points within 3 of it,// `std.rounds.Grown`'s body. Grown past its hole, the tube closes over the axis.unit mm
use std
use std.solids
use std.rounds
in std.front {
c := point
fix((4, 0)) c
tube := circle(center: c) hint(r: 2)
radius(2) tube
}
torus := solid(std.solids.Revolution(face(tube), about: std.z))
grown := std.rounds.Grown(torus, d: 3mm)
part := solid(grown.body)
anvilcad left no solid to show.
Time
1.3 ms; CPU time 1.1 ms; peak memory 4.8 MB
Notes
refused not supported yet: the offset would make a torus's tube reach its axis
//! A torus about the z axis (middle circle 4, tube 2) grown by 3, past its hole: its one face is//! the tube of radius 5, which closes over the axis.use anvil_brep::{Frame, Solid};
usecrate::shared::{offset, torus};
pubfnbuild() -> Result<Solid, String> {
// the torus has no edge to round: growing it is moving its one faceoffset(&torus(&Frame::world(), 4., 2.)?, 3.)
}