mpacts.geometrygenerators. meshobjects

In order to be able to use this module import it like this:

import mpacts.geometrygenerators.meshobjects
#or assign it to a shorter name
import mpacts.geometrygenerators.meshobjects as mes

IcoSphere

class mpacts.geometrygenerators.meshobjects.IcoSphere

Bases: mpacts.geometrygenerators.meshobjects.TriangleMeshObject, mpacts.core.baseobject.BaseObject

Mesh object representing an icosphere.
Has no default location.
  • Optional keywords:
    • recursionlevel (default value = 0) — Level of subdivision of the icosphere
    • tolerance (default value = 9.9999999999999995e-08) — Relative Tolerance used to decide whether two vertices are the same (with respect to bounding box of object)
object __init__(tuple args, dict kwds) :
args: name, parent kwds: [tolerance, recursionlevel]
IcoSphere(name, parent, **kwargs)

MeshObject

class mpacts.geometrygenerators.meshobjects.MeshObject

Bases: mpacts.core.baseobject.BaseObject

Abstract Base Class for all mesh objects. Cannot be instatiated directly

Raises an exception This class cannot be instantiated from Python

MeshObject(name, parent, **kwargs)
aabb((MeshObject)self point) → object
area((MeshObject)self) → float
center_of_mass((MeshObject)self) → object
centers((MeshObject)self) → Array_Vector :

Returns an Array with the centers of the ‘cells’ (eg triangles) of the MeshObject.

closest_vertex((MeshObject)self, (object)point) → int
edges((MeshObject)self) → Array_LineIndex :

Returns an Array with the edges of the MeshObject.

flip_normals((TriangleMeshObject)self) → None
inertia_tensor((MeshObject)arg1, (float)self) → object
inertia_tensor_diagonal((MeshObject)arg1, (float)self) → object
is_cavity((MeshObject)self) → bool :

Is true when the normals point inwards i.e. the mesh represents a ‘hole’ with a negative volume.

is_point_inside((MeshObject)self, (object)point) → bool
normals((MeshObject)self) → Array_Vector :

Returns an Array with the triangles of the MeshObject.

rotate((MeshObject)self, (object)quaternion) → None
rotate_by_axis_and_angle((MeshObject)self, (object)axis, (float)angle) → None
rotation_for_alignment_along_inertia((MeshObject)self) → object
scale((MeshObject)self, (float)scalex, (float)scaley, (float)scalez) → None
subdivide((MeshObject)self) → None :

Refine the mesh once by dividing each triangle into four smaller triangles. New vertices are placed at the edge midpoints of each original triangle. Hence the original shape is fully conserved (and not smoothed). The resulting mesh will have 4 times as many triangles, and the new number of vertices (for a closed triangulation) will be 2*N_v + N_t - 2, with N_v original number of vertices and N_t original number of triangles. Call this method multiple times to iteratively refine the mesh.

translate((MeshObject)self, (object)vector) → None
vertices((MeshObject)self) → Array_Point :

Returns an Array with the vertices (x) of the MeshObject.

volume((MeshObject)self) → float

TriangleMeshObject

class mpacts.geometrygenerators.meshobjects.TriangleMeshObject

Bases: mpacts.geometrygenerators.meshobjects.MeshObject, mpacts.core.baseobject.BaseObject

Class for triangular mesh objects.
Has no default location.
  • Optional keywords:
    • tolerance (default value = 9.9999999999999995e-08) — Relative Tolerance used to decide whether two vertices are the same (with respect to bounding box of object)
object __init__(tuple args, dict kwds) :
args: name, parent kwds: [tolerance]
TriangleMeshObject(name, parent, **kwargs)
add_triangle((TriangleMeshObject)self, (object)triangle) → int
add_vertex((TriangleMeshObject)self, (object)vertex) → int
remove_duplicate_vertices((TriangleMeshObject)self) → None
triangles((TriangleMeshObject)self) → Array_TriangleIndex :

Returns an Array with the triangles of the MeshObject.