The cl-ply Reference Manual

This is the cl-ply Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:16:25 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-ply

Cl-ply is a library to handle PLY format which is also known as the Stanford Triangle Format.

Author

Masayuki Takagi

License

LLGPL

Long Description

# Cl-Ply

[![Build Status](https://travis-ci.org/takagi/cl-ply.svg?branch=master)](https://travis-ci.org/takagi/cl-ply)
[![Coverage Status](https://coveralls.io/repos/takagi/cl-ply/badge.svg)](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.

Version

0.1

Dependencies
  • cl-ppcre (system).
  • cl-pattern (system).
Source

cl-ply.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 cl-ply/src

Source

cl-ply.asd.

Parent Component

cl-ply (system).

Child Component

cl-ply.lisp (file).


4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 cl-ply/cl-ply.asd

Source

cl-ply.asd.

Parent Component

cl-ply (system).

ASDF Systems

cl-ply.

Packages

cl-ply-asd.


4.1.2 cl-ply/src/cl-ply.lisp

Source

cl-ply.asd.

Parent Component

src (module).

Packages

cl-ply.

Public Interface
Internals

5 Packages

Packages are listed by definition order.


5.1 cl-ply-asd

Source

cl-ply.asd.

Use List
  • asdf/interface.
  • common-lisp.

5.2 cl-ply

Source

cl-ply.lisp.

Use List

common-lisp.

Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Macros

Macro: with-ply-for-reading ((var filespec) &body body)
Package

cl-ply.

Source

cl-ply.lisp.


6.1.2 Ordinary functions

Function: ply-close (plyfile)
Package

cl-ply.

Source

cl-ply.lisp.

Function: ply-comments (plyfile)
Package

cl-ply.

Source

cl-ply.lisp.

Function: ply-element-names (plyfile)
Package

cl-ply.

Source

cl-ply.lisp.

Function: ply-element-size (plyfile element-name)
Package

cl-ply.

Source

cl-ply.lisp.

Function: ply-obj-info (plyfile)
Package

cl-ply.

Source

cl-ply.lisp.

Function: ply-open-for-reading (filespec)
Package

cl-ply.

Source

cl-ply.lisp.

Function: ply-read-element (plyfile element-name)
Package

cl-ply.

Source

cl-ply.lisp.


6.2 Internals


6.2.1 Special variables

Special Variable: +ply-file-types+
Package

cl-ply.

Source

cl-ply.lisp.

Special Variable: +ply-types+
Package

cl-ply.

Source

cl-ply.lisp.


6.2.2 Ordinary functions

Function: %make-comment (&key text)
Package

cl-ply.

Source

cl-ply.lisp.

Function: %make-element (&key name size properties)
Package

cl-ply.

Source

cl-ply.lisp.

Function: %make-list-property (&key count-type element-type name)
Package

cl-ply.

Source

cl-ply.lisp.

Function: %make-obj-info (&key text)
Package

cl-ply.

Source

cl-ply.lisp.

Function: %make-plyfile (&key stream file-type version elements comments obj-info)
Package

cl-ply.

Source

cl-ply.lisp.

Function: %make-scalar-property (&key type name)
Package

cl-ply.

Source

cl-ply.lisp.

Function: comment-header-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Function: comment-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Reader: comment-text (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

text.

Function: copy-comment (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Function: copy-element (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Function: copy-list-property (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Function: copy-obj-info (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Function: copy-plyfile (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Function: copy-scalar-property (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Function: element-add-property (element property)
Package

cl-ply.

Source

cl-ply.lisp.

Function: element-header-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Reader: element-name (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

name.

Function: element-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Reader: element-properties (instance)
Writer: (setf element-properties) (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

properties.

Reader: element-size (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

size.

Function: end-header-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Function: format-header-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Function: header-kind (object)
Package

cl-ply.

Source

cl-ply.lisp.

Reader: list-property-count-type (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

count-type.

Reader: list-property-element-type (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

element-type.

Reader: list-property-name (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

name.

Function: list-property-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Function: make-comment (header)
Package

cl-ply.

Source

cl-ply.lisp.

Function: make-element (header)
Package

cl-ply.

Source

cl-ply.lisp.

Function: make-obj-info (header)
Package

cl-ply.

Source

cl-ply.lisp.

Function: make-plyfile (stream)
Package

cl-ply.

Source

cl-ply.lisp.

Function: make-property (header)
Package

cl-ply.

Source

cl-ply.lisp.

Function: obj-info-header-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Function: obj-info-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Reader: obj-info-text (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

text.

Function: parse-comment-header (line)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-double-float (string)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-element-header (line)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-end-header (line)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-format-header (line)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-header (line)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-integer% (string)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-obj-info-header (line)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-ply-file-type (string)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-ply-header (line)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-ply-type (string)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-property-header (line)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-single-float (string)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-unsigned-integer (string)
Package

cl-ply.

Source

cl-ply.lisp.

Function: parse-value (string ply-type)
Package

cl-ply.

Source

cl-ply.lisp.

Function: ply-header-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Function: plyfile-add-comment (plyfile comment)
Package

cl-ply.

Source

cl-ply.lisp.

Function: plyfile-add-element (plyfile element)
Package

cl-ply.

Source

cl-ply.lisp.

Function: plyfile-add-obj-info (plyfile obj-info)
Package

cl-ply.

Source

cl-ply.lisp.

Function: plyfile-add-property (plyfile property)
Package

cl-ply.

Source

cl-ply.lisp.

Reader: plyfile-comments (instance)
Writer: (setf plyfile-comments) (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

comments.

Function: plyfile-element-by-name (plyfile element-name)
Package

cl-ply.

Source

cl-ply.lisp.

Reader: plyfile-elements (instance)
Writer: (setf plyfile-elements) (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

elements.

Reader: plyfile-file-type (instance)
Writer: (setf plyfile-file-type) (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

file-type.

Reader: plyfile-obj-info (instance)
Writer: (setf plyfile-obj-info) (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

obj-info.

Function: plyfile-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Function: plyfile-set-format (plyfile header)
Package

cl-ply.

Source

cl-ply.lisp.

Reader: plyfile-stream (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

stream.

Reader: plyfile-version (instance)
Writer: (setf plyfile-version) (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

version.

Function: property-header-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Function: read-element (stream file-type element)
Package

cl-ply.

Source

cl-ply.lisp.

Function: read-element-ascii (stream element)
Package

cl-ply.

Source

cl-ply.lisp.

Function: read-element-big-endian (stream type)
Package

cl-ply.

Source

cl-ply.lisp.

Function: read-element-little-endian (stream type)
Package

cl-ply.

Source

cl-ply.lisp.

Function: read-header (stream)
Package

cl-ply.

Source

cl-ply.lisp.

Reader: scalar-property-name (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

name.

Function: scalar-property-p (object)
Package

cl-ply.

Source

cl-ply.lisp.

Reader: scalar-property-type (instance)
Package

cl-ply.

Source

cl-ply.lisp.

Target Slot

type.


6.2.3 Structures

Structure: comment
Package

cl-ply.

Source

cl-ply.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: text
Initform

:text

Readers

comment-text.

Writers

This slot is read-only.

Structure: element
Package

cl-ply.

Source

cl-ply.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: name
Initform

:name

Readers

element-name.

Writers

This slot is read-only.

Slot: size
Initform

:size

Readers

element-size.

Writers

This slot is read-only.

Slot: properties
Readers

element-properties.

Writers

(setf element-properties).

Structure: list-property
Package

cl-ply.

Source

cl-ply.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: count-type
Initform

:count-type

Readers

list-property-count-type.

Writers

This slot is read-only.

Slot: element-type
Initform

:element-type

Readers

list-property-element-type.

Writers

This slot is read-only.

Slot: name
Initform

:name

Readers

list-property-name.

Writers

This slot is read-only.

Structure: obj-info
Package

cl-ply.

Source

cl-ply.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: text
Initform

:text

Readers

obj-info-text.

Writers

This slot is read-only.

Structure: plyfile
Package

cl-ply.

Source

cl-ply.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: stream
Package

common-lisp.

Readers

plyfile-stream.

Writers

This slot is read-only.

Slot: file-type
Readers

plyfile-file-type.

Writers

(setf plyfile-file-type).

Slot: version
Readers

plyfile-version.

Writers

(setf plyfile-version).

Slot: elements
Readers

plyfile-elements.

Writers

(setf plyfile-elements).

Slot: comments
Readers

plyfile-comments.

Writers

(setf plyfile-comments).

Slot: obj-info
Readers

plyfile-obj-info.

Writers

(setf plyfile-obj-info).

Structure: scalar-property
Package

cl-ply.

Source

cl-ply.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: type
Package

common-lisp.

Initform

:type

Readers

scalar-property-type.

Writers

This slot is read-only.

Slot: name
Initform

:name

Readers

scalar-property-name.

Writers

This slot is read-only.


6.2.4 Types

Type: property ()
Package

cl-ply.

Source

cl-ply.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
C   E   F   H   L   M   O   P   R   S   W  
Index Entry  Section

%
%make-comment: Private ordinary functions
%make-element: Private ordinary functions
%make-list-property: Private ordinary functions
%make-obj-info: Private ordinary functions
%make-plyfile: Private ordinary functions
%make-scalar-property: Private ordinary functions

(
(setf element-properties): Private ordinary functions
(setf plyfile-comments): Private ordinary functions
(setf plyfile-elements): Private ordinary functions
(setf plyfile-file-type): Private ordinary functions
(setf plyfile-obj-info): Private ordinary functions
(setf plyfile-version): Private ordinary functions

C
comment-header-p: Private ordinary functions
comment-p: Private ordinary functions
comment-text: Private ordinary functions
copy-comment: Private ordinary functions
copy-element: Private ordinary functions
copy-list-property: Private ordinary functions
copy-obj-info: Private ordinary functions
copy-plyfile: Private ordinary functions
copy-scalar-property: Private ordinary functions

E
element-add-property: Private ordinary functions
element-header-p: Private ordinary functions
element-name: Private ordinary functions
element-p: Private ordinary functions
element-properties: Private ordinary functions
element-size: Private ordinary functions
end-header-p: Private ordinary functions

F
format-header-p: Private ordinary functions
Function, %make-comment: Private ordinary functions
Function, %make-element: Private ordinary functions
Function, %make-list-property: Private ordinary functions
Function, %make-obj-info: Private ordinary functions
Function, %make-plyfile: Private ordinary functions
Function, %make-scalar-property: Private ordinary functions
Function, (setf element-properties): Private ordinary functions
Function, (setf plyfile-comments): Private ordinary functions
Function, (setf plyfile-elements): Private ordinary functions
Function, (setf plyfile-file-type): Private ordinary functions
Function, (setf plyfile-obj-info): Private ordinary functions
Function, (setf plyfile-version): Private ordinary functions
Function, comment-header-p: Private ordinary functions
Function, comment-p: Private ordinary functions
Function, comment-text: Private ordinary functions
Function, copy-comment: Private ordinary functions
Function, copy-element: Private ordinary functions
Function, copy-list-property: Private ordinary functions
Function, copy-obj-info: Private ordinary functions
Function, copy-plyfile: Private ordinary functions
Function, copy-scalar-property: Private ordinary functions
Function, element-add-property: Private ordinary functions
Function, element-header-p: Private ordinary functions
Function, element-name: Private ordinary functions
Function, element-p: Private ordinary functions
Function, element-properties: Private ordinary functions
Function, element-size: Private ordinary functions
Function, end-header-p: Private ordinary functions
Function, format-header-p: Private ordinary functions
Function, header-kind: Private ordinary functions
Function, list-property-count-type: Private ordinary functions
Function, list-property-element-type: Private ordinary functions
Function, list-property-name: Private ordinary functions
Function, list-property-p: Private ordinary functions
Function, make-comment: Private ordinary functions
Function, make-element: Private ordinary functions
Function, make-obj-info: Private ordinary functions
Function, make-plyfile: Private ordinary functions
Function, make-property: Private ordinary functions
Function, obj-info-header-p: Private ordinary functions
Function, obj-info-p: Private ordinary functions
Function, obj-info-text: Private ordinary functions
Function, parse-comment-header: Private ordinary functions
Function, parse-double-float: Private ordinary functions
Function, parse-element-header: Private ordinary functions
Function, parse-end-header: Private ordinary functions
Function, parse-format-header: Private ordinary functions
Function, parse-header: Private ordinary functions
Function, parse-integer%: Private ordinary functions
Function, parse-obj-info-header: Private ordinary functions
Function, parse-ply-file-type: Private ordinary functions
Function, parse-ply-header: Private ordinary functions
Function, parse-ply-type: Private ordinary functions
Function, parse-property-header: Private ordinary functions
Function, parse-single-float: Private ordinary functions
Function, parse-unsigned-integer: Private ordinary functions
Function, parse-value: Private ordinary functions
Function, ply-close: Public ordinary functions
Function, ply-comments: Public ordinary functions
Function, ply-element-names: Public ordinary functions
Function, ply-element-size: Public ordinary functions
Function, ply-header-p: Private ordinary functions
Function, ply-obj-info: Public ordinary functions
Function, ply-open-for-reading: Public ordinary functions
Function, ply-read-element: Public ordinary functions
Function, plyfile-add-comment: Private ordinary functions
Function, plyfile-add-element: Private ordinary functions
Function, plyfile-add-obj-info: Private ordinary functions
Function, plyfile-add-property: Private ordinary functions
Function, plyfile-comments: Private ordinary functions
Function, plyfile-element-by-name: Private ordinary functions
Function, plyfile-elements: Private ordinary functions
Function, plyfile-file-type: Private ordinary functions
Function, plyfile-obj-info: Private ordinary functions
Function, plyfile-p: Private ordinary functions
Function, plyfile-set-format: Private ordinary functions
Function, plyfile-stream: Private ordinary functions
Function, plyfile-version: Private ordinary functions
Function, property-header-p: Private ordinary functions
Function, read-element: Private ordinary functions
Function, read-element-ascii: Private ordinary functions
Function, read-element-big-endian: Private ordinary functions
Function, read-element-little-endian: Private ordinary functions
Function, read-header: Private ordinary functions
Function, scalar-property-name: Private ordinary functions
Function, scalar-property-p: Private ordinary functions
Function, scalar-property-type: Private ordinary functions

H
header-kind: Private ordinary functions

L
list-property-count-type: Private ordinary functions
list-property-element-type: Private ordinary functions
list-property-name: Private ordinary functions
list-property-p: Private ordinary functions

M
Macro, with-ply-for-reading: Public macros
make-comment: Private ordinary functions
make-element: Private ordinary functions
make-obj-info: Private ordinary functions
make-plyfile: Private ordinary functions
make-property: Private ordinary functions

O
obj-info-header-p: Private ordinary functions
obj-info-p: Private ordinary functions
obj-info-text: Private ordinary functions

P
parse-comment-header: Private ordinary functions
parse-double-float: Private ordinary functions
parse-element-header: Private ordinary functions
parse-end-header: Private ordinary functions
parse-format-header: Private ordinary functions
parse-header: Private ordinary functions
parse-integer%: Private ordinary functions
parse-obj-info-header: Private ordinary functions
parse-ply-file-type: Private ordinary functions
parse-ply-header: Private ordinary functions
parse-ply-type: Private ordinary functions
parse-property-header: Private ordinary functions
parse-single-float: Private ordinary functions
parse-unsigned-integer: Private ordinary functions
parse-value: Private ordinary functions
ply-close: Public ordinary functions
ply-comments: Public ordinary functions
ply-element-names: Public ordinary functions
ply-element-size: Public ordinary functions
ply-header-p: Private ordinary functions
ply-obj-info: Public ordinary functions
ply-open-for-reading: Public ordinary functions
ply-read-element: Public ordinary functions
plyfile-add-comment: Private ordinary functions
plyfile-add-element: Private ordinary functions
plyfile-add-obj-info: Private ordinary functions
plyfile-add-property: Private ordinary functions
plyfile-comments: Private ordinary functions
plyfile-element-by-name: Private ordinary functions
plyfile-elements: Private ordinary functions
plyfile-file-type: Private ordinary functions
plyfile-obj-info: Private ordinary functions
plyfile-p: Private ordinary functions
plyfile-set-format: Private ordinary functions
plyfile-stream: Private ordinary functions
plyfile-version: Private ordinary functions
property-header-p: Private ordinary functions

R
read-element: Private ordinary functions
read-element-ascii: Private ordinary functions
read-element-big-endian: Private ordinary functions
read-element-little-endian: Private ordinary functions
read-header: Private ordinary functions

S
scalar-property-name: Private ordinary functions
scalar-property-p: Private ordinary functions
scalar-property-type: Private ordinary functions

W
with-ply-for-reading: Public macros