MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / Mesh

Class Mesh

python/pymesh/Mesh.py:7–345  ·  view source on GitHub ↗

A generic representation of a surface or volume mesh. Attributes: vertices: A :math:`(N_v \\times D)` array of vertex coordinates, where :math:`N_v` is the number of vertices, :math:`D` is the dimention of the embedding space (:math:`D` must be either 2 or 3).

Source from the content-addressed store, hash-verified

5import PyMesh
6
7class Mesh(object):
8 """ A generic representation of a surface or volume mesh.
9
10 Attributes:
11
12 vertices: A :math:`(N_v \\times D)` array of vertex coordinates, where
13 :math:`N_v` is the number of vertices, :math:`D` is the dimention
14 of the embedding space (:math:`D` must be either 2 or 3).
15
16 faces: A :math:`(N_f \\times F_d)` array of vertex indices that represents
17 a generalized array of faces, where
18 :math:`N_f` is the number of faces, :math:`F_d` is the number of
19 vertex per face. Only triangles (:math:`F_d=3`) and quad
20 (:math:`F_d=4`) faces are supported.
21
22 voxels: A :math:`(N_V \\times V_d)` array of vertex indices that
23 represents an array of generalized voxels, where :math:`N_V` is the
24 number of voxels, :math:`V_d` is the number of vertex per voxel.
25 Only tetrahedron (:math:`V_d=4`) and hexahedron (:math:`V_d=8`) are
26 supported for now.
27
28 num_vertices: Number of vertices (:math:`N_v`).
29 num_faces: Number of faces (:math:`N_f`).
30 num_voxels: Number of voxels (:math:`N_V`).
31 dim: Dimention of the embedding space (:math:`D`).
32 vertex_per_face: Number of vertices in each face (:math:`F_d`).
33 vertex_per_voxel: Number of vertices in each voxel (:math:`V_d`).
34
35 attribute_names: Names of all attribute associated with this mesh.
36 bbox: A :math:`(2 \\times D)` array where the first row is the
37 minimum values of each vertex coordinates, and the second row is the
38 maximum values.
39
40
41 nodes: Same as :py:attr:`vertices`.
42 elements: Array of elements of the mesh. Same as :py:attr:`faces` for
43 surface mesh, or :py:attr:`voxels` for volume mesh.
44
45 num_nodes: Number of nodes.
46 num_elements: Number of elements.
47 nodes_per_element: Number of nodes in each element.
48 element_volumes: An array representing volumes of each element.
49
50 num_components: Number of vertex-connected_components.
51 num_surface_components: Number of edge-connected components.
52 num_volume_components: Number of face-connected components.
53
54 """
55
56 def __init__(self, raw_mesh):
57 """ Private constructor
58
59 Please see :py:mod:`meshio` for methods of loading and saving mesh.
60 """
61 self.__mesh = raw_mesh
62
63 def add_attribute(self, name):
64 """ Add an attribute to mesh.

Callers 6

load_meshFunction · 0.90
form_meshFunction · 0.90
meshMethod · 0.90
decompressFunction · 0.90
cut_to_manifoldFunction · 0.90
cut_meshFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected