mrpt.viz
Package Contents
- class mrpt.viz.AssimpLoadFlags(value: int)
Members:
RealTimeFast
RealTimeQuality
RealTimeMaxQuality
FlipUVs
IgnoreMaterialColor
Verbose
- property name: str
- property value: int
- FlipUVs: ClassVar[AssimpLoadFlags]
- IgnoreMaterialColor: ClassVar[AssimpLoadFlags]
- RealTimeFast: ClassVar[AssimpLoadFlags]
- RealTimeMaxQuality: ClassVar[AssimpLoadFlags]
- RealTimeQuality: ClassVar[AssimpLoadFlags]
- Verbose: ClassVar[AssimpLoadFlags]
- class mrpt.viz.CAnimatedAssimpModel
C++ API: class mrpt::viz::CAnimatedAssimpModel
Bases:
CAssimpModelExtension of CAssimpModel with skeletal animation support.
- getAnimationCount() int
Get number of animations in the model.
- getAnimationDuration(anim_idx: int = 0) float
Get animation duration in seconds.
- getAnimationName(anim_idx: int) str
Get animation name by index.
- loadScene(file_name: str, flags: int = 4116) None
Loads a 3D scene and extracts skeleton/animation data.
- setActiveAnimation(anim_name: str) None
Select which animation to play (by index).
- setActiveAnimationByIndex(idx: int) None
Select which animation to play (by index).
- setAnimationTime(t_seconds: float) None
Set current animation time in seconds. Updates all bone transforms for the active animation and rebuilds the mesh geometry with skinned positions.
- setLooping(loop: bool) None
Enable/disable animation looping.
- class mrpt.viz.CArrow
C++ API: class mrpt::viz::CArrow
Bases:
CVisualObjectA 3D arrow.
- setArrowEnds(x0: float, y0: float, z0: float, x1: float, y1: float, z1: float) None
Sets the arrow start (x0, y0, z0) and end (x1, y1, z1) points.
- setHeadRatio(arg0: float) None
Sets the length of the arrow head, relative to the arrow length.
- setSmallRadius(arg0: float) None
Sets the radius of the arrow body.
- class mrpt.viz.CAssimpModel
C++ API: class mrpt::viz::CAssimpModel
Bases:
CVisualObjectA 3D model loaded from any file format supported by the Assimp library.
- loadScene(file_name: str, flags: int = 4116) None
Loads a 3D scene from a file in any Assimp-supported format.
- class mrpt.viz.CAxis(xmin: float = -1.0, ymin: float = -1.0, zmin: float = -1.0, xmax: float = 1.0, ymax: float = 1.0, zmax: float = 1.0, frequency: float = 1.0, lineWidth: float = 3.0, marks: bool = True)
C++ API: class mrpt::viz::CAxis
Bases:
CVisualObjectDraw a 3D world axis, with coordinate marks at some regular interval.
- enableTickMarks(arg0: bool) None
Shows or hides the tick marks.
- getFrequency() float
Returns the spacing between tick marks.
- getTextScale() float
Returns the size of text labels.
- setAxisLimits(arg0: float, arg1: float, arg2: float, arg3: float, arg4: float, arg5: float) None
Sets the axis limits (xmin, ymin, zmin, xmax, ymax, zmax).
- setFrequency(arg0: float) None
Changes the frequency of the “ticks”.
- setTextScale(arg0: float) None
Sets the size of text labels (default: 0.25).
- class mrpt.viz.CBox
C++ API: class mrpt::viz::CBox
CBox(corner1: mrpt.math.TPoint3D, corner2: mrpt.math.TPoint3D, is_wireframe: bool = False, lineWidth: float = 1.0)
Bases:
CVisualObjectA solid or wireframe box, given its two opposite corners.
- enableBoxBorder(arg0: bool) None
Enable/disable drawing a border around solid boxes.
- getBoxCorners() tuple
Get the current box corners.
- isWireframe() bool
Returns true if wireframe mode is enabled.
- setBoxBorderColor(color: mrpt.img.TColor) None
Color of the box edges, drawn if enableBoxBorder()
- setBoxCorners(arg0: mrpt.math.TPoint3D, arg1: mrpt.math.TPoint3D) None
Set the position and size of the box, from two corners in 3D.
- setWireframe(arg0: bool) None
Sets wireframe rendering mode (true) or solid mode (false, default)
- class mrpt.viz.CCamera
C++ API: class mrpt::viz::CCamera
Bases:
CVisualObjectDefines the intrinsic and extrinsic camera coordinates from which to render a 3D scene.
- setAzimuthDegrees(arg0: float) None
Sets the camera azimuth angle, in degrees.
- setElevationDegrees(arg0: float) None
Sets the camera elevation angle, in degrees.
- setZoomDistance(arg0: float) None
Sets the camera distance to the point it looks at.
- class mrpt.viz.CColorBar(colormap: int = 0, width: float = 0.2, height: float = 1.0, min_col: float = 0.0, max_col: float = 1.0, min_value: float = 0.0, max_value: float = 1.0, label_format: str = '%7.02f', label_font_size: float = 0.05000000074505806)
C++ API: class mrpt::viz::CColorBar
Bases:
CVisualObjectA colorbar indicator. This class renders a colorbar as a 3D object, in the XY plane.
- setColorAndValueLimits(col_min: float, col_max: float, value_min: float, value_max: float) None
Sets the color range and the value range it represents.
- setColormap(colormap: int) None
Sets the colormap, as the integer value of a mrpt.img.TColormap.
- class mrpt.viz.CCylinder
C++ API: class mrpt::viz::CCylinder
CCylinder(baseRadius: float, topRadius: float, height: float = 1.0, slices: int = 20)
Bases:
CVisualObjectA cylinder or cone whose base lies in the XY plane.
- getHeight() float
Gets the cylinder’s height.
- setHeight(arg0: float) None
Changes cylinder’s height.
- setRadii(arg0: float, arg1: float) None
Sets both radii independently.
- setRadius(arg0: float) None
Sets both radii to a single value, configuring the object as a cylinder.
- class mrpt.viz.CDisk
C++ API: class mrpt::viz::CDisk
CDisk(out_radius: float, in_radius: float, slices: int = 50)
Bases:
CVisualObjectA planar disk in the XY plane.
- property in_radius: float
Inner radius.
- property out_radius: float
Outer radius.
- setDiskRadius(out_radius: float, in_radius: float = 0.0) None
Sets the outer and inner radii.
- setSlicesCount(N: int) None
Sets the number of slices (at least 3; default: 50).
- class mrpt.viz.CEllipsoid2D
C++ API: class mrpt::viz::CEllipsoid2D
Bases:
CVisualObjectA 2D ellipse on the XY plane, centered at the origin of this object pose.
- setCovMatrix(arg0: mrpt.math.CMatrixDouble22) None
Like setCovMatrixAndMean(), for mean=zero.
- setQuantiles(arg0: float) None
Changes the scale of the “sigmas” for drawing the ellipse/ellipsoid (default=3, ~97 or ~98% CI); the exact mathematical meaning is: This value of “quantiles” q should be set to the square root of the chi-squared inverse cdf corresponding to the desired confidence interval.
- class mrpt.viz.CEllipsoid3D
C++ API: class mrpt::viz::CEllipsoid3D
Bases:
CVisualObjectA 3D ellipsoid, centered at zero with respect to this object pose.
- set3DsegmentsCount(arg0: int) None
The number of segments of a 3D ellipse (in both “axes”) (default=20)
- setCovMatrix(arg0: mrpt.math.CMatrixDouble33) None
Like setCovMatrixAndMean(), for mean=zero.
- setQuantiles(arg0: float) None
Changes the scale of the “sigmas” for drawing the ellipse/ellipsoid (default=3, ~97 or ~98% CI); the exact mathematical meaning is: This value of “quantiles” q should be set to the square root of the chi-squared inverse cdf corresponding to the desired confidence interval.
- class mrpt.viz.CEllipsoidInverseDepth2D
C++ API: class mrpt::viz::CEllipsoidInverseDepth2D
Bases:
CVisualObjectAn uncertainty ellipse of an (inverse range, yaw) variable, drawn in 2D Cartesian space.
- getQuantiles() float
Returns the number of sigmas of the drawn ellipse (see setQuantiles()).
- getUnderflowMaxRange() float
Returns the range used for points of the ellipsoid that fall in negative ranges.
- setCovMatrix(arg0: mrpt.math.CMatrixDouble22) None
Like setCovMatrixAndMean(), for mean=zero.
- setQuantiles(q: float) None
Changes the scale of the “sigmas” for drawing the ellipse/ellipsoid (default=3, ~97 or ~98% CI); the exact mathematical meaning is: This value of “quantiles” q should be set to the square root of the chi-squared inverse cdf corresponding to the desired confidence interval.
- setUnderflowMaxRange(maxRange: float) None
Sets the range used for points of the ellipsoid that fall in negative ranges (default: 1e6).
- class mrpt.viz.CEllipsoidInverseDepth3D
C++ API: class mrpt::viz::CEllipsoidInverseDepth3D
Bases:
CVisualObjectAn uncertainty ellipsoid of an (inverse range, yaw, pitch) variable, drawn in 3D Cartesian space.
- getQuantiles() float
Returns the number of sigmas of the drawn ellipsoid (see setQuantiles()).
- getUnderflowMaxRange() float
Returns the range used for points of the ellipsoid that fall in negative ranges.
- setCovMatrix(arg0: mrpt.math.CMatrixDouble33) None
Like setCovMatrixAndMean(), for mean=zero.
- setQuantiles(q: float) None
Changes the scale of the “sigmas” for drawing the ellipse/ellipsoid (default=3, ~97 or ~98% CI); the exact mathematical meaning is: This value of “quantiles” q should be set to the square root of the chi-squared inverse cdf corresponding to the desired confidence interval.
- setUnderflowMaxRange(maxRange: float) None
Sets the range used for points of the ellipsoid that fall in negative ranges (default: 1e6).
- class mrpt.viz.CEllipsoidRangeBearing2D
C++ API: class mrpt::viz::CEllipsoidRangeBearing2D
Bases:
CVisualObjectAn uncertainty ellipse of a (range, bearing) variable, drawn in 2D Cartesian space.
- getQuantiles() float
Returns the number of sigmas of the drawn ellipse (see setQuantiles()).
- setCovMatrix(arg0: mrpt.math.CMatrixDouble22) None
Like setCovMatrixAndMean(), for mean=zero.
- setQuantiles(q: float) None
Changes the scale of the “sigmas” for drawing the ellipse/ellipsoid (default=3, ~97 or ~98% CI); the exact mathematical meaning is: This value of “quantiles” q should be set to the square root of the chi-squared inverse cdf corresponding to the desired confidence interval.
- class mrpt.viz.CFrustum
C++ API: class mrpt::viz::CFrustum
CFrustum(near_distance: float, far_distance: float, horz_FOV_degrees: float, vert_FOV_degrees: float, lineWidth: float = 1.0, draw_lines: bool = True, draw_planes: bool = False)
Bases:
CVisualObjectA solid or wireframe frustum in 3D (a rectangular truncated pyramid), with arbitrary (possibly assymetric) field-of-view angles.
- property far_plane: float
Distance to the far plane.
- property horz_fov: float
Horizontal field of view, in degrees.
- property near_plane: float
Distance to the near plane.
- property vert_fov: float
Vertical field of view, in degrees.
- setHorzFOV(fov_degrees: float) None
Changes horizontal FOV (symmetric)
- setNearFarPlanes(near: float, far: float) None
Changes distance of near & far planes.
- setPlaneColor(color: mrpt.img.TColor) None
Sets the color of the planes (line color is set with setColor()).
- setVertFOV(fov_degrees: float) None
Changes vertical FOV (symmetric)
- class mrpt.viz.CGridPlaneXY(xmin: float = -10.0, xmax: float = 10.0, ymin: float = -10.0, ymax: float = 10.0, z: float = 0.0, frequency: float = 1.0)
C++ API: class mrpt::viz::CGridPlaneXY
Bases:
CVisualObjectA grid of lines over the XY plane.
- setGridFrequency(arg0: float) None
Sets the spacing between grid lines.
- setPlaneLimits(xmin: float, xmax: float, ymin: float, ymax: float) None
Sets the grid limits in x and y.
- setPlaneZcoord(arg0: float) None
Sets the grid height (z).
- class mrpt.viz.CGridPlaneXZ(xmin: float = -10.0, xmax: float = 10.0, zmin: float = -10.0, zmax: float = 10.0, y: float = 0.0, frequency: float = 1.0)
C++ API: class mrpt::viz::CGridPlaneXZ
Bases:
CVisualObjectA grid of lines over the XZ plane.
- setGridFrequency(arg0: float) None
Sets the spacing between grid lines.
- setPlaneLimits(xmin: float, xmax: float, zmin: float, zmax: float) None
Sets the grid limits in x and z.
- setPlaneYcoord(arg0: float) None
Sets the grid y coordinate.
- class mrpt.viz.CLight
C++ API: class mrpt::viz::CLight
CLight(light: TLight)
Bases:
CVisualObjectA light source placed in the scene graph: its position and direction are relative to the pose of this object and its parents. It is switched on and off with setVisibility().
- class mrpt.viz.CMesh(enable_transparency: bool = False, xMin: float = -1.0, xMax: float = 1.0, yMin: float = -1.0, yMax: float = 1.0)
C++ API: class mrpt::viz::CMesh
Bases:
CVisualObjectA planar (XY) grid where each cell has an associated height and, optionally, a texture map.
- enableColorFromZ(v: bool) None
Enable color from Z height using HOT colormap
- enableTransparency(v: bool) None
Enables or disables transparency.
- enableWireFrame(v: bool) None
Shows the mesh as wireframe (true) or solid (false).
- setGridLimits(xMin: float, xMax: float, yMin: float, yMax: float) None
Sets the x and y limits of the grid.
- setZ(Z: numpy.ndarray) None
Set height matrix (numpy float32 2D array)
- class mrpt.viz.CMesh3D
C++ API: class mrpt::viz::CMesh3D
Bases:
CVisualObjectA 3D mesh composed of triangles and/or quads. A typical usage example would be a 3D model of an object.
- enableFaceNormals(v: bool) None
Enables or disables computing normals per face.
- enableShowEdges(v: bool) None
Shows or hides the edges.
- enableShowFaces(v: bool) None
Shows or hides the faces.
- enableShowVertices(v: bool) None
Shows or hides the vertices.
- loadMesh(vertices: numpy.ndarray, face_vertices: numpy.ndarray, verts_per_face: numpy.ndarray) None
Load a mesh from numpy arrays: vertices (Nx3 float32), face_vertices (M,) int32, verts_per_face (F,) int32
- class mrpt.viz.CMeshFast(enable_transparency: bool = False, xMin: float = -1.0, xMax: float = 1.0, yMin: float = -1.0, yMax: float = 1.0)
C++ API: class mrpt::viz::CMeshFast
Bases:
CVisualObjectA planar (XY) grid where each cell has an associated height and, optionally, a texture map.
- enableColorFromZ(v: bool, colormap: int = 4) None
Enable color from Z height (colormap int)
- enableTransparency(v: bool) None
Enables or disables transparency.
- setGridLimits(xmin: float, xmax: float, ymin: float, ymax: float) None
Sets the x and y limits of the grid.
- setZ(Z: numpy.ndarray) None
Set height matrix (numpy float32 2D array)
- class mrpt.viz.COctoMapVoxels
C++ API: class mrpt::viz::COctoMapVoxels
Bases:
CVisualObjectRenders voxels, typically from a 3D octomap.
- clear() None
Clears everything.
- enableCubeTransparency(enable: bool) None
Enables or disables using the alpha channel of the voxel colors.
- enableLights(enable: bool) None
Can be used to enable/disable the effects of lighting in this object.
- getVoxelCount(set_index: int) int
Returns the total count of voxels in one voxel set.
- getVoxelSetCount() int
Returns the number of voxel sets.
- push_back_Voxel(set_index: int, x: float, y: float, z: float, side: float, r: int = 200, g: int = 200, b: int = 200, a: int = 255) None
Appends a voxel (center, side length and RGBA color) to a voxel set.
- resizeVoxelSets(n: int) None
Sets the number of voxel sets.
- resizeVoxels(set_index: int, n: int) None
Sets the number of voxels in one voxel set.
- setVisualizationMode(mode: OctoMapVisualizationMode) None
Select the visualization mode. To have any effect, this method has to be called before loading the octomap.
- showGridLines(show: bool) None
Shows/hides the grid lines.
- showVoxels(voxel_set: int, show: bool) None
Shows or hides the voxels of one voxel set.
- showVoxelsAsPoints(enable: bool) None
For quick renders: render voxels as points instead of cubes.
- class mrpt.viz.COrbitCameraController
C++ API: class mrpt::viz::COrbitCameraController
Framework-agnostic orbit/pan/zoom camera controller.
- azimuth_deg: float
- elevation_deg: float
- roll_deg: float
- zoom: float
- onMouseButton(x: int, y: int, button: int, down: bool) None
Call on button press/release.
- onMouseMove(x: int, y: int, buttons: int, modifiers: int) None
Call on mouse-move events while any button is held.
- onScroll(delta: float, modifiers: int) None
Call on scroll-wheel events.
- setAzimuthDegrees(deg: float) None
Sets the camera azimuth angle, in degrees.
- setCameraPointing(x: float, y: float, z: float) None
Sets the point the camera looks at (x, y, z).
- setElevationDegrees(deg: float) None
Sets the camera elevation angle, in degrees.
- setZoomDistance(d: float) None
Sets the camera distance to the point it looks at.
- class mrpt.viz.CPointCloud
C++ API: class mrpt::viz::CPointCloud
Bases:
CVisualObjectA cloud of points, all with the same color or each depending on its value along a particular coordinate axis.
- clear() None
Empty the list of points.
- getPointSize() float
Returns the rendered point size, in pixels.
- insertPoint(x: float, y: float, z: float) None
Adds a new point to the cloud.
- setPointSize(pointSize: float) None
Point size, in pixels
- setPoints(arg0: numpy.ndarray) None
Sets all points from a NumPy array of shape (N, 3).
- class mrpt.viz.CPointCloudColoured
C++ API: class mrpt::viz::CPointCloudColoured
Bases:
CVisualObjectA cloud of points, each one with an individual color (R,G,B,A).
- clear() None
Erase all the points.
- getPointSize() float
Returns the rendered point size, in pixels.
- push_back(x: float, y: float, z: float, r: float = 1.0, g: float = 1.0, b: float = 1.0, a: float = 1.0) None
Inserts a new point into the point cloud.
- setPointSize(pointSize: float) None
Point size, in pixels
- size() int
Return the number of points.
- class mrpt.viz.CPolyhedron
C++ API: class mrpt::viz::CPolyhedron
Bases:
CVisualObjectThis class represents arbitrary polyhedra. The class includes a set of static methods to create common polyhedrons.
- static CreateCuboctahedron(radius: float) CPolyhedron
Creates a cuboctahedron, consisting of six square faces and eight triangular ones (see http://en.wikipedia.org/wiki/Cuboctahedron).
- static CreateDodecahedron(radius: float) CPolyhedron
Creates a regular dodecahedron (see http://en.wikipedia.org/wiki/Dodecahedron).
- static CreateHexahedron(radius: float) CPolyhedron
Creates a regular cube, also called hexahedron (see http://en.wikipedia.org/wiki/Hexahedron).
- static CreateIcosahedron(radius: float) CPolyhedron
Creates a regular icosahedron (see http://en.wikipedia.org/wiki/Icosahedron).
- static CreateIcosidodecahedron(radius: float, type: bool = True) CPolyhedron
Creates an icosidodecahedron, with 12 pentagons and 20 triangles (see http://en.wikipedia.org/wiki/Icosidodecahedron).
- static CreateOctahedron(radius: float) CPolyhedron
Creates a regular octahedron (see http://en.wikipedia.org/wiki/Octahedron).
- static CreateTetrahedron(radius: float) CPolyhedron
Creates a regular tetrahedron (see http://en.wikipedia.org/wiki/Tetrahedron).
- static CreateTruncatedHexahedron(radius: float) CPolyhedron
Creates a truncated hexahedron, with six octogonal faces and eight triangular ones (see http://en.wikipedia.org/wiki/Truncated_hexahedron).
- static CreateTruncatedIcosahedron(radius: float) CPolyhedron
Creates a truncated icosahedron, consisting of 20 hexagons and 12 pentagons.
- static CreateTruncatedOctahedron(radius: float) CPolyhedron
Creates a truncated octahedron, with eight hexagons and eight squares (see http://en.wikipedia.org/wiki/Truncated_octahedron).
- static CreateTruncatedTetrahedron(radius: float) CPolyhedron
Creates a truncated tetrahedron, consisting of four triangular faces and for hexagonal ones (see http://en.wikipedia.org/wiki/Truncated_tetrahedron).
- class mrpt.viz.CSetOfLines
C++ API: class mrpt::viz::CSetOfLines
Bases:
CVisualObjectA set of independent lines (or segments), one line with its own start and end positions (X,Y,Z).
- appendLine(x0: float, y0: float, z0: float, x1: float, y1: float, z1: float) None
- appendLine(arg0: mrpt.math.TSegment3D) None
Appends a segment.
- clear() None
Clear the list of segments.
- class mrpt.viz.CSetOfObjects
C++ API: class mrpt::viz::CSetOfObjects
Bases:
CVisualObjectA group of 3D objects, placed relative to the pose of this object.
- clear() None
Removes all objects.
- insert(obj: CVisualObject) None
Adds an object to the set.
- class mrpt.viz.CSetOfTexturedTriangles
C++ API: class mrpt::viz::CSetOfTexturedTriangles
Bases:
CVisualObjectA set of textured triangles. This class can be used to draw any solid, arbitrarily complex object with textures.
- clearTriangles() None
Removes all triangles.
- getTrianglesCount() int
Returns the number of triangles.
- class mrpt.viz.CSetOfTriangles
C++ API: class mrpt::viz::CSetOfTriangles
Bases:
CVisualObjectA set of colored triangles, able to draw any solid, arbitrarily complex object without textures.
- clearTriangles() None
Clear this object, removing all triangles.
- getTrianglesCount() int
Get triangle count.
- class mrpt.viz.CSimpleLine
C++ API: class mrpt::viz::CSimpleLine
Bases:
CVisualObjectA line segment.
- getLineEnd() mrpt.math.TPoint3Df
Returns the line end point.
- getLineStart() mrpt.math.TPoint3Df
Returns the line start point.
- setLineCoords(x0: float, y0: float, z0: float, x1: float, y1: float, z1: float) None
Sets the line end points (x0, y0, z0, x1, y1, z1).
- class mrpt.viz.CSkyBox
C++ API: class mrpt::viz::CSkyBox
Bases:
CVisualObjectA Sky Box: 6 textures that are always rendered at “infinity” to give the impression of the scene to be much larger.
- assignImage(face: CubeTextureFace, img: mrpt.img.CImage) None
Assigns a texture. It is mandatory to assign all 6 faces before initializing/rendering the texture.
- class mrpt.viz.CSphere(radius: float = 1.0, nDivs: int = 20)
C++ API: class mrpt::viz::CSphere
Bases:
CVisualObjectA solid or wire-frame sphere.
- getRadius() float
Returns the sphere radius.
- setNumberDivs(arg0: int) None
Sets the number of slices and stacks used to render the sphere.
- setRadius(arg0: float) None
Sets the sphere radius.
- class mrpt.viz.CText
C++ API: class mrpt::viz::CText
CText(text: str)
Bases:
CVisualObjectA 2D text label at a 3D position, always facing the camera.
- getString() str
Return the current text associated to this label.
- setFont(arg0: str, arg1: int) None
Sets the font among “sans”, “serif”, “mono”.
- setString(arg0: str) None
Sets the text to display.
- class mrpt.viz.CText3D(text: str = '', fontName: str = 'sans', scale: float = 1.0)
C++ API: class mrpt::viz::CText3D
Bases:
CVisualObjectA 3D text (rendered with OpenGL primitives), with selectable font face and drawing style.
- getString() str
Returns the currently text associated to this object.
- setString(arg0: str) None
Sets the displayed string.
- class mrpt.viz.CTexturedPlane(x_min: float = -1.0, x_max: float = 1.0, y_min: float = -1.0, y_max: float = 1.0)
C++ API: class mrpt::viz::CTexturedPlane
Bases:
CVisualObjectA 2D plane in the XY plane with a texture image.
- enableLighting(enable: bool = True) None
Enables or disables lighting on the plane.
- getPlaneCorners() tuple
Get the coordinates of the four corners that define the plane on the XY plane.
- setPlaneCorners(xMin: float, xMax: float, yMin: float, yMax: float) None
Set the coordinates of the four corners that define the plane on the XY plane.
- setTextureRepeat(repeatX: float, repeatY: float) None
Set the number of times the texture repeats in each direction.
- class mrpt.viz.CVectorField2D
C++ API: class mrpt::viz::CVectorField2D
Bases:
CVisualObjectA 2D vector field representation, consisting of points and arrows drawn on a plane (invisible grid).
- clear() None
Clear the matrices.
- setGridCenterAndCellSize(cx: float, cy: float, cell_x: float, cell_y: float) None
Set the coordinates of the grid on where the vector field will be drawn by setting its center and the cell size.
- setGridLimits(xmin: float, xmax: float, ymin: float, ymax: float) None
Set the coordinates of the grid on where the vector field will be drawn using x-y max and min values.
- setPointColor(R: float, G: float, B: float, A: float = 1.0) None
Set the point color in the range [0,1].
- setVectorField(vx: numpy.ndarray, vy: numpy.ndarray) None
Sets the vector components at each grid cell, as 2D float arrays of equal shape.
- setVectorFieldColor(R: float, G: float, B: float, A: float = 1.0) None
Set the arrow color in the range [0,1].
- class mrpt.viz.CVectorField3D
C++ API: class mrpt::viz::CVectorField3D
Bases:
CVisualObjectA 3D vector field representation, consisting of points and arrows drawn at any spatial position.
- clear() None
Clear the matrices.
- setMaxSpeedForColor(s: float) None
Set the max speed associated for the color map ( m_still_color, m_maxspeed_color)
- setPointColor(R: float, G: float, B: float, A: float = 1.0) None
Set the point color in the range [0,1].
- setPointCoordinates(px: numpy.ndarray, py: numpy.ndarray, pz: numpy.ndarray) None
Sets the point coordinates, as 2D float arrays of equal shape.
- setVectorField(vx: numpy.ndarray, vy: numpy.ndarray, vz: numpy.ndarray) None
Sets the vector components at each point, as 2D float arrays of equal shape.
- setVectorFieldColor(R: float, G: float, B: float, A: float = 1.0) None
Set the arrow color in the range [0,1].
- class mrpt.viz.CubeTextureFace(value: int)
Members:
LEFT
RIGHT
TOP
BOTTOM
FRONT
BACK
- property name: str
- property value: int
- BACK: ClassVar[CubeTextureFace]
- BOTTOM: ClassVar[CubeTextureFace]
- FRONT: ClassVar[CubeTextureFace]
- LEFT: ClassVar[CubeTextureFace]
- RIGHT: ClassVar[CubeTextureFace]
- TOP: ClassVar[CubeTextureFace]
- class mrpt.viz.OctoMapVisualizationMode(value: int)
Members:
FIXED : All voxels have the same fixed color
COLOR_FROM_HEIGHT : Color voxels by height
COLOR_FROM_OCCUPANCY : Color by occupancy probability
TRANSPARENCY_FROM_OCCUPANCY : Transparency from occupancy
TRANS_AND_COLOR_FROM_OCCUPANCY : Both transparency and color from occupancy
COLOR_FROM_RGB_DATA : Use per-voxel stored RGB
- property name: str
- property value: int
- COLOR_FROM_HEIGHT: ClassVar[OctoMapVisualizationMode]
- COLOR_FROM_OCCUPANCY: ClassVar[OctoMapVisualizationMode]
- COLOR_FROM_RGB_DATA: ClassVar[OctoMapVisualizationMode]
- FIXED: ClassVar[OctoMapVisualizationMode]
- TRANSPARENCY_FROM_OCCUPANCY: ClassVar[OctoMapVisualizationMode]
- TRANS_AND_COLOR_FROM_OCCUPANCY: ClassVar[OctoMapVisualizationMode]
- class mrpt.viz.Scene
C++ API: class mrpt::viz::Scene
A 3D scene: one or more viewports, each with a set of objects to render.
- clear(createMainViewport: bool = True) None
Removes all objects (and viewports), then re-creates the main viewport
- getViewport(name: str = 'main') Viewport
Returns the viewport with the given name (default: “main”), or None.
- insert(arg0: CVisualObject) None
Insert a new object into the scene, in the given viewport (by default, into the “main” viewport).
- class mrpt.viz.TLight
C++ API: struct mrpt::viz::TLight
A single light source (directional, point, or spot).
- property cast_shadows: bool
Whether this Point/Spot light casts shadows (cube shadow map, default: False).
- property range: float
Maximum reach of Point/Spot lights [m], where the light fades to zero (0=unlimited).
- attenuation_constant: float
- attenuation_linear: float
- attenuation_quadratic: float
- diffuse: float
- direction: mrpt.math.TPoint3Df
- position: mrpt.math.TPoint3Df
- specular: float
- spot_inner_cutoff_deg: float
- spot_outer_cutoff_deg: float
- type: TLightType
- static Directional(dir: mrpt.math.TPoint3Df, r: float = 1.0, g: float = 1.0, b: float = 1.0, diffuse: float = 0.800000011920929, specular: float = 0.949999988079071) TLight
Factory: creates a directional light.
- class mrpt.viz.TLightType(value: int)
Members:
Directional
Point
Spot
- property name: str
- property value: int
- Directional: ClassVar[TLightType]
- Point: ClassVar[TLightType]
- Spot: ClassVar[TLightType]
- class mrpt.viz.TTriangle
C++ API: struct mrpt::viz::TTriangle
TTriangle(p1: mrpt.math.TPoint3Df, p2: mrpt.math.TPoint3Df, p3: mrpt.math.TPoint3Df)
A triangle (float coordinates) with RGBA colors (u8) and UV (texture coordinates) for each vertex.
- vertices: list[TTriangleVertex]
- computeNormals() None
Compute the three normals from the cross-product of “v01 x v02”.
- class mrpt.viz.TTriangleVertex
One vertex of a TTriangle: position, color, normal and texture coordinates.
- setColor(color: mrpt.img.TColor) None
Set vertex color from TColor
- class mrpt.viz.Viewport
C++ API: class mrpt::viz::Viewport
A viewport within a Scene, containing a set of OpenGL objects to render.
- property name: str
Returns the name of the viewport.
- clear() None
Removes all objects.
- insert(obj: CVisualObject) None
Adds an object to the viewport.
- setCustomBackgroundColor(arg0: mrpt.img.TColorf) None
Defines the viewport background color.
- setViewportPosition(arg0: float, arg1: float, arg2: float, arg3: float) None
Change the viewport position and dimension on the rendering window.
- mrpt.viz.create_point_cloud(pts_array, color=(255, 255, 255))
Returns a CPointCloud with the points of an (N, 3) array, in one color (R, G, B, 0-255).
- mrpt.viz.posePDF2opengl(pdf: mrpt.poses.CPosePDF) CSetOfObjects
- mrpt.viz.posePDF2opengl(pdf: mrpt.poses.CPose3DPDF) CSetOfObjects
Returns a 3D representation of a 3D pose PDF (ellipsoids, particles, …)