This is the cl-ply Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Tue Jul 15 04:13:24 2025 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-plyCl-ply is a library to handle PLY format which is also known as the Stanford Triangle Format.
Masayuki Takagi
LLGPL
# Cl-Ply
[](https://travis-ci.org/takagi/cl-ply)
[](https://coveralls.io/r/takagi/cl-ply)
Cl-ply is a library to handle PLY format which is also known as the Stanford Triangle Format.
## Example
Here shows hot to read PLY file with cl-ply.
The following is an example PLY file:
ply
format ascii 1.0
comment this is test ply data.
element vertex 2
property float x
property float y
property float z
element face 2
property list uchar int vertex_indices
end_header
0.0 1.0 2.0
3.0 4.0 5.0
4 0 1 2 3
4 4 5 6 7
It contains two elements, ‘vertex‘ that has three float properties and ‘face‘ that has a list property of integer.
You can read the PLY file as following:
;; open a PLY file, closed automatically when control leaves
(cl-ply:with-ply-for-reading (plyfile #P"/path/to/file.ply")
;; read and print vertex elements
(loop repeat (cl-ply:ply-element-size plyfile "vertex")
do (format t "element vertex ~S~%"
(cl-ply:ply-read-element plyfile "vertex")))
;; read and print face elements
(loop repeat (cl-ply:ply-element-size plyfile "face")
do (format t "element face ~S~%"
(cl-ply:ply-read-element plyfile "face"))))
## Installation
Cl-ply can be installed via Quicklisp.
(ql:quickload :cl-ply)
## API
### [Macro] with-ply-for-reading
WITH-PLY-FOR-READING (var filespec) form* => results
Opens a file stream named by ‘filespec‘ and creates a plyfile object, reading PLY headers from the file. The plyfile object is bound to ‘var‘. ‘with-ply‘ evaluates ‘form‘ as an implicit progn with ‘var‘ and returns the result values. When control leaves the forms, either normally and abnormally, the file stream is automatically closed.
### [Function] ply-open-for-reading
OPEN-PLY-FOR-READING filespec => plyfile
Opens a file stream named by ‘filespec‘, creates a plyfile object and returns it. The plyfile object should be closed after its use.
### [Function] ply-close
PLY-CLOSE plyfile => result
Closes the plyfile object ‘plyfile‘. The return value is that of standard’s ‘close‘ function.
### [Function] ply-element-names
PLY-ELEMENT-NAMES plyfile => element-names
Returns all names of elements in ‘plyfile‘.
### [Function] ply-element-size
PLY-ELEMENT-SIZE plyfile element-name => size
Returns the number of elements named by ‘element-name‘ in ‘plyfile‘.
### [Function] ply-read-element
PLY-READ-ELEMENT plyfile element-name => result
Reads an element of ‘element-name‘ from ‘plyfile‘ and returns as a list of its properties.
### [Function] ply-comments
PLY-COMMENTS plyfile => comments
Returns a list of comments in ‘plyfile‘.
### [Function] ply-obj-info
PLY-OBJ-INFO plyfile => obj_info
Returns object information in ‘plyfile‘.
## FAQ
**Q. Does cl-ply support writing PLY format?**
A. No. Currenly, only reading PLY format is supported.
**Q. Does cl-ply support reading / writing PLY format in binary type?**
A. No. Currently, only ASCII type is supported.
## Reference
* [PLY - Polygon File Format](http://paulbourke.net/dataformats/ply/)
## Author
* Masayuki Takagi (kamonama@gmail.com)
## Copyright
Copyright (c) 2013 Masayuki Takagi (kamonama@gmail.com)
## License
Licensed under the LLGPL License.
0.1
cl-ppcre (system).
cl-pattern (system).
src (module).
Modules are listed depth-first from the system components tree.
Files are sorted by type and then listed depth-first from the systems components trees.
cl-ply/src/cl-ply.lispsrc (module).
ply-close (function).
ply-comments (function).
ply-element-names (function).
ply-element-size (function).
ply-obj-info (function).
ply-open-for-reading (function).
ply-read-element (function).
with-ply-for-reading (macro).
%make-comment (function).
%make-element (function).
%make-list-property (function).
%make-obj-info (function).
%make-plyfile (function).
%make-scalar-property (function).
+ply-file-types+ (special variable).
+ply-types+ (special variable).
comment (structure).
comment-header-p (function).
comment-p (function).
comment-text (reader).
copy-comment (function).
copy-element (function).
copy-list-property (function).
copy-obj-info (function).
copy-plyfile (function).
copy-scalar-property (function).
element (structure).
element-add-property (function).
element-header-p (function).
element-name (reader).
element-p (function).
element-properties (reader).
(setf element-properties) (writer).
element-size (reader).
end-header-p (function).
format-header-p (function).
header-kind (function).
list-property (structure).
list-property-count-type (reader).
list-property-element-type (reader).
list-property-name (reader).
list-property-p (function).
make-comment (function).
make-element (function).
make-obj-info (function).
make-plyfile (function).
make-property (function).
obj-info (structure).
obj-info-header-p (function).
obj-info-p (function).
obj-info-text (reader).
parse-comment-header (function).
parse-double-float (function).
parse-element-header (function).
parse-end-header (function).
parse-format-header (function).
parse-header (function).
parse-integer% (function).
parse-obj-info-header (function).
parse-ply-file-type (function).
parse-ply-header (function).
parse-ply-type (function).
parse-property-header (function).
parse-single-float (function).
parse-unsigned-integer (function).
parse-value (function).
ply-header-p (function).
plyfile (structure).
plyfile-add-comment (function).
plyfile-add-element (function).
plyfile-add-obj-info (function).
plyfile-add-property (function).
plyfile-comments (reader).
(setf plyfile-comments) (writer).
plyfile-element-by-name (function).
plyfile-elements (reader).
(setf plyfile-elements) (writer).
plyfile-file-type (reader).
(setf plyfile-file-type) (writer).
plyfile-obj-info (reader).
(setf plyfile-obj-info) (writer).
plyfile-p (function).
plyfile-set-format (function).
plyfile-stream (reader).
plyfile-version (reader).
(setf plyfile-version) (writer).
property (type).
property-header-p (function).
read-element (function).
read-element-ascii (function).
read-element-big-endian (function).
read-element-little-endian (function).
read-header (function).
scalar-property (structure).
scalar-property-name (reader).
scalar-property-p (function).
scalar-property-type (reader).
Packages are listed by definition order.
cl-plycommon-lisp.
ply-close (function).
ply-comments (function).
ply-element-names (function).
ply-element-size (function).
ply-obj-info (function).
ply-open-for-reading (function).
ply-read-element (function).
with-ply-for-reading (macro).
%make-comment (function).
%make-element (function).
%make-list-property (function).
%make-obj-info (function).
%make-plyfile (function).
%make-scalar-property (function).
+ply-file-types+ (special variable).
+ply-types+ (special variable).
comment (structure).
comment-header-p (function).
comment-p (function).
comment-text (reader).
copy-comment (function).
copy-element (function).
copy-list-property (function).
copy-obj-info (function).
copy-plyfile (function).
copy-scalar-property (function).
element (structure).
element-add-property (function).
element-header-p (function).
element-name (reader).
element-p (function).
element-properties (reader).
(setf element-properties) (writer).
element-size (reader).
end-header-p (function).
format-header-p (function).
header-kind (function).
list-property (structure).
list-property-count-type (reader).
list-property-element-type (reader).
list-property-name (reader).
list-property-p (function).
make-comment (function).
make-element (function).
make-obj-info (function).
make-plyfile (function).
make-property (function).
obj-info (structure).
obj-info-header-p (function).
obj-info-p (function).
obj-info-text (reader).
parse-comment-header (function).
parse-double-float (function).
parse-element-header (function).
parse-end-header (function).
parse-format-header (function).
parse-header (function).
parse-integer% (function).
parse-obj-info-header (function).
parse-ply-file-type (function).
parse-ply-header (function).
parse-ply-type (function).
parse-property-header (function).
parse-single-float (function).
parse-unsigned-integer (function).
parse-value (function).
ply-header-p (function).
plyfile (structure).
plyfile-add-comment (function).
plyfile-add-element (function).
plyfile-add-obj-info (function).
plyfile-add-property (function).
plyfile-comments (reader).
(setf plyfile-comments) (writer).
plyfile-element-by-name (function).
plyfile-elements (reader).
(setf plyfile-elements) (writer).
plyfile-file-type (reader).
(setf plyfile-file-type) (writer).
plyfile-obj-info (reader).
(setf plyfile-obj-info) (writer).
plyfile-p (function).
plyfile-set-format (function).
plyfile-stream (reader).
plyfile-version (reader).
(setf plyfile-version) (writer).
property (type).
property-header-p (function).
read-element (function).
read-element-ascii (function).
read-element-big-endian (function).
read-element-little-endian (function).
read-header (function).
scalar-property (structure).
scalar-property-name (reader).
scalar-property-p (function).
scalar-property-type (reader).
Definitions are sorted by export status, category, package, and then by lexicographic order.
structure-object.
:text
This slot is read-only.
structure-object.
:text
This slot is read-only.
structure-object.
common-lisp.
This slot is read-only.
| Jump to: | %
(
C E F H L M O P R S W |
|---|
| Jump to: | %
(
C E F H L M O P R S W |
|---|
| Jump to: | +
C E F N O P S T V |
|---|
| Jump to: | +
C E F N O P S T V |
|---|
| Jump to: | C E F L M O P S T |
|---|
| Jump to: | C E F L M O P S T |
|---|