SBSurface#
This class describes a renderable surface that stores the triangle geometry of a mesh.
Surfaces are typically obtained from a mesh, but they can also be constructed explicitly from geometry arrays when building custom visual data in Python.
- class samson.SBSurface(self: samson.SBSurface, numberOfTriangles: int, numberOfPositions: int, indexData: list[int], positionData: list[float], normalData: list[float], colorData: list[float], flagData: list[int], nodeIndexData: list[int], textureCoordinateData: list[float], diffuseTexture: SBMVisualModelTexture = None)#
Bases:
pybind11_objectThis class describes a surface.
Constructs a surface from explicit geometry arrays.
Array sizes must match: - indexData: 3 * numberOfTriangles - positionData: 3 * numberOfPositions - normalData: 3 * numberOfPositions - colorData: 4 * numberOfPositions - flagData: numberOfPositions - nodeIndexData: numberOfPositions - textureCoordinateData: 2 * numberOfPositions
- getColorData(self: samson.SBSurface) list[float]#
Returns the color data; size: 4 * numberOfPositions
- getDiffuseTexture(self: samson.SBSurface) SBMVisualModelTexture#
Returns the diffuse texture
- getFlagData(self: samson.SBSurface) list[int]#
Returns the flag data; size: numberOfPositions
- getIndexData(self: samson.SBSurface) list[int]#
Returns the index data; size: 3 * numberOfTriangles
- getNodeIndexData(self: samson.SBSurface) list[int]#
Returns the node index data; size: numberOfPositions
- getNormalData(self: samson.SBSurface) list[float]#
Returns the normal data; size: 3 * numberOfPositions
- getPositionData(self: samson.SBSurface) list[float]#
Returns the position data; size: 3 * numberOfPositions
- getTextureCoordinateData(self: samson.SBSurface) list[float]#
Returns the texture coordinate data; size: 2 * numberOfPositions
- setColorData(self: samson.SBSurface, data: list[float]) None#
Sets the color data; size: 4 * numberOfPositions
- setDiffuseTexture(self: samson.SBSurface, texture: SBMVisualModelTexture) None#
Sets the diffuse texture
- setFlagData(self: samson.SBSurface, data: list[int]) None#
Sets the flag data; size: numberOfPositions
- setIndexData(self: samson.SBSurface, data: list[int]) None#
Sets the index data; size: 3 * numberOfTriangles
- setNodeIndexData(self: samson.SBSurface, data: list[int]) None#
Sets the node index data; size: numberOfPositions
- setNormalData(self: samson.SBSurface, data: list[float]) None#
Sets the normal data; size: 3 * numberOfPositions
- setPositionData(self: samson.SBSurface, data: list[float]) None#
Sets the position data; size: 3 * numberOfPositions
- setTextureCoordinateData(self: samson.SBSurface, data: list[float]) None#
Sets the texture coordinate data; size: 2 * numberOfPositions
- property numberOfPositions#
Number of vertex positions in the surface.
- property numberOfTriangles#
Number of triangles in the surface.