Model.create_voxel_lattice_mesh#

Model.create_voxel_lattice_mesh(collection_2d, collection_1d, origin_x, origin_y, origin_z, voxel_size_x, voxel_size_y, voxel_size_z, mesh_extent_x, mesh_extent_y, mesh_extent_z)#

Creates 1D and 2D axis parallel lattice meshes.

Parameters:
  • collection_2d (Collection) – The collection containing the 2D input entities. Valid entities are surfaces and elements.

  • collection_1d (Collection) – The collection containing the 1D input entities. If no 1D entities are used as input, this should be an empty collection.

  • origin_x (double) – The coordinates of the domain origin.

  • origin_y (double) – The coordinates of the domain origin.

  • origin_z (double) – The coordinates of the domain origin.

  • voxel_size_x (double) – The voxel size discretization along the axes.

  • voxel_size_y (double) – The voxel size discretization along the axes.

  • voxel_size_z (double) – The voxel size discretization along the axes.

  • mesh_extent_x (int) – The boundary of the domain to be considered, specified using the rightmost corner of the domain bounding box relative to the origin. The rightmost extreme of the domain is calculated as (voxel_size_x * mesh_extent_x).

  • mesh_extent_y (int) – The boundary of the domain to be considered, specified using the rightmost corner of the domain bounding box relative to the origin. The rightmost extreme of the domain is calculated as (voxel_size_y * mesh_extent_y).

  • mesh_extent_z (int) – The boundary of the domain to be considered, specified using the rightmost corner of the domain bounding box relative to the origin. The rightmost extreme of the domain is calculated as (voxel_size_z * mesh_extent_z).

Example#

Create a lattice mesh for all surfaces and lines that fall within the domain boundary defined by a box with corners ( 0,0,0 ) and ( 100 , 100 , 100 ) , with unit size discretization along all axes#
import hm
import hm.entities as ent

model = hm.Model()

surfs_collection = hm.Collection(model, ent.Surface)
lines_collection = hm.Collection(model, ent.Line)

model.create_voxel_lattice_mesh(
    collection_2d=surfs_collection,
    collection_1d=lines_collection,
    origin_x=0.0,
    origin_y=0.0,
    origin_z=0.0,
    voxel_size_x=1.0,
    voxel_size_y=1.0,
    voxel_size_z=1.0,
    mesh_extent_x=100,
    mesh_extent_y=100,
    mesh_extent_z=100,
)