BuildSphere, get a sphere surface model
This can be considered the triangular version of file exchange id 20888 which uses quad patches.
BUILDSPHERE:
Returns the triangulated model of a sphere using the icosahedron subdivision method.
INPUT:
- n (integer number) indicates the number of subdivisions, it can assumes values between 0-inf. The greater n the better will look the surface but the more time will be spent in surface construction and more triangles will be put in the output model.
OUTPUT:
- In p (n x 3) and t(m x 3) we can find points and triangles indexes of the model. The sphere is supposed to be of unit radius and centered in (0,0,0). To obtain spheres centered in different location, or with different radius, is just necessary a translation and a scaling transformation. These operation are not performed by this code because it is extremely convenient, in order of time performances, to do them out of the function avoiding to call the construction step each time.
NOTE:
This function is more efficient than the matlab command sphere in terms of dimension of the model/ accuracy of recostruction. This is due to the well triangulated model that requires a minor number of patches for the same geometrical reconstruction accuracy. Possible improvement are possible in time execution and model subdivision flexibility.
EXAMPLE:
CONTACTS:
Author: Giaccari Luigi Created:25/04/2009
For info/bugs/questions/suggestions : giaccariluigi@msn.com
Download Now
Popularity: 4% [?]
Related Posts
Comments
2 Comments on BuildSphere, get a sphere surface model
-
k on
Tue, 9th Feb 2010 05:30
Great!
Could you write another version of this that can make a sphere from a given number of the points?
I mean, input: the number of the points -> output: sphere data
[Reply]
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:
February 9th, 2010 at 11:27
I will think about it
[Reply]