API Reference
Sub-Packages
Internally, pygfx is structured into several sub-packages that provide the functionality exposed in the top-level namespace. At times, you may wish to search the docs of these sub-packages for additional information. In that case, you can read more about them here:
Objects to view a scene. |
|
Objects to control cameras. |
|
Containers for geometry data. |
|
Helpers for visual debugging of scenes. |
|
Linear Algebra Routines (deprecated) |
|
Containers for Material data. |
|
World Objects and Events. |
|
Objects to draw a scene onto a canvas. |
|
Containers for buffers and textures. |
|
Utility functions for pygfx. |
Public API
The primary way of accessing pygfx is by using the members of its top-level namespace. Currently this includes the following classes, which comprise the public API:
|
Generate a box (rectangular cuboid). |
|
Generate a cylinder or a cylinder segment. |
|
Generate a cone or a cone segment. |
|
Generate a sphere. |
|
Generate a plane. |
|
Generic container for Geometry data. |
|
Geometry specific for representing text. |
|
A formatted piece of text. |
|
Convert a Trimesh geometry object to pygfx geometry. |
|
Generate a octahedron. |
|
Generate a icosahedron. |
|
Generate a dodecahedron. |
|
Generate a tetrahedron. |
|
Generate a torus knot. |
|
Generate a Klein bottle. |
|
A WorldObject to indicate the scene's axes. |
|
A WorldObject that shows a grid-shaped wireframe. |
|
A WorldObject that shows a box-shaped wireframe. |
|
Gizmo to manipulate a WorldObject. |
|
Light source indicator for point lights. |
|
Light source indicator for directional lights. |
|
Light source indicator for spot lights. |
|
Material base class. |
|
Convert a Trimesh material object into a pygfx material. |
|
Basic mesh material. |
|
Phong mesh material. |
|
Color from Mesh normals. |
|
Render surface normals as lines. |
|
Display a mesh slice. |
|
PBR shaded material. |
|
Point default material. |
|
A material for points, renders Gaussian blobs with a standard deviation of 1/6 of the size. |
|
Basic line material. |
|
Thin line material. |
|
Thin line segment material. |
|
Line segment material. |
|
Arrow (vector) line material. |
|
Rasterized image material. |
|
Basic volume material. |
|
A material for rendering a slice through a 3D texture at the surface of a mesh. |
|
A material for rendering volumes using raycasting. |
|
A material rendering a volume using MIP rendering. |
|
Solid/Gradient background color. |
|
Image/Skybox background. |
|
Skybox background. |
|
Basic text material. |
|
Base class for objects. |
|
A group of objects. |
|
Root of the scene graph. |
|
The scene's background. |
|
A point cloud. |
|
An object representing a line using a list of vertices (3D positions). |
|
A mesh. |
|
A 2D image. |
|
A 3D image. |
|
A text. |
|
Display a mesh multiple times using instances. |
|
Light Base Class. |
|
Radial point light source. |
|
Directional light source. |
|
Ambient light source. |
|
Directional point light source. |
|
Shadow map utility base class. |
Shadow map utility for directional lights. |
|
Shadow map utility for spot light sources. |
|
Shadow map utility for point light sources. |
|
|
Renderer base class. |
|
Turns Scenes into rasterized images using wgpu. |
|
Turns scenes into SVG images. |
|
Resource base class. |
|
A contigous piece of GPU memory. |
|
Container for textures. |
|
View into a Texture. |
|
A representation of color (in the sRGB colorspace). |
|
Load a scene from a file. |
|
Display a WorldObject |
|
A Helper to display an object or scene |
|
A rectangular area on a renderer. |
Storage and discovery of text glyphs. |
|
Predefined Colormaps. |
|
|
Instances of the Logger class represent a single logging channel. |