3D Triangulated Models Collection
Popularity: 7% [?]
Related Posts
Comments
8 Comments on 3D Triangulated Models Collection
-
Sora on
Tue, 26th Jan 2010 12:05
-
Sora on
Tue, 26th Jan 2010 15:44
Hello,
I just checked your program. But clearly, all triangles do NOT have the same orientation. And I also found in your progruam you wrote:
%Last Update: 03/1/2008
%Created: 10/10/2008
How can it be possible!
[Reply]
‘Unconnected triangles? there should be none!’
Oh, maybe I didnt speak it clearly. Because I found your routine only works on closed surface, I modified it to delete the triangles with one long edge and corresponding normals when I deal with a set of points which are just part of a closed surface. But it’s just a simple thresholding, so it produced some unconnected triangles. And then I have to remove these triangles. And I am also thinking: if one triangle has only one neighbouring triangle, we’d better remove it?
And yes the routine is memory hungry. But it’s common in this field. After a quick check, I think maybe you can save some data (e.g. the normals, etc)as cells rather than arrays to save memory.
[Reply]
Luigi Giaccari Reply:
January 26th, 2010 at 16:35
“And I am also thinking: if one triangle has only one neighbouring triangle, we’d better remove it?”
That depends on what you are doing.
“I think maybe you can save some data (e.g. the normals, etc)as cells rather than arrays to save memory.”
That would save memory??? why?
I actually have several improvements in mind, about quality, speed and memory management. Just don’t have time to code them.
About the memory management the bottleneck is MATLAB itself. On my PC it can only handle about 7e6 doubles which are only 8*7e6= 5,6MB.
Unfortunately matlab requires much more memory to handle this small amount of data. This is the reason why a memory help error may occur for relative large model.
[Reply]
Sora Reply:
January 26th, 2010 at 19:32
Because you do not necessarily need a contiguous block of memory to store a cell array. The memory for each cell needs to be contiguous, but not the entire array of cells. So sometimes it can avoid the error ‘out of memory’. And if you are good at preallocating memory space, you can speed up your program in this way because to preallocate memory space for cells are easier than to do that for arrays. (it’s very hard for you to put a 100kg pig into a fridge but easy to put 100kg pork into the same fridge
).
[Reply]
Luigi Giaccari Reply:
January 27th, 2010 at 09:42
Thank you,
my future codes will take into account your advise.
Luigi
Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!
Include MATLAB code in your comment by doing the following:
<pre lang="MATLAB">
%insert code here
</pre>


















































Luigi Giaccari Reply:
January 26th, 2010 at 12:56
Yes, the data of the last update is wrong. I guess it was 2009.
“But clearly, all triangles do NOT have the same orientation”
Do you have any example?
if you have it you just found a bug.
I want to clarify something: MyRobustCrust returns a conform orientation and the normals are stored in tnorm. This normal orientation does not respect the indexes of triangles. Let me explain:
Generally normals equal the cross product (p2-p1) X (p3-p1).
Where the triangle is stored as [ p1 p2 p3 ]
This is untrue in MyRobustCrust.
The Matlab rendering routine behind “trisurf” re-compute normals according the triangle indexes. It does not take into account the tnorm array. To have a nice rendering we have to respect this convention.
So what I did in this model collection is to reorder the triangles indexes to help the rendering with trisurf. The triangulation have been obtained with MyRobustCrust and reordered.
Luigi
[Reply]
Sora Reply:
January 26th, 2010 at 14:58
Oh, I see
Because you said ‘All models were created with the new MyRobustCrust.’
and in this m file, you do not actually run the reorder function (% t=raddrizza(t,tnorm,p);), I think the reorder step has already been within MyRobustCrust. But actually not. I think it’s just a mistake of understanding. I run raddrizza this time and found the orientations are all correct now.
Anyway, it’s a very good program. It’s very impressive about the speed. And clearly, it’s carefully writen–to save memory is very important!
By the way, about the triangulation result, MyRobustCrust and MyCrustOpen, which one do you think is better? I also use ‘removeUnconnectedTri’ function (developed by another guy on the forum) to remove some unconnected triangles produced by your routines.
[Reply]
Luigi Giaccari Reply:
January 26th, 2010 at 15:10
Unconnected triangles? there should be none! please send me a report on my e-mail.
MyRobustCrust should be better but it works only on closed surfaces (it needs a volume).
“It’s very impressive about the speed. And clearly, it’s carefully written–to save memory is very important!”
I wish to, the routine is unoptimized and very memory hungry. It can only handle a maximum of about 200′000 points and it may takes several minutes to do that.
If you care about speed, keep in contact with the blog, in a few week I will publish a demo of : http://www.advancedmcode.org/fast-surface-recostruction-delaunay2-5d.html
Any suggestion is appriaciated.
Luigi
Luigi