Determine if point X,Y is inside polygon of given element

err = ac_request("geometry_calc_2d","is_point_on_element_polygon",double X, double Y, int iElemDescr);

or

err = ac_request("geometry_calc_2d","is_point_on_element_polygon",double X, double Y, int iElemDescr, bool mainContOnly, double grow_contour, double grow_holes);


Here:

X,Y - coordinates of the studied point;

iElemDescr - element descriptor (not "ts_guid" but "ac_element");

mainContOnly - take into account only the outer contour (excluding cutouts);

grow_contour - how much to expand or narrow (if with a minus) the outer contour before performing the calculation;

grow_holes - how much to expand or narrow (if with a minus) cutouts before performing the calculation;


Returns 0 if there is no error.

The result is read by the following function ac_getnumvalue() - if 1 is inside the polygon, 0 is outside (or in the cut if mainContOnly is true)