|
NAMEPDL::IO::STL - read/write 3D stereolithography files SYNOPSIS use PDL;
use PDL::IO::STL;
($vertices, $faceidx, $colours) = rstl('owl.stl'); # read an STL file
wstl('file.stl', $vertices, $faceidx, $colours); # write an STL file
DESCRIPTIONNormal-vector information is currently ignored. The "attribute byte count", used sometimes to store colour information, is currently ignored. This module is based on CAD::Format::STL, but with "binmode" on opened filehandles and little-endian (i.e. network) order forced on the binary format. FUNCTIONSrstlRead an STL file (ASCII or binary), returning vertices and face-indices. ($vertices, $faceidx, $colours) = rstl('owl.stl'); # read an STL file
wstlSimple PDL STL writer wstl 'file.stl', $vertices, $faceidx; wstl 'file.stl', $vertices, $faceidx, \%OPTIONS; wstl $fh, $vertices, $faceidx, \%OPTIONS; Passing a file-handle is supported, so multiple parts can be written to an ASCII file with several calls. "wstl" accepts several options that may be passed in as a hash ref if desired:
AUTHOREd J, based on Eric Wilhelm's code in CAD::Format::STL.
|