# Divide mesh according to level of detail

### Background

I need to remesh by OpenVDB, like what Blender remesh does:

Voxel

Uses an OpenVDB to generate a new manifold mesh from the current geometry while trying to preserve the mesh’s original volume.

### Problem

The problem is that OpenVDB gets a constant voxel size. But I have meshes with varying polygon density/granularity, i.e. high-detail and low-detail components. To preserve the topology of high-detail components, the voxel size has to be too small for the whole 3d model.

### Possible workaround

A mesh might be broken down into distinct components of higher detail and lower detail.

### Question

Is there any algorithm or library to help me break down the mesh into distinct components according to level of detail? I looked at CGAL, but I couldn't figure out.

• Mesh density is mostly a function of connected primitive area. So lots of connected triangles all with a "small" relative area equal high density. Bin sorting on triangle area and connectivity generally gives good results. Commented Mar 5, 2021 at 17:01
• @pmw1234 Thanks :) Just curious, have you done this approach before? Commented Mar 6, 2021 at 8:47
• Yes, its simple enough to code up quickly, and gives reasonable results. If the model is indexed then connectivity is just a matter of spinning looping looking for that index. If the index lives in two bins of the same size group, then the bins can be merged. The, the last step is to merge bins that are below some minimum number of triangles. The downside to this method is that its slow. Oh and to see your bins in action just draw each bin with its own color. Commented Mar 6, 2021 at 11:32
• @pmw1234 Great! Thanks :) I think your suggested approach could be an answer. Commented Mar 6, 2021 at 11:37