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

fz_objt_alys_closest_pnt_on_face

Description

Finds the closest point on a face 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 inside (1), or on (2) the face boundary. Note, that when the model_type is facetted and the face is non planar, the closest point may not be accurate, as the plane equation of a non planar face is not well defined.

Plugin Prototype

fzrt_error_td fz_objt_alys_closest_pnt_on_face(

fzrt_int

windex,

fz_objt_ptr

obj,

fzrt_int

findx,

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

findx [Input]

face 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 face.

closest_pt [Result, Optional]

the closest point on the face

dist [Result, Optional]

the distance of the closest point to the original point

where [Result, Optional]

1 if the closest point is inside the face and 2 if it is on a face boundary

Returns

Error codes

Availability

6.0.0.0

Function Set

fz_model_fset


Defined in

fz_objt_alys_api.h