The solid a ring fills as it is turned a whole turn about an upright line beside it.
The ring is a torus whose axis is the vertical line through (8, 0): the circle through its tube's centers has radius 3, and its tube has radius 1, centered on the plane z = 0.
It turns rigidly a whole turn about the z axis. Make the solid of everything the ring passes through.
The ring's top and bottom circles stay in their planes and sweep flat annuli; its circles nearest and farthest from the z axis at each height sweep the inner and outer walls. The result is a solid ring about the z axis, from 4 to 12 out, its section in each half-plane through the z axis a stadium: the band |z| ≤ 1 between 5 and 11 out, ended by half discs of radius 1.
† 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
168 ms; CPU time 397 ms; peak memory 25.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.
//! The solid a ring fills turned a whole turn about the z axis: the torus about the vertical line//! through (8, 0), of radii 3 and 1, centred on z = 0.use cad_kernel::build::torus;
use cad_kernel::geom::tolerance;
use cad_kernel::swept::closed::closed;
use cad_kernel::topo::Brep;
use cad_kernel::trajectory::{Screw, Trajectory};
use std::f64::consts::TAU;
/// How closely the ring is meshed for the sweep's membership reads: a hundredth of its tube's/// radius.constBAR: f64 = 0.01;
pubfnbuild() -> Result<Brep, String> {
let up = [0., 0., 1.];
let ring = torus([8., 0., 0.], up, 3., 1.)?;
// the turn about z: a screw that does not advance, a whole turn over a roll of τlet path = Trajectory::Twist(Screw { origin: [0., 0., 0.], axis: up, ratio: 1., advance: 0. });
// the kernel's closed swept solid: a torus about an axis along the turn's, turned wholeclosed(&ring, &path, [0., TAU], BAR, tolerance(ring.size()))
.map_err(|why| format!("the ring's sweep not built: {why:?}"))
}
Time
1.39 s; CPU time 1.39 s; peak memory 377.7 MB
Notes
wrong its STEP's loops along seams run clockwise about their faces' normals, against ISO 10303-42: read by the standard, those faces are the rest of their surfaces, where the seams are not (read its way, it holds the solid)
Workaround † no sweep of a solid
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 ring lying flat, turned a whole turn about a line beside it. The solid a ring fills as it is
turned a whole turn about an upright line beside it.
The ring is a torus whose axis is the vertical line through (8, 0): the circle through its tube's
centers has radius 3, and its tube has radius 1, centered on the plane z = 0.
It turns rigidly a whole turn about the z axis. Make the solid of everything the ring passes
through.
The ring's top and bottom circles stay in their planes and sweep flat annuli; its circles nearest
and farthest from the z axis at each height sweep the inner and outer walls. The result is a solid
ring about the z axis, from 4 to 12 out, its section in each half-plane through the z axis a
stadium: the band |z| ≤ 1 between 5 and 11 out, ended by half discs of radius 1."""import math
fromOCP.BRepBuilderAPIimportBRepBuilderAPI_MakeFacefromOCP.BRepPrimAPIimportBRepPrimAPI_MakeTorusfromOCP.gp import gp, gp_Ax2, gp_Ax3, gp_Cylinder, gp_Pnt
from sweep import plane, turned, unified, united
CENTRE = (8, 0, 0) # the ring's centre; its axis is the vertical line through itRING, TUBE = 3, 1# the radius of the circle through the tube's centres, and the tube'sdefbuild():
ring = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(*CENTRE), gp.DZ_s()), RING, TUBE).Shape()
# The turn's axis and the ring's are parallel. The ring's normal is square to the turn's# velocity where it lies in the plane y = 0 through both axes, and on its top and bottom# circles, where it is upright: the plane and the cylinder of radius 3 about the ring's axis# cut it along that contact.
cylinder = BRepBuilderAPI_MakeFace(gp_Cylinder(gp_Ax3(gp_Pnt(*CENTRE), gp.DZ_s()), RING),
0, 2 * math.pi, -2 * TUBE, 2 * TUBE).Face()
_, *swept = turned(ring, gp.OZ_s(), 360, [plane((0, 0, 0), (0, 1, 0)), cylinder])
# Turned a whole turn, the ring is swept round back to where it started; and no point stays# inside it all the way round (half a turn takes it clear of where it was), so each point# it covers where it starts it covers again later, coming in across a leading face. What the# leading faces sweep is the whole solid.returnunified(united(swept))
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
422 ms; CPU time 695 ms; peak memory 28.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.
//! The solid a ring fills as it turns a whole turn about the z axis: the torus whose axis is the//! vertical line through (8, 0), the circle through its tube's centres of radius 3, its tube of//! radius 1, centred on the plane z = 0.//!//! kentron's sweep of a solid (`sweep::solid`, one turn), which refuses it: kentron's sweep//! refuses a turn of a whole turn or more, whose ends would be one.usecrate::bench::{frame, p};
use kentron::math::{Axis, Direction};
use kentron::primitives::Torus;
use kentron::sweep::{self, RigidMotion};
use kentron::topology::{Model, Shape};
use std::f64::consts::TAU;
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let ring = Torus::new(3.0, 1.0).with_frame(frame(p(8.0, 0.0, 0.0), Direction::Z)).build(m)?;
sweep::solid(m, ring, &RigidMotion::Turn { axis: Axis::Z, from: 0.0, to: TAU })
}
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
101 ms; CPU time 101 ms; peak memory 40.8 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no sweep of a solid
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 solid a ring fills as it is turned a whole turn about the z axis: the torus about the//! vertical line through (8, 0) whose tube, of radius 1, is centred on the circle of radius 3 in//! the plane z = 0.//!//! solidcraft-kernel has no sweep of a solid, so the turn is built by elementary geometry: turned//! a whole turn about an axis, a solid sweeps its shadow, the circles about the axis it meets,//! revolved. At height z the ring is the annulus about (8, 0) between 3 ∓ √(1 − z²), which meets//! the circles about the z axis from 5 − √(1 − z²) out to 11 + √(1 − z²): the shadow is the//! stadium of the band |z| ≤ 1 from 5 to 11 ended by half discs of radius 1.usecrate::solids::*;
use solidcore_record::Seg2;
use std::f64::consts::{FRAC_PI_2, PI};
pubfnbuild() -> R<Body> {
let line = |a: (f64, f64), b: (f64, f64)| Seg2::Line { a: v2(a.0, a.1), b: v2(b.0, b.1) };
let end = |x: f64, start: f64| Seg2::Arc { center: v2(x, 0.0), radius: 1.0, start, sweep: PI };
let stadium = vec![
line((5.0, -1.0), (11.0, -1.0)),
end(11.0, -FRAC_PI_2),
line((11.0, 1.0), (5.0, 1.0)),
end(5.0, FRAC_PI_2),
];
revolve_z(Region2 { outer: Loop2 { segs: stadium }, holes: vec![] }, 360.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
52 ms; CPU time 51 ms; peak memory 20.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 solid a torus (axis the vertical through (8, 0), middle radius 3, tube 1) fills as it turns a// whole turn about the z axis.//// A whole turn about z sweeps the torus's shadow on a half-plane through z revolved: at height z// the torus reaches from 5 - √(1 - z²) to 11 + √(1 - z²) from the axis, a stadium between half// discs of radius 1 about (5, 0) and (11, 0).let m = model();
m.profile(xz()).path(5.0, -1.0).line_to(11.0, -1.0).arc_to([12.0, 0.0], [11.0, 1.0]).line_to(5.0, 1.0)
.arc_to([4.0, 0.0], [5.0, -1.0]).close().sketch("shadow")
.revolve(axis_at([0.0, 0.0, 0.0], [0.0, 0.0, 1.0]), full_circle());
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
5.7 ms; CPU time 5.4 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.
//! Everything a ring passes through as it turns a whole turn about the z axis: the torus about the//! upright line through (8, 0), the circle through its tube's centres of radius 3 in z = 0, its//! tube of radius 1.//!//! Through the kernel's whole sweep of a solid (`sweep_solid`): the ring, a solid of revolution//! about the upright line through (8, 0, 0) whose meridian is the circle of radius 1 about the//! point 3 from the axis, turned a whole turn about the z axis.usecrate::solids::p;
usecrate::solids::swept::{revolved_tool, turn_about_z, Piece};
usecrate::Refusal;
use brep_kernel::{sweep_solid, BrepSolid};
use std::f64::consts::{TAU};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let (x, z) = (p(1.0, 0.0, 0.0), p(0.0, 0.0, 1.0));
let ring = revolved_tool(p(8.0, 0.0, 0.0), z, x, &[
Piece::Arc { centre: [3.0, 0.0], radius: 1.0, start: 0.0, end: TAU },
]);
Ok(sweep_solid(&ring, &turn_about_z(0.0, TAU, 0.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
2 ms; CPU time 1.8 ms; peak memory 6.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 solid a ring (the torus about the upright through (8, 0), radii 3 and 1, centered on z = 0)//! fills as it turns a whole turn about the z axis.//!//! The ring is cadrs's torus primitive; what it passes through is cadrs's sweep of a solid (one//! whole turn).usecrate::bench::{p3, torus, v3};
usecrate::shared::swept::{swung, z_axis};
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let ring = torus(k, p3(8.0, 0.0, 0.0), v3(0.0, 0.0, 1.0), 3.0, 1.0)?;
swung(k, ring, z_axis(), 0.0, 360.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
1.7 ms; CPU time 1.5 ms; peak memory 7.9 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † its sweep of a solid declines it
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 solid a ring fills as it turns a whole turn about the z axis: the torus about the upright//! line through (8, 0), its tube's centers on the circle of radius 3 in the plane z = 0, its tube//! of radius 1.//!//! springrep's sweep of a solid declines this one (it cannot tell whether a face piece is inside).//! A circle about the z axis that crosses the ring's hole meets the ring on both sides of it, so a//! whole turn sweeps the hole, filled, too; the ring with its hole filled meets every circle about//! the z axis in one arc, across the plane y = 0. So the sweep is that section, the stadium from ρ//! = 4 to 12 of height 2, turned a whole turn (`shared::swept`, a turn).use std::f64::consts::{PI, TAU};
use springrep::topo::Brep;
usecrate::shared::swept::{arc, line, outline, swing};
pubfnbuild() -> Result<Brep, String> {
let section = outline(vec![
line((5.0, -1.0), (11.0, -1.0), "floor"),
arc((11.0, 0.0), 1.0, -PI / 2.0, PI, "outer"),
line((11.0, 1.0), (5.0, 1.0), "roof"),
arc((5.0, 0.0), 1.0, PI / 2.0, PI, "inner"),
]);
swing(§ion, 0.0, TAU, "swept")
}
geomsolver left no solid to show.
Time
45 ms; CPU time 45 ms; peak memory 23.6 MB
Notes
refused error[E080]: `part`: native CAD boundary construction for continuous motion sweeps is not yet supported
// A ring lying flat, turned a whole turn about the z axis beside it. The ring is a torus about the// vertical line through (8, 0), its tube (radius 1) 3 from that line on z = 0: the tube's circle// drawn in the front plane and turned about the line. The part is the kernel's sweep of the ring// as it turns a whole turn about z.unit mm
use std
use std.solids
use std.place (vertical, right_of)
use std.motion (turns)
in std.front {
construction centerline spindle := vertical line(std.origin, hint((0, 1)))
length(1mm) spindle
private foot := point
foot right_of(d: 8mm) std.origin
construction centerline ring_axis := vertical line(foot, hint((8, 1)))
length(1mm) ring_axis
private tc := point hint((11, 0))
tc right_of(d: 3mm) foot
private tube := circle(center: tc) hint(r: 1)
radius(1mm) tube
}
constructionring := solid(std.solids.Revolution(face(tube), about: ring_axis))
swing := frame
swing turns(1) spindle
part := solid({ p | some t in (0deg, 360deg): p inringat(under: swing) t })
Time
1.4 ms; CPU time 1.2 ms; peak memory 4.7 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no sweep of a solid
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.
//! What a torus whose axis is the vertical through (8, 0) (middle circle 3, tube 1) fills as it//! turns a whole turn about the z axis.use std::f64::consts::FRAC_PI_2;
use anvil_brep::Solid;
use anvil_brep::profile::Segment;
usecrate::shared::{line, swung, v2};
pubfnbuild() -> Result<Solid, String> {
// anvil-brep has no sweep of a solid. Turned a whole turn about the z axis the ring fills the// revolve of what it covers in a half-plane through the axis: between 5 and 11 out within// |z| ≤ 1, ended by half disks of radius 1, a stadiumswung(
vec![
line(v2(5., -1.), v2(11., -1.)),
Segment::Arc { center: v2(11., 0.), radius: 1., start: -FRAC_PI_2, sweep: 2. * FRAC_PI_2 },
line(v2(11., 1.), v2(5., 1.)),
Segment::Arc { center: v2(5., 0.), radius: 1., start: FRAC_PI_2, sweep: 2. * FRAC_PI_2 },
],
0.,
360.,
)
}