LineResampler

Synopsis

LineResamper takes a polyline and outputs a given number of equispaced points along this line. The points can be clipped inside a given area and they can not be less than the number of input points.

Input Ports

Name Type Description

in_points float[][2] Coordinates of polyline.
in_dims int[2] Dimensions of the active area.
parent UIconnection Connection to the user interface.

Parameters

Name Type Description UI Control

Num. Points int Number of points to be output. Field Box
Clip points int Specifies if resulting points must be inside active area. Toggle

Output Ports

Name Type Description

out_mesh Point Mesh Points and cell data that represent the data.
out_obj DefaultObject Directly renderable output object.

Description

The LineReampler takes the coordinates of a polyline and generates a specified number of equispaced points along the polyline. The specified number of output points must be at least the number of input points. If a lower number of points is specified the number of input points is used instead. If the option `Clip points' is set, the calculated points have to be inside of the active area given by the input dimensions. If points are outside of this area they are clipped to the border.

Inputs

in_points : float[][2]

Coordinates of polyline along which equispaced points are to be calculated.

in_dims : int[2]

Dimension of the active area. If `clip points' is set the points outside of this area are clipped to the border of the area.

parent : UIconnection

This is the port that automatically connects the user interface of the module to the user interface of AVS/express.

Parameters

Num. Points

Integer parameter that specifies the number of points to be calculated. It can not be smaller than the number of points in the polyline. If it is smaller then the output will have the same number of points as the input.

Clip points

Integer parameter that specifies whether all points which are outside of the active area should be clipped to the border of the active area. The active area is specified by the in_dims input.

Outputs

out_mesh : Point Mesh

This mesh output represents the calculated points. It can be used for further processing of the points.

out_obj : DefaultObject

This port is suitable for direct connection to a 2D viewer. It contains the coordinates and cell set for the calculated points.

Example

The LineResamplerEg example application illustrates how to use the LineResampler macro. A image is read and the SuperDraw macro can be used to draw a polyline as normal. The LineResampler macro can be then be used to increase the number of output points. Each output point is shown be a cross.

Files

iac_proj/draw/drawmods.v Creates the DrawMods library containing the low-level modules RegionResamplerCore, LineResamplerCore, SuperDrawCore and the parameter blocks DrawLineParams and LineResamplerParams.

iac_proj/draw/drawmacs.v Creates the DrawMacs library containing the user interface macros SuperDrawUI and LineResamplerUI, the functional macros SuperDrawFunc and LineResampleFunc, and the user macros SuperDraw, LineResampler and RegionResampler.

iac_proj/draw/drawapps.v Creates the DrawApps library containing the example applications SuperDrawEg, LineResamplerEg, and RegionResamplerEg.

Other Notes

The low-level DrawMods library containing the low-level modules does not specify a process. By default the express process will be used.

Author

Mario Valle,
AVS Inc.

Modifications

Anja Bindrich, 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