Model.extend_elements#

Model.extend_elements(collection_source, collection_target, options)#

Extends , connects and optionally remeshes 2D elements onto target 2D elements. Additionally, this detects whether the elements to be extended intersect the target elements. If they do intersect, small penetrations are also removed during the extension and connection. Such small penetrations are defined as ≥ half of the average element size.

Parameters:
  • collection_source (Collection) – The collection containing the entities.

  • collection_target (Collection) – The collection containing the entities.

  • options (hwString) – Additional strings defining extended parameters/options.

Options are defined in “name value(s)” format. Valid options are:

projection value

0 - Extend along tangent direction (default, if not provided).

1 - Project normal to destination.

2 - Use direction specified by projection_vector.

projection_vector x y z

3 doubles defining the vector direction. Must be defined, if projection is 2.

angle value

The angle used to define feature edges on the mesh. If not defined, 25.0 is used.

remesh_extension value

0 - Do not remesh extension.

1 - Remesh extension (default if not provided).

remesh_dest_mode value

0 - Do not remesh destination. Destination mesh is stitched to maintain element connectivity.

1 - Remesh all input destination elements.

2 - Remesh destination elements defined by remesh_dest_layers.

remesh_dest_layers value

Must be defined, if remesh_dest_mode is 2.

0 - Remesh only the destination elements attached to the extended element edges.

> 0 - Remesh additional layers in addition to the destination elements attached to the extended element edges.

mesh_dest_type value

Automatically detected from input mesh, if not provided.

0 - tria

1 - quad

2 - mixed

3 - R-tria

4 - quad only

mesh_dest_size value

Automatically detected from input mesh, if not provided.

Example#

Extend use nodes with IDs 704 - 734 , target elements with IDs 381 - 605 , use a tangent projection , a feature angle of 30.0 , remeshe the extension , and remeshe the destination use 2 layers#
import hm
import hm.entities as ent

model = hm.Model()

collection1 = hm.Collection(model, ent.Node, list(range(704,735)))

collection2 = hm.Collection(model,ent.Element, list(range(381,606)))

model.extend_elements(
  collection_source=collection1,
  collection_target=collection2,
  options="projection 0 angle 30.000000 remesh_extension 1 remesh_dest_mode 2 remesh_dest_layers 2"
)