Model.genericimpactor#
- Model.genericimpactor(mode, method='Manual', targetids=hwIntList(), nameprefix='GenericImpact', csvpath='', posmethod='Normal_to_target', xangle=0.000000, yangle=0.000000, zangle=0.000000, aimingpoint='Contact', movebackdistance=0.000000, impactpoints=hwDoubleList(), origin=hwTriple(0.000000, 0.000000, 0.000000), xaxis=hwTriple(1.000000, 0.000000, 0.000000), zaxis=hwTriple(0.000000, 0.000000, 1.000000), xspacing=50.000000, yspacing=50.000000, xplanewidth=200.000000, yplanewidth=200.000000, headformids=hwIntList(), headformsystemid=0, designpointids=hwIntList(), exportpath='', mainfilepath='', headformfilepath='', transformationtype=0, dpnamesfordirandincludes=True, folderforeachdp=True, exportcsv=True, resetmarking=False, resetpositioning=False)#
Creates and manages generic impactor design points for safety analysis. This function supports multiple modes of operation including point creation (marking), positioning for impactor placement, and export of solver decks. The function can handle manual point placement, CSV import, and automated raster mesh generation. Following requirement must be met before executing the function:
Target surface components must be available for point projection.
For positioning mode: impactor components, impactor system, and design points must be created.
For export mode: valid file paths must be specified and accessible.
- Parameters:
mode (int) – The operation mode controlling which functionality to execute. It can be combined using bitwise operations:
1 - Create/Mark impact points
2 - Position impactor at design points
4 - Review positioning results/duplicate impactor entity and place at design point
8 - Export solver decks
For example, if set to 6, both positioning (2) and review (4) will be executed. Valid modes are 1, 2, 6, 10, and 14.
- Parameters:
method (hwString) – The method for creating impact points when the mode includes marking (1). Valid values are:
Manual - Use manually specified coordinates from impactpoints.
Import_from_file - Import points from CSV file specified in csvpath.
Raster - Generate regular grid pattern using raster parameters
- Parameters:
targetids (hwIntList) – The list of component IDs representing target surfaces for point projection, normal calculation, and collision detection. Mandatory except for when
methodis set to Import_from_file.nameprefix (hwString) – The prefix string for generated entity names. Default is GenericImpact.
csvpath (hwString) – The path to CSV file containing impact point data. Required when
methodis set to Import_from_file.
CSV format should include the following columns: PointX, PointY, PointZ, and optionally PivotX, PivotY, PivotZ, NormalX, NormalY, NormalZ, PositioningMethod, XAngle, YAngle, ZAngle, MoveBack, AimingPointMethod, Active, PointName, Comment.
- Parameters:
posmethod (hwString) – The positioning method for impactor placement. Valid values are:
Normal_to_target - Position impactor normal to target surface.
Target/Angles - Position using specified rotation angles.
Read_from_property - Use existing values from structural properties.
- Parameters:
xangle (double) – The rotation angles in degrees around x axis. Used when
posmethodis set to Target/Angles.yangle (double) – The rotation angles in degrees around y axis. Used when
posmethodis set to Target/Angles.zangle (double) – The rotation angles in degrees around z axis. Used when
posmethodis set to Target/Angles.aimingpoint (hwString) – The direction for impactor aiming when using angle-based positioning. Valid values are:
Contact - Aim along surface normal.
Target - Aim along transformed impactor x-axis.
- Parameters:
movebackdistance (double) – The distance in model units to move the impactor back from the contact point.
impactpoints (hwDoubleList) – The list of coordinates in a flat list format (x1, y1, z1, x2, y2, z2, …, xN, yN, zN) for manual point placement. Required when
methodis set to Manual.origin (hwTriple) – The x, y, z coordinates of the origin point for raster mesh generation.
xaxis (hwTriple) – The direction vectors defining the raster mesh coordinate system.
zaxis (hwTriple) – The direction vectors defining the raster mesh coordinate system.
xspacing (double) – The spacing between points in x directions for raster mesh.
yspacing (double) – The spacing between points in y directions for raster mesh.
xplanewidth (double) – The total width of the raster mesh in x direction.
yplanewidth (double) – The total width of the raster mesh in y direction.
headformids (hwIntList) – The list of component IDs representing impactor geometry. Required for positioning and export modes.
headformsystemid (int) – The ID of the system defining impactor coordinate system. Required for positioning mode.
designpointids (hwIntList) – The list of design point IDs to be positioned or exported. Required for positioning and export modes.
exportpath (hwString) – The directory for exported solver decks. Required for
mode8.mainfilepath (hwString) – The main model file path. This will be duplicated and required includes/groups will be added to this. Required for
mode8.headformfilepath (hwString) – The impactor model file path. Required for
mode8.transformationtype (int) – Reserved for future development
dpnamesfordirandincludes (bool) – Reserved for future development
folderforeachdp (bool) – The export option to create separate folder for each design point.
exportcsv (bool) – The export options to export CSV summary file.
resetmarking (bool) – The reset option to clear existing entities before operation. Delete existing marking entities.
resetpositioning (bool) – The reset option to clear existing entities before operation. Delete existing positioning entities.
Example#
Create impact points using the manual method#import hm import hm.entities as ent model = hm.Model() model.genericimpactor( mode=1, method="Manual", targetids=[2000554, 2000894], impactpoints=[-1710.19, -743.2607, 930.9553], posmethod="Target/Angles", xangle=0.5, yangle=0.3, zangle=0.4, aimingpoint="Contact", movebackdistance=5.9 )
Create impact points using the Raster method#import hm import hm.entities as ent model = hm.Model() model.genericimpactor( mode=1, method="Raster", targetids=[2000896, 2000900, 2000901], origin=[-2124.25, -678.62, 723.05], xaxis=[0, 0, 1], zaxis=[0, -1, 0], posmethod="Normal_to_target", movebackdistance=2.6, xspacing=20.0, yspacing=25.0, xplanewidth=151.0, yplanewidth=151.0 )