readSLPSTL

Synopsis

Reads in either a Pro/Engineer RENDER format file (.SLP) or a Stereo-Lithography (.STL) file and creates field data from it and directly renderable Data objects from the data.

Parameters

The following lists all of the parameters found in the parameter block ReadSLPSTLParams, which are accessed by the module ReadSLPSTLFile and the UI Macro ReadSLPSTLUI.

Name Type Description UI Control

filename string input SLP/STL filename Read SLP/STL File Name
err int error message trigger Error label
err_str string error message to display Error label

Output Ports

Name Type Description

out Field field data representing the SLP/STL model.
obj DataObjectNoTexture directly renderable output object.

Description

The readSLPSTL macro reads in two kinds of files, Pro/Engineer RENDER format files (.SLP) and Stereo-Lithography (.STL) files. Data from these files is parsed by the macro and output in two forms, Field data and directly renderable DataObject. It is assumed that the RENDER format has only two data components - NORMAL and COLOR. These are both read and put into the node_data, since the data is based on the triangle vertices. It is also assumed that there is only one solid in the RENDER file.

The module is capable of reading in both ASCII and binary forms of the STL file format, and converting the patches present into AVS/Express triangle lists. When reading in binary data the module also detects bigendian/littlendian conversion switching. It also sets two parameters within the parameter block it references. These are used to display error messages to the user through the UI. The SLP/STL file to be read can also be chosen through the user interface.

Parameters

filename

A member of the ReadSLPSTLParams parameter block group, this string value is used to specify the name of the SLP or the STL file that should be loaded.

err

A member of the ReadSLPSTLParams parameter block group, this int value is used to trigger the display of error messages in the UI. When this parameter is set to 1 the error label present in the UI becomes visible. This parameter is set by the function and is not used for input.

err_str

A member of the ReadSLPSTLParams parameter block group, this string value is used to output the current error message so that it can be displayed. This parameter is set by the function and is not used for input.

Output Ports

out

The most primitive output field of the readSLPSTL macro. This contains the model read from the SLP/STL file represented as field data.

obj

The directly renderable output field of the readSLPSTL macro. This contains a DataObjectNoTexture object that can be rendered by the standard data viewers. The Data Object is generated directly from the field data created from the SLP/STL file.

Utility Macros

The low-level ReadSLPSTLFile module is used in this User Macro readSLPSTL.

Example

An example application ReadSLPSTLEg is provided, which loads either a SLP or a STL file, generates a set of field data from it and then displays it using the standard 3d viewer.

Files

iac_proj/rd_slpst/rdslmacs.v contains the readSLPSTL User Macro, the ReadSLPSTLUI UI Macro, and the example application ReadSLPSTLEg V definitions.

Other Notes

The ReadSLPSTLMacs library inherits its process. As this library contains no procedural code, the process is not important. The low-level ReadSLPSTLFile module, executes under the process specified in its library, not the process defined in the high-level library.

Authors

Jeremy Maccelari
Ian Curington

Modifications

Andrew Dodd
Paul G. Lever
Tobias Schiebeck

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL

See Also

ReadSLPSTLParams, ReadSLPSTLUI and ReadSLPSTLFile.