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 3: the solid of every point at least 3 from the puck's outside.
That is more than the rounds' radius. A round moved 3 inward would be a torus of tube radius 2 − 3 = −1, turned inside out: it is no part of the result, and the moved side and the moved top or bottom run on past it until they meet in a sharp edge. The result is the plain cylinder of radius 3 from z = 3 to z = 7, its edges sharp.
As a set: the puck is the cylinder of radius 4 from z = 2 to z = 8 grown by 2, so shrinking it by 3 is shrinking that cylinder by 1.
expected
closed form
volume
113.0973355
π·3²·4 = 36π: the cylinder of radius 3 from z = 3 to z = 7
area
131.9468915
2π·3² + 2π·3·4 = 42π
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
21 ms; CPU time 25 ms; peak memory 11.7 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.
//! 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 3: every point of it at least 3 inside it.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 = 3.;
/// `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(&shrunk(&puck, ROUND, Join::Round)?, SHRINK - ROUND, Join::Round)
}
Time
642 ms; CPU time 641 ms; peak memory 361.6 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 past 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 3: the
solid of every point at least 3 from the puck's outside.
That is more than the rounds' radius. A round moved 3 inward would be a torus of tube radius 2 − 3 =
−1, turned inside out: it is no part of the result, and the moved side and the moved top or bottom
run on past it until they meet in a sharp edge. The result is the plain cylinder of radius 3 from z
= 3 to z = 7, its edges sharp."""fromOCP.BRepPrimAPIimportBRepPrimAPI_MakeCylinderfromOCP.gp import gp, gp_Ax2, gp_Pnt
RADIUS = 3BOTTOM = 3HEIGHT = 4defbuild():
# 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
12 ms; CPU time 12 ms; peak memory 11.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.
//! 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 3: every point at least 3 from its outside. The//! rounds turn inside out and drop: the plain cylinder of radius 3 from z = 3 to z = 7.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, -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
228 ms; CPU time 227 ms; peak memory 54.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.
//! The puck of `offset/rounded-puck-shrunk-by-its-rounds`, its rims rounded to radius 2, shrunk//! by 3: every point at least 3 from its outside, SolidCraft's offset of the whole solid inward//! (`offset_solid`, rounded), the moved faces that cross trimmed and merged.usesuper::rounded_puck_shrunk_by_its_rounds::rounded_puck;
usecrate::solids::*;
pubfnbuild() -> R<Body> {
solidcraft_kernel::offset_solid(&rounded_puck()?, -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
8.6 ms; CPU time 8.4 ms; peak memory 21.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.
//! A rounded puck shrunk past 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 3://! the solid of every point at least 3 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 = 3.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.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.
//! A rounded puck shrunk past 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 3://! the solid of every point at least 3 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 = 3.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
4.3 ms; CPU time 4 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 3, past the rounds' radius: the rounds vanish, leaving the cylinder of radius 3 from//! z = 3 to z = 7.//! springrep 1.0.1 refuses it: its face offset cannot follow a round moved past its radius ("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, 3.)
}
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 3: 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 3 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: -3mm)
part := solid(shrunk.body)
anvilcad left no solid to show.
Time
16 ms; CPU time 15 ms; peak memory 5.3 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//! 3..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, -3.)
}