A puck: the cylinder of radius 6 on the z axis from z = 0 to z = 10 with both its circular edges rounded to radius 2, each round a quarter of a torus whose tube has radius 2 about the circle of radius 4 at z = 2 or z = 8. Shrink it by 2: the solid of every point at least 2 from the puck's outside.
That is exactly the rounds' radius. Each round, moved 2 inward, shrinks onto its tube's center line, the circle of radius 4 at z = 2 or z = 8: it has no area and is an edge of the result, where the moved side, the cylinder of radius 4, meets the moved top or bottom at a right angle. The result is the plain cylinder of radius 4 from z = 2 to z = 8, its edges sharp.
As a set: the puck is that cylinder grown by 2, every point within 2 of it, so shrinking it by 2 gives the cylinder back.
expected
closed form
volume
301.5928947
π·4²·6 = 96π: the cylinder of radius 4 from z = 2 to z = 8
area
251.3274123
2π·4² + 2π·4·6 = 80π
Drawing
TopIsometricFrontRight
Third-angle projection, the three views at one scale. Drawn from occt'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
19 ms; CPU time 22 ms; peak memory 11.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.
//! The cylinder of radius 6 on the z axis from z = 0 to z = 10, both its circular edges rounded to//! radius 2, shrunk by 2: every point of it at least 2 inside it.//!//! Shrunk by exactly their radius, each round's torus shrinks onto its tube's middle circle: the//! kernel's offset takes it there in one step.use cad_kernel::boolean::{combined, Op};
use cad_kernel::build::{disc, prism};
use cad_kernel::fillet::roll;
use cad_kernel::geom::{tolerance, V};
use cad_kernel::offset::{shrunk, Join};
use cad_kernel::topo::Brep;
constRADIUS: f64 = 6.;
constHEIGHT: f64 = 10.;
constROUND: f64 = 2.;
constSHRINK: f64 = 2.;
/// `part` with the edge through `at` rounded to `ROUND`: the kernel's piece taken off a convex/// edge, filled in at a concave one.fnrounded(part: &Brep, at: V) -> Result<Brep, String> {
let round = roll(part, at, ROUND, tolerance(part.size()))?;
let op = if round.concave { Op::Union } else { Op::Cut };
Ok(combined(part, &round.piece, op, 0.)?)
}
pubfnbuild() -> Result<Brep, String> {
let cylinder = prism(&disc([0., 0., 0.], [0., 0., 1.], RADIUS), 0., HEIGHT)?;
// each rim is picked by a point on it, the top's and then the bottom'slet puck = rounded(&rounded(&cylinder, [0., RADIUS, HEIGHT])?, [0., RADIUS, 0.])?;
shrunk(&puck, SHRINK, Join::Round)
}
Time
647 ms; CPU time 647 ms; peak memory 361.7 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no offset that drops a round shrunk away; the cylinder left is built outright
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 rounded puck shrunk by exactly its rounds' radius. A puck: the cylinder of radius 6 on the z
axis from z = 0 to z = 10 with both its circular edges rounded to radius 2, each round a quarter
of a torus whose tube has radius 2 about the circle of radius 4 at z = 2 or z = 8. Shrink it by
2: the solid of every point at least 2 from the puck's outside.
That is exactly the rounds' radius. Each round, moved 2 inward, shrinks onto its tube's center line,
the circle of radius 4 at z = 2 or z = 8: it has no area and is an edge of the result, where the
moved side, the cylinder of radius 4, meets the moved top or bottom at a right angle. The result is
the plain cylinder of radius 4 from z = 2 to z = 8, its edges sharp."""fromOCP.BRepPrimAPIimportBRepPrimAPI_MakeCylinderfromOCP.gp import gp, gp_Ax2, gp_Pnt
RADIUS = 4BOTTOM = 2HEIGHT = 6defbuild():
# BRepOffsetAPI_MakeOffsetShape makes no solid of the rounded puck shrunk this far: it does not# drop a round that has shrunk to nothing or turned inside out. The result is built as the case# states it, the plain cylinder the moved side, top and bottom bound.returnBRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, 0, BOTTOM), gp.DZ_s()), RADIUS, HEIGHT).Shape()
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
5.5 ms; CPU time 5.3 ms; peak memory 11.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 puck, the cylinder of radius 6 on the z axis from z = 0 to z = 10 with both rims rounded to//! radius 2, shrunk by 2: every point at least 2 from its outside. Each round collapses onto its centre circle, an edge of//! the result: the plain cylinder of radius 4 from z = 2 to z = 8.usecrate::Refusal;
usecrate::shared::offset::rounded_puck;
use kentron::offset::{self, Join};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> Result<Shape, Refusal> {
let puck = rounded_puck(m, true)?;
Ok(offset::shape(m, puck, -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.
Time
206 ms; CPU time 206 ms; peak memory 53.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.
//! A puck, the cylinder of radius 6 on the z axis from z = 0 to z = 10 with both rims rounded to//! radius 2, shrunk by 2, the rounds' radius: every point at least 2 from its outside, SolidCraft's//! offset of the whole solid inward (`offset_solid`, rounded), the moved faces that cross trimmed//! and merged.usecrate::solids::*;
/// `body` with its circles about the z axis, each `(radius, z)`, rounded to `size`: each circle/// picked at a point on it and taken whole, its tangent chain (a circle may be split at seams).pubfnround_circles(body: &Body, circles: &[(f64, f64)], size: f64) -> R<Body> {
letmut edges = Vec::new();
for &(r, z) in circles {
// picked 1 radian round from +x, away from the circles' seams
edges.extend(solidcraft_kernel::tangent_chain(body, &[v3(r * 1f64.cos(), r * 1f64.sin(), z)])?);
}
solidcraft_kernel::fillet(body, &edges, size)
}
/// The puck: the cylinder with its rims, the circles of radius 6 at z = 0 and z = 10, rounded.pubfnrounded_puck() -> R<Body> {
round_circles(&zcyl(0.0, 0.0, 6.0, 0.0, 10.0)?, &[(6.0, 0.0), (6.0, 10.0)], 2.0)
}
pubfnbuild() -> R<Body> {
solidcraft_kernel::offset_solid(&rounded_puck()?, -2.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
7.8 ms; CPU time 7.4 ms; peak memory 21.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.
//! A rounded puck shrunk by exactly its rounds' radius. A puck: the cylinder of radius 6 on the z//! axis from z = 0 to z = 10 with both its circular edges rounded to radius 2, each round a quarter//! of a torus whose tube has radius 2 about the circle of radius 4 at z = 2 or z = 8. Shrink it by//! 2: the solid of every point at least 2 from the puck's outside.//!//! The edges are rounded by the kernel's fillet and the solid shrunk by its offset, which drops a//! round turned inside out (or shrunk to nothing) and joins the faces on either side of it.usecrate::solids::offset::{parallel};
usecrate::solids::p;
usecrate::Refusal;
use brep_kernel::{fillet_edges, make_cylinder_brep, BrepSolid};
constDISTANCE: f64 = 2.0;
pubfnbuild() -> Result<BrepSolid, Refusal> {
let puck = make_cylinder_brep(p(0.0, 0.0, 0.0), p(0.0, 0.0, 1.0), 6.0, 10.0)?;
// both circular edges, each by a point on itlet edges = [p(0.0, -6.0, 0.0), p(0.0, -6.0, 10.0)];
let rounded = fillet_edges(&puck, &edges, None, 2.0, false, None)?;
Ok(parallel(&rounded, -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
4 ms; CPU time 3.7 ms; peak memory 10.3 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 rounded puck shrunk by exactly its rounds' radius. A puck: the cylinder of radius 6 on the z//! axis from z = 0 to z = 10 with both its circular edges rounded to radius 2, each round a quarter//! of a torus whose tube has radius 2 about the circle of radius 4 at z = 2 or z = 8. Shrink it by//! 2: the solid of every point at least 2 from the puck's outside.//!//! The edges are rounded by cadrs's Fillet and the part shrunk by its offset. cadrs declines it://! its offset has no slab for a torus face moved to or past its tube's center line.usecrate::bench::{cylinder, p3, v3};
usecrate::shared::fillet::fillet;
usecrate::shared::offset::shrunk;
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel, Pick};
constDISTANCE: f64 = 2.0;
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let puck = cylinder(k, p3(0.0, 0.0, 0.0), v3(0.0, 0.0, 1.0), 6.0, 10.0)?;
let edges = k.edges_at(puck, &[p3(0.0, -6.0, 0.0), p3(0.0, -6.0, 10.0)])?;
let rounded = fillet(k, puck, &edges, 2.0)?;
shrunk(k, rounded, 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
3.8 ms; CPU time 3.6 ms; peak memory 8.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.
//! The cylinder of radius 6 on the z axis from z = 0 to z = 10, both rims rounded to radius 2,//! shrunk by 2, exactly the rounds' radius: each round shrinks onto its tube's centre circle,//! leaving the cylinder of radius 4 from z = 2 to z = 8.//! springrep 1.0.1 refuses it: its face offset cannot follow a round moved onto its centre circle//! ("an offset … closes a torus to nothing").use springrep::blend::fillet;
use springrep::primitive::cylinder;
use springrep::topo::Brep;
usecrate::shared::offset::shrunk;
usecrate::shared::{at, e};
pubfnbuild() -> Result<Brep, String> {
let puck = cylinder(&at([0., 0., 0.]), 6., 10., "puck").map_err(e)?;
let rims = [("puck.start", "puck.side"), ("puck.end", "puck.side")];
let rounded = fillet(&puck, &rims, 2., "round").map_err(e)?;
shrunk(&rounded, 2.)
}
geomsolver left no solid to show.
Time
81 ms; CPU time 81 ms; peak memory 26.5 MB
Notes
refused error[E080]: `shrunk.body`: a body shelled and rounded as well is read by the field
// A rounded puck shrunk by 2: a cylinder of radius 6 on the z axis from z = 0 to z = 10 (its circle// drawn in the top plane, the prism over it), both its circular edges rounded to radius 2, and the// points of it at least 2 from its outside, `std.rounds.Grown`'s body for a negative reach.unit mm
use std
use std.solids
use std.rounds
use std.rounds (round)
in std.top {
o := point
fix((0, 0)) o
rim := circle(center: o) hint(r: 6)
radius(6) rim
}
puck := solid(std.solids.Prism(face(rim), from: 0mm, to: 10mm))
round(r: 2mm) puck
shrunk := std.rounds.Grown(puck, d: -2mm)
part := solid(shrunk.body)
anvilcad left no solid to show.
Time
16 ms; CPU time 16 ms; peak memory 5 MB
Notes
refused not supported yet: the offset is larger than a curved face's radius
//! A cylinder of radius 6 on the z axis from z = 0 to 10, both rims rounded to radius 2, shrunk by//! 2..use anvil_brep::{Frame, Solid};
usecrate::shared::{cylinder, fillet, offset, ring};
pubfnbuild() -> Result<Solid, String> {
let p = fillet(&cylinder(&Frame::world(), 6., 0., 10.)?, &[ring(6., 0.), ring(6., 10.)], 2.)?;
offset(&p, -2.)
}