Skip to content

Fix handling of X3D IndexedLineSet nodes - #5362

Merged
kimkulling merged 3 commits into
assimp:masterfrom
andre-schulz:fix_X3D_IndexedLineSet
Jan 9, 2024
Merged

kimkulling merged 3 commits into
assimp:masterfrom
andre-schulz:fix_X3D_IndexedLineSet

Conversation

@andre-schulz

Copy link
Copy Markdown
Contributor

This MR fixes the handling of IndexedLineSet nodes in X3D files. Currently, IndexedLineSet polylines with > 2 indices are mistakenly converted to triangles and polygons. Additionally, this MR adds a unit test.

Fixes #3101

…gles/polygons

Currently, when the coordIndex attribute of an IndexedLineSet contains a
polyline with > 2 indices, X3DGeoHelper::coordIdx_str2faces_arr() will
incorrectly determine the primitive type to be aiPrimitiveType_TRIANGLE or
aiPrimitiveType_POLYGON instead of aiPrimitiveType_LINE.

To fix this, this commit adds functions to explicitly handle an IndexedLineSet.

Fixes assimp#3101
Unit test for issue assimp#3101

Thanks to @mvidiassov for the X3D test file!
@andre-schulz
andre-schulz force-pushed the fix_X3D_IndexedLineSet branch from 4cee35e to 2b01ba2 Compare January 1, 2024 12:54
@kimkulling
kimkulling merged commit 74af43f into assimp:master Jan 9, 2024
@kimkulling

Copy link
Copy Markdown
Member

Merged, thanks a lot for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

X3D importer converts polylines into polygons

2 participants