Meshing
iota.mesh
This method give access to Mesh generation and manipulation methods in Iota.
Classes
Mesh
: class containing mesh objectMeshSearch
: auxiliar class for spatial searches over a mesh
Methods
Enum
iota.mesh.export_format
types of mesh formats for export
Methods
Load a mesh list from file
*Returns a list of meshes
Arguments
filename
: (str) file containing the meshes to me readedsplit
: (bool) split meshes by connectivities (default: True)
Example
meshes = iota.mesh.load(
filename = 'my_username',
split = True
)
print(meshes)
Export a mesh to file
Arguments
mesh
: (iota.mesh.Mesh) mesh object to be exportedfilename
: (str) file to write the meshformat
: (iota.mesh.export_format) mesh format for to written (default: P4S)
Example
status = iota.mesh.export(
mesh = myMesh,
filename = '/file/to/write/the/mesh/mesh.meta',
format = iota.mesh.export_format.P4S
)
print('mesh is ok: ',status)
Create a linear mesh of edges
Arguments
start
: (iota.Vector3d) point representing the origin of the lineend
: (iota.Vector3d) point representing the end of the lineelement_size
: (float) size of the triangular elementsname
: (str) name of the mesh (default: 'line')
Example
line = iota.mesh.create_line(
start = iota.Vector3d(0,0,0),
end = iota.Vector3d(1,1,0),
element_size = 0.1,
name = 'my_linear_mesh'
)
Create a circular mesh of triangles
Arguments
centre
: (iota.Vector3d) point representing the centre of the circleradius
: (float) radius of the circlenormal
: (iota.Vector3d) normal vector representing the plane of the circleelement_size
: (float) size of the triangular elementsname
: (str) name of the mesh (default: 'circle')
Example
circle = iota.mesh.create_circle(
centre = iota.Vector3d(0,0,0),
radius = 1.0,
normal = iota.Vector3d(0,0,1),
element_size = 0.1,
name = 'my_circle'
)
Create a rectangular mesh of triangles
Arguments
origin
: (iota.Vector3d) point representing the origin of the rectanglenormal
: (iota.Vector3d) normal vector representing the plane of the rectanglelength
: (float) length of the rectanglewidth
: (float) width of the rectangleelement_size
: (float) size of the triangular elementsname
: (str) name of the mesh (default: 'rectangle')
Example
rectangle = iota.mesh.create_rectangle(
origin = iota.Vector3d(0,0,0),
normal = iota.Vector3d(0,0,1),
length = 1.0,
width = 1.0,
element_size = 0.1,
name = 'my_rectangle'
)
Create a cuboid mesh of tetrahedra
Arguments
origin
: (iota.Vector3d) point representing the origin of the cuboidup
: (iota.Vector3d) vector representing the up direction of the cuboidlength
: (float) length of the cuboidwidth
: (float) width of the cuboidheight
: (float) height of the cuboidelement_size
: (float) size of the elementsname
: (str) name of the mesh (default: 'cuboid')skin
: (bool) generate the surface instead of volume (default: False)
Example
cuboid = iota.mesh.create_cuboid(
origin = iota.Vector3d(0,0,0),
up = iota.Vector3d(0,0,1),
length = 1.0,
width = 1.0,
height = 1.0,
element_size = 0.1,
name = 'my_cuboid'
)
Create a cylinder mesh of tetrahedra
Arguments
origin
: (iota.Vector3d) point representing the origin of the cylinderup
: (iota.Vector3d) vector representing the up direction of the cylinderradius
: (float) radius of the cylinderheight
: (float) height of the cylinderelement_size
: (float) size of the elementsname
: (str) name of the mesh (default: 'cylinder')skin
: (bool) generate the surface instead of volume (default: False)
Example
cylinder = iota.mesh.create_cylinder(
origin = iota.Vector3d(0,0,0),
up = iota.Vector3d(0,0,1),
radius = 1.0,
height = 1.0,
element_size = 0.1,
name = 'my_cylinder'
)
Last updated
Was this helpful?