Repository navigation
Add rounded ring bands (tori) as a feature - #14
Merged
Merged
Conversation
…ring band (torus_boss / torus_recess), plan as a TorusOp, and rebuild as a PartDesign::Revolution (additive boss) or PartDesign::Groove (subtractive seat) of a circular-arc profile. The core gained a Torus primitive and a fit_torus fitter (least-variance axis, (rho,h) circle). The fit carries two impostor gates -- conical (a cone's normals make a constant angle with its axis) and partial-patch (a torus wraps the major axis; a slot half-cylinder end does not) -- so truncated cones and slot ends are not mis-fit. 29 new test_torus.py tests (detection/planning/round-trip/negatives) + ring-boss and ring-groove smoke cases; headless suite 580 passed, FreeCAD smoke 119 checks green.
MasoudMiM
added a commit
that referenced
this pull request
Oct 31, 2026
ROADMAP: Phase 2 (cones/spheres/tori) marked done (PR #14, shipped in v0.18.0); drop the stale '(current slice: feature/tori)' marker and the 'after v0.17.7' version anchor. VERIFY: rewrite the stale 'Non-goals at v0.3' section (it still claimed output was surface patches, not solids) as current known limitations; describe the smoke-test output as the reconstructed parts rather than a single cylinder + caps. design-notes: add Torus to the primitives list in the Architecture section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 item 3 (the last of the three feature-depth items): detect and rebuild full-revolution ring bands as editable PartDesign history.
What
A rounded ring band is a torus: a tube of revolution standing on a face. A band growing out of the face it sits on is a donut blend the fillet rule cannot claim (fillets are partial revolutions; a ring band is a full one) →
torus_boss. A band cut into a face is a ring groove →torus_recess. PartDesign has no torus primitive, so the executor revolve-builds the band: a circular-arc profile sketched on a plane through the major axis, spun 360° as aPartDesign::Revolution(boss) orPartDesign::Groove(seat).The core had no torus primitive at all, so a ring band was either left unassigned or absorbed by a straight-walled terrace pad (the right footprint at the wrong profile). This adds the full pipeline:
core/primitives.py: newTorusprimitive (complexity 3, 7 dof).core/fitting.py: newfit_torusfitter (least-variance axis — a ring is thin along its major axis, opposite a cylinder; circle in the (rho, h) cross-section; nonlinear refinement), registered infit_best.core/emission.py:_torus_patch(poloidal v = 0 at tube top, full-u from the toroidal angle).core/features.py:torus_boss/torus_recessrules (rim annulus = two concentric circles where the tube is cut by the face; additive from the rim face's mean normal; axis out of the face for a boss, into the material for a seat).core/history.py:TorusOpplan op +BuildPlan.tori.core/solidify.py+tests/test_adversarial.py: headless torus-band rebuild for round-trip verification.build.py: the revolve/groove executor branch (arcs built through 3 points so >180° profiles close).scripts/freecad_smoke_test.py: ring-boss + ring-groove cases.Impostor gates (the interesting part)
The flexible 7-dof fit grabs impostors a simpler fitter misses:
Scope
Rounded ring bosses and ring seats. Standalone donuts (no rim / no planar base) and partial-revolution bands are out of scope.
Verification
test_torus.pytests — detection, planning, round-trip, and negatives incl. the slot-half-cylinder impostor).