pyux.identify_distance_along_direction - pytha-3d-cad/pytha-lua-api GitHub Wiki

Identifies the distance of the given cursor position from a coordinate along an arbitrary axis.

pyui.identify_distance_along_direction(coos_vp, rel_origin, direction)

Parameters

Type Description
coos_vp {u, v} Normalized viewport coordinates of the mouse cursor.
rel_origin {x,y,z} The origin coordinate of the axis.
direction {x,y,z} The direction vector of the axis.

Return value

Type Description
number The distance along the axis in construction units.

Notes:

The coos_vp coordinates are solely to be received from one of the mous picking and dragging handler function calls such as set_on_left_click_handler or set_on_left_dragstart_handler.

This function is especially useful for mouse dragging to determine an interactive movement along a given axis. In on_dragstart the initial coordinates can be received, while the displacement is calculated in on_dragmove.

See also

pyux, identify_part, identify_coordinate, identify_point_on_plane, set_on_left_dragstart_handler, set_on_left_dragmove_handler, set_on_left_dragend_handler