Repository navigation
feat(DXF): load DXF as independent surfaces; Assimp formats as one surface per object - #235
Merged
Merged
Conversation
…CE layer DXF files are no longer read through Assimp, which merged the entities of a layer and dropped the polyface faces written as quads with a repeated vertex (2,1,4,2), loading such files with 0 polygons. Each polyface mesh POLYLINE becomes a surface named after its XDATA "Name" or "Nom de Galerie" (else <layer>_<handle>), the 3DFACE entities give one surface per layer, and degenerate faces and unsupported entities are skipped with a warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed corners The OBJ, STL and PLY readers merged every Assimp mesh of the file into one surface. They now return one surface per scene node holding meshes (an OBJ g/o object, an STL solid; a PLY file stays one surface), named after it, each with the textures of its materials. Objects without polygons are dropped. Consecutive corners on the same vertex or on equal points (including last/first) are merged before building a polygon, so f 1 2 3 1 gives a triangle instead of a dropped degenerate polygon; faces left with less than 3 corners are skipped with the other unsupported faces. load_one on a multi-object OBJ (or multi-solid STL) file now raises a data error: callers must iterate the returned surfaces (load_all in Python). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
panquez
approved these changes
Nov 20, 2026
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.
Why
A DXF made of polyface meshes (triangles stored as quads repeating their first vertex,
a,b,c,a) loaded with 0 polygons. Assimp kept the faces as 4-vertex polygons, thenSurfaceMeshMergerdropped every polygon with a repeated vertex. Assimp's DXF importer also groups everything per layer and drops handles/XDATA, so individual objects could not be recovered.What
DXF: own reader (no Assimp)
PolygonalSurface3Dper polyface POLYLINE; 3DFACEs grouped into one surface per layer (vertices colocated).Name, thenNom de Galerie, else<layer>_<handle>, with\U+XXXXescapes decoded.EOF. A leading comment, a UTF-8 BOM or a missing SEQEND is tolerated. Binary DXF is a data error. Unsupported entities (LINE, POINT, INSERT…) are skipped with a warning; VIEWPORT is skipped silently.OBJ / STL / PLY (Assimp)
g/o, STL solid), named after it. The meshes of an object (one per material) are still merged, so a multi-material object stays one surface with all its textures.Behavior changes
load_oneon a multi-object OBJ or multi-solid STL now raises a data error: useload_alland iterate.Tests
test-dxf: newpolyface_surfaces.dxf,3D_faces.dxfper layer (expected counts computed independently), plus inline cases for trailing content, missing corners, the minimum int index, missing SEQEND, BOM, comments, unicode layer names and VIEWPORT.test-obj: per-object surfaces, a multi-material object (placed after another group, so its position in the file differs from its index in the object), repeated corners, an unnamed object.test-stl/test-ply: names.🤖 Generated with Claude Code