Tight surface meshing of 3D points

13 visualizaciones (últimos 30 días)
Luca Vacca
Luca Vacca el 6 de Abr. de 2020
Respondida: darova el 6 de Abr. de 2020
Given a set of 3D points, I need to create a surface triangulation to be stored in .stl file. The set of points is similar to a prism with C-shaped base, or a box with a small cilyndrical hole centered on one edge.
How can I create a tight surface mesh? I tried functions such as boundary, alphaShape, MyRobustCrust (https://it.mathworks.com/matlabcentral/fileexchange/63730-surface-reconstruction-from-scattered-points-cloud), and so on, but I didn't reach my expectation. Do you have any further suggestions?
I think probably the cause is that points are not well distributed to be meshed in such ways. Do you know any method to increase the set of points to the optimal number for using those functions?
Thanks in advance
  2 comentarios
darova
darova el 6 de Abr. de 2020
Please attach the data, your attempts
Luca Vacca
Luca Vacca el 6 de Abr. de 2020
Here it is the .mat file with variables, c is the set of points to be meshed and it derives from an approximation of the boolean difference b - a.

Iniciar sesión para comentar.

Respuestas (2)

John D'Errico
John D'Errico el 6 de Abr. de 2020
Sadly, there is no optimal amount of data, no optimal distribution of points. Only as much data as you can get.
The quality of the surface reconstruction will improve with more data, and more evenly distributed data on the surface. How could it not?
At the same time, there would also be areas where a finer sampling will be necessary, because those areas have cusps or other highly nonlinear shapes.
It is ironic, that the one part of your shape where not as much information is needed is the area where the surface is very well behaved. There any scheme will work well, and will probably yield a decent approximation, even with a less dense sampling. But at the same time, that will also be a region where one probably could generate more data easily, but who cares? You don't need it there.
Can you somehow generate extra data, purely from only the data you have? That question gets a fairly emphatic no. At the very least, it would be difficult as hell, and would require a great deal of information about the surface.
Consider this very simple shape, described only be some scattered data points:
px = [0 1 1 .6 .5 .4 0 0];
py = [0 0 1 1 .2 1 1 0];
S = polyshape(px,py);
xy = rand(1000,2);
in = isinterior(S,xy)
xy = xy(in,:);
plot(xy(:,1),xy(:,2),'r.')
Where exactly does the end of that interior cusp lie? How far down does it go? Yes, if you were willing to make a variety of assumptions based on the known shape of the bounding polygon, you could find the shape of that hole, reasonably well. But making up more data, based on nothing more than the data you already have will not improve your ability to predict the shape of that internal cusp.
Essentially, if you want more data, then you need to improve the process where the data was generated, not make up more data from the existing data.

darova
darova el 6 de Abr. de 2020
I just looped through all edges and calculated length
clc,clear
load points.mat
ii = 1:50:size(a,1); % i reduced size of data (my computer can't handle it)
x = a(ii,1);
y = a(ii,2);
z = a(ii,3);
% plot3(x,y,z,'.r')
DT = delaunayTriangulation(x,y,z); % create tetrahedrons
con = DT.ConnectivityList;
pp = DT.Points;
xx = pp(:,1);
yy = pp(:,2);
zz = pp(:,3);
x = xx(con);
y = yy(con);
z = zz(con);
ix = true(size(con,1),1);
mlength = 20; % minimum side length
for i = 1:3
for j = i+1:4
A = [x(:,i)-x(:,j) y(:,i)-y(:,j) z(:,i)-z(:,j)]; % length of side
D = sqrt(sum(A.^2,2)) < mlength; % is length small?
ix = ix & D; % if big write '0'
end
end
tetramesh(con(ix,:),pp)
% alpha(0.5)
axis equal vis3d
Data reduced and minimum side length is 20

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by