alecjacobson / gptoolbox

Matlab toolbox for Geometry Processing.
MIT License
628 stars 166 forks source link

Shrink wrap mesh? #32

Closed oqilipo closed 7 years ago

oqilipo commented 7 years ago

Hello

My question is if something similar could be done with this toolbox?

There is a function in Materialise Magics to Shrink Wrap a mesh: You can define:

Here is an example: Original: original Shrink Wrap with 2mm Sample Interval, 20mm Gap Fill and Organic Shape True: shrinkwrap_sampleinterval-2mm_gapfill-20mm_organicshape-true

Thanks in advance oqilipo

alecjacobson commented 7 years ago

I'm not sure exactly what Materialise Magics is doing. If I had to guess, it would be that they're using the closing operation. You can get an approximate closing very easily using the signed_distance_isosurface function in Matlab.

% parameter controlling gap size to merge
sigma = 0.5;
% Dilate original
 [V1,F1] = signed_distance_isosurface(V,F,'Level',sigma);
% Erode dilation
 [V2,F2] = signed_distance_isosurface(V1,F1,'Level',-sigma);

You'll have to play around with the parameters of signed_distance_isosurface.

Here's an animation I made using this type of closing for various sigmas.

iwires-shrink

oqilipo commented 7 years ago

Looks promising. I will play around with the parameters.

Thanks a lot!

output_gq9nnl