Diagnose the currently selected polysurfaces/extrusions. Sibling to clean-geometry (curves).
One script next to this file, cleangeosol_diagnose.py, via the usual one-line loader. v1 is
REPORT-ONLY — reports counts and stashes a plan in sc.sticky["cleangeosol_plan"]; a v2 apply is
deferred.
Checks
A. Open vs closed — Brep.IsSolid → closed. Else count naked edges (Edge.Valence == EdgeAdjacency.Naked) + total naked length, and classify burst (fixable) vs open (intentional)
by testing whether JoinNakedEdges(JOIN_TOL) on a duplicate closes it or shrinks the naked count.
Burst = the surfaces touch but aren't joined (repairable); intentional = large isolated naked loops.
B. Extrusion-convertibility — for closed solids: find two parallel planar caps + confirm every
side face normal is ⊥ to the sweep direction (prismatic). Right prism → convertible; a sheared
cap offset → oblique, flagged NOT convertible (Extrusion.Create is perpendicular-only). Objects
already Rhino.Geometry.Extrusion are skipped (already light).
Procedure
Resolve path. Glob **/clean-geometry-solids/cleangeosol_diagnose.py. Do NOT hardcode.
Prints: closed/open/already-extrusion counts; burst-fixable vs intentional-open (with examples:
id, naked-edge count, naked length, burst?); extrusion convertible vs oblique.
Report. v1 stops here. For a fix now, do it explicitly per object with confirmation.
Gotchas (baked in)
Selection excludes locked/hidden. Only selectable objects are scanned (e.g. 50 of 340 breps on
the test model — the rest were on locked layers). Unlock/show layers to include them.
Burst test is on a DUPLICATE (DuplicateBrep().JoinNakedEdges) so nothing is modified.
JOIN_TOL = 1000×tol is a generous detection threshold — the v2 fix should use a tighter,
confirmed value so it never welds truly-separate shells.
Oblique gate is essential. A sheared prism looks convertible but Extrusion.Create (perpendicular
extrude only) would silently build a different solid — so oblique prisms are reported as skip, not
convertible. v2 must re-validate any rebuild by volume+centroid before replacing.
Complex breps skipped for extrusion analysis (Faces.Count > 400) — a prism has few faces.
EdgeAdjacency.Naked and Surface.TryGetPlane (tuple [0]=bool [1]=plane) are RhinoCommon;
Vector3d * Vector3d is the dot product in IronPython.
Not yet implemented (deferred to v2)
Apply. v1 reports only. v2: JoinNakedEdges(tol) / CapPlanarHoles to close confirmed bursts;
rebuild right prisms as Extrusion.Create(profile, signedHeight, cap) (holes via SetOuterProfile
AddInnerProfile) with post-convert volume/centroid validation before Objects.Replace.
Distinguishing intentional-open more finely (paired-naked-edge fraction, planarity of the missing cap).
Non-brep surfaces / meshes.
Reference
Built 2026-07-01 (task 2 non-curve half of the 6-task suite). Diagnose validated on the live model
260629 main ms.3dm (50 selectable breps → 28 solid / 22 open-intentional / 23 extrusion-convertible /
1 oblique). See memory rhino-clean-rhino-method and the plan.
1---2name: clean-geometry-solids3description: clean-geometry-solids4---56# clean-geometry-solids78Diagnose the **currently selected** polysurfaces/extrusions. Sibling to `clean-geometry` (curves).9One script next to this file, `cleangeosol_diagnose.py`, via the usual one-line loader. **v1 is10REPORT-ONLY** — reports counts and stashes a plan in `sc.sticky["cleangeosol_plan"]`; a v2 apply is11deferred.1213## Checks14- **A. Open vs closed** — `Brep.IsSolid` → closed. Else count naked edges (`Edge.Valence ==15 EdgeAdjacency.Naked`) + total naked length, and classify **burst (fixable)** vs **open (intentional)**16 by testing whether `JoinNakedEdges(JOIN_TOL)` on a *duplicate* closes it or shrinks the naked count.17 Burst = the surfaces touch but aren't joined (repairable); intentional = large isolated naked loops.18- **B. Extrusion-convertibility** — for closed solids: find two parallel planar caps + confirm every19 side face normal is ⊥ to the sweep direction (prismatic). **Right prism → convertible**; a sheared20 cap offset → **oblique**, flagged NOT convertible (`Extrusion.Create` is perpendicular-only). Objects21 already `Rhino.Geometry.Extrusion` are skipped (already light).2223## Procedure241. **Resolve path.** Glob `**/clean-geometry-solids/cleangeosol_diagnose.py`. Do NOT hardcode.252. **Diagnose.**26 ```python27 exec(open(r"<ABS>\cleangeosol_diagnose.py").read())28 ```29 Prints: closed/open/already-extrusion counts; burst-fixable vs intentional-open (with examples:30 id, naked-edge count, naked length, burst?); extrusion convertible vs oblique.313. **Report.** v1 stops here. For a fix now, do it explicitly per object with confirmation.3233## Gotchas (baked in)34- **Selection excludes locked/hidden.** Only selectable objects are scanned (e.g. 50 of 340 breps on35 the test model — the rest were on locked layers). Unlock/show layers to include them.36- **Burst test is on a DUPLICATE** (`DuplicateBrep().JoinNakedEdges`) so nothing is modified.37 `JOIN_TOL = 1000×tol` is a generous *detection* threshold — the v2 fix should use a tighter,38 confirmed value so it never welds truly-separate shells.39- **Oblique gate is essential.** A sheared prism looks convertible but `Extrusion.Create` (perpendicular40 extrude only) would silently build a *different* solid — so oblique prisms are reported as skip, not41 convertible. v2 must re-validate any rebuild by volume+centroid before replacing.42- **Complex breps skipped** for extrusion analysis (`Faces.Count > 400`) — a prism has few faces.43- **`EdgeAdjacency.Naked`** and `Surface.TryGetPlane` (tuple `[0]`=bool `[1]`=plane) are RhinoCommon;44 `Vector3d * Vector3d` is the dot product in IronPython.4546## Not yet implemented (deferred to v2)47- **Apply.** v1 reports only. v2: `JoinNakedEdges(tol)` / `CapPlanarHoles` to close confirmed bursts;48 rebuild right prisms as `Extrusion.Create(profile, signedHeight, cap)` (holes via `SetOuterProfile`49 + `AddInnerProfile`) with post-convert volume/centroid validation before `Objects.Replace`.50- Distinguishing intentional-open more finely (paired-naked-edge fraction, planarity of the missing cap).51- Non-brep surfaces / meshes.5253## Reference54Built 2026-07-01 (task 2 non-curve half of the 6-task suite). Diagnose validated on the live model55`260629 main ms.3dm` (50 selectable breps → 28 solid / 22 open-intentional / 23 extrusion-convertible /561 oblique). See memory `rhino-clean-rhino-method` and the plan.
Run npx skillmds@latest add hongikarchi/clean-geometry-solids in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
clean-geometry-solids It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
hongikarchi (@hongikarchi) published this skill. Their other Agent Skills are listed on their SkillMD profile.