Model.hm_wadlinesgetinternalbumperline#

Model.hm_wadlinesgetinternalbumperline(spacing, max_depth=10, max_height=520)#

Returns the averaged points for the internal bumper line as a series of x, y, and z values. It will use the front entities set using Model.hm_wadlinessetentities_bycollection() or Model.hm_wadlinessetentities_bymode() and the corner_angle set with Model.hm_wadlinessetparameters() to determine the “Corner of Bumper” for both sides of the vehicle. If Model.hm_wadlinessetbumper() has been used, the outermost ends of those entities will be determined. All points for the internal bumper reference line will fit laterally between either the “Corner of Bumper” or the outermost ends of the bumper entities, whichever is larger. This is the “Edge of Bumper Test Zone.”

Parameters:
  • spacing (double) – The lateral distance, starting from the center line, at which the points will be placed.

  • max_depth (double) – The maximum rearward distance a point can be from the first point of contact with the bumper entities and still be used to find the height of the bumper entities. If the bumper entities have not been set, the front entities are used instead.

  • max_height (double) – The maximum height allowed for the averaged points as measured from the origin (set using hm_wadlinessetaxes()).

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, 182.0], forwardvec=[-1.0, 0.0, 0.0], leftvec=[0.0, -1.0, 0.0]
)

comps1 = hm.Collection(
    model, ent.Component, ids=[100000199, 100000200, 290000007, 410000016, 411000016, 420000004, 420000005, 420000006, 420000007, 420000008, 420000009, 420000010, 420000011, 420000012, 420000013, 420000014, 420000015, 420000016,420000019, 420000020 ]
)
comps2 = hm.Collection(model, ent.Component, ids=[100000003, 100000010, 100000022, 100000113])

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

components = hm.Collection(model, ent.Component, ids=[407000001, 407000002])

model.hm_wadlinessetbumper(entities=components)

_,resultlist = model.hm_wadlinesgetinternalbumperline(spacing=10.0, max_depth=50.0, max_height=50.0)

model.hm_wadlinesend()

for result in resultlist:
    print("pointCoordinates",result.pointCoordinates)