Repository navigation
import(): weld exactly-equal vertices in every mesh format; X3D/VRML Switch, LOD and prototypes - #272
Merged
Merged
Conversation
A closed solid written as a triangle soup, or with its vertex list
duplicated, imported as an open surface ("N boundary edges, M unwelded
vertices") that could not take part in CSG. OpenSCAD 2026.02.01 imports
such an OFF, OBJ or 3MF as a solid; it cannot import X3D or VRML.
Granularity follows OpenSCAD, checked by running it: the whole file for
OBJ (across `o` groups) and OFF (one mesh), each object for 3MF (two open
halves in separate objects stay open there). X3D and VRML weld each
Shape's geometry, like AMF and 3MF. Exact positions only, as for STL and
AMF.
appendWelded() now carries the per-object weld for 3MF, AMF, X3D and
VRML. weldVertices() rejects a face index past the vertex list instead of
reading out of bounds (OBJ and 3MF never checked one). The 3MF reader no
longer reads `<triangles>` as a degenerate triangle.
Also fixes scene_import.cpp's header, which still said AMF's `unit`
scales to millimetres.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…totypes warn Switch and LOD imported every child, so a file with alternatives drew all of them on top of each other. Switch now imports only its whichChoice child (nothing at the spec default -1 or out of range), and LOD only its first, most detailed level -- VRML's `choice`/`level` fields, X3D's child elements. Prototypes are still not expanded, but no longer fail silently. X3D stops walking ProtoDeclare/ExternProtoDeclare bodies, which were imported once as plain geometry with their IS connections ignored, and reports those and ProtoInstance through the skipped-node warning. VRML remembers every PROTO/EXTERNPROTO name and reports instances of one as "PROTO instance", where the import used to come out empty with no explanation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 8, 2026
Merged
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.
Follows #270 (AMF) to the other mesh importers, and fixes three X3D/VRML scene-structure problems found on the way.
Exact-position weld
Only STL and AMF merged vertices at exactly the same position, so a closed OFF, OBJ, 3MF, X3D or VRML file written as a triangle soup imported as an open surface that could not take part in CSG. Behaviour learned only by running OpenSCAD 2026.02.01:
ogroups<mesh>appendWelded(mesh_import) reuses the existingweldVertices.weldVerticesnow rejects a face index past the vertex list (OBJ and 3MF never validated, so it used to reach Manifold as VertexOutOfBounds). Also fixed: the 3MF reader's<trianglesearch matched<triangles>and added a degenerate (0,0,0) triangle to every mesh, silently dropped by Manifold. scene_import.cpp's header no longer claims AMF'sunitscales to mm.X3D / VRML scene structure
whichChoicechild (nothing for -1, the default, or out of range); LOD only its first level. Both used to import every child.ProtoDeclarebody as plain geometry (it ignoredIS), and both formats warn:skipped what is not a mesh: 1 ProtoDeclare, 1 ProtoInstance/2 PROTO instance.Verification
tests/test_import_export.cpp, all failing on the old code. Full suite: 1479 passed.test_python_bindings.py: 63 passed.Remaining (unchanged, documented in CLAUDE.md): open meshes in CSG are drawn with a warning where OpenSCAD drops them; near-coincident vertices are not merged (
repair=truecovers it); prototypes are skipped, not expanded.🤖 Generated with Claude Code