Skip to content

Add mergeGeometries as a component #605

@garma83

Description

@garma83

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions