00Schneider
00Schneider

Reputation: 3

Meshlab Weighted Simplification

I'm using Meshlab Quadric edge collapse for simplification. The idea is to use a second mesh to define a region of interest in the mesh and to than calculate with Hausdorff Distance the distance between the two meshes. Than with weighted simplification I want the further away parts of the mesh to be stronger simplified than the closer parts. Unfortunatly I have no idea how to get there as the per Vertex quality is high on the further away parts and low on the part close to the defined region of interest and I would need it the other way around. Any idea? Many thanks!

Upvotes: 0

Views: 413

Answers (1)

Rockcat
Rockcat

Reputation: 3240

There is an easy way to achieve that using the Per Vertex Quality Function filter.

First, let me build an example similar to yours. I have two meshes (grey and yellow gargoyles), and will use the Distance from Reference Mesh to compute the distance from one mesh to the other, and store distance values as quality per vertex.

enter image description here

We can render the quality histogram to see the values. You can see that there is a lot of vertices with distance near to 0.0 (blue values). The max distance value between both mesh is 1.83 (red values).

enter image description here

Now, you want to invert these values in a way that low-distance values take high-quality values. You can use the Per Vertex Quality Function filter and write an expression that convert low values to high values. In your expression, q represent the current per vertex quality value, so you can use formulas like q = 1.83 - q or q = 1 / (1+q)

In this example, I have used q = 1.83 - q. This is nice, but makes the formula to depend of max value of distance. As you see, the histogram has been reversed and now the vertex that had low-distance high-quality values.

enter image description here

And here, I have used q = 1 / (1+q). I use this formula to avoid divisions by zero that would be yield by plain 1 / q. You can also go non-linear and use something as q = 1 / (1 + q * q).

enter image description here

Upvotes: 1

Related Questions