ExtrudeGeometry: Index is null


I am trying to merge two different types of buffer geometries: one BoxBufferGeometry and two ExtrudeBufferGeometry - for this I am using BufferGeometryUtils.mergeBufferGeometries.

Unfortunately I am getting following error message:

mergeBufferGeometries() failed with geometry at index 1. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.

Here I understand that my Extrude Geometries are not getting any indexes - how can I come around this issue?

Many thanks for your help.

Try to call .toNonIndexed() on your box geometry before merging.

Hi @prisoner849 and many thanks for your quick reply! This worked, or at least it removed the error message - however I ended up changing my approach by using one extrude geometry to build by shape instead of a box and two prisms. Thank you again!