ellipse

Synopsis

Generates a set of 3D ellipse objects, with both polyline ellipse edges and a surface linking the ellipses together.

EllipseParams Parameters

Name Type Description UI Control

num_ellipses int number of ellipses UIslider
num_points int number of points per ellipse UIslider
aboutxc float x-coord of stack centre -
aboutyc float y-coord of stack centre -

RandomNumParams Parameters

Name Type Description UI Control

min_val float minimum ellipse radius UIslider
max_val float maximum ellipse radius UIslider

Output Ports

Name Type Description

out_polyline_mesh Mesh ellipse edge mesh
out_quad_mesh Mesh ellipse connections mesh
out_obj GroupObject directly renderable output object

Description

The ellipse user macro generates a series of randomly sized and shaped ellipses connected by a surface into a tube like structure. Each ellipse is created in the X-Y plane and offset a fixed distance from the adjacent ellipses along the Z-axis. The major and minor axes of the generated ellipses are always aligned with the X and Y axes. The mesh defining the ellipse edges is a polyline mesh. The connecting surface is a quadrilateral mesh. The actual size and shape of each ellipse is generated by using a sequence of random numbers. These numbers are generated from a set seed value. Hence the elliptical tube will have the same shape each time it is used. Parameters allow control over the number of ellipses, the accuracy of the model, base position for the stack of ellipses and the range of ellipse sizes.

The Ellipse project is primarily designed to be an illustration of how geometric objects can be created with the AVS/Express Visualization system. The technique of using a combination of custom code and Field Mapping modules has many applications. To assist in learning from this code both the V script code and the C++ source code are well documented. Practically this module could be used as the basis of a data visualization method that uses ellipses. Alternatively the basic method could be used to generate other geometric shapes.

The Ellipse project uses the RandomNumCore module to generate the required sequence of random numbers. More information on this module can be found in the Common project documentation.

Inputs

(none)

Parameters used from EllipseParams block

num_ellipses

A member of the EllipseParams parameter block group, this integer value is used to specify the number of ellipses that should be generated. The UI slider component sets a maximum of 50 ellipses and a minimum of 2 ellipses. To generate the connecting surface at least 2 ellipses are required. If more ellipses are required the parameter can be directly modified. Depending upon memory usage the macro should be able to generate any number of ellipses.

num_points

A member of the EllipseParams parameter block group, this integer value is used to specify the number of points that should be generated per ellipse. This sets the accuracy of the resulting mesh. The UI slider component sets a maximum of 60 points and a minimum of 4 points. To generate a meaningful ellipse at least 4 points must be generated per ellipse. If higher accuracy is required the parameter can be directly modified. Depending upon memory usage the macro should be able to generate any number of points.

aboutxc aboutyc

Members of the EllipseParams parameter block group, these float values specify the coordinates of the centre point of the stack of ellipses. They define how far the stack is offset horizontally from the origin.

Parameters used from RandomNumParams block

Only two of the parameters from this block are directly alterable from the ellipse User macro. The number of random numbers generated is automatically set to equal the number of ellipses to be generated. The seed values are set internally within the Functional Macro. This was done so that different sequences of random numbers could be used for both x and y dimensions.

min_val max_val

Members of the RandomNumParams parameter block group, these float values specify the range of random numbers that should be generated. Therefore they also specify the minimum and maximum possible radii of the generated ellipses. If the specified minimum value is greater than the maximum value the parameters will be swapped internally.

Outputs

out_polyline_mesh

Polyline mesh containing the edges of each ellipse.

out_quad_mesh

Quadrilateral mesh containing the surface connecting the ellipses.

out_obj

The directly renderable output of the ellipse macro. This contains a GroupObject object that can be rendered by the standard data viewers. This GroupObject contains DataObjects representing both the polyline ellipse edges and the quadrilateral surface. If this object is viewed both of these sets of data will be visible. If only one of these objects is required to be viewed then a DataObject can be generated from the appropriate mesh output. Alternatively the original DataObjects can be exported from the Ellipse Functional macro.

Utility Modules

The User Macro ellipse combines the Functional Macro Ellipse with the UI Macro EllipseUI. The User macro also makes use of the common parameter blocks EllipseParams and RandomNumParams to tie the Functional Macro and UI macro together. The Functional Macro uses the RandomNumCore module from the Common project to generate ellipse coordinate data.

Example

An example application EllipseEg is provided that uses a set of random data to generate a elliptical tube. It shows how the size and shape of the ellipse can altered through a User Interface. The random data is generated using a set seed value hence the same data will be generated each time the example application is used.

Files

iac_proj/ellipse/ell_macs.v contains the V definitions of the Functional Macro Ellipse, the User macro ellipse, the UI macro EllipseUI and the example application EllipseEg.

Prerequisites

The Functional and User Interface macros of this project rely on the successful installation of the following components. Without them they will not function correctly.

Other Notes

The EllipseMacs library inherits its process. As this library contains no procedural code, the process is not important. The modules in the low-level EllipseMods library execute under the process specified in that library, not the process defined in the high-level library.

Author

Steve Larkin
Advanced Visual Systems, Ltd.
Hanworth Lane, Chertsey Surrey, UK
KT16 9JX

Andrew Dodd
International AVS Centre

Contact

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

See Also

EllipseCore, RandomNumCore, Ellipse, EllipseEg, Mesh mappers library