Model.hm_wadlinesispointintestzone#
- Model.hm_wadlinesispointintestzone(testpoint, tolerance, normal, num_pts, points)#
Returns whether a point is inside a test zone by taking in the coordinates of the zone boundary returned by
Model.hm_wadlinesgetadulttestzone()andModel.hm_wadlinesgetchildtestzone(), along with the impact direction of the impact point. The impact point and zone boundary are projected to a plane perpendicular to the impact direction, then tested to find if the projection of the impact point is within the polygon defined by the zone boundary.num_ptsshould always be provided before the points option.- Parameters:
testpoint (hwTriple) – The x/y/z coordinates of the impact point to be tested.
tolerance (double) – Test points that are within this tolerance to the zone boundary are also returned as inside the zone boundary. Default 1e-6.
normal (hwTriple) – The normal direction x/y/z of the plane to which the zone boundary and test point is projected. This is expected to be along the impact direction of the impact point.
num_pts (int) – The number of points defining the zone boundary. Must be provided before points.
points (hwDoubleList) – The ordered x/y/z coordinate values of all points of the zone boundary.
- Returns:
hwReturnStatus- Status objectHmQueryResult- Result object containing the output values:isInside (bool)
Example#
Setup and extract WAD lines data#import hm import hm.entities as ent model = hm.Model() model.hm_wadlinesinit() model.hm_wadlinesispointintestzone( testpoint=ent.Point(model, 38), tolerance=0, normal=[0, 0, 1], num_pts=10, points=[ 1343.514343661, 709.91761797527, 973.43251742578, 1334.7036682323, 703.07456401521, 973.15886027621, 1327.8482379749, 697.4142871779, 972.93366355648, 1323.86674249, 694.00118686161, 972.79787178914, 1310.125533079, 681.68252694578, 972.30776823337, 1309.4710911285, 681.07217688483, 972.28348517521, 1301.5068502671, 673.437787072, 971.97974746194, 1297.3418689169, 669.34475639184, 971.81690435206, 1293.2547572113, 665.2922768409, 971.65567458753, 1289.222029365, 661.21716017109, 971.49354419], ) model.hm_wadlinesend()