Model.voxel_lattice_hex_mesh_drag_faces#

Model.voxel_lattice_hex_mesh_drag_faces(voxel_collection, face_node_collection, dx, dy, dz)#

Drags faces of existing voxels to create new voxels. This must be preceded by a call to Model.voxel_lattice_hex_mesh_init() and either a call to Model.voxel_lattice_hex_mesh_import() or Model.voxel_lattice_hex_mesh_create(). It must be followed by a call to Model.voxel_lattice_hex_mesh_create() to create the voxels.

Parameters:
  • voxel_collection (Collection) – The collection containing the element entities to drag.

  • face_node_collection (Collection) – The collection containing the node entities of the elements in the voxel_collection defining the face to drag.

  • dx (double) – The value to drag in the x direction.

  • dy (double) – The value to drag in the y direction.

  • dz (double) – The value to drag in the z direction.

Example#

Register voxels in comps with IDs 100 and 101 and drag elements with IDs 500 - 600 use the face with nodes with IDs 100 - 110 by ( 50,0,0 )#
import hm
import hm.entities as ent

model = hm.Model()

# Creating a collection that contains the components with IDs 100 and 101
in_component_collection = hm.Collection(model, ent.Component, [100, 101])

# Creating a collection that contains the elements to be draged
filter_drag_elements = hm.FilterByEnumeration(ent.Element, list(range(500, 601)))
drag_elements_collection = hm.Collection(model, filter_drag_elements)

# Creating a collection that contains the nodes of the face to drag
filter_nodes = hm.FilterByEnumeration(ent.Node, list(range(100, 111)))
nodes_collection = hm.Collection(model, filter_nodes)

model.voxel_lattice_hex_mesh_init(voxel_size=10.0)
model.voxel_lattice_hex_mesh_import(collection=in_component_collection)
model.voxel_lattice_hex_mesh_drag_faces(
    voxel_collection=drag_elements_collection,
    face_node_collection=nodes_collection,
    dx=50.0,
    dy=0.0,
    dz=0.0,
)
model.voxel_lattice_hex_mesh_create()
model.voxel_lattice_hex_mesh_end()