VARKON Version 1.16 1998-06-08


intersect - Function

Geometrical function


Description

Returns the position of intersect between a line, arc or curve and a line, arc, curve, b_plane, XY-plane or surface. In the case of a lin/surface, arc/surfcae or curve/surface intersect an optional parameter may be used to specify that parametric values relating to the surface should be returned instead of the usual coordinates.

Syntax

intersect(ref1, ref2, alt, output)

REF ref1;
REF ref2;
INT alt;
INT output;

Principal parameters

ref1 - Identity of first entity
ref2 - Identity of second entity

Optional parameters

alt - Alternative, default = 1
output - Requested output. 0 = coordinates (default), 1= parameter value(s)

Return value

A VECTOR equal to the specified position

Example

intersect(#1,#2)

The first position of intersect between #1 and #2 if you travel along #1 from its start to its end.


intersect(#1,#2,-1)

Same as above but with #1 and #2 extended.



intersect(#1,#2,2)

The position where #1 intersects with #2 for the second time.



intersect(#2,#1,2)

The position where #2 intersects with #1 for the second time.

intersect(#2,#1,1,1)

The parametric (u,v)-value corresponding to the position on the surface where #2 and #1 intersect. One of #1 and #2 must be a surface.

Comments

If more than one intersection exists the "alt"-parameter can be used to select the right solution. If alt is negative any involved lines or arcs are extended to infinity.

In a 2D module lines, arcs and curves can be intersected with lines arcs or curves only. In a 3D module lines, arcs and curves may also be intersected with surfaces, b_planes and the XY-plane of a coordinate system.

If a line, arc or curve is intersected with a line, arc or curve in a 3D module their projection along the Z-axis onto the active XY-plane is used to calculate the the intersect. This means that they do not have to be in true 3D contact with each other in order to find an intersect but it also means that the result will depend on the orientation of the active XY-plane. If a line, arc or curve is intersected with a surface, b_plane or XY-plane the true position is calculated without respect to the active XY-plane.

If a line, arc or curve is intersected with a line, arc or curve in a 3D module the position returned is guaranteed to be a position on the first entity even if this entity is not in the active XY-plane. This means that intersecting #1 with #2 is not the same as intersecting #2 with #1 if they are not in contact with each other.


VARKON Homepage Index