A plate, the cylinder of radius 8 about the z axis from z = −2 to z = 0, and on it the ball of radius 3 about (0, 0, 1), joined: the ball stands up out of the plate's top through the circle of radius √8. The concave edge where the ball meets the plate's top is filleted to radius 1.5: a piece of a torus tangent to the top and to the ball. Grow the solid by 3 with rounded edges: every point within 3 of it.
That is more than the fillet's radius. A fillet grown by its radius or more shrinks to nothing: its moved face would be a torus of tube radius 1.5 − 3 ≤ 0, and the moved top and the moved ball run on until they meet in a sharp concave edge, as if the fillet had never been there. So the result is the sharp plate and ball grown by 3: the bottom moved down 3, the plate's side out 3 with a quarter round of radius 3 at each of its rims, the plate's top up 3 and the ball grown to radius 6 about (0, 0, 1), meeting in the circle of radius √((3 + d)² − (d − 1)²) = 5.65685424949 at z = 3.
As a set: the filleted solid lies between the sharp one and the sharp one closed by 1.5 (grown by 1.5 and shrunk back), and growing either of those by at least 1.5 gives the same solid, so the result is the sharp plate and ball grown by 3: every point within 3 of it.
expected
closed form
volume
3024.918105
Pappus on the grown half-section: 2π∮ρ²/2 dz round its boundary, the lines z = −2 − d (to ρ = 8), ρ = 8 + d, z = d (to ρ = √((3 + d)² − (d − 1)²)), the arcs of radius d about (8, −2) and (8, 0), and the arc of radius 3 + d about (0, 1) up to the axis, each in closed form; d = 3
area
1177.457766
Σ π(ρ₀ + ρ₁)L over the lines and 2πR(c Δα + R Δ sin α) over the arcs of radius R about (c, ·), the same boundary as for the volume
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
30 ms; CPU time 42 ms; peak memory 11.9 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no offset past a round's radius (offset in two steps, the first the round's radius)
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
3024.918105
3024.918105
0.0e+00
area
1177.457766
1177.457766
3.9e-16
agrees with
kentron, solidcraft, next.BREP, cadrs, springrep
mesh
38255 triangles, closed, 1 degenerate
centre of gravity
(-1.07583e-15, 6.85898e-16, -0.579032) its STEP's solid
inertia
about it, of unit density: Ixx 99849.1; Iyy 99849.1; Izz 159732; Ixy 4.26326e-12; Iyz -3.16247e-12; Izx 2.60909e-12
//! The plate of radius 8 on the z axis from z = −2 to z = 0 joined to the ball of radius 3 about//! (0, 0, 1), the concave edge where the ball meets the plate's top filleted to radius 1.5, grown//! by 3 with rounded edges: every point within 3 of it.//!//! The plate and the ball share the z axis, so the joined solid is their half-sections joined and//! turned about it, and the fillet is the kernel's round of that section's corner: a ball of the//! fillet's radius rolled between the plate's top and the sphere. (`fillet::roll` between the plane//! and the sphere in space fails to build this fillet.)//!//! The kernel's offset sweeps a fillet's torus outward only as far as its tube's radius: past it//! the torus would turn inside out, and the offset refuses it rather than drop it. A solid grown by//! a and then by b is the solid grown by a + b (every point within a + b of it), so it is grown//! first by the fillet's radius, which takes the fillet down to a sharp edge, and then by the//! rest.use cad_kernel::build::revolve;
use cad_kernel::corners::round;
use cad_kernel::offset::{grown, Join};
use cad_kernel::planar::{Region, Seg, Step};
use cad_kernel::recipe::region_profile;
use cad_kernel::topo::Brep;
use std::f64::consts::{FRAC_PI_2, TAU};
constPLATE_RADIUS: f64 = 8.;
constPLATE_DEPTH: f64 = 2.;
constBALL_CENTRE: f64 = 1.;
constBALL_RADIUS: f64 = 3.;
constFILLET: f64 = 1.5;
constGROWTH: f64 = 3.;
/// The half-section's steps' tags: the plate's bottom, side and top, the ball, the axis, and the/// fillet between the top and the ball.constBOTTOM: u32 = 1;
constSIDE: u32 = 2;
constTOP: u32 = 3;
constBALL: u32 = 4;
constAXIS: u32 = 5;
constROOT: u32 = 6;
pubfnbuild() -> Result<Brep, String> {
// where the ball leaves the plate's top, the circle of radius √8 at z = 0, and its angle about// the ball's centre in the half-sectionlet leaves = (BALL_RADIUS * BALL_RADIUS - BALL_CENTRE * BALL_CENTRE).sqrt();
let from = (-BALL_CENTRE).atan2(leaves);
// the half-section in (ρ, z): along the bottom, up the side, in along the top to the ball, up// round the ball to the axis and down itlet steps = [
(Seg::Line { a: [0., -PLATE_DEPTH], b: [PLATE_RADIUS, -PLATE_DEPTH] }, BOTTOM),
(Seg::Line { a: [PLATE_RADIUS, -PLATE_DEPTH], b: [PLATE_RADIUS, 0.] }, SIDE),
(Seg::Line { a: [PLATE_RADIUS, 0.], b: [leaves, 0.] }, TOP),
(Seg::Arc { c: [0., BALL_CENTRE], r: BALL_RADIUS, a0: from, sweep: FRAC_PI_2 - from },
BALL),
(Seg::Line { a: [0., BALL_CENTRE + BALL_RADIUS], b: [0., -PLATE_DEPTH] }, AXIS),
];
let steps = steps.into_iter().map(|(seg, tag)| Step { seg, chart: None, tag }).collect();
let section = Region::new(vec![steps]);
// the corner where the ball meets the top filleted in the section (the kernel reads it as// concave and fills it), then the whole turned about the axislet filleted = round(§ion, &[TOP], &[BALL], FILLET, ROOT)?;
let (origin, axis) = ([0., 0., 0.], [0., 0., 1.]);
let profile = region_profile(&filleted, origin, [1., 0., 0.], axis, &|_| String::new());
let part = revolve(&profile, origin, axis, TAU)?;
grown(&grown(&part, FILLET, Join::Round)?, GROWTH - FILLET, Join::Round)
}
occt left no solid to show.
Time
654 ms; CPU time 653 ms; peak memory 388 MB
Notes
crashed OCP.OCP.Standard.Standard_NoSuchObject: BRep_Tool:: no parameters on surface
"""A ball standing in a plate, its root filleted, grown to twice the fillet's radius. A plate, the cylinder of radius 8 about the z axis from z = −2 to z = 0, and on it the ball of radius 3 about
(0, 0, 1), joined: the ball stands up out of the plate's top through the circle of radius √8. The concave edge
where the ball meets the plate's top is filleted to radius 1.5: a piece of a torus tangent to the top and to the ball. Grow the solid by 3 with
rounded edges: every point within 3 of it.
That is more than the fillet's radius. A fillet grown by its radius or more shrinks to nothing: its
moved face would be a torus of tube radius 1.5 − 3 ≤ 0, and the moved top and the moved ball run on until they meet
in a sharp concave edge, as if the fillet had never been there. So the result is the sharp plate and ball
grown by 3: the bottom moved down 3, the plate's side out 3 with a quarter round of radius 3 at each of its
rims, the plate's top up 3 and the ball grown to radius 6 about (0, 0, 1), meeting in the circle of radius
√((3 + d)² − (d − 1)²) = 5.65685424949 at z = 3."""fromOCP.BRepAlgoAPIimportBRepAlgoAPI_FusefromOCP.BRepBuilderAPIimportBRepBuilderAPI_MakeSolidfromOCP.BRepPrimAPIimportBRepPrimAPI_MakeCylinder, BRepPrimAPI_MakeSpherefromOCP.TopAbsimportTopAbs_ShapeEnumfromOCP.TopoDSimportTopoDSfromOCP.gp import gp_Ax2, gp_Dir, gp_Pnt
from bench importRefusedfrom blend import edges_where, rounded
from edit import on_circle
from offset import offset
DISTANCE = 3.0defbuild():
up = gp_Dir(0, 0, 1)
plate = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, 0, -2), up), 8, 2).Shape()
joined = BRepAlgoAPI_Fuse(plate, BRepPrimAPI_MakeSphere(gp_Pnt(0, 0, 1), 3).Shape())
ifnot joined.IsDone():
raiseRefused("BRepAlgoAPI_Fuse declined the plate and the ball")
solid = joined.Shape()
solid = rounded(solid, 1.5, edges_where(solid, on_circle((0, 0, 0), 8 ** 0.5)), "the ball's root")
result = offset(solid, DISTANCE)
# OCCT's offset may give the solid back as its closed shell; the solid is the one it bounds.if result.ShapeType() == TopAbs_ShapeEnum.TopAbs_SHELL:
result = BRepBuilderAPI_MakeSolid(TopoDS.Shell(result)).Solid()
return result
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
19 ms; CPU time 18 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.
//! The plate, the cylinder of radius 8 about the z axis from z = −2 to z = 0, and on it the ball of//! radius 3 about (0, 0, 1), joined, the concave edge where they meet filleted to radius 1.5; grown by//! 3: every point within 3 of it. The fillet grown past its radius drops, and the grown top and//! ball meet in a sharp concave edge.usecrate::Refusal;
usecrate::bench::{frame, p};
usecrate::shared::offset::on_plate;
use kentron::math::Direction;
use kentron::offset::{self, Join};
use kentron::primitives::Sphere;
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> Result<Shape, Refusal> {
let ball = Sphere::new(3.0).with_frame(frame(p(0.0, 0.0, 1.0), Direction::Z)).build(m)?;
// the ball meets the plate's top in the circle of radius √8let solid = on_plate(m, 2.0, ball, 8f64.sqrt(), 1.5)?;
Ok(offset::shape(m, solid, 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.
Time
647 ms; CPU time 648 ms; peak memory 56.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
3024.918105
3024.918105
3.0e-16
area
1177.457766
1177.457766
5.8e-16
agrees with
cad-kernel, kentron, next.BREP, cadrs, springrep
mesh
44617 triangles, closed, 1 degenerate
centre of gravity
(-1.04764e-15, 1.11341e-15, -0.579032) its STEP's solid
inertia
about it, of unit density: Ixx 99849.1; Iyy 99849.1; Izz 159732; Ixy 4.60716e-11; Iyz 2.75363e-12; Izx -2.13429e-11
//! The ball on a plate of `offset/filleted-ball-on-plate-grown-past-its-fillet`, its concave edge//! filleted to radius 1.5, grown by 3: every point within 3 of it, SolidCraft's offset of the//! whole solid (`offset_solid`), its convex edges rounded.usesuper::filleted_ball_on_plate_grown_past_its_fillet::filleted_ball_on_plate;
usecrate::solids::*;
pubfnbuild() -> R<Body> {
solidcraft_kernel::offset_solid(&filleted_ball_on_plate(1.5)?, 3.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
24 ms; CPU time 23 ms; peak memory 21.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.
Data
its STEP's
expected
rel. error
volume
3024.918105
3024.918105
3.0e-16
area
1177.457766
1177.457766
0.0e+00
agrees with
cad-kernel, kentron, solidcraft, cadrs, springrep
mesh
70508 triangles, closed, 2 degenerate
centre of gravity
(4.687e-16, -3.24644e-16, -0.579032) its STEP's solid
inertia
about it, of unit density: Ixx 99849.1; Iyy 99849.1; Izz 159732; Ixy 5.9697e-12; Iyz -8.11761e-12; Izx -4.73983e-12
//! A ball standing in a plate, its root filleted, grown to twice the fillet's radius: a plate (radius 8, z = −2 to 0) and the ball of radius 3 about (0, 0, 1) joined,//! the concave root filleted to radius 1.5, grown by 3 with rounded edges.//!//! The root is filleted by the kernel's fillet and the solid grown by its offset, which drops a fillet//! grown to or past its radius and joins the faces on either side of it.usecrate::solids::boolean::union;
usecrate::solids::offset::parallel;
usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{fillet_edges, make_cylinder_brep, make_sphere_brep, BrepSolid};
constDISTANCE: f64 = 3.0;
pubfnbuild() -> Result<BrepSolid, Refusal> {
let z = p(0.0, 0.0, 1.0);
let plate = make_cylinder_brep(p(0.0, 0.0, -2.0), z, 8.0, 2.0)?;
let boss = make_sphere_brep(p(0.0, 0.0, 1.0), 3.0, z)?;
let joined = union(&plate, &boss)?;
// the root, by a point on itlet filleted = fillet_edges(&joined, &[p(0.0, -(8f64).sqrt(), 0.0)], None, 1.5, false, None)?;
Ok(parallel(&filleted, DISTANCE)?)
}
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
11 ms; CPU time 18 ms; peak memory 11.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.
//! A ball standing in a plate, its root filleted, grown to twice the fillet's radius: a plate (radius 8, z = −2 to 0) and the ball of radius 3 about (0, 0, 1) joined,//! the concave root filleted to radius 1.5, grown by 3. cadrs's cylinder and ball united, filleted, then its offset.usecrate::bench::{ball, cylinder, p3, union, v3};
usecrate::shared::fillet::fillet;
usecrate::shared::offset::grown;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, Pick};
constDISTANCE: f64 = 3.0;
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let z = v3(0.0, 0.0, 1.0);
let plate = cylinder(k, p3(0.0, 0.0, -2.0), z, 8.0, 2.0)?;
let boss = ball(k, p3(0.0, 0.0, 1.0), 3.0)?;
let joined = union(k, plate, boss)?;
let root = k.edge_at(joined, p3(0.0, -(8f64).sqrt(), 0.0))?;
let filleted = fillet(k, joined, &[root], 1.5)?;
grown(k, filleted, DISTANCE)
}
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
5.2 ms; CPU time 5 ms; peak memory 8.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
3024.918105
3024.918105
0.0e+00
area
1177.457766
1177.457766
1.9e-16
agrees with
cad-kernel, kentron, solidcraft, next.BREP, cadrs
mesh
38255 triangles, closed, 1 degenerate
centre of gravity
(-1.22616e-15, 9.11398e-16, -0.579032) its STEP's solid
inertia
about it, of unit density: Ixx 99849.1; Iyy 99849.1; Izz 159732; Ixy 3.80851e-12; Iyz -6.01578e-13; Izx 5.57247e-12
//! The plate of radius 8 from z = −2 to z = 0 with the ball of radius 3 about (0, 0, 1) standing in//! it, the concave edge where they meet filleted to radius 1.5, grown by 3, twice the fillet's//! radius: the fillet vanishes and the moved top and ball meet in a sharp concave edge. springrep//! 1.0.1 refuses it: its offset cannot follow the concave fillet moved past its radius ("an offset//! … closes a torus to nothing").use springrep::topo::Brep;
usecrate::shared::offset::{ball_on_plate, grown};
pubfnbuild() -> Result<Brep, String> {
grown(&ball_on_plate(1.5)?, 3.)
}
geomsolver left no solid to show.
Time
76 ms; CPU time 80 ms; peak memory 27.8 MB
Notes
refused error[E080]: `grown.body`: a body grown whose faces a term of it reads (a round) is read by the field
// A ball standing in a plate, its root filleted, grown by 3: the plate the prism over a circle of// radius 8 about the origin of the top plane, from z = −2 to z = 0; the ball of radius 3 about// (0, 0, 1) in union with it; the concave edge where the ball meets the plate's top rounded to// radius 1.5; and the points within 3 of all that, `std.rounds.Grown`'s body.unit mm
use std
use std.sets
use std.solids
use std.solids (union)
use std.rounds
use std.rounds (round)
in std.top {
o := point
fix((0, 0)) o
rim := circle(center: o) hint(r: 8)
radius(8) rim
}
centre := point
fix((0, 0, 1)) centre
body := solid(std.solids.Prism(face(rim), from: -2mm, to: 0mm))
ball := solid(std.sets.Ball(centre, r: 3mm))
ball union body
body.ball round(r: 1.5mm) body.near
grown := std.rounds.Grown(body, d: 3mm)
part := solid(grown.body)
anvilcad left no solid to show.
Time
1.1 ms; CPU time 960 µs; peak memory 3.6 MB
Notes
refused anvil-brep's offset moves each face along its normal and extends the moved faces until they meet, keeping the solid's edges; it adds no round about a convex edge or corner, so it cannot grow a solid to every point within a distance of it
//! A ball standing in a plate, its root filleted, grown to twice the fillet's radius, grown with its convex edges rounded.use anvil_brep::Solid;
pubfnbuild() -> Result<Solid, String> {
Err("anvil-brep's offset moves each face along its normal and extends the moved faces until they meet, keeping the solid's edges; it adds no round about a convex edge or corner, so it cannot grow a solid to every point within a distance of it".into())
}