Buffergeometry triangles subdivision

Are there any utilities within the three.js distribution for subdividing bufferGeometry triangles into smaller ones based on some criteria - such as a maximum triangle side length? Couldn’t find anything in bufferGeometry utils. Not sure if there are other places to look.

Best,
OLDMAN

@oldman do you think you’d be able to use the subdivision modifier with the flatOnly flag checked?

2 Likes

There are also some remnants left inside the implementation of PolyhedronGeometry, but you need to extract them if you want to use them. It is better to use the external subdiv library, as @Lawrence3DPK suggests.

1 Like

that’s cool, i didn’t know about…

what do you mean by…

i wonder how either of these would work with imported models, do you know if converting an imported glb’s BufferGeometry to PolyhedronGeometry is possible as to access and apply the internal subdivide function?

1 Like

Currently they (the functions that subdivide) are inside the class definition and I’m not sure how tightly they are connected to the polyhedron geometry. So, by ‘extracting’ I mean to copy their code somewhere outside the class and use it independently from the polyhedron class. This may or may not require some additional fixes, the first person to do this can tell. In any case, the code is not a complete subdiv algorithm, as it only splits faces and does not smooth surfaces.

Using the polyhedron class as it is may not be good, because apart from the subdivision, it also makes normalization (i.e. scales all vertices after subdivision so they are spread on a sphere).

1 Like

Thanks, I shall give your suggestions a try

In these triangle subdivision techniques, is there anything that can also improve triangle aspect ratio while doing the dicing? Particularly if it is starting with narrow, sliver type triangles. Thanks much.

OLDMAN