catmull

Synopsis

Generates a Catmull-Rom spline from a series of 2D or 3D coordinates.

Input Ports

Name Type Description

in float array coordinates of nodes to be used to generate spline

Parameters

The following lists all of the parameters found in the parameter block CatmullParams, which are accessed by the module CatmullRomSpline and the UI Macro CatmullUI.

Name Type Description UI Control

steps int numbers of steps in spline Edit Box
line_type enum whether the spline is closed or open Radio Buttons

Output Ports

Name Type Description

out float array coordinates of spline nodes
out_mesh mesh spline represented as a polyline mesh
obj DataObject Default Renderable Object

Description

catmull is a user module that takes a series of either 2D or 3D floating point coordinates and generates a spline that passes through all the points with C1 continuity. The spline is then output as a similar series of coordinates, a polyline mesh and a directly renderable DataObject. The number of connecting steps between two points and whether the curve is closed or open can be specified through the user interface.

Input Ports

&in

Reference to an array of floating point coordinates which are to be used as the nodes that the spline curve connects. Coordinates can be either 2 or 3 dimensional and should be represented by arrays of the form [n][2] and [n][3] respectively, where n is the number of nodes. A spline curve is then generated that connects the nodes together in the order given.

Parameters

steps

A member of the CatmullParams parameter block group, this int value is used to specify the number of steps that should be used to create the spline curve connecting two points.

line_type

A member of the CatmullParams parameter block group, this enumeration is used to specify whether the spline curve should be a complete closed curve or whether the curve should be left open. The enumeration is of the form shown below:

      enum line_type { choices => {"closed","open"}; } = "closed";

Output Ports

out

The most primitive output field of the catmull macro. This contains the generated spline represented as a floating point array of coordinates. The resultant array is of the same form as the input array. Therefore for a 3D spline the resultant array would have the following dimensions [spline_n][3] where spline_n is the number of coordinate points generated by the spline calculation.

out_mesh

The spline curve represented as a polyline mesh.

obj

The directly renderable output field of the catmull macro. This contains a DataObject object that can be rendered by the standard data viewers. The Data Object is generated within the same module as the polyline mesh output.

Utility Macros

The low-level CatmullRomSpline module is used in this User Macro catmull.

Example

An example application CatmullEg is provided, which takes an array of 8 3D coordinates and smoothes the polyline between them by calculating a Catmull-Rom spline curve.

Files

iac_proj/catmull/ctmlmacs.v contains the catmull User Macro, the CatmullUI UI Macro, and the example application CatmullEg V definitions.

Other Notes

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

Authors

Mario Valle

Modifications

Andrew Dodd
Paul G. Lever

Contact

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

See Also

CatmullParams, CatmullUI, CatmullEg and CatmullRomSpline.