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

Identifies the snapped plane at the given cursor position.

pyui.identify_plane(coos_vp, [selection_elements,] [excluded_elements])

Parameters

Type Description
coos_vp {u, v} Normalized viewport coordinates of the mouse cursor.
selection_elements {element_handle_1, ...} Optional: A table of element handles that are exclusively considered in the selection. May be nil.
excluded_elements {element_handle_1, ...} Optional: A table of element handles that are excluded from the selection. May be nil.

Return value

Type Description
res {...} A table containing the following information about the snapped 3D plane:
res.coos {x,y,z} Snapped coordinate.
res.normal {x,y,z} Normal vector of the picked face. {0,0,1} if no face was selected.

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.

selection_elements may be nil, in this case all parts are considered in the selection.

See also

pyux, identify_part, identify_coordinate, set_on_left_click_handler, set_on_right_click_handler, set_on_left_dragstart_handler, set_on_left_dragmove_handler, set_on_left_dragend_handler