GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
PDL::IO::STL(3) User Contributed Perl Documentation PDL::IO::STL(3)

PDL::IO::STL - read/write 3D stereolithography files

 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

Normal-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.

Read an STL file (ASCII or binary), returning vertices and face-indices.

 ($vertices, $faceidx, $colours) = rstl('owl.stl'); # read an STL file

Simple 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:

Whether to write out the file as ASCII or binary.
The part name to use.

Ed J, based on Eric Wilhelm's code in CAD::Format::STL.

2025-02-03 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.