Model.hm_wadlinesgetreferenceline#

Model.hm_wadlinesgetreferenceline(line_location, offset=0, method=0)#

Returns coordinate data defining WAD reference lines.

Parameters:
  • line_location (int) – The location of the line to query (0=front, 1=rear, 2=left, 3=right, 4=upper bumper, 5=lower bumper, 6=left corner, 7=right corner). 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 all run from front to back and from left to right.

  • offset (double) – Argument that defines an offset to apply when querying the rear, left and right reference lines. A positive value offsets the line toward the center of the bonnet by the specified value. Negative values are supported, but should not be necessary.

  • method (int) –

    The method to use for measuring the offset distance.

    0 - Euro NCAP (default if not specified)

    1 - Homologation

    2 - ECER

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
)

_,resultlist1 = model.hm_wadlinesgetreferenceline(line_location=0)
_,resultlist2 = model.hm_wadlinesgetreferenceline(line_location=1)
_,resultlist3 = model.hm_wadlinesgetreferenceline(line_location=2)
_,resultlist4 = model.hm_wadlinesgetreferenceline(line_location=3)
_,resultlist5 = model.hm_wadlinesgetreferenceline(line_location=4)
_,resultlist6 = model.hm_wadlinesgetreferenceline(line_location=5)
_,resultlist7 = model.hm_wadlinesgetreferenceline(line_location=6)
_,resultlist8 = model.hm_wadlinesgetreferenceline(line_location=7)

model.hm_wadlinesgetwadline(distance=1000.0)
model.hm_wadlinesgetwadline(distance=1500.0)
model.hm_wadlinesgetwadline(distance=1700.0)
model.hm_wadlinesgetwadline(distance=2100.0)

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("pointCoordinates1",result1.pointCoordinates)
for result2 in resultlist2:
    print("pointCoordinates2",result2.pointCoordinates)
for result3 in resultlist3:
    print("pointCoordinates3",result3.pointCoordinates)
for result4 in resultlist4:
    print("pointCoordinates4",result4.pointCoordinates)
for result5 in resultlist5:
    print("pointCoordinates5",result5.pointCoordinates)
for result6 in resultlist6:
    print("pointCoordinates6",result6.pointCoordinates)
for result7 in resultlist7:
    print("pointCoordinates7",result7.pointCoordinates)
for result8 in resultlist8:
    print("pointCoordinates8",result8.pointCoordinates)