Repository navigation
feat(modeling): polygonize linked STL slice contour - #5
Merged
Merged
Conversation
Brutich
marked this pull request as ready for review
August 27, 2026 23:03
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.
Closes #4.
What changed and why
The saved script now preserves the actual triangle-section segments instead of inferring an outline from a point-cloud concave hull. It snaps and deduplicates segment endpoints, nodes/dissolves the section network, polygonizes closed rings, heals bounded gaps between separate STL solids with an outward/inward buffer, and creates the largest exterior shell as Revit model lines.
The existing script and documentation paths remain unchanged so saved BIMO presets can continue to reference them.
Scope and intentional exclusions
Included:
ConcaveHullwith NetTopologySuite segment union andPolygonizer;gap_healing_mm(250mm default) and topology-preserving simplification (50mm default) parameters;0;OUT;__uidoc__.Documentand keep the model write in one rollback-safe transaction;catalog.jsonand the paired guide with tuning guidance and prototype evidence;AGENTS.mdwithout storing chat transcripts or unfiltered reasoning.Excluded:
User impact
With the defaults, the script slices the selected linked STL at
L3 + 1500 mm, uses a25 mmendpoint grid, heals polygon fragments by250 mm, simplifies by50 mm, and creates the largest exterior shell as model lines.IN[3]andIN[4]can now be tuned independently to distinguish gap-healing effects from simplification discrepancies.The script may create one cyan line subcategory, one horizontal
SketchPlane, and one closed model-line chain in a single transaction. It does not modify the link or source STL.Validation performed
python tools/validate_catalog.py— passed for 6 scripts.git diff --check— passed.L3 + 1500 mmslice: 49 meshes, 7,264,272 triangles, 12,275 raw segments, 9,861 unique snapped segments, 997 polygonized fragments, 13 dangles, no cut edges, and no invalid rings.250 mmgap healing and50 mmsimplification, the prototype created 179 model lines; the exterior-shell area changed from approximately 572.873 m² after healing to 573.418 m² after simplification. The result was visually reviewed against the linked building mesh.The exact generalized repository file has not been executed as-is in Revit, so
revit.testedremains empty.Risks, limitations, and remaining checks
250 mmhealing default is model-dependent and can bridge intended recesses or round corners;IN[4] = 50with25,10, and0, then verify undo removes all created elements.Documentation impact
The paired guide and machine-readable catalog now describe polygonization, gap healing, tuning order, output diagnostics, model/file-system side effects, prototype validation, and the remaining exact-script Revit test. Decision record
docs/decisions/0001-linked-stl-slice-contour.mdis the long-lived source for alternatives, measurements, accepted reasoning, implementation traps, and future experiments;AGENTS.mdand the script guide link to it.