ProjectedMesh¶
from mcot.surface.mesh import ProjectedMesh
- class mcot.surface.mesh.ProjectedMesh(mesh, indices, position, orientation)[source]¶
1-dimensional slice of a 2D mesh.
Inheritance diagram
digraph inheritance6ae6bdce3e { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "mcot.surface.mesh.ProjectedMesh" [URL="#mcot.surface.mesh.ProjectedMesh",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="1-dimensional slice of a 2D mesh."]; }Methods
line_collection
(inplane_vec[, flip_other, ...])Returns a matplotlib line collection of the projected surface.
spanned_coordinates
(inplane_vec[, flip_other])Computes the 2D coordinates from the position
Attributes
npoints
line_collection¶
- ProjectedMesh.line_collection(inplane_vec, flip_other=False, surface_arr=None, axes=None, **kwargs)[source]¶
Returns a matplotlib line collection of the projected surface.
- Parameters
inplane_vec – (3, ) array defining the hemisphere that will be used as the x-coordinate (see ProjectedMesh.spanned_coordinates)
flip_other – if True the y-coordinate is defined based on the negative of the cross product betwen the plane normal and inplane_vec rather than the positive
surface_arr – (N, ) or (N, 3) array defining values for vertices on the original mesh. If set will be used to set the color along the line;
axes – matplotlib axes. If set the LineCollection will be added to this plot
kwargs – keywords are pased on to the creation of the LineCollection (see matplotlib.collections.LineCollection)
- Returns
the new LineCollection
- Return type
matplotlib.collections.LineCollection
spanned_coordinates¶
- ProjectedMesh.spanned_coordinates(inplane_vec, flip_other=False)[source]¶
Computes the 2D coordinates from the position
- Parameters
inplane_vec – (3, ) array with any in-plane hemisphere defining the first coordinate
flip_other – if True the second coordinate is defined based on the negative of the cross product betwen the plane normal and inplane_vec rather than the positive
- Returns
(Npoints, 2) array with the coordinates along and perpendicular to
inplane_vec