5.0

5.0 | 3 ratings Rate this file 48 downloads (last 30 days) File Size: 2.13 KB File ID: #20922

patch2stl

by Sven

 

30 Jul 2008 (Updated 31 Jul 2008)

Code covered by BSD License  

Export a vertices/faces patch to an STL triangular mesh

Download Now | Watch this File

File Information
Description

%PATCH2STL Write STL file from patch (vertices/faces) data.
% PATCH2STL('filename',p) writes a stereolithography (STL) file
% for a patch mesh defined by P. P must be a structure with 'VERTICES'
% and 'FACES' fields.
%
% PATCH2STL(...,'mode') may be used to specify the output format.
%
% 'binary' - writes in STL binary format (default)
% 'ascii' - writes in STL ASCII format
%
% Example:
%
% tmpvol = zeros(20,20,20); % Empty voxel volume
% tmpvol(8:12,8:12,5:15) = 1; % Turn some voxels on
% fv = isosurface(tmpvol, 0.99); % Create the patch object
% patch2stl('test.stl',fv) % Save to binary .stl

% Based on surf2stl by Bill McDonald
%
% Author: Sven Holcombe, 07-30-08

This is based heavily on Bill McDonald's previous work, simply enabling his output functions for a different form of input.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
surf2stl

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
02 Aug 2008 Scott Burnside

Nice companion to cad2matdemo.m. Very useful.

28 Apr 2009 Georg Stillfried

Worked fine!

02 Jul 2009 Holger Roth

Great! That's what I looked for...

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
data import Sven 22 Oct 2008 10:12:38
data export Sven 22 Oct 2008 10:12:38
stl Sven 22 Oct 2008 10:12:38
mesh Sven 22 Oct 2008 10:12:38
trimesh Sven 22 Oct 2008 10:12:38
tri Sven 22 Oct 2008 10:12:38
patch Sven 22 Oct 2008 10:12:38
stl ben harrison 20 Jul 2009 03:20:13
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com