LoopStructural.datatypes.Surface#
- class LoopStructural.datatypes.Surface(vertices: numpy.ndarray, triangles: numpy.ndarray, normals: numpy.ndarray | None = None, name: str = 'surface', values: numpy.ndarray | None = None, properties: dict | None = None, cell_properties: dict | None = None)#
Bases:
object
- __init__(vertices: ndarray, triangles: ndarray, normals: ndarray | None = None, name: str = 'surface', values: ndarray | None = None, properties: dict | None = None, cell_properties: dict | None = None) None #
Methods
__init__
(vertices, triangles[, normals, ...])from_dict
(d[, flatten])plot
([pyvista_kwargs])Calls pyvista plot on the vtk object
save
(filename[, replace_spaces, ext])to_dict
([flatten])vtk
()Attributes
cell_properties
name
normals
properties
_summary_
_summary_
values
vertices
triangles
- plot(pyvista_kwargs={})#
Calls pyvista plot on the vtk object
- Parameters:
pyvista_kwargs (dict, optional) – kwargs passed to pyvista.DataSet.plot(), by default {}
- property triangle_area#
_summary_
- Returns:
_type_ – _description_
Notes
Area of triangle for a 3d triangle with vertices at points A, B, C is given by det([A-C, B-C])**.5
- property triangle_normal: ndarray#
_summary_
- Returns:
np.ndarray – numpy array of normals N,3 where N is the number of triangles
Notes
The normal of a triangle is given by the cross product of two vectors in the plane of the triangle