Repository navigation
Add spherical bosses (domes) and seats (sockets) - #13
Merged
Merged
Conversation
…ution spherical cap and rebuild it as editable PartDesign history. A convex cap standing on a face is a spherical BOSS (dome), a concave cap cut into a face is a spherical SEAT (socket). PartDesign has no sphere primitive, so the executor revolve-builds the cap: a circular-arc profile sketched on a vertical plane through the axis, spun 360 deg as a PartDesign::Revolution (additive dome) or PartDesign::Groove (subtractive seat), the apex placed exactly. Smooth domes, truncated (flat-topped) domes, and smooth sockets are supported; full spheres and flat-bottomed sockets are out of scope. The apex is read off the patch's high-elevation end (r_hi ~ 0 => the smooth pole, a real r_hi => a flat truncation). FreeCAD's tessellator peels a boolean-cut socket's pole off as a separate tiny cone cap, so the sphere patch stops just short of the pole and reads a small nonzero r_hi; that pole cap (a cone whose apex sits at the sphere's geometric pole, opening back toward the rim) is recognized so the socket is still detected and rebuilt smooth. A truncated dome's flat top, when the segmentation keeps it as a separate plane, is recorded as provenance and excluded from the base extent (like the cylindrical boss cap), so the base pad is not inflated to the top of the dome. New: the sphere detection rule in features.py, the SphereOp plan op in history.py, the _add_sphere revolve executor branch in build.py, the headless _sphere_cap in solidify.py, 26 test_sphere.py tests (detection/planning/round-trip), and dome + socket smoke cases. Headless suite 551 passed; FreeCAD smoke test green.
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.
Detect a full-revolution spherical CAP and rebuild it as editable PartDesign history. A convex cap standing on a face is a spherical boss (dome), a concave cap cut into a face is a spherical seat (socket). PartDesign has no sphere primitive, so the executor revolve-builds the cap: a circular-arc profile sketched on a vertical plane through the axis, spun 360 deg as a
PartDesign::Revolution(additive dome) orPartDesign::Groove(subtractive seat), the apex placed exactly.Scope: smooth domes, truncated (flat-topped) domes, and smooth sockets. Full spheres and flat-bottomed sockets are out of scope (left unassigned, per the unplanned doctrine).
Pole-cap tessellation artifact (the FreeCAD socket regression): the apex is read off the patch's high-elevation end (
r_hi ~ 0=> the smooth pole, a realr_hi=> a flat truncation). FreeCAD's tessellator peels a boolean-cut socket's pole off as a separate tiny cone cap, so the sphere patch stops just short of the pole and reads a small nonzeror_hi— previously misclassified as a flat-bottom socket and dropped. The pole cap (a cone whose apex sits at the sphere's geometric pole, opening back toward the rim) is now recognized so the socket is still detected and rebuilt smooth. A truncated dome's flat top, when the segmentation keeps it as a separate plane, is recorded as provenance and excluded from the base extent (like the cylindrical boss cap).Changes
core/features.py— thesphere_boss/sphere_seatdetection rule (+_is_concave_sphere,_plane_hole_loops_on_sphere,_outer_loop_is_disk_on_sphere, pole-cap recognition).core/history.py— theSphereOpplan op, dispatch, and the sphere-boss base-extent exclusion.build.py— the_add_sphererevolve executor branch (Revolution / Groove).core/solidify.py— the headless_sphere_cap(truncation-capable).tests/test_sphere.py— 26 new tests (detection / planning / round-trip).scripts/freecad_smoke_test.py— dome + socket smoke cases.Verification
Closes Phase 2 item 2 (spheres) of the roadmap.