Model.hm_wadlinesgetwadline#

Model.hm_wadlinesgetwadline(distance)#

Returns coordinate data defining a WAD line.

Parameters:

distance (double) – The distance from ground level for the WAD line, as measured along the vehicle. The data will be returned as a list of doubles. Every three doubles are the X, Y, and Z coordinates of a point along the line. The lines run from left to right.

Returns:

Example#

Setup and extract WAD lines data#
import hm
import hm.entities as ent

model = hm.Model()

model.hm_wadlinesinit()

model.hm_wadlinessetparameters(
    side_angle=45.0,
    front_angle=50.0,
    spacing=100.0,
    rear_reference_radius=100.0,
    reference_resolution=50.0,
    upper_bumper_angle=20.0,
    lower_bumper_angle=25.0,
    corner_angle=60.0,
)

model.hm_wadlinessetaxes(
    origin=[0.0, 0.0, 0.0], forwardvec=[1.0, 0.0, 0.0], leftvec=[0.0, 1.0, 0.0]
)

comps1 = hm.Collection(
    model, ent.Component, "Name=bonnet OR Name=bumper OR Name=fenderL OR Name=fenderR"
)
comps2 = hm.Collection(model, ent.Component, "Name=windshield OR Name=a-pillars")

model.hm_wadlinessetentities_bycollection(frontEntities=comps1, rearEntities=comps2)

elems = hm.Collection(
    model, ent.Element, hm.Collection(model, ent.Component, name="wipers")
)

model.hm_wadlinessetwipers(
    wiperEntities=elems, use_for_reference_line=False, use_for_wad_line=True
)

model.hm_wadlinesgetreferenceline(line_location=0)
model.hm_wadlinesgetreferenceline(line_location=1)
model.hm_wadlinesgetreferenceline(line_location=2)
model.hm_wadlinesgetreferenceline(line_location=3)
model.hm_wadlinesgetreferenceline(line_location=4)
model.hm_wadlinesgetreferenceline(line_location=5)
model.hm_wadlinesgetreferenceline(line_location=6)
model.hm_wadlinesgetreferenceline(line_location=7)

_,resultlist1 = model.hm_wadlinesgetwadline(distance=1000.0)
_,resultlist2 = model.hm_wadlinesgetwadline(distance=1500.0)
_,resultlist3 = model.hm_wadlinesgetwadline(distance=1700.0)
_,resultlist4 = model.hm_wadlinesgetwadline(distance=2100.0)

_,result = model.hm_wadlinesgetgridpoints(
    wad_child_min=1000.0,
    wad_child_max=1500.0,
    wad_adult_min=1700.0,
    wad_adult_max=2100.0,
    side_tolerance=50.0,
)

model.hm_wadlinesend()

for result1 in resultlist1:
    print("pointCoordinates",result1.pointCoordinates)
for result2 in resultlist2:
    print("pointCoordinates",result2.pointCoordinates)
for result3 in resultlist3:
    print("pointCoordinates",result3.pointCoordinates)
for result4 in resultlist4:
    print("pointCoordinates",result4.pointCoordinates)