Files
PozzettiAndrea-ComfyUI-Geom…/nodes
PozzettiAndreaandClaude Opus 4.8 aa714e7826 Add Fit Primitives node (Mesh2Brep stage 2): per-patch fit + agglomerative merge
Takes the VSA patch_id field, robustly fits each patch to plane/sphere/cylinder/cone
(geometric residual, sigma-clip refit), and AGGLOMERATIVELY MERGES adjacent patches
whose COMBINED points fit one primitive -- collapsing VSA's bands of a cylinder/cone/
sphere into a single patch. Outputs face fields patch_id / patch_type (0 plane,1 sphere,
2 cyl,3 cone) / fit_residual + per-patch params in metadata.

Key correctness fixes over the first cut: merge gates on INLIER FRACTION (>= thresh of
combined points within merge_tol) not mean RMS -- a biased sample previously let a
degenerate fit swallow the whole mesh into one "plane". Plus degeneracy guards on the
sphere (reject r > 8*spread = really a plane/cylinder), cylinder (r outside [1e-4,30]*
spread), and cone (half-angle in [0.09,1.48], bounded apex). Face grouping via one
argsort instead of per-patch np.where (was ~1.8B ops). Validated on decimated 101_clean:
4039 raw patches -> 73 consolidated; barrel=cylinder, flange=plane, chamfers=cone.

Known: runtime scales with raw patch count (agglomerative); torus not yet supported.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 13:59:59 +02:00
..
2026-05-16 21:14:42 +02:00
2026-05-16 21:14:42 +02:00
2026-06-16 23:43:35 +02:00
2026-03-01 15:15:53 +00:00