VARKON Version 1.16 1998-09-24


on - Function

Returns a position


Description

Returns a 2D or 3D position related to an entity. The position returned is always relative to the active coordinate system.

Syntax

on(ref)
VECTOR p;

This syntax is used for 0-dimensional entities like points or text.

on(ref, t)
VECTOR p;
FLOAT t;

This syntax is used for 1-dimensional entities like lines, arcs or curves. If t is not specified a default value of zero is used.

on(ref, uv)
VECTOR p;
VECTOR uv;

This syntax is used for b_planes and surfaces. X- and Y-components of uv are used to hold the U- and V-values. The Z-component of uv is not used.

Principal parameters

ref - Referenced entity
t - Parameter value for wireframe entity
uv - UV-value for surface entity. uv.x = U-value and uv.y = V-value

Optional parameters

See above.

Return value

The position specified.

Examples

p:=on(#5);

The position of #5. If #5 is a line, arc or curve the start of the entity is used, t=0.


p:=on(#5,0.5);

The mid of a line or arc or the mid of the first segment of a curve.


p:=on(#5,1);

The end of a line or arc or the end of the first segment of a curve.


p:=on(#5,vec(1.5,0.8));

The position on a surface corresponding to U=1.5 and V=0.8.


VARKON Homepage Index