Write STL C++ Mex function

Versión 1.1.0.0 (30,1 KB) por Arso
c++ mex function for writing ASCII stl file from nodes and triangles list
519 Descargas
Actualizado 3 may 2013

Ver licencia

Matlab functions for writing and reading textual files are lacking in speed. Here is c++ implementation for simple writing ASCII stl files from Matlab with reasonable speed for data up to 250k nodes and triangles.

For writing 100k(17MB on HDD) it takes 2-3 seconds and for huge stl like 10 millions nodes/triangles(over 1GB stl file) it takes approximately one minute on my machine(1.5GM RAM, 1.5 GHz).

%% FORMAT
writeSTL(nodes,triangles,filename)
%INPUTS
%nodes[NumberOfNodes x 3]
%trianles[NumberOfTringles x 3]
%filename['string']

example
nodes = [1 2 3; 4 5 6; 7 8 9];
triangles = [1 2 3];
filaname = 'one triangle.stl';

Enjoy!
---------------------------------------
I have been reported that sharing mex files is not allowed. If You are not sure how to compile c++ to mex go to folder with writeSTL.cpp and just type "mex writeSTL.cpp", then call function.
---------------------------------------

Citar como

Arso (2024). Write STL C++ Mex function (https://www.mathworks.com/matlabcentral/fileexchange/41597-write-stl-c-mex-function), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2010a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre STL (STereoLithography) en Help Center y MATLAB Answers.
Etiquetas Añadir etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.1.0.0

fixed title...

1.0.0.0