cientos icon indicating copy to clipboard operation
cientos copied to clipboard

Add mergeGeometries as a component

Open garma83 opened this issue 9 months ago • 0 comments

Description

As a developer using TresJS I would like to be able to use the mergeGeometries function that is in the three.js examples dir, so I can optimize performance in case I have many geometries that have the same material and don't need to move independent of each other.

Suggested solution

Be able to do the following:

<TresMesh>
<MergeGeometries>
<TresBoxGeometry :args=[1,4,1] />
<TresBoxGeometry :args=[4,1,1] />
</MergeGeometries>
<TresStandardMaterial>
</TresMesh>

Where the boxes are possibly generated from a v-for loop. The component would merge the geometries in the slot, and basically function as a single geometry as far as the mesh is concerned

Alternative

No response

Additional context

I have a branch with a solution ready for review. This requirement has emerged from a migration from a trois js project

Validations

garma83 avatar Mar 26 '25 18:03 garma83