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

fz_objt_alys_ratio_pnt_on_segt

Description

Gets the distance ratio of a point on a segment. The point is assumed to be on the segment. The returned ratio parameter indicates how far from the start point of the segment the point is located (as a ratio of 0.0 ... 1.0). It will be 0.0 when the point is exactly at the start, 0.5 for the mid point and 1.0 for the end.
This function heavily relies on the point passed in to be exactly located on the segment. This can be achieved by previously projecting a 3d point on the segment with the api . If the point passed in is too far off the segment, an error will be returned.

Plugin Prototype

fzrt_error_td fz_objt_alys_ratio_pnt_on_segt(

fzrt_int

windex,

fz_objt_ptr

obj,

fzrt_int

sindx,

fz_objt_model_type_enum

model_type,

fz_xyz_td *

pt,

double *

ratio )

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 on the segment

ratio [Result, Optional]

distance ratio of the point, form the start point of the segment

Returns

Error codes

Availability

7.0.0.0

Function Set

fz_model_fset


Defined in

fz_objt_alys_api.h