Model.voxel_lattice_hex_mesh_import#
- Model.voxel_lattice_hex_mesh_import(collection)#
Imports an existing voxelization in to the current voxel session. Import is successful only if all the elements in the selection are voxels of the size exactly equal to the current voxel size and the grid is aligned to the global axes and (0,0,0).
This must be preceded by a call to
Model.voxel_lattice_hex_mesh_init().- Parameters:
collection (Collection) – The collection containing the entities that the voxelization will be imported.
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()