Model.hm_wadlinessetentities_bymode#

Model.hm_wadlinessetentities_bymode(collection_front, mode)#

Sets the entities used for a WAD lines analysis.

Parameters:
  • collection_front (Collection) – The collection containing the front entities of the vehicle.

  • mode (hwString) – The string all_in_one to denote all entities are given in collection_front, or front_only to run only a front bumper analysis.

Returns:

Example#

Setup and extract WAD lines data by put all entities on the first collection#
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]
)

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

model.hm_wadlinessetentities_bymode(
    collection_front=comps,
    mode="all_in_one"
)

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
)

for loc in range(8):
    model.hm_wadlinesgetreferenceline(line_location=loc)

for dist in [1000.0, 1500.0, 1700.0, 2100.0]:
    model.hm_wadlinesgetwadline(distance=dist)

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()
The example can be modified instead to only run a bumper analysis#
# ...

comps = hm.Collection(
    model, ent.Component, "Name=bonnet OR Name=bumper OR Name=fenderL OR Name=fenderR"
)

model.hm_wadlinessetentities_bymode(collection_front=comps, mode="front_only")

# ...