LoopStructural.datatypes.Surface#
- class LoopStructural.datatypes.Surface(vertices: numpy.ndarray = <factory>, triangles: numpy.ndarray = <factory>, colour: Union[str, numpy.ndarray, NoneType] = <factory>, normals: Optional[numpy.ndarray] = None, name: str = 'surface', values: Optional[numpy.ndarray] = None, properties: Optional[dict] = None, cell_properties: Optional[dict] = None)#
Bases:
object
- __init__(vertices: ~numpy.ndarray = <factory>, triangles: ~numpy.ndarray = <factory>, colour: str | ~numpy.ndarray | None = <factory>, normals: ~numpy.ndarray | None = None, name: str = 'surface', values: ~numpy.ndarray | None = None, properties: dict | None = None, cell_properties: dict | None = None) None #
Methods
__init__
([vertices, triangles, colour, ...])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
colour
- 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