formZ SDK | 5.0 API Reference | Project | Modeling | Objects | Analysis

fz_objt_alys_closest_pnt_on_segt

Description

Finds the closest point on a segment from a given point. The returned information contains the closest point, the distance of the original point to the closest point and a flag that tells, whether the closest point is between the segment end point (1), or on either segment end point (2).

Plugin Prototype

fzrt_error_td fz_objt_alys_closest_pnt_on_segt(

fzrt_int

windex,

fz_objt_ptr

obj,

fzrt_int

sindx,

fz_objt_model_type_enum

model_type,

fz_xyz_td *

pt,

fz_xyz_td *

closest_pt,

double *

dist,

fzrt_int *

where )

Parameters

windex [Input]

project window index

obj [Input]

object

sindx [Input]

segment index

model_type [Input]

object topology type. FZ_OBJT_MODEL_TYPE_UNSPEC may be used to use the object's natural model type.

pt [Input]

the point to for which to find the closest point on the segment.

closest_pt [Result, Optional]

the closest point on the segment

dist [Result, Optional]

the distance of the closest point to the original point

where [Result, Optional]

1 if the closest point is inside the segment and 2 if it is on a segment end point

Returns

Error codes

Availability

6.0.0.0

Function Set

fz_model_fset


Defined in

fz_objt_alys_api.h