meshmagick.MMviewer module¶
This module implements a viewer based on VTK.
- class meshmagick.MMviewer.MMViewer[source]¶
Bases:
object
This class implements a viewer based on VTK
- add_line(p0, p1, color=(0, 0, 0))[source]¶
Add a line to the viewer
- Parameters
p0 (array_like) – position of one end point of the line
p1 (array_like) – position of a second end point of the line
color (array_like, optional) – RGB color of the line. Default is black (0, 0, 0)
- Returns
- Return type
vtkPolyData
- add_plane(center, normal)[source]¶
Add a plane to the viewer
- Parameters
center (array_like) – The origin of the plane
normal (array_like) – The normal of the plane
- add_point(pos, color=(0, 0, 0))[source]¶
Add a point to the viewer
- Parameters
pos (array_like) – The point’s position
color (array_like, optional) – The RGB color required for the point. Default is (0, 0, 0) corresponding to black.
- Returns
- Return type
vtkPolyData
- add_polydata(polydata, color=(1, 1, 0), representation='surface')[source]¶
Add a polydata object to the viewer
- Parameters
polydata (vtkPolyData) – the object to be added
color (array_like, optional) – the color of the object. Default is yellow (1, 1, 0)
representation (str) – the representation mode of the object (‘surface’ or ‘wireframe’). Default is ‘surface’.