File Exchange Pick of the Week

June 5th, 2009

Writing to STL files

Jiro's pick this week is surf2stl by Bill McDonald.

About a month ago, at a seminar I gave at a university, a graduate student came up to me and asked whether there was a function for writing out 3D model files. Specifically, he was referring to STL files (stereolithography files). It was a topical question because it came soon after I talked about some of the exporting capabilities in MATLAB for graphical file formats.

I knew that we didn't have any built in, but I promptly suggested checking out the File Exchange. I've seen a few functions for reading from STL files, so I figured there would be counterparts. Sure enough, there were a few. Here's a list of entries with a tag of "stl".

From the list, I am highlighting Bill's surf2stl. It has nice help, clean code, good reviews, and has even inspired another entry.

Download and give it a try!

Comments?


Get the MATLAB code

Published with MATLAB® 7.8

2 Responses to “Writing to STL files”

  1. Yousif m. ali replied on :

    I have the following question and hope that you may shed some light on it. Thanks in advance
    I am working on image, how to recover scale, rotation, shear from projective t-matrix?
    For example:
    1.6971 1.838 0
    -1.314 0.989 0
    0 0 1

  2. jiro replied on :

    Yousif, I’m not sure I understand your question. It’s probably better to post your question on the newsgroup

    http://www.mathworks.com/matlabcentral/newsreader/

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Bob, Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

  • Zach: Hi Doug and Les, I didn’t have a lot of time to mess with this, but I did find a work-around. I plotted...
  • hamed: k
  • Les: @Zach This isn’t exactly what you are looking for but at least it puts all three parameters on the same...
  • Zach: Thanks for your suggestions Doug. I’ll give that a shot and see what happens. I’ve seen many of...
  • Doug: @Zach, I would say to use plotYYY, because that is close to what you want, but using depth as Y makes sense....
  • Doug: @Teja, I think this will work: http://www.mathworks .com/access/helpdesk /help/techdoc/ref...
  • Gify: merry christmas :) nice christmas tree! Regards, Janet Gify
  • Teja: Dear Doug Is there anyway to plot a surface from nonuniform data without meshgrid and griddata? Basically i...
  • Zach: I’m working with geophysical data, so I’d like to produce a depth profile. The y-axis would be...
  • Doug: @Ashok First, please do not use variable names that are MATLAB commands (std and mean). Second, p(j) should be...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.