Sisyphe.core.sisypheMesh
External packages/modules
PyQt5, Qt GUI, https://www.riverbankcomputing.com/software/pyqt/
SimpleITK, medical image processing, <https://simpleitk.org/
vtk, visualization engine/3D rendering, https://vtk.org/
- class Sisyphe.core.sisypheMesh.SisypheMesh
Description
PySisyphe mesh class.
This class provides access to internal vtk classes: vtkPolyData, vtkPolyDataMapper and vtkActor.
Getter and Setter access to mesh points with slicing ability. Getter: v = instance_name[idx] Setter: instance_name[idx] = [x, y, z] idx is int index, or list/tuple of indices or pythonic slicing (i.e. python slice object, used the syntax first:last:step)
Scope of available methods:
creating mesh from simple shapes (line, tube, sphere, cube),
creating brain/head outer surface mesh,
creating mesh from discrete region-of-interest (ROI),
creating isosurface mesh from volume,
mesh properties management,
filtering (decimate, clean, smoothing, fill holes),
boolean operators (union, intersection, difference),
expanding/shrinking,
geometric transformation,
binary image discretization,
feature extraction (surface, volume, center-of-mass, bounds, principal axes, distances…),
IO methods for common mesh file formats (OBJ, STL, VTK, VTP).
Inheritance
object -> SisypheMesh
Creation: 22/03/2023 Last revision: 22/03/2025
- ParseXML(doc: Document) None
Read the current SisypheMesh instance attributes from xml document instance.
Parameters
- docminidom.Document
xml document
- classmethod addInstance() None
Increment the SisypheMesh instance count. This class method is called by the constructor.
- applyTransform(trf: SisypheTransform | vtkTransform)
Apply an affine geometric transformation to the mesh of the current SisypheMesh instance. The center of rotation is the origin. This method performs a resampling of the vtkPolyData points.
Parameters
- trfSisypheTransform | vtkTransform
affine geometric transformation
- clean(updatenormals: bool = True) None
Merge duplicate points, remove unused points and remove degenerate cells in the mesh of the current SisypheMesh instance.
Parameters
- updatenormalsbool
recalculate normals after reduction
- clear() None
Clear the current SisypheMesh instance (empty).
- combinePolyData(data: vtkActor | vtkPolyDataMapper | vtkPolyData | SisypheMesh) None
Combine a mesh to the mesh of the current SisypheMesh instance.
Parameters
- datavtkActor | vtkPolyDataMapper | vtkPolyData | SisypheMesh
mesh to append
- convertToSisypheROI(refimg: SisypheVolume | None, tol: float = 0.0) SisypheROI
Binary discretization of the current SisypheMesh instance mesh.
Parameters
- refimgSisyphe.core.sisypheVolume.SisypheVolume | None
reference volume, mesh is discretized in this reference space
- tolfloat
The tolerance for including a voxel inside the mask. This is in fractions of a voxel, and must be between 0.0 and 1.0 (default 0.0, no tolerance, all the voxel volume must be inside mesh to become part of the mask)
Returns
- Sisyphe.core.sisypheROI.SisypheROI
ROI
- convertToSisypheVolume(refimg: SisypheVolume, tol: float = 0.0) SisypheVolume
Binary discretization of the current SisypheMesh instance mesh.
Parameters
- refimgSisyphe.core.sisypheVolume.SisypheVolume
reference volume, mesh is discretized in this reference space
- tolfloat
The tolerance for including a voxel inside the mask. This is in fractions of a voxel, and must be between 0.0 and 1.0 (default 0.0, no tolerance, all the voxel volume must be inside mesh to become part of the mask)
Returns
- Sisyphe.core.sisypheVolume.SisypheVolume
binary volume
- convertToVTKImage(refimg: SisypheVolume | None, tol: float = 0.0) vtkImageData
Binary discretization of the current SisypheMesh instance mesh.
Parameters
- refimgSisyphe.core.sisypheVolume.SisypheVolume | None
reference volume, mesh is discretized in this reference space
- tolfloat
The tolerance for including a voxel inside the mask. This is in fractions of a voxel, and must be between 0.0 and 1.0 (default 0.0, no tolerance, all the voxel volume must be inside mesh to become part of the mask)
Returns
- vtk.vtkImageData
binary volume
- copyColorFromROI(roi: SisypheROI) None
Set the mesh color of the current SisypheMesh instance from a SisypheROI parameter.
Parameters
- roiSisyphe.core.sisypheROI.SisypheROI
roi color to copy
- copyFrom(data: vtkActor | vtkPolyDataMapper | vtkPolyData | SisypheMesh) None
Set the vtkPolydata attribute of the current SisypheMesh instance from SisypheMesh, vtkActor, vtkPolyDataMapper or vtkPolyData instance (deep copy).
Parameters
- dataSisypheMesh | vtkActor | vtkPolyDataMapper | vtkPolyData
vtkPolyData to copy
- copyPropertiesFromMesh(mesh: SisypheMesh) None
Set the vtkActor attribute properties (surface rendering properties) of the current SisypheMesh instance from a SisypheMesh parameter (deep copy).
Parameters
- meshSisypheMesh
mesh to copy
- copyPropertiesFromVtkActor(v: vtkActor) None
Set the vtkActor attribute properties (surface rendering properties) of the current SisypheMesh instance from a vtkActor parameter (deep copy).
Parameters
- vvtkActor
vtkActor to copy
- copyPropertiesFromVtkProperty(v: vtkProperty) None
Set the vtkActor attribute properties (surface rendering properties) of the current SisypheMesh instance (deep copy).
Parameters
- vvtkProperty
vtkProperty to copy
- createCube(dx: float, dy: float, dz: float, p: list[float] | tuple[float, float, float] = (0.0, 0.0, 0.0)) None
Create a cube-shaped SisypheMesh instance.
Parameters
- dxfloat
length of the cube in the x-direction (mm)
- dyfloat
length of the cube in the y-direction (mm)
- dzfloat
length of the cube in the z-direction (mm)
- plist[float, float, float]
position coordinates
- createFromROI(roi: SisypheROI, fill: float = 1000.0, decimate: float = 1.0, clean: bool = False, smooth: str = 'sinc', niter: int = 10, factor: float = 0.1, algo: str = 'flying', largest: bool = False) None
Create SisypheMesh instance from SisypheROI.
Parameters
- roiSisyphe.core.sisypheROI.SisypheROI
image used to process isosurface
- fillfloat
identify and fill holes in mesh (See docstring for the fillHoles method)
- decimatefloat
mesh points reduction percentage (between 0.0 and 1.0, See docstring for the decimate method)
- cleanbool
merge duplicate points, remove unused points and remove degenerate cells (See docstring for the clean method)
- smoothstr
‘sinc’, ‘laplacian’, smoothing algorithm (See docstrings for the sincSmooth and laplacianSmooth methods)
- niterint
number of iterations (default 20)
- factorfloat
lower values produce more smoothing (between 0.0 and 1.0) - if smooth == ‘sinc’, passband factor - if smooth == ‘laplacian’, relaxation factor
- algostr
‘contour’, ‘marching’, ‘flying’, algorithm used to generate isosurface
- largestbool
keep only the largest isosurface (default False)
- createIsosurface(img: SisypheVolume, isovalue: float, fill: float = 1000.0, decimate: float = 1.0, clean: bool = False, smooth: str = 'sinc', niter: int = 10, factor: float = 0.1, algo: str = 'flying', largest: bool = False) None
Create isosurface SisypheMesh instance.
Parameters
- imgSisyphe.core.sisypheVolume.SisypheVol
reference image used to process isosurface
- isovaluefloat
threshold used as isovalue to generate isosurface
- fillfloat
identify and fill holes in mesh (See docstring for the fillHoles method)
- decimatefloat
mesh points reduction percentage (between 0.0 and 1.0, See docstring for the decimate method)
- cleanbool
merge duplicate points, remove unused points and remove degenerate cells (See docstring for the clean method)
- smoothstr
‘sinc’, ‘laplacian’, smoothing algorithm (See docstrings for the sincSmooth and laplacianSmooth methods)
- niterint
number of iterations (default 20)
- factorfloat
lower values produce more smoothing (between 0.0 and 1.0) - if smooth == ‘sinc’, passband factor - if smooth == ‘laplacian’, relaxation factor
- algostr
‘contour’, ‘marching’, ‘flying’, algorithm used to generate isosurface
- largestbool
keep only the largest isosurface (default False)
- createLine(p1: list[float] | tuple[float, float, float], p2: list[float] | tuple[float, float, float], d: float) None
Create a line-shaped SisypheMesh instance.
Parameters
- p1list[float, float, float]
first point coordinates
- p2list[float, float, float]
second point coordinates
- dfloat
line width (mm)
- createOuterSurface(img: SisypheVolume, seg: str = 'huang', fill: float = 1000.0, decimate: float = 1.0, clean: bool = False, smooth: str = 'sinc', niter: int = 10, factor: float = 0.1, algo: str = 'flying', largest: bool = True) None
Create brain/head outer surface SisypheMesh instance.
Parameters
- imgSisypheVolume
reference image used to process outer surface
- segstr
algorithm used for automatic object/background segmentation: ‘mean’, ‘otsu’, ‘huang’, ‘renyi’, ‘yen’, ‘li’, ‘shanbhag’, ‘triangle’, ‘intermodes’,’maximumentropy’, ‘kittler’, ‘isodata’, ‘moments’
- fillfloat
identify and fill holes in mesh (See docstring for the fillHoles method)
- decimatefloat
mesh points reduction percentage (between 0.0 and 1.0, See docstring for the decimate method)
- cleanbool
merge duplicate points, remove unused points and remove degenerate cells (See docstring for the clean method)
- smoothstr
‘sinc’, ‘laplacian’, smoothing algorithm (See docstrings for the sincSmooth and laplacianSmooth methods)
- niterint
number of iterations (default 20)
- factorfloat
lower values produce more smoothing (between 0.0 and 1.0)
if smooth == ‘sinc’, passband factor
if smooth == ‘laplacian’, relaxation factor
- algostr
‘contour’, ‘marching’, ‘flying’, algorithm used to generate isosurface
- largestbool
keep only the largest isosurface (default False)
- createSphere(r: float, p: list[float] | tuple[float, float, float] = (0.0, 0.0, 0.0), res: int = 64) None
Create a sphere-shaped SisypheMesh instance.
Parameters
- rfloat
sphere radius (mm)
- plist[float, float, float]
center coordinates
- resint
set the number of points in the latitude and longitude directions (default 64)
- createTube(p1: list[float] | tuple[float, float, float], p2: list[float] | tuple[float, float, float], r: float, sides: int) None
Create a tube-shaped SisypheMesh instance.
Parameters
- p1list[float, float, float]
first point coordinates
- p2list[float, float, float]
second point coordinates
- rfloat
tube radius (mm)
- sidesint
number of sides
- createXML(doc: Document, currentnode: Element) None
Write the current SisypheMesh instance attributes to xml document instance.
Parameters
- docminidom.Document
xml document
- currentnodeminidom.Element
xml root node
- decimate(v: float, updatenormals: bool = True) None
Reduce the number of triangles in the mesh of the SisypheMesh instance.
Parameters
- vfloat
reduction ratio (between 0.0 and 1.0), ex. 0.2, -20% of triangles
- updatenormalsbool
recalculate normals after reduction
- difference(datas: SisypheMesh | list[SisypheMesh]) None
Difference between mesh of the current SisypheMesh instance and meshes union.
Parameters
- datasSisypheMesh | list[SisypheMesh]
mesh(es) used for difference
- dilate(mm: float) None
Expand mesh of the current SisypheMesh instance with an isotropic margin in mm.
Parameters
- mmfloat
isotropic margin in mm
- erode(mm: float) None
Shrink mesh of the current SisypheMesh instance with an isotropic margin in mm.
Parameters
- mmfloat
isotropic margin in mm
- fillHoles(size: float = 1000.0, updatenormals: bool = True) None
Identify and fill mesh holes of the current SisypheMesh instance.
Parameters
- sizefloat
size threshold of the hole that can be filled, radius to the bounding circumsphere containing the hole (default 1000.0).
- updatenormalsbool
recalculate normals after reduction
- filter(fill: float = 1000.0, decimate: float = 0.5, clean: bool = False, smooth: str = 'sinc', niter: int = 20, factor: float = 0.1) None
Mesh filtering of the current SisypheMesh instance. rocessing order: decimate, fill holes, clean and finally smooth.
Parameters
- fillfloat
identify and fill holes in mesh (See docstring for the fillHoles method)
- decimatefloat
mesh points reduction percentage (between 0.0 and 1.0, See docstring for the decimate method)
- cleanbool
merge duplicate points, remove unused points and remove degenerate cells (See docstring for the clean method)
- smoothstr
‘sinc’, ‘laplacian’, smoothing algorithm (See docstrings for the sincSmooth and laplacianSmooth methods)
- niterint
number of iterations (default 20)
- factorfloat
lower values produce more smoothing (between 0.0 and 1.0)
if smooth == ‘sinc’, passband factor
if smooth == ‘laplacian’, relaxation factor
- getActor() vtkActor
Get the vtkActor attribute of the current SisypheMesh instance.
Returns
- vtkActor
vtkActor shallow copy
- getAmbient() float
Get mesh ambient lighting coefficient of the current SisypheMesh instance.
Returns
- float
ambient lighting coefficient
- getBounds() tuple[float, ...]
Get the vtkPolyData attribute bounds of the current SisypheMesh instance.
Returns
- tuple[float, …]
x minimum, x maximum,
y minimum, y maximum,
z minimum, z maximum
- getCenter() list[float] | tuple[float, float, float]
Get the vtkPolydata attribute bounding box center, in world coordinates, of the current SisypheMesh instance. All rotations take place around this point.
Returns
- tuple[float, float, float]
center coordinates
- getCenterOfMass() list[float] | tuple[float, float, float]
Get mesh center-of-mass coordinates of the current SisypheMesh instance.
Returns
- tuple[float, float, float]
center-of-mass coordinates
- getColor() list[float] | tuple[float, float, float]
Get the mesh color of the current SisypheMesh instance.
Returns
- tuple[float, float, float]
mesh color, red, green, blue (0.0 <= value <= 1.0)
- getDiffuse() float
Get mesh diffuse lighting coefficient of the current SisypheMesh instance.
Returns
- float
diffuse lighting coefficient
- getDirname() str
Get the path of the file name attribute of the current SisypheMesh instance.
Returns
- str
file name
- getDistanceFromSurfaceToPoint(p: list[float] | tuple[float, float, float]) tuple[float, list[float] | tuple[float, float, float]]
Get distance between a point and the mesh surface of the current SisypheMesh instance.
Parameters
- ptuple[float, float, float]
point coordinates
Returns
- tuple[float, list[float, float, float]]
float, distance between p and surface of the mesh
list[float, float, float], coordinates of the closest surface point of the mesh
- getDistanceFromSurfaceToSurface(mesh: vtkActor | vtkPolyDataMapper | vtkPolyData | SisypheMesh) tuple[float, float]
Get distance between surfaces of a mesh and the mesh of the current SisypheMesh instance.
Parameters
mesh : vtkPolyData | vtkPolyDataMapper | vtkActor | SisypheMesh
Returns
- tuple[float, float]
minimum and maximum distances between meshes
- getEdgeColor() list[float] | tuple[float, float, float]
Get the mesh edges color of the current SisypheMesh instance.
Returns
- tuple[float, float, float]
edges color, red, green, blue (0.0 <= value <= 1.0)
- getEdgeQColor() QColor
Get the mesh edges color (as QColor) of the current SisypheMesh instance
Returns
- PyQt5.QtGui.QColor
edges color
- getEdgeVisibility() bool
Get mesh edges visibility of the current SisypheMesh instance.
Returns
- bool
True if edges are visbile
- getFilename() str
Get the file name attribute of the current SisypheMesh instance. This file name is used by save() method.
Returns
- str
file name
- getFilenamePrefix(sep: str = '_') str
Get prefix (if any) from the file name attribute of the current SisypheMesh instance.
Parameters
- sepstr
char between prefix and base name (default ‘_’)
Returns
- str
prefix
- getFilenameSuffix(sep: str = '_') str
Get suffix (if any) from the file name attribute of the current SisypheMesh instance.
Parameters
- sepstr
char between prefix and base name (default ‘_’)
Returns
- str
suffix
- classmethod getFilterExt() str
Get SisypheMesh filter used by QFileDialog.getOpenFileName() and QFileDialog.getSaveFileName().
Returns
- str
‘PySisyphe Mesh (.xmesh)’
- classmethod getInstancesCount() int
Get the SisypheMesh instance count.
Returns
- int
instance count
- getLUT() vtkLookupTable
Get the mesh look-up table colormap (as vtkLookupTable) of the current SisypheMesh instance.
Returns
- vtkLookupTable
lut copy
- getLineWidth() float
Get mesh line width (mm) of the current SisypheMesh instance.
Returns
- float
line width in mm
- getMemorySize() int
Get the memory size of the current SisypheMesh instance.
Returns
- int
memory size in KBytes
- getMeshSurface() float
Get mesh surface (mm2) of the current SisypheMesh instance.
Returns
- float
mesh surface (mm2)
- getMeshVolume() float
Get mesh volume (mm3) of the current SisypheMesh instance.
Returns
- float
mesh volume (mm3)
- getMetallic() float
Get mesh metallic coefficient of the current SisypheMesh instance. Usually this value is either 0.0 or 1.0 for real material but any value in between is valid. This parameter is only used by PBR Interpolation (Default is 0.0).
Returns
- float
metallic coefficient
- getNumberOfPoints() int
Get the number of points of the vtkPolyData attribute of the current SisypheMesh instance.
Returns
- int
number of points
- getOpacity() float
Get the mesh opacity of the current SisypheMesh instance.
Returns
- float
opacity, between 0.0 and 1.0
- getOrigin() list[float] | tuple[float, float, float]
Get the vtkPolydata attribute origin, in world coordinates, of the current SisypheMesh instance. All rotations take place around this point.
Returns
- tuple[float, float, float]
origin coordinates
- getPoint(idx: int = 0) tuple[float, float, float]
Get a point of the vtkPolyData.
Parameters
- idxint
point index in the vtkPolyData
Returns
- tuple[float, float, float]
point coordinates
- getPointSize() float
Get mesh point size (mm) of the current SisypheMesh instance.
Returns
- float
point size in mm
- getPoints() vtkPoints
Get the vtKPoints (vtk container of points) of the vtkPolyData attribute of the current SisypheMesh instance.
Returns
- vtkPoints
vtkPoints shallow copy
- getPolyData() vtkPolyData
Get the vtkPolyData attribute of the current SisypheMesh instance.
Returns
- vtkPolydata
vtkPolydata shallow copy
- getPolyDataMapper() vtkPolyDataMapper
Get the vtkPolyDataMapper attribute of the current SisypheMesh instance.
Returns
- vtkPolydataMapper
vtkPolydataMapper shallow copy
- getPosition() tuple[float, float, float]
Get the mesh position (mm), in world coordinates, of the current SisypheMesh instance.
Returns
- Tuple[float, float, float]
x, y, z world coordinates
- getPrincipalAxis() tuple[list[float] | tuple[float, float, float], list[float] | tuple[float, float, float], list[float] | tuple[float, float, float], list[float] | tuple[float, float, float], list[float] | tuple[float, float, float]]
Get mesh PCA axes of the current SisypheMesh instance.
Returns
- tuple[tuple[float, float, float], …]
first tuple[float, float, float], center-of-mass coordinates
second tuple[float, float, float], PCA major axis
third tuple[float, float, float], PCA intermediate axis
fourth tuple[float, float, float], PCA minor axis
fifth tuple[float, float, float], length of major, intermediate and minor axes
- getQColor(opacity: bool = False) QColor
Get the mesh color (as QColor) of the current SisypheMesh instance.
Parameters
- opacitybool
copies the mesh opacity to alpha QColor component if true
Returns
- PyQt5.QtGui.QColor
mesh color
- getReferenceID() str
Get reference ID attribute of the current SisypheMesh instance. A mesh is defined in the space of a reference SisypheVolume whose ID is the reference ID.
Returns
- str
reference ID
- getRenderLinesAsTubes() bool
Checks whether mesh lines in the current SisyphusMesh instance are rendered as tubes
Returns
- bool
True if mesh lines are rendered as tubes
- getRenderPointsAsSpheres() bool
Checks whether mesh points in the current SisyphusMesh instance are rendered as spheres.
Returns
- bool
True if mesh points are rendered as spheres
- getRenderingAlgorithm() int
Get the shading interpolation method (as int code) used to render the mesh of the current SisypheMesh instance.
Returns
- int
shading interpolation code (0 ‘Flat’, 1 ‘Gouraud’, 2 ‘Phong’, 3 ‘PBR’)
- getRenderingAlgorithmAsString() str
Get the shading interpolation method (as string) used to render the mesh of the current SisypheMesh instance.
Returns
- str
‘Flat’, ‘Gouraud’, ‘Phong’, ‘PBR’
- getRotation() tuple[float, float, float]
Get the mesh rotation (°), in world coordinates, of the current SisypheMesh instance.
Returns
- Tuple[float, float, float]
x, y, z world coordinates
- getRoughness() float
Get mesh roughness coefficient of the current SisypheMesh instance. This value has to be between 0.0 (glossy) and 1.0 (rough). A glossy material has reflections and a high specular part. This parameter is only used by PBR Interpolation (Default 0.5)
Returns
- float
roughness coefficient, between 0.0 (glossy) and 1.0 (rough)
- getScalarColorVisibility() bool
Check whether the scalar color visibility mode of the current SisypheMesh instance is on. In this mode, the color of each point in the mesh is calculated from the scalar value, displayed with a look-up table colormap, at the point’s coordinates in the reference SisypheVolume image array.
Returns
- bool
True if scalar color visibility mode is on
- getScale() list[float] | tuple[float, float, float]
Get a scale factor (zoom) which is applied to the vtkPolyData attribute of the current SisypheMesh instance.
Returns
- tuple[float, float, float]
scales in x, y, z axes
- getShading() bool
Get the mesh shading mode of the current SisypheMesh instance.
Returns
- bool
True if shading id on
- getSpecular() float
Get mesh specular lighting coefficient of the current SisypheMesh instance.
Returns
- float
specular lighting coefficient
- getSpecularPower() float
Get mesh specular power of the current SisypheMesh instance.
Returns
- float
specular power
- getTransform() SisypheTransform
Get the rigid geometric transformation applied to the mesh of the current SisypheMesh instance.
Returns
- SisypheTransform
rigid geometric transformation
- getVertexColor() list[float] | tuple[float, float, float]
Get the mesh vertex color of the current SisypheMesh instance.
Returns
- tuple[float, float, float]
vertex color, red, green, blue (0.0 <= value <= 1.0)
- getVertexQColor() QColor
Get the mesh vertex color (as QColor) of the current SisypheMesh instance
Returns
- PyQt5.QtGui.QColor
vertex color
- getVertexVisibility() bool
Get mesh vertex visibility of the current SisypheMesh instance.
Returns
- bool
True if vertices are visible
- getVisibility() bool
Get the mesh visibility of the current SisypheMesh instance.
Returns
- bool
True if visible
- getVtkProperty() vtkProperty
Get the vtkActor attribute properties (surface rendering properties) of the current SisypheMesh instance.
Returns
- vtkProperty
vtkProperty shallow copy
- hasFilename() bool
Check that the file name attribute of the SisypheMesh instance is set (not None).
Returns
- bool
True if file name si defined
- hasReferenceID() bool
Check if the reference ID of the current SisypheMesh instance is defined (not ‘’).
Returns
- bool
True if reference ID is defined
- intersection(datas: SisypheMesh | list[SisypheMesh]) None
Intersection of meshes with the mesh of the current SisypheMesh instance.
Parameters
- datasSisypheMesh | list[SisypheMesh]
mesh(es) used for intersection
- isDefaultOrigin() bool
Check whether the mesh origin of the current SisypheMesh instance is (0.0, 0.0 ,0.0).
Returns
- bool
True if origin is (0.0, 0.0 ,0.0).
- isDefaultPosition() bool
Check whether the mesh position of the current SisypheMesh instance is (0.0, 0.0 ,0.0).
Returns
- bool
True if mesh position is (0.0, 0.0 ,0.0)
- isDefaultRotation() bool
Check whether the mesh rotation of the current SisypheMesh instance is (0.0, 0.0 ,0.0).
Returns
- bool
True if mesh rotation is (0.0, 0.0 ,0.0)
- isEmpty() bool
Check whether the current SisypheMesh instance is empty.
Returns
- bool
True if empty
- isPointInside(p: list[float] | tuple[float, float, float]) bool
Check whether a point is inside mesh of the current SisypheMesh instance.
Parameters
- ptuple[float, float, float]
point coordinates
Returns
- bool
True if point is inside mesh
- isPointOutside(p: list[float] | tuple[float, float, float]) bool
Check whether a point is outside mesh of the current SisypheMesh instance.
Parameters
- ptuple[float, float, float]
point coordinates
Returns
- bool
True if point is outside mesh
- laplacianSmooth(niter: int = 20, relax: float = 0.1, edge: bool = True, boundary: bool = True, updatenormals: bool = True) None
Adjust mesh point positions using a Laplacian smoothing of the current SisypheMesh instance. The effect is to “smooth” the mesh, making the cells better shaped and the vertices more evenly distributed.
Parameters
- niterint
determines the maximum number of smoothing iterations (between 10 and 100, default 20)
- relaxfloat
relaxation factor, lower values produce more smoothing. Small relaxation factors and large numbers of iterations are more stable than larger relaxation factors and smaller numbers of iterations (between 0.0 and 1.0, default 0.1)
- edgebool
enables/disables customized smoothing of the interior vertices. Interior vertices are classified as either “simple”, “interior edge”, or “fixed”, and smoothed differently. A feature edge occurs when the angle between the two surface normals of a polygon sharing an edge is greater than a feature angle (45°). Then, vertices used by no feature edges are classified “simple”, vertices used by exactly two feature edges are classified “interior edge”, and all others are “fixed” vertices. “fixed” vertices are not smoothed at all. “simple” vertices are smoothed as before. “interior edge” vertices are smoothed only along their two connected edges, and only if the angle between the edges is less than an edge angle (15°).
- boundarybool
enables/disables the smoothing operation on vertices that are on the “boundary” of the mesh. A boundary vertex is one that is surrounded by a semi-cycle of polygons (or used by a single line)
- updatenormalsbool
recalculate normals after reduction
- load(filename: str) None
Load mesh of the current SisypheMesh instance from a PySisyphe Mesh (.xmesh) file.
Parameters
- filenamestr
PySisyphe Mesh file name
- loadFromOBJ(filename: str) None
Load mesh of the current SisypheMesh instance from OBJ (.obj) file.
Parameters
- filenamestr
OBJ file name
- loadFromSTL(filename: str) None
Load mesh of the current SisypheMesh instance from STL (.stl) file.
Parameters
- filenamestr
STL file name
- loadFromVTK(filename: str) None
Load mesh of the current SisypheMesh instance from VTK (.vtk) file.
Parameters
- filenamestr
VTK file name
- loadFromXMLVTK(filename: str) None
Load mesh of the current SisypheMesh instance from XMLVTK (.vtp) file.
Parameters
- filenamestr
XMLVTK Mesh file name
- classmethod openMesh(filename: str) SisypheMesh
Create a SisypheMesh instance from various mesh file formats.
Parameters
- filenamestr
mesh file name (supported formats ‘obj’, ‘stl’, ‘vtk’, ‘vtp’)
Returns
- SisypheMesh
loaded mesh
- save() None
Save the current SisypheMesh instance mesh to a PySisyphe Mesh (.xmesh) file. This method uses the file name attribute of the current SisypheMesh instance.
- saveAs(filename: str) None
Save the current SisypheMesh instance mesh to a PySisyphe Mesh (.xmesh) file.
Parameters
- filenamestr
PySisyphe Mesh file name
- saveToOBJ(filename: str) None
Save the current SisypheMesh instance mesh to an OBJ (.obj) file.
Parameters
- filenamestr
OBJ file name
- saveToSTL(filename: str) None
Save the current SisypheMesh instance mesh to a STL (.stl) file.
Parameters
- filenamestr
STL file name
- saveToVTK(filename: str) None
Save the current SisypheMesh instance mesh to a VTK (.vtk) file.
Parameters
- filenamestr
VTK file name
- saveToXMLVTK(filename: str) None
Save the current SisypheMesh instance mesh to XMLVTK (.vtp) file.
Parameters
- filenamestr
XMLVTK file name
- setActor(actor: vtkActor) None
Set the vtkActor attribute of the current SisypheMesh instance.
Parameters
actor : vtkActor
- setAmbient(v: float) None
Set mesh ambient lighting coefficient of the current SisypheMesh instance.
Parameters
- vfloat
ambient lighting coefficient (between 0.0 and 1.0)
- setColor(r: float, g: float, b: float) None
Set the mesh color of the current SisypheMesh instance. This color is not used if the scalar color visibility mode is on.
Parameters
- rfloat
mesh color, 0.0 <= red component <= 1.0
- gfloat
mesh color, 0.0 <= green component <= 1.0
- bfloat
mesh color, 0.0 <= blue component <= 1.0
- setDefaultFilename() None
Set default file name attribute of the current SisypheMesh instance. This file name is used by save() method. Default file name = name attribute + mesh file extension (‘.xmesh’)
- setDefaultName() None
Set default name attribute of the current SisypheMesh instance. default name = ‘MESH’ + instance count.
- setDefaultOrigin() None
Set the vtkPolydata attribute origin to (0.0, 0.0, 0.0), in world coordinates, of the current SisypheMesh instance. All rotations take place around this point.
- setDiffuse(v: float) None
Set mesh diffuse lighting coefficient of the current SisypheMesh instance.
Parameters
- vfloat
diffuse lighting coefficient (between 0.0 and 1.0)
- setDirname(filename: str) None
Set the path of the file name attribute of the current SisypheMesh instance.
Returns
- str
file name
- setEdgeColor(r: float, g: float, b: float) None
Set the mesh edges color of the current SisypheMesh instance.
Parameters
- rfloat
edges color, 0.0 <= red component <= 1.0
- gfloat
edges color, 0.0 <= green component <= 1.0
- bfloat
edges color, 0.0 <= blue component <= 1.0
- setEdgeQColor(c: QColor) None
Set the mesh edges color of the current SisypheMesh instance from a QColor.
Parameters
- cPyQt5.QtGui.QColor
edges color
- setEdgeVisibilityOff() None
Hide mesh edges of the current SisypheMesh instance.
- setEdgeVisibilityOn() None
Show mesh edges of the current SisypheMesh instance.
- setFilename(filename: str) None
Set the file name attribute of the current SisypheMesh instance. This file name is used by save() method.
Parameters
- filenamestr
file name
- setFilenamePrefix(prefix: str, sep: str = '_') None
Set a prefix to the file name attribute of the current SisypheMesh instance.
Parameters
- prefixstr
prefix to add
- sepstr
char between prefix and base name (default ‘_’)
- setFilenameSuffix(suffix: str, sep: str = '_') None
Set a suffix to the file name attribute of the current SisypheMesh instance.
Parameters
- suffixstr
suffix to add
- sepstr
char between base name and suffix (default ‘_’)
- setFlatRendering() None
Set “Flat” shading interpolation method to render the mesh of the current SisypheMesh instance.
- setGouraudRendering() None
Set “Gouraud” shading interpolation method to render the mesh of the current SisypheMesh instance.
- setLUT(lut: SisypheVolume | SisypheLut | vtkLookupTable) None
Set the mesh look-up table colormap of the current SisypheMesh instance. Set the scalar color visibility mode of the current SisypheMesh instance to on. In this mode, the color of each mesh point is calculated from the scalar value, displayed with a look-up table colormap, at the point’s coordinates in the reference SisypheVolume image array.
Parameters
- lutSisypheVolume | SisypheLut | vtkLookupTable
lut to copy
- setLUTScalarRange(vmin: float, vmax: float) None
Set the scalar range of the look-up table colormap of the current SisypheMesh instance.
Parameters
- vmin: float
minimum scalar value
- vmaxfloat
maximum scalar value
- setLineWidth(v: float) None
Set line width size (mm) of the current SisypheMesh instance.
Parameters
- vfloat
line width in mm
- setMetallic(v: float) None
Set mesh metallic coefficient of the current SisypheMesh instance. Usually this value is either 0.0 or 1.0 for real material but any value in between is valid. This parameter is only used by PBR Interpolation (Default is 0.0).
Parameters
- vfloat
metallic coefficient
- setName(name: str) None
Set the name attribute of the current SisypheMesh instance.
Parameters
- namestr
mesh name
- setNameFromFilename(filename: str) None
Set the name attribute of the current SisypheMesh instance from a file name.
Parameters
- filenamestr
file name
- setOpacity(alpha: float) None
Set the mesh opacity of the current SisypheMesh instance.
Parameters
- alphafloat
opacity, between 0.0 and 1.0
- setOrigin(x: float, y: float, z: float) None
Set the vtkPolydata attribute origin, in world coordinates, of the current SisypheMesh instance. All rotations take place around this point.
Parameters
- xfloat
x-axis coordinate
- yfloat
y-axis coordinate
- zfloat
z-axis coordinate
- setOriginFromReferenceVolume(v: SisypheVolume) None
Set the vtkPolydata attribute origin, in world coordinates, of the current SisypheMesh instance to the center of a SisypheVolume.
Parameters
- vSisypheVolume
origin is placed at the center of this volume
- setOriginToCenter() None
Set the vtkPolydata attribute origin to the bounding box center, in world coordinates, of the current SisypheMesh instance. All rotations take place around this point.
- setPBRRendering() None
Set “PBR” shading interpolation method to render the mesh of the current SisypheMesh instance.
- setPathFromVolume(volume: SisypheVolume) None
Set path part of the file name attribute of the current SisypheMesh instance from the path part (dirname) of the file name attribute of a SisypheVolume parameter.
Parameters
- volumeSisyphe.core.sisypheVolume.SisypheVolume
volume used to replace dirname
- setPhongRendering() None
Set “Phong” shading interpolation method to render the mesh of the current SisypheMesh instance.
- setPoint(idx: int, p: list[float] | tuple[float, float, float]) None
Get a point of the vtkPolyData.
Parameters
- idxint
point index in the vtkPolyData
- ptuple[float, float, float] | list[float, float, float]
point coordinates
- setPointScalarColorFromVolume(vol: SisypheVolume, depth: int = 0, feature: str = 'mean', wait: DialogWait | None = None) None
Calculate scalar values associated to each vtkPolydata point from scalars values in the reference SisypheVolume image array.
Several scalar values are accumulated for each vtkPolydata point, the first being the scalar value in the reference SisypheVolume image array to the point’s coordinates, the next for points spaced by a constant step of 1 mm in the direction of the normal vector over a depth set in parameter. The value associated to each vtkPolydata point can be the mean, median, minimum, maximum or sum of the accumulated values.
Parameters
- volSisypheVolume
reference volume
- depthcython.int
depth in mm, in the normal vector direction. if depth is 0.0, no accumulation (scalar value to the point’s coordinates, default)
- featurestr
‘mean’, ‘median’, ‘min’, ‘max’, ‘sum’
- waitDialogWait | None
progress bar dialog (optional)
- setPointSize(v: float) None
Set mesh point size (mm) of the current SisypheMesh instance.
Parameters
- vfloat
point size in mm
- setPoints(p: vtkPoints) None
Set the vtKPoints (vtk container of points) of the vtkPolyData attribute of the current SisypheMesh instance.
Parameters
- pvtkPoints
vtkPoints to copy
- setPolyData(data: vtkActor | vtkPolyDataMapper | vtkPolyData | SisypheMesh) None
Set the vtkPolydata attribute of the current SisypheMesh instance from SisypheMesh, vtkActor, vtkPolyDataMapper or vtkPolyData instance (shallow copy).
Parameters
- dataSisypheMesh | vtkActor | vtkPolyDataMapper | vtkPolyData
vtkPolydata to copy
- setPosition(x: float, y: float, z: float) None
Set the mesh position (mm), in world coordinates, of the current SisypheMesh instance.
Parameters
- xfloat
x-axis coordinate
- yfloat
y-axis coordinate
- zfloat
z-axis coordinate
- setQColor(c: QColor, opacity: bool = False) None
Set the mesh color of the current SisypheMesh instance from a QColor. This color is not used if the scalar color visibility mode is on.
Parameters
- cPyQt5.QtGui.QColor
mesh color
- opacitybool
sets mesh opacity from QColor alpha component if True
- setReferenceID(ID: str | SisypheVolume) None
Set the reference ID attribute of the current SisypheMesh instance. A mesh is defined in the space of a reference SisypheVolume whose ID is the reference ID.
Parameters
- IDstr | SisypheVolume
if SisypheVolume, get ID attribute
- setRenderLinesAsTubesOff() None
Stop rendering mesh lines of the current SisypheMesh instance as tubes.
- setRenderLinesAsTubesOn() None
Render mesh lines of the current SisypheMesh instance as tubes.
- setRenderPointsAsSpheresOff() None
Stop rendering mesh points of the current SisypheMesh instance as spheres.
- setRenderPointsAsSpheresOn() None
Render mesh points of the current SisypheMesh instance as spheres.
- setRenderingAlgorithm(r: int) None
Set the shading interpolation method, as int code, used to render the mesh of the current SisypheMesh instance.
Parameters
- rint
shading interpolation code (0 ‘Flat’, 1 ‘Gouraud’, 2 ‘Phong’, 3 ‘PBR’)
- setRotation(x: float, y: float, z: float) None
Set the mesh rotation (°), in world coordinates, of the current SisypheMesh instance.
Parameters
- xfloat
x-axis coordinate
- yfloat
y-axis coordinate
- zfloat
z-axis coordinate
- setRoughness(v: float) None
Set mesh roughness coefficient of the current SisypheMesh instance. This value has to be between 0.0 (glossy) and 1.0 (rough). A glossy material has reflections and a high specular part. This parameter is only used by PBR Interpolation (Default 0.5)
Parameters
- vfloat
roughness coefficient, between 0.0 (glossy) and 1.0 (rough)
- setScalarColorVisibility(v: bool) None
Set the scalar color visibility mode of the current SisypheMesh instance. If scalar color visibility mode is on, the color of each mesh point is calculated from the scalar value, displayed with a look-up table colormap, at the point’s coordinates in the reference SisypheVolume image array. Otherwise, the mesh is painted with even color fixed by the setColor (or setQColor) method.
Parameters
- vbool
scalar visibility
- setScalarColorVisibilityOff() None
Set the scalar color visibility mode of the current SisypheMesh instance to off. In this mode, the mesh is painted with even color fixed by the setColor (or setQColor) method.
- setScalarColorVisibilityOn() None
Set the scalar color visibility mode of the current SisypheMesh instance to on. In this mode, the color of each point in the mesh is calculated from the scalar value, displayed with a look-up table colormap, at the point’s coordinates in the reference SisypheVolume image array.
- setScale(sx: float, sy: float, sz: float) None
Set a scale factor (zoom) to the vtkPolyData attribute of the current SisypheMesh instance.
Parameters
- sxfloat
x-axis scale
- syfloat
y-axis scale
- szfloat
z-axis scale
- setSpecular(v: float) None
Set mesh specular lighting coefficient of the current SisypheMesh instance.
Parameters
- vfloat
specular lighting coefficient (between 0.0 and 1.0)
- setSpecularPower(v: float) None
Set mesh specular power of the current SisypheMesh instance.
Parameters
- vfloat
specular power (between 0.0 and 50.0)
- setTransform(trf: SisypheTransform | vtkTransform) None
Apply a rigid geometric transformation to the mesh of the current SisypheMesh instance.
Parameters
- trfSisypheTransform | vtkTransform
rigid geometric transformation
- setVertexColor(r: float, g: float, b: float) None
Set the mesh vertex color of the current SisypheMesh instance.
Parameters
- rfloat
vertex color, 0.0 <= red component <= 1.0
- gfloat
vertex color, 0.0 <= green component <= 1.0
- bfloat
vertex color, 0.0 <= blue component <= 1.0
- setVertexQColor(c: QColor) None
Set the mesh vertex color of the current SisypheMesh instance from a QColor.
Parameters
- cPyQt5.QtGui.QColor
vertex color
- setVertexVisibilityOff() None
Hide mesh vertex of the current SisypheMesh instance.
- setVertexVisibilityOn() None
Show mesh vertex of the current SisypheMesh instance.
- setVisibility(v: bool) None
Set the mesh visibility of the current SisypheMesh instance.
Parameters
- vbool
visible if True
- setVisibilityOff() None
Hide the current SisypheMesh instance.
- setVisibilityOn() None
Show the current SisypheMesh instance.
- setVtkProperty(v: vtkProperty) None
Set the vtkActor attribute properties (surface rendering properties) of the current SisypheMesh instance (shallow copy).
Parameters
- vvtkProperty
vtkProperty to copy
- shadingOff() None
Disables mesh shading mode for the current SisypheMesh instance.
- shadingOn() None
Enables mesh shading mode for the current SisypheMesh instance.
- sincSmooth(niter: int = 10, passband: float = 0.1, edge: bool = True, boundary: bool = True, updatenormals: bool = True) None
Adjust mesh point positions using a windowed sinc function interpolation kernel of the current SisypheMesh instance. The effect is to “smooth” the mesh, making the cells better shaped and the vertices more evenly distributed.
Parameters
- niterint
determines the maximum number of smoothing iterations (between 10 and 20, default 10)
- passbandfloat
pass band factor, lower values produce more smoothing (between 0.0 and 2.0, default 0.1)
- edgebool
enables/disables customized smoothing of the interior vertices. Interior vertices are classified as either “simple”, “interior edge”, or “fixed”, and smoothed differently. A feature edge occurs when the angle between the two surface normals of a polygon sharing an edge s greater than a feature angle (45°). Then, vertices used by no feature edges are classified “simple”, vertices used by exactly two feature edges are classified “interior edge”, and all others are “fixed” vertices. “fixed” vertices are not smoothed at all. “simple” vertices are smoothed as before. “interior edge” vertices are smoothed only along their two connected edges, and only if the angle between the edges is less than an edge angle (15°).
- boundarybool
enables/disables the smoothing operation on vertices that are on the “boundary” of the mesh. A boundary vertex is one that is surrounded by a semi-cycle of polygons (or used by a single line)
- updatenormalsbool
recalculate normals after reduction
- union(datas: SisypheMesh | list[SisypheMesh]) None
Union of meshes with the mesh of the current SisypheMesh instance.
Parameters
- datasSisypheMesh | list[SisypheMesh]
mesh(es) used for union
- update() None
Update mesh rendering of the current SisypheMesh instance.
- class Sisyphe.core.sisypheMesh.SisypheMeshCollection
Description
Named list container of SisypheMesh instances. Container key to address elements can be an int index, a mesh name str or a SisypheMesh instance (uses name attribute as str key).
Getter methods of the SisypheMesh class are added to the SisypheMeshCollection class, returning a list of values returned by each SisypheMesh element in the container.
Inheritance
object -> SisypheMeshCollection
Creation: 22/03/2023 Last revision: 23/05/2024
- append(value: SisypheMesh) None
Append a SisypheMesh element in the current SisypheMeshCollection instance container.
Parameters
- valueSisypheMesh
mesh to append
- clear() None
Remove all elements from the current SisypheMeshCollection instance container (empty).
- copy() SisypheMeshCollection
Copy the current SisypheMeshCollection instance container (Shallow copy of elements).
Returns
- SisypheMeshCollection
SisypheMeshCollection shallow copy
- copyToList() list[SisypheMesh]
Copy the current SisypheMeshCollection instance container to a list (Shallow copy of elements).
Returns
- list[SisypheMesh]
SisypheMeshCollection shallow copy
- count() int
Get the number of SisypheMesh elements in the current SisypheMeshCollection instance container.
Returns
- int
number of SisypheMesh elements
- getList() list[SisypheMesh]
Get the list attribute of the current SisypheMeshCollection instance container (Shallow copy of the elements).
Returns
- list[SisypheMesh]
SisypheMeshCollection shallow copy
- getReferenceID() str
Get reference ID attribute of the current SisypheMeshCollection instance. All meshes in the container are defined in the space of a reference SisypheVolume whose ID is the reference ID.
Returns
- str
reference ID
- hasReferenceID() bool
Check if the reference ID of the current SisypheMeshCollection instance is defined (not empty str).
Returns
- bool
True if reference ID is defined
- index(value: str | SisypheMesh) int
Index of a SisypheMesh element in the current SisypheMeshCollection instance container.
Parameters
- valuestr | SisypheMesh
mesh name or SisypheMesh
Returns
- int
index
- insert(key: int | str | SisypheMesh, value: SisypheMesh) None
Insert a SisypheMesh element at the position given by the key in the current SisypheMeshCollection instance container.
Parameters
- keyint | str | SisypheMesh
int, index
str, mesh name index
SisypheMesh, mesh index
- valueSisypheMesh
mesh to insert
- isEmpty() bool
Checks if SisypheMeshCollection instance container is empty.
Returns
- bool
True if empty
- keys() list[str]
Get the list of keys in the current SisypheMeshCollection instance container.
Returns
- list[str]
list of keys in the container
- load(filenames: str | list[str]) None
Load SisypheMesh elements in the current SisypheMeshCollection instance container from a list of PySisyphe Mesh (.xmesh) file names.
Parameters
- filenamesstr | list[str]
list of PySisyphe Mesh (.xmesh) file names
- loadFromOBJ(filenames: str | list[str]) None
Load SisypheMesh elements in the current SisypheMeshCollection instance container from a list of OBJ (.obj) file names.
Parameters
- filenamesstr | list[str]
list of OBJ (.obj) file names
- loadFromSTL(filenames: str | list[str]) None
Load SisypheMesh elements in the current SisypheMeshCollection instance container from a list of STL (.stl) file names.
Parameters
- filenamesstr | list[str]
list of STL (.stl) file names
- loadFromVTK(filenames: str | list[str]) None
Load SisypheMesh elements in the current SisypheMeshCollection instance container from a list of VTK (.vtk) file names.
Parameters
- filenamesstr | list[str]
list of VTK (.vtk) file names
- loadFromXMLVTK(filenames: str | list[str]) None
Load SisypheMesh elements in the current SisypheMeshCollection instance container from a list of XMLVTK (.vtp) file names.
Parameters
- filenamesstr | list[str]
list of XMLVTK (.vtp) file names
- pop(key: int | str | SisypheMesh | None = None) SisypheMesh
Remove a SisypheMesh element from the current SisypheMeshCollection instance container and return it. If key is None, removes and returns the last element.
Parameters
- keyint | str | SisypheMesh | None
int, index of the SisypheMesh to remove
str, mesh name of the SisypheMesh to remove
SisypheMesh to remove
None, remove the last element
Returns
- SisypheMesh
element removed from the container
- remove(value: int | str | SisypheMesh) None
Remove a SisypheMesh element from the current SisypheMeshCollection instance container.
Parameters
- valueint | str | SisypheMesh
int, index of the SisypheMesh to remove
str, mesh name of the SisypheMesh to remove
SisypheMesh to remove
- resample(trf: SisypheTransform, save: bool = True, dialog: bool = False, prefix: str | None = None, suffix: str | None = None, wait: DialogWait | None = None)
Apply an affine geometric transformation to all the SisypheMesh elements of the current SisypheMeshCollection instance container. This method performs a resampling of the vtkPolyData points.
Parameters
- trfSisypheTransform | vtkTransform
affine geometric transformation
- savebool
save resampled SisypheMesh elements (default True)
- dialogbool
dialog box to choice file name of each resampled SisypheMesh element (default False)
- prefixstr | None
prefix added to file name of the resampled SisypheMesh elements (default None)
- suffixstr | None
suffix added to file name of the resampled SisypheMesh elements (default None)
- waitDialogWait | None
progress bar dialog (optional)
- reverse() None
Reverses the order of the elements in the current SisypheMeshCollection instance container.
- save(wait: DialogWait | None = None)
Iteratively save SisypheMesh elements in the current SisypheMeshCollection instance container.
- setAmbient(v: float) None
Set ambient lighting coefficient attribute of all the SisypheMesh elements of the current SisypheMeshCollection instance container.
Parameters
- vfloat
ambient lighting coefficient (between 0.0 and 1.0)
- setDiffuse(v: float) None
Set diffuse lighting coefficient attribute of all the SisypheMesh elements of the current SisypheMeshCollection instance container.
Parameters
- vfloat
diffuse lighting coefficient (between 0.0 and 1.0)
- setEdgeVisibilityOff() None
Hide mesh vertex of all the SisypheMesh elements of the current SisypheMeshCollection instance container.
- setEdgeVisibilityOn() None
Show mesh vertex of all the SisypheMesh elements of the current SisypheMeshCollection instance container.
- setFlatRendering() None
Set “Flat” shading interpolation method to render all the SisypheMesh elements of the current SisypheMeshCollection instance container.
- setGouraudRendering() None
Set “Gouraud” shading interpolation method to render all the SisypheMesh elements of the current SisypheMeshCollection instance container.
- setLineWidth(v: float) None
Set line width size (mm) of all the SisypheMesh elements of the current SisypheMeshCollection instance container.
Parameters
- vfloat
line width in mm
- setMetallic(v: float) None
Set metallic attribute of all the SisypheMesh elements of the current SisypheMeshCollection instance container.
Parameters
- vfloat
metallic (between 0.0 and 1.0)
- setOpacity(alpha: float) None
Set opacity attribute of all the SisypheMesh elements of the current SisypheMeshCollection instance container.
Parameters
- alphafloat
opacity (between 0.0 and 1.0)
- setPBRRendering() None
Set “PBR” shading interpolation method to render all the SisypheMesh elements of the current SisypheMeshCollection instance container.
- setPhongRendering() None
Set “Phong” shading interpolation method to render all the SisypheMesh elements of the current SisypheMeshCollection instance container.
- setPointSize(v: float) None
Set point size (mm) of all the SisypheMesh elements of the current SisypheMeshCollection instance container.
Parameters
- vfloat
point size in mm
- setReferenceID(ID: str | SisypheMesh | SisypheVolume) None
Set reference ID attribute of the current SisypheMeshCollection instance. All meshes in the container are defined in the space of a reference SisypheVolume whose ID is the reference ID.
Parameters
- IDstr | SisypheMesh | Sisyphe.core.sisypheVolume.SisypheVolume
str, ID
SisypheMesh, ID attribute of the SisypheMesh
Sisyphe.core.sisypheVolume.SisypheVolume, ID attribute of the SisypheVolume
- setRenderLinesAsTubesOff() None
Stop rendering mesh lines of all the SisypheMesh elements of the current SisypheMeshCollection instance container as tubes.
- setRenderLinesAsTubesOn() None
Render mesh lines of all the SisypheMesh elements of the current SisypheMeshCollection instance container as tubes.
- setRenderPointsAsSpheresOff() None
Stop rendering mesh points of all the SisypheMesh elements of the current SisypheMeshCollection instance container as spheres.
- setRenderPointsAsSpheresOn() None
Render mesh points of all the SisypheMesh elements of the current SisypheMeshCollection instance container as spheres.
- setRoughness(v: float) None
Set roughness attribute of all the SisypheMesh elements of the current SisypheMeshCollection instance container.
Parameters
- vfloat
roughness (between 0.0 and 1.0)
- setSpecular(v: float) None
Set specular lighting coefficient attribute of all the SisypheMesh elements of the current SisypheMeshCollection instance container.
Parameters
- vfloat
specular lighting coefficient (between 0.0 and 1.0)
- setSpecularPower(v: float) None
Set specular power attribute of all the SisypheMesh elements of the current SisypheMeshCollection instance container.
Parameters
- vfloat
specular power (between 0.0 and 50.0)
- setVisibility(v: bool) None
Set visibility attribute of all the SisypheMesh elements of the current SisypheMeshCollection instance container.
Parameters
- vbool
visible if True
- setVisibilityOff() None
Hide all the SisypheMesh elements of the current SisypheMeshCollection instance container.
- setVisibilityOn() None
Show all the SisypheMesh elements of the current SisypheMeshCollection instance container.