1STL(3)                User Contributed Perl Documentation               STL(3)
2
3
4

NAME

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

SYNOPSIS

9        use PDL;
10        use PDL::IO::STL;
11
12        ($vertices, $faceidx, $colours) = rstl('owl.stl'); # read an STL file
13        wstl('file.stl', $vertices, $faceidx, $colours); # write an STL file
14

DESCRIPTION

16       Normal-vector information is currently ignored.  The "attribute byte
17       count", used sometimes to store colour information, is currently
18       ignored.
19
20       This module is based on CAD::Format::STL, but with "binmode" on opened
21       filehandles and little-endian (i.e. network) order forced on the binary
22       format.
23

FUNCTIONS

25   rstl
26       Read an STL file (ASCII or binary), returning vertices and face-
27       indices.
28
29        ($vertices, $faceidx, $colours) = rstl('owl.stl'); # read an STL file
30
31   wstl
32       Simple PDL FITS writer
33
34         wstl 'file.stl', $vertices, $faceidx;
35         wstl 'file.stl', $vertices, $faceidx, \%OPTIONS;
36         wstl $fh, $vertices, $faceidx, \%OPTIONS;
37
38       Passing a file-handle is supported, so multiple parts can be written to
39       an ASCII file with several calls.
40
41       "wstl" accepts several options that may be passed in as a hash ref if
42       desired:
43
44       mode (default='binary')
45          Whether to write out the file as ASCII or binary.
46
47       name (default='part')
48          The part name to use.
49

AUTHOR

51       Ed J, based on Eric Wilhelm's code in CAD::Format::STL.
52
53
54
55perl v5.38.0                      2023-07-21                            STL(3)
Impressum