BuildSphere, get a sphere surface model

August 6, 2009 by Luigi Giaccari 
Filed under: Geometry, Graphics 
2 Comments
VN:F [1.8.1_1037]
Rating: 0 (from 0 votes)
VN:F [1.8.1_1037]
Rating: 8.0/10 (1 vote cast)

BuildSphere

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 icosaedron 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 costruction 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 costruction 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 due to well triangulated model that requires a minor number of patches for the same geometrical recostruction accuracy. Possible improvement are possible in time execution and model subdivision flexibility.

EXAMPLE:

n=5;

[p,t]=BuildSphere(n);

figure(1)
axis equal
hold on
trisurf(t,p(:,1),p(:,2),p(:,3));
axis vis3d
view(3)

CONTACTS:

Author: Giaccari Luigi Created:25/04/2009

For info/bugs/questions/suggestions : giaccariluigi@msn.com


Download Now

VN:F [1.8.1_1037]
Rating: 8.0/10 (1 vote cast)
VN:F [1.8.1_1037]
Rating: 0 (from 0 votes)
BuildSphere, get a sphere surface model 8.0101

Popularity: 25% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Live
  • PDF
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Add to favorites
  • email
  • MySpace
  • RSS

Related Posts

Comments

2 Comments on BuildSphere, get a sphere surface model

  1. k on Tue, 9th Feb 2010 05:30
  2. 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

    UN:F [1.8.1_1037]
    Rating: 5.0/5 (1 vote cast)
    UN:F [1.8.1_1037]
    Rating: 0 (from 0 votes)

    [Reply]


    Luigi Giaccari Reply:

    I will think about it

    UA:F [1.8.1_1037]
    Rating: 0.0/5 (0 votes cast)
    UA:F [1.8.1_1037]
    Rating: 0 (from 0 votes)

    [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>