STL_Import: import function for STL files

August 8, 2009 by Luigi Giaccari · 19 Comments
Filed under: CAD, Geometry 
VN:F [1.8.1_1037]
Rating: 0 (from 0 votes)
VN:F [1.8.1_1037]
Rating: 9.0/10 (1 vote cast)

NormalsComputation1

STL_Import is a tool designed to import into MATLAB both binary and ASCII STL files.

This script is mainly a collage between file exchange file id 22409 and 3642, plus some other features that can be considered new.

SYNOPSIS:

  • mode 1 (default)
    [p,t,tnorm]=STL_Import(filename,mode)
  • mode 2
    [v,tnorm])=STL_Import(filename,mode)

input:

  • filename: string representing the name of the file

mode:

  • mode=1 (if omitted is automatically set to one)

set the the output to:

output=[p,t,tnorm]

where:

  • p=points (unique) of the model nx3 array
  • t=triangles indexes of the model
  • tnorm= normals of triangles
  • mode=2

set the the output to:

output=[v,tnorm]

where:

  • v= vertex (not unique points) of the model nx3 array. Each trhee points we have a triangle in consecutive order.
  • tnorm= normals of triangles

EXAMPLES:

[p,t,tnorm]=STL_Import('link1.stl',1);%MODE1
[pv,tnorm]=STL_Import('link1.stl',2);%MODE2

Author: Giaccari Luigi (giaccariluigi@msn.com)

Download Now

VN:F [1.8.1_1037]
Rating: 9.0/10 (1 vote cast)
VN:F [1.8.1_1037]
Rating: 0 (from 0 votes)

Popularity: 29% [?]

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