这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@vivagelive
Copy link
Contributor

Hi. @Knightro63!
Some addings for BufferGeometryUtils:
-Added method mergeGeometries.

Summary

  • Implemented BufferGeometryUtil.mergeGeometries to safely merge multiple BufferGeometry instances.
  • Added validation for:
    • Matching attribute sets across all geometries.
    • Matching morph attribute sets and morphTargetsRelative flag.
    • Consistent indexing (all indexed or all non-indexed).
  • Added _mergeAttributes helper to combine BufferAttribute arrays into a single attribute.
  • Optional useGroups parameter to preserve material group information.

Why

Ensures merged geometries are compatible and prevents runtime errors due to mismatched attributes.

Notes

  • Returns null if geometries are incompatible.
  • Prints debug messages for mismatches (can be replaced with logging later).

Have a nice day!

@vivagelive vivagelive changed the title Added method mergeGeometries into buffergeometry_utils.dart. Added method mergeGeometries into buffer_geometry_utils.dart. Sep 5, 2025
@Knightro63 Knightro63 merged commit 34e6685 into Knightro63:main Sep 5, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants