0.1.33
Loading...
Searching...
No Matches
pyhelios.Visualizer.Visualizer Class Reference

High-level interface for 3D visualization and rendering. More...

Detailed Description

High-level interface for 3D visualization and rendering.

This class provides a user-friendly wrapper around the native Helios visualizer plugin with automatic plugin availability checking and graceful error handling.

The visualizer provides OpenGL-based 3D rendering with interactive controls, image export, and comprehensive scene configuration options.

Definition at line 136 of file Visualizer.py.

Public Member Functions

 __init__ (self, int width, int height, int antialiasing_samples=4, bool headless=False)
 Initialize Visualizer with graceful plugin handling.
 
 __enter__ (self)
 Context manager entry.
 
 __exit__ (self, exc_type, exc_value, traceback)
 Context manager exit with proper cleanup.
 
None buildContextGeometry (self, Context context, Optional[List[int]] uuids=None)
 Build Context geometry in the visualizer.
 
None plotInteractive (self)
 Open interactive visualization window.
 
None plotUpdate (self)
 Update visualization (non-interactive).
 
None printWindow (self, str filename, Optional[str] image_format=None)
 Save current visualization to image file.
 
None closeWindow (self)
 Close visualization window.
 
None setCameraPosition (self, vec3 position, vec3 lookAt)
 Set camera position using Cartesian coordinates.
 
None setCameraPositionSpherical (self, SphericalCoord angle, vec3 lookAt)
 Set camera position using spherical coordinates.
 
None setBackgroundColor (self, RGBcolor color)
 Set background color.
 
None setBackgroundTransparent (self)
 Enable transparent background mode (v1.3.53+).
 
None setBackgroundImage (self, str texture_file)
 Set custom background image texture (v1.3.53+).
 
None setBackgroundSkyTexture (self, Optional[str] texture_file=None, int divisions=50)
 Set sky sphere texture background with automatic scaling (v1.3.53+).
 
None setLightDirection (self, vec3 direction)
 Set light direction.
 
None setLightingModel (self, Union[int, str] lighting_model)
 Set lighting model.
 
None colorContextPrimitivesByData (self, str data_name, Optional[List[int]] uuids=None)
 Color context primitives based on primitive data values.
 
None setCameraFieldOfView (self, float angle_FOV)
 Set camera field of view angle.
 
Tuple[vec3, vec3getCameraPosition (self)
 Get current camera position and look-at point.
 
RGBcolor getBackgroundColor (self)
 Get current background color.
 
None setLightIntensityFactor (self, float intensity_factor)
 Set light intensity scaling factor.
 
Tuple[int, int] getWindowSize (self)
 Get window size in pixels.
 
Tuple[int, int] getFramebufferSize (self)
 Get framebuffer size in pixels.
 
None printWindowDefault (self)
 Print window with default filename.
 
None displayImageFromPixels (self, List[int] pixel_data, int width, int height)
 Display image from RGBA pixel data.
 
None displayImageFromFile (self, str filename)
 Display image from file.
 
None displayImageWithBoundingBoxes (self, str image_file, str bbox_file, str classes_file="", float line_width=2.0, int fontsize=12)
 Display an image with YOLO bounding boxes overlaid.
 
None displayImageWithSegmentationMasks (self, str image_file, str mask_file, float fill_opacity=0.4, float line_width=2.0, int fontsize=12, bool show_labels=True)
 Display an image with COCO segmentation masks overlaid.
 
None enableExactColorMode (self)
 Render primitive colors exactly as they are set in the Context.
 
None disableExactColorMode (self)
 Restore the default brightening of primitive colors.
 
None enableLinearPipeline (self)
 Enable the physically-based linear-light rendering pipeline.
 
None disableLinearPipeline (self)
 Disable the linear-light pipeline, shading directly in sRGB space.
 
bool isLinearPipelineEnabled (self)
 Check whether the linear-light rendering pipeline is enabled.
 
None setExposure (self, float exposure)
 Set the linear exposure multiplier applied before tone mapping.
 
float getExposure (self)
 Get the linear exposure multiplier applied before tone mapping.
 
None setPhongMaterial (self, float ambient, float diffuse, float specular, float shininess)
 Set the Phong material parameters used to shade Context primitives.
 
Tuple[float, float, float, float] getPhongMaterial (self)
 Get the Phong material parameters used to shade Context primitives.
 
None setAmbientColors (self, RGBcolor sky_color, RGBcolor ground_color)
 Set the hemispheric ambient sky and ground-bounce colors.
 
RGBcolor getAmbientSkyColor (self)
 Get the hemispheric ambient sky color.
 
RGBcolor getAmbientGroundColor (self)
 Get the hemispheric ambient ground-bounce color.
 
None enableSmoothShading (self)
 Enable smooth per-vertex-normal shading.
 
None disableSmoothShading (self)
 Select flat (per-face) shading.
 
bool isSmoothShadingEnabled (self)
 Check whether smooth per-vertex-normal shading is enabled.
 
bool isHeadlessMultisamplingActive (self)
 Check whether headless rendering obtained multisampled framebuffer attachments.
 
vec2 getTextboxSize (self, str textstring, int fontsize, str fontname)
 Measure the rendered size of a text string without adding it to the visualizer.
 
 getWindowPixelsRGB (self, Optional[List[int]] buffer=None)
 Get RGB pixel data from the current window.
 
Tuple[List[float], int, int] getDepthMap (self)
 Get depth map from current window.
 
None plotDepthMap (self)
 Plot depth map visualization.
 
None clearGeometry (self)
 Clear all geometry from visualizer.
 
None clearContextGeometry (self)
 Clear context geometry from visualizer.
 
None deleteGeometry (self, int geometry_id)
 Delete specific geometry by ID.
 
None updateContextPrimitiveColors (self)
 Update context primitive colors.
 
List[vec3getGeometryVertices (self, int geometry_id)
 Get vertices of a geometry primitive.
 
None setGeometryVertices (self, int geometry_id, List[vec3] vertices)
 Set vertices of a geometry primitive.
 
None addCoordinateAxes (self)
 Add coordinate axes at origin with unit length.
 
None addCoordinateAxesCustom (self, vec3 origin, vec3 length, str sign="both")
 Add coordinate axes with custom properties.
 
None disableCoordinateAxes (self)
 Remove coordinate axes.
 
None addGridWireFrame (self, vec3 center, vec3 size, List[int] subdivisions)
 Add grid wireframe.
 
None enableColorbar (self)
 Enable colorbar.
 
None disableColorbar (self)
 Disable colorbar.
 
None setColorbarPosition (self, vec3 position)
 Set colorbar position.
 
None setColorbarSize (self, float width, float height)
 Set colorbar size.
 
None setColorbarRange (self, float min_val, float max_val)
 Set colorbar range.
 
None setColorbarTicks (self, List[float] ticks)
 Set colorbar tick marks.
 
None setColorbarTitle (self, str title)
 Set colorbar title.
 
None setColorbarFontColor (self, RGBcolor color)
 Set colorbar font color.
 
None setColorbarFontSize (self, int font_size)
 Set colorbar font size.
 
None setColormap (self, Union[int, str] colormap)
 Set predefined colormap.
 
None setCustomColormap (self, List[RGBcolor] colors, List[float] divisions)
 Set custom colormap.
 
None colorContextPrimitivesByObjectData (self, str data_name, Optional[List[int]] obj_ids=None)
 Color context primitives by object data.
 
None colorContextPrimitivesRandomly (self, Optional[List[int]] uuids=None)
 Color context primitives randomly.
 
None colorContextObjectsRandomly (self, Optional[List[int]] obj_ids=None)
 Color context objects randomly.
 
None clearColor (self)
 Clear primitive colors from previous coloring operations.
 
None hideWatermark (self)
 Hide Helios logo watermark.
 
None showWatermark (self)
 Show Helios logo watermark.
 
None updateWatermark (self)
 Update watermark geometry to match current window size.
 
None hideNavigationGizmo (self)
 Hide navigation gizmo (coordinate axes indicator in corner).
 
None showNavigationGizmo (self)
 Show navigation gizmo (coordinate axes indicator in corner).
 
None enableMessages (self)
 Enable standard output from visualizer plugin.
 
None disableMessages (self)
 Disable standard output from visualizer plugin.
 
None plotOnce (self, bool get_keystrokes=True)
 Run one rendering loop.
 
None plotUpdateWithVisibility (self, bool hide_window=False)
 Update visualization with window visibility control.
 
None setPointCullingEnabled (self, bool enabled)
 Enable or disable point cloud culling optimization.
 
None setPointCullingThreshold (self, int threshold)
 Set the minimum number of points required to trigger culling.
 
None setPointMaxRenderDistance (self, float distance)
 Set the maximum rendering distance for points.
 
None setPointLODFactor (self, float factor)
 Set the level-of-detail factor for distance-based culling.
 
dict getPointRenderingMetrics (self)
 Get point cloud rendering performance metrics.
 
 __del__ (self)
 Destructor to ensure proper cleanup.
 

Public Attributes

 width = width
 
 height = height
 
 antialiasing_samples = antialiasing_samples
 
 headless = headless
 
 visualizer = None
 

Static Public Attributes

int LIGHTING_NONE = 0
 
int LIGHTING_PHONG = 1
 
int LIGHTING_PHONG_SHADOWED = 2
 
int COLORMAP_HOT = 0
 
int COLORMAP_COOL = 1
 
int COLORMAP_RAINBOW = 2
 
int COLORMAP_LAVA = 3
 
int COLORMAP_PARULA = 4
 
int COLORMAP_GRAY = 5
 

Protected Member Functions

 _check_context_alive (self)
 Raise if a Context was loaded and has since been destroyed.
 

Protected Attributes

 _context
 

Constructor & Destructor Documentation

◆ __init__()

pyhelios.Visualizer.Visualizer.__init__ ( self,
int width,
int height,
int antialiasing_samples = 4,
bool headless = False )

Initialize Visualizer with graceful plugin handling.

Parameters
widthWindow width in pixels
heightWindow height in pixels
antialiasing_samplesNumber of antialiasing samples (default: 4). Pass 0 to disable antialiasing, which is required for exact color reproduction – see :meth:enableExactColorMode.
headlessEnable headless mode for offscreen rendering (default: False)
Exceptions
VisualizerErrorIf visualizer plugin is not available
ValueErrorIf parameters are invalid

Definition at line 166 of file Visualizer.py.

◆ __del__()

pyhelios.Visualizer.Visualizer.__del__ ( self)

Destructor to ensure proper cleanup.

Definition at line 2732 of file Visualizer.py.

Member Function Documentation

◆ __enter__()

pyhelios.Visualizer.Visualizer.__enter__ ( self)

Context manager entry.

Definition at line 266 of file Visualizer.py.

◆ __exit__()

pyhelios.Visualizer.Visualizer.__exit__ ( self,
exc_type,
exc_value,
traceback )

Context manager exit with proper cleanup.

Definition at line 270 of file Visualizer.py.

◆ _check_context_alive()

pyhelios.Visualizer.Visualizer._check_context_alive ( self)
protected

Raise if a Context was loaded and has since been destroyed.

Definition at line 261 of file Visualizer.py.

◆ addCoordinateAxes()

None pyhelios.Visualizer.Visualizer.addCoordinateAxes ( self)

Add coordinate axes at origin with unit length.

Exceptions
VisualizerErrorIf operation fails

Definition at line 1885 of file Visualizer.py.

◆ addCoordinateAxesCustom()

None pyhelios.Visualizer.Visualizer.addCoordinateAxesCustom ( self,
vec3 origin,
vec3 length,
str sign = "both" )

Add coordinate axes with custom properties.

Parameters
originAxes origin position
lengthAxes length in each direction
signAxis direction ("both" or "positive")
Exceptions
ValueErrorIf parameters are invalid
VisualizerErrorIf operation fails

Definition at line 1906 of file Visualizer.py.

◆ addGridWireFrame()

None pyhelios.Visualizer.Visualizer.addGridWireFrame ( self,
vec3 center,
vec3 size,
List[int] subdivisions )

Add grid wireframe.

Parameters
centerGrid center position
sizeGrid size in each direction
subdivisionsGrid subdivisions [x, y, z]
Exceptions
ValueErrorIf parameters are invalid
VisualizerErrorIf operation fails

Definition at line 1951 of file Visualizer.py.

◆ buildContextGeometry()

None pyhelios.Visualizer.Visualizer.buildContextGeometry ( self,
Context context,
Optional[List[int]] uuids = None )

Build Context geometry in the visualizer.

   This method loads geometry from a Helios Context into the visualizer
   for rendering. If no UUIDs are specified, all geometry is loaded.
Parameters
contextHelios Context instance containing geometry
uuidsOptional list of primitive UUIDs to visualize (default: all)
Exceptions
VisualizerErrorIf geometry building fails
ValueErrorIf parameters are invalid

Definition at line 296 of file Visualizer.py.

◆ clearColor()

None pyhelios.Visualizer.Visualizer.clearColor ( self)

Clear primitive colors from previous coloring operations.

Exceptions
VisualizerErrorIf operation fails

Definition at line 2368 of file Visualizer.py.

◆ clearContextGeometry()

None pyhelios.Visualizer.Visualizer.clearContextGeometry ( self)

Clear context geometry from visualizer.

Exceptions
VisualizerErrorIf operation fails

Definition at line 1756 of file Visualizer.py.

◆ clearGeometry()

None pyhelios.Visualizer.Visualizer.clearGeometry ( self)

Clear all geometry from visualizer.

Warning
Do NOT use this to refresh a scene between animation frames. The visualizer syncs from the Context incrementally using the Context's dirty flags. Clearing discards the visualizer's geometry while the Context primitives remain marked clean, so the next rebuild pulls in nothing and subsequent frames render empty – printWindow() then silently writes no file.

To animate a changing Context, just call buildContextGeometry() and plotUpdate() each frame without clearing; additions, deletions and modifications are all picked up automatically.

Exceptions
VisualizerErrorIf operation fails

Definition at line 1741 of file Visualizer.py.

◆ closeWindow()

None pyhelios.Visualizer.Visualizer.closeWindow ( self)

Close visualization window.

   This method closes any open visualization window. It's safe to call
   even if no window is open.
Exceptions
VisualizerErrorIf window closing fails

Definition at line 475 of file Visualizer.py.

◆ colorContextObjectsRandomly()

None pyhelios.Visualizer.Visualizer.colorContextObjectsRandomly ( self,
Optional[List[int]] obj_ids = None )

Color context objects randomly.

Parameters
obj_idsOptional list of object IDs to color (None for all)
Exceptions
ValueErrorIf object IDs are invalid
VisualizerErrorIf operation fails

Definition at line 2341 of file Visualizer.py.

◆ colorContextPrimitivesByData()

None pyhelios.Visualizer.Visualizer.colorContextPrimitivesByData ( self,
str data_name,
Optional[List[int]] uuids = None )

Color context primitives based on primitive data values.

   This method maps primitive data values to colors using the current colormap.
   The visualization will be updated to show data variations across primitives.

   The data must have been previously set on the primitives in the Context using
   context.setPrimitiveDataFloat(UUID, data_name, value) before calling this method.
Parameters
data_nameName of the primitive data to use for coloring. This should match the data label used with setPrimitiveDataFloat().
uuidsOptional list of specific primitive UUIDs to color. If None, all primitives in context will be colored.
Exceptions
VisualizerErrorIf visualizer is not initialized or operation fails
ValueErrorIf data_name is invalid or UUIDs are malformed
Example
>>> # Set data on primitives in context >>> context.setPrimitiveDataFloat(patch_uuid, "radiation_flux_SW", 450.2) >>> context.setPrimitiveDataFloat(triangle_uuid, "radiation_flux_SW", 320.1) >>> >>> # Build geometry and color by data >>> visualizer.buildContextGeometry(context) >>> visualizer.colorContextPrimitivesByData("radiation_flux_SW") >>> visualizer.plotInteractive()
>>> # Color only specific primitives >>> visualizer.colorContextPrimitivesByData("temperature", [uuid1, uuid2, uuid3])

Definition at line 768 of file Visualizer.py.

◆ colorContextPrimitivesByObjectData()

None pyhelios.Visualizer.Visualizer.colorContextPrimitivesByObjectData ( self,
str data_name,
Optional[List[int]] obj_ids = None )

Color context primitives by object data.

Parameters
data_nameName of object data to use for coloring
obj_idsOptional list of object IDs to color (None for all)
Exceptions
ValueErrorIf parameters are invalid
VisualizerErrorIf operation fails

Definition at line 2276 of file Visualizer.py.

◆ colorContextPrimitivesRandomly()

None pyhelios.Visualizer.Visualizer.colorContextPrimitivesRandomly ( self,
Optional[List[int]] uuids = None )

Color context primitives randomly.

Parameters
uuidsOptional list of primitive UUIDs to color (None for all)
Exceptions
ValueErrorIf UUIDs are invalid
VisualizerErrorIf operation fails

Definition at line 2310 of file Visualizer.py.

◆ deleteGeometry()

None pyhelios.Visualizer.Visualizer.deleteGeometry ( self,
int geometry_id )

Delete specific geometry by ID.

Parameters
geometry_idID of geometry to delete
Exceptions
ValueErrorIf geometry ID is invalid
VisualizerErrorIf operation fails

Definition at line 1775 of file Visualizer.py.

◆ disableColorbar()

None pyhelios.Visualizer.Visualizer.disableColorbar ( self)

Disable colorbar.

Exceptions
VisualizerErrorIf operation fails

Definition at line 1995 of file Visualizer.py.

◆ disableCoordinateAxes()

None pyhelios.Visualizer.Visualizer.disableCoordinateAxes ( self)

Remove coordinate axes.

Exceptions
VisualizerErrorIf operation fails

Definition at line 1930 of file Visualizer.py.

◆ disableExactColorMode()

None pyhelios.Visualizer.Visualizer.disableExactColorMode ( self)

Restore the default brightening of primitive colors.

   This also restores the linear-light pipeline (see :meth:`enableLinearPipeline`).
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis.disableExactColorMode()

Definition at line 1184 of file Visualizer.py.

◆ disableLinearPipeline()

None pyhelios.Visualizer.Visualizer.disableLinearPipeline ( self)

Disable the linear-light pipeline, shading directly in sRGB space.

   This reproduces the rendering behavior of helios-core versions before 1.3.83.
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis.disableLinearPipeline()

Definition at line 1226 of file Visualizer.py.

◆ disableMessages()

None pyhelios.Visualizer.Visualizer.disableMessages ( self)

Disable standard output from visualizer plugin.

Exceptions
VisualizerErrorIf operation fails

Definition at line 2491 of file Visualizer.py.

◆ disableSmoothShading()

None pyhelios.Visualizer.Visualizer.disableSmoothShading ( self)

Select flat (per-face) shading.

   Useful for alpha-masked cutout geometry such as leaf textures, where interpolated
   normals can look worse than a single flat normal per face.
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis.disableSmoothShading()

Definition at line 1472 of file Visualizer.py.

◆ displayImageFromFile()

None pyhelios.Visualizer.Visualizer.displayImageFromFile ( self,
str filename )

Display image from file.

Parameters
filenamePath to image file
Exceptions
ValueErrorIf filename is invalid
VisualizerErrorIf operation fails

Definition at line 1006 of file Visualizer.py.

◆ displayImageFromPixels()

None pyhelios.Visualizer.Visualizer.displayImageFromPixels ( self,
List[int] pixel_data,
int width,
int height )

Display image from RGBA pixel data.

Parameters
pixel_dataRGBA pixel data as list of integers (0-255)
widthImage width in pixels
heightImage height in pixels
Exceptions
ValueErrorIf parameters are invalid
VisualizerErrorIf operation fails

Definition at line 974 of file Visualizer.py.

◆ displayImageWithBoundingBoxes()

None pyhelios.Visualizer.Visualizer.displayImageWithBoundingBoxes ( self,
str image_file,
str bbox_file,
str classes_file = "",
float line_width = 2.0,
int fontsize = 12 )

Display an image with YOLO bounding boxes overlaid.

   Each box is drawn as a colored outline with its class name on a filled chip in
   the box's top-left corner. Boxes are colored by class ID from a fixed palette of
   seven colors, so classes whose IDs differ by a multiple of seven share a color.

   This reads the annotation format written by
   :meth:`pyhelios.RadiationModel.writeImageBoundingBoxes`.
Parameters
image_filePath to the image file (JPEG or PNG)
bbox_filePath to the YOLO-format bounding box annotation file
classes_filePath to the class name file. If empty (the default), a file named "classes.txt" beside bbox_file is used when one exists; otherwise boxes are labeled with their numeric class ID.
line_widthWidth of the box outlines in screen pixels
fontsizeSize of the class label font in points
Exceptions
ValueErrorIf a path is not a non-empty string, or a numeric argument is out of range
VisualizerErrorIf the operation fails
Note
Like :meth:displayImageFromFile, this clears any existing geometry and does not return until the window is closed.
Example
>>> vis.displayImageWithBoundingBoxes("scene.jpeg", "scene.txt")

Definition at line 1048 of file Visualizer.py.

◆ displayImageWithSegmentationMasks()

None pyhelios.Visualizer.Visualizer.displayImageWithSegmentationMasks ( self,
str image_file,
str mask_file,
float fill_opacity = 0.4,
float line_width = 2.0,
int fontsize = 12,
bool show_labels = True )

Display an image with COCO segmentation masks overlaid.

   Each mask is drawn as a translucent filled polygon with a solid outline and its
   class name on a filled chip. Masks are colored by their position in the file
   rather than by class, so two touching objects of the same class stay
   distinguishable.

   This reads the annotation format written by
   :meth:`pyhelios.RadiationModel.writeImageSegmentationMasks`.
Parameters
image_filePath to the image file (JPEG or PNG)
mask_filePath to the COCO JSON segmentation mask file
fill_opacityOpacity of the translucent fill, between 0 and 1. A value of 0 draws the outline without a fill.
line_widthWidth of the mask outlines in screen pixels
fontsizeSize of the class label font in points
show_labelsWhether to draw the class name chip on each mask. Pass False to see the masks alone, which helps when many overlapping chips would cover the image.
Exceptions
ValueErrorIf a path is not a non-empty string, or a numeric argument is out of range
VisualizerErrorIf the operation fails
Note
Like :meth:displayImageFromFile, this clears any existing geometry and does not return until the window is closed.
Example
>>> vis.displayImageWithSegmentationMasks("scene.jpeg", "annotations.json")

Definition at line 1110 of file Visualizer.py.

◆ enableColorbar()

None pyhelios.Visualizer.Visualizer.enableColorbar ( self)

Enable colorbar.

Exceptions
VisualizerErrorIf operation fails

Definition at line 1980 of file Visualizer.py.

◆ enableExactColorMode()

None pyhelios.Visualizer.Visualizer.enableExactColorMode ( self)

Render primitive colors exactly as they are set in the Context.

   By default the fragment shader multiplies primitive colors by 1.5, which
   brightens ordinary renders but means a color read back out of the framebuffer is
   not the color that was set. This mode disables that multiplier, which is required
   when the framebuffer carries data rather than an image -- for example when object
   IDs are encoded as RGB values and decoded from the rendered pixels.

   Exact reproduction additionally requires that no lighting be applied (see
   :meth:`setLightingModel` with ``LIGHTING_NONE``, the default) and that the
   Visualizer was constructed with ``antialiasing_samples=0``, since antialiasing
   blends colors at primitive edges and produces pixels that decode to meaningless
   IDs.

   This also disables the linear-light pipeline (see :meth:`disableLinearPipeline`),
   since tone mapping would likewise alter the values read back.
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis = Visualizer(800, 600, antialiasing_samples=0) >>> vis.enableExactColorMode()

Definition at line 1165 of file Visualizer.py.

◆ enableLinearPipeline()

None pyhelios.Visualizer.Visualizer.enableLinearPipeline ( self)

Enable the physically-based linear-light rendering pipeline.

   This is the default. Albedo is decoded from sRGB to linear light before shading,
   and the shaded radiance is tone-mapped through an ACES filmic curve and
   re-encoded to sRGB. Compared with shading directly on non-linear sRGB values,
   mid-tones are brighter, shadow terminators are smoother, and bright surfaces roll
   off rather than clipping flat against the 8-bit framebuffer.
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis.enableLinearPipeline()

Definition at line 1207 of file Visualizer.py.

◆ enableMessages()

None pyhelios.Visualizer.Visualizer.enableMessages ( self)

Enable standard output from visualizer plugin.

Exceptions
VisualizerErrorIf operation fails

Definition at line 2476 of file Visualizer.py.

◆ enableSmoothShading()

None pyhelios.Visualizer.Visualizer.enableSmoothShading ( self)

Enable smooth per-vertex-normal shading.

   This is the default. Only geometry that supplies distinct vertex normals is
affected    Sphere, Tube and Cone objects, and Polymesh objects loaded from an OBJ
   or PLY file that carries them. Patches, triangles and voxels added directly to
   the Context carry the face normal replicated across their vertices and render
   identically either way.
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis.enableSmoothShading()

Definition at line 1452 of file Visualizer.py.

◆ getAmbientGroundColor()

RGBcolor pyhelios.Visualizer.Visualizer.getAmbientGroundColor ( self)

Get the hemispheric ambient ground-bounce color.

Returns
Color of ambient light bouncing from below
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis.getAmbientGroundColor()

Definition at line 1428 of file Visualizer.py.

◆ getAmbientSkyColor()

RGBcolor pyhelios.Visualizer.Visualizer.getAmbientSkyColor ( self)

Get the hemispheric ambient sky color.

Returns
Color of ambient light arriving from above
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis.getAmbientSkyColor()

Definition at line 1407 of file Visualizer.py.

◆ getBackgroundColor()

RGBcolor pyhelios.Visualizer.Visualizer.getBackgroundColor ( self)

Get current background color.

Returns
Background color as RGBcolor object
Exceptions
VisualizerErrorIf operation fails

Definition at line 858 of file Visualizer.py.

◆ getCameraPosition()

Tuple[vec3, vec3] pyhelios.Visualizer.Visualizer.getCameraPosition ( self)

Get current camera position and look-at point.

Returns
Tuple of (camera_position, look_at_point) as vec3 objects
Exceptions
VisualizerErrorIf operation fails

Definition at line 833 of file Visualizer.py.

◆ getDepthMap()

Tuple[List[float], int, int] pyhelios.Visualizer.Visualizer.getDepthMap ( self)

Get depth map from current window.

Returns
Tuple of (depth_pixels, width, height)
Exceptions
VisualizerErrorIf operation fails

Definition at line 1681 of file Visualizer.py.

◆ getExposure()

float pyhelios.Visualizer.Visualizer.getExposure ( self)

Get the linear exposure multiplier applied before tone mapping.

Returns
Current exposure multiplier
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis.getExposure() 1.0

Definition at line 1295 of file Visualizer.py.

◆ getFramebufferSize()

Tuple[int, int] pyhelios.Visualizer.Visualizer.getFramebufferSize ( self)

Get framebuffer size in pixels.

Returns
Tuple of (width, height) in pixels
Exceptions
VisualizerErrorIf operation fails

Definition at line 932 of file Visualizer.py.

◆ getGeometryVertices()

List[vec3] pyhelios.Visualizer.Visualizer.getGeometryVertices ( self,
int geometry_id )

Get vertices of a geometry primitive.

Parameters
geometry_idUnique identifier of the geometry primitive
Returns
List of vertices as vec3 objects
Exceptions
ValueErrorIf geometry ID is invalid
VisualizerErrorIf operation fails
Example
>>> # Get vertices of a specific geometry >>> vertices = visualizer.getGeometryVertices(geometry_id) >>> for vertex in vertices: ... print(f"Vertex: ({vertex.x}, {vertex.y}, {vertex.z})")

Definition at line 1823 of file Visualizer.py.

◆ getPhongMaterial()

Tuple[float, float, float, float] pyhelios.Visualizer.Visualizer.getPhongMaterial ( self)

Get the Phong material parameters used to shade Context primitives.

Returns
Tuple of (ambient, diffuse, specular, shininess)
Exceptions
VisualizerErrorIf the operation fails
Example
>>> ambient, diffuse, specular, shininess = vis.getPhongMaterial()

Definition at line 1352 of file Visualizer.py.

◆ getPointRenderingMetrics()

dict pyhelios.Visualizer.Visualizer.getPointRenderingMetrics ( self)

Get point cloud rendering performance metrics.

   Provides detailed statistics about point cloud culling and rendering
   performance, useful for optimizing visualization settings.
Returns
Dictionary with keys:
  • 'total_points' (int): Total number of points in the scene
  • 'rendered_points' (int): Number of points actually rendered after culling
  • 'culling_time_ms' (float): Time spent on culling in milliseconds
Exceptions
VisualizerErrorIf operation fails
Example
>>> metrics = vis.getPointRenderingMetrics() >>> print(f"Total: {metrics['total_points']}") >>> print(f"Rendered: {metrics['rendered_points']}") >>> cull_rate = (1 - metrics['rendered_points']/metrics['total_points']) * 100 >>> print(f"Culling rate: {cull_rate:.1f}%")
Note
Metrics are only meaningful after calling plotUpdate() or plotInteractive(). The culling_time_ms represents CPU time spent on culling calculations, not total frame time.

Definition at line 2716 of file Visualizer.py.

◆ getTextboxSize()

vec2 pyhelios.Visualizer.Visualizer.getTextboxSize ( self,
str textstring,
int fontsize,
str fontname )

Measure the rendered size of a text string without adding it to the visualizer.

   Returns the extent that :meth:`addTextboxByCenter` would occupy for the same
   string, font and font size. The width is the sum of the glyph advances, so it
   includes the side bearings; the height is that of the tallest glyph in the
   string, so it depends on which characters the string contains. The ``_`` and
   ``^`` subscript and superscript markers are handled as
   :meth:`addTextboxByCenter` handles them: they occupy no width themselves and
   halve the size of the character that follows.
Parameters
textstringText to be measured
fontsizeSize of the text font in points
fontnameName of a font in the visualizer fonts directory, e.g. "OpenSans-Regular"
Returns
Width and height of the text in window-normalized units.
Exceptions
ValueErrorIf an argument is invalid
VisualizerErrorIf the operation fails
Note
The result depends on the current framebuffer dimensions and DPI scale, and therefore changes when the window is resized.
Example
>>> size = vis.getTextboxSize("Leaf area", 14, "OpenSans-Regular") >>> print(f"{size.x:.3f} x {size.y:.3f}")

Definition at line 1565 of file Visualizer.py.

◆ getWindowPixelsRGB()

pyhelios.Visualizer.Visualizer.getWindowPixelsRGB ( self,
Optional[List[int]] buffer = None )

Get RGB pixel data from the current window.

   Data is stored as r-g-b * column * row, so indices (0,1,2) are the RGB values for row 0
   column 0, indices (3,4,5) are row 0 column 1, and so on.

   Call without arguments to have the buffer allocated for you at the correct size -- this is
   the recommended form and cannot be undersized::

       pixels, width, height = visualizer.getWindowPixelsRGB()
Parameters
bufferOptional pre-allocated list to fill in place. It must hold exactly 3 * width * height elements, where width and height come from :meth:getFramebufferSizenot :meth:getWindowSize and not the dimensions passed to the constructor. On a high-DPI (Retina) display the framebuffer is larger than the window, typically by a factor of two per axis, so a buffer sized from the window dimensions is four times too small.
Returns
If buffer is None, a tuple of (pixel_data, width, height). Otherwise None; buffer is filled in place.
Exceptions
ValueErrorIf ``buffer`` is not a list, or is not sized for the current framebuffer
VisualizerErrorIf operation fails

Definition at line 1617 of file Visualizer.py.

◆ getWindowSize()

Tuple[int, int] pyhelios.Visualizer.Visualizer.getWindowSize ( self)

Get window size in pixels.

Returns
Tuple of (width, height) in pixels
Exceptions
VisualizerErrorIf operation fails

Definition at line 909 of file Visualizer.py.

◆ hideNavigationGizmo()

None pyhelios.Visualizer.Visualizer.hideNavigationGizmo ( self)

Hide navigation gizmo (coordinate axes indicator in corner).

   The navigation gizmo shows XYZ axes orientation and can be clicked
   to snap the camera to standard views (top, front, side, etc.).
Exceptions
VisualizerErrorIf operation fails

Definition at line 2435 of file Visualizer.py.

◆ hideWatermark()

None pyhelios.Visualizer.Visualizer.hideWatermark ( self)

Hide Helios logo watermark.

Exceptions
VisualizerErrorIf operation fails

Definition at line 2385 of file Visualizer.py.

◆ isHeadlessMultisamplingActive()

bool pyhelios.Visualizer.Visualizer.isHeadlessMultisamplingActive ( self)

Check whether headless rendering obtained multisampled framebuffer attachments.

   Headless rendering draws into a multisampled framebuffer using the sample count
   given to the constructor and resolves it before readback, so saved images are
   anti-aliased. The requested count is clamped to the driver maximum, and a driver
   that refuses the attachments falls back silently -- this query is how to detect
   that.
Returns
True if multisampled attachments were obtained
Note
macOS drives OpenGL through a translation layer that accepts the attachments but does not rasterize into them, so this can report True while the saved image is not actually anti-aliased.
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis.isHeadlessMultisamplingActive() True

Definition at line 1525 of file Visualizer.py.

◆ isLinearPipelineEnabled()

bool pyhelios.Visualizer.Visualizer.isLinearPipelineEnabled ( self)

Check whether the linear-light rendering pipeline is enabled.

Returns
True if the linear pipeline is enabled
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis.isLinearPipelineEnabled() True

Definition at line 1247 of file Visualizer.py.

◆ isSmoothShadingEnabled()

bool pyhelios.Visualizer.Visualizer.isSmoothShadingEnabled ( self)

Check whether smooth per-vertex-normal shading is enabled.

Returns
True if smooth shading is enabled
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis.isSmoothShadingEnabled() True

Definition at line 1493 of file Visualizer.py.

◆ plotDepthMap()

None pyhelios.Visualizer.Visualizer.plotDepthMap ( self)

Plot depth map visualization.

Exceptions
VisualizerErrorIf operation fails

Definition at line 1711 of file Visualizer.py.

◆ plotInteractive()

None pyhelios.Visualizer.Visualizer.plotInteractive ( self)

Open interactive visualization window.

   This method opens a window with the current scene and allows user
   interaction (camera rotation, zooming, etc.). The program will pause
   until the window is closed by the user.

   Interactive controls:
   - Mouse scroll: Zoom in/out
   - Left mouse + drag: Rotate camera
   - Right mouse + drag: Pan camera
   - Arrow keys: Camera movement
   - +/- keys: Zoom in/out
Exceptions
VisualizerErrorIf visualization fails, or if the Visualizer was constructed with headless=True (helios-core 1.3.85+ raises rather than driving a window that was never shown or does not exist)

Definition at line 345 of file Visualizer.py.

◆ plotOnce()

None pyhelios.Visualizer.Visualizer.plotOnce ( self,
bool get_keystrokes = True )

Run one rendering loop.

   Any geometry pending upload is transferred to the GPU before rendering, but unlike
   :meth:`plotUpdate` the Context geometry is not rebuilt. Call :meth:`buildContextGeometry`
   or :meth:`plotUpdate` if primitives have been added to or changed in the Context since the
   last render.
Parameters
get_keystrokesWhether to process keystrokes
Exceptions
VisualizerErrorIf operation fails

Definition at line 2514 of file Visualizer.py.

◆ plotUpdate()

None pyhelios.Visualizer.Visualizer.plotUpdate ( self)

Update visualization (non-interactive).

   This method updates the visualization window without user interaction.
   The program continues immediately after rendering. Useful for batch
   processing or creating image sequences.

   In headless mode, automatically hides the window to prevent graphics driver crashes on some platforms.
Exceptions
VisualizerErrorIf visualization update fails

Definition at line 369 of file Visualizer.py.

◆ plotUpdateWithVisibility()

None pyhelios.Visualizer.Visualizer.plotUpdateWithVisibility ( self,
bool hide_window = False )

Update visualization with window visibility control.

Parameters
hide_windowWhether to hide the window during update
Exceptions
VisualizerErrorIf operation fails

Definition at line 2532 of file Visualizer.py.

◆ printWindow()

None pyhelios.Visualizer.Visualizer.printWindow ( self,
str filename,
Optional[str] image_format = None )

Save current visualization to image file.

   This method exports the current visualization to an image file.
   Starting from v1.3.53, supports both JPEG and PNG formats.

   The frame is rendered as part of the capture (helios-core 1.3.85+), so it is
   not necessary to call :meth:`plotUpdate` beforehand: handing the Visualizer a
   Context with :meth:`buildContextGeometry` and calling this straight away
   produces a correct image. A render is performed whenever the frame currently
   on the GPU is not the one that would be captured (geometry changed, the camera
   moved, or the navigation gizmo had to be hidden) and skipped when it would
   produce an identical frame, so calling :meth:`plotUpdate` first is harmless
   but redundant. The navigation gizmo is always absent from the captured image.
Parameters
filenameOutput filename for image Can be absolute or relative to user's current working directory Extension (.jpg, .png) is recommended but not required
image_formatImage format - "jpeg" or "png" (v1.3.53+). If None, automatically detects from filename extension. Defaults to "jpeg" if not detectable from extension.
Exceptions
VisualizerErrorIf image saving fails
ValueErrorIf filename or format is invalid
Note
PNG format is required to preserve transparent backgrounds when using setBackgroundTransparent(). JPEG format will render transparent areas as black.
Example
>>> visualizer.printWindow("output.jpg") # Auto-detects JPEG >>> visualizer.printWindow("output.png") # Auto-detects PNG >>> visualizer.printWindow("output.img", image_format="png") # Explicit PNG

Definition at line 419 of file Visualizer.py.

◆ printWindowDefault()

None pyhelios.Visualizer.Visualizer.printWindowDefault ( self)

Print window with default filename.

Exceptions
VisualizerErrorIf operation fails

Definition at line 952 of file Visualizer.py.

◆ setAmbientColors()

None pyhelios.Visualizer.Visualizer.setAmbientColors ( self,
RGBcolor sky_color,
RGBcolor ground_color )

Set the hemispheric ambient sky and ground-bounce colors.

   Ambient light is blended between the two according to surface orientation:
   upward-facing surfaces pick up ``sky_color``, downward-facing surfaces
   ``ground_color``. Setting both to the same value recovers the single constant
   ambient term used before helios-core 1.3.83.
Parameters
sky_colorColor of light arriving from above
ground_colorColor of light bouncing from below
Exceptions
ValueErrorIf either argument is not an RGBcolor
VisualizerErrorIf the operation fails
Example
>>> vis.setAmbientColors(RGBcolor(0.5, 0.6, 0.75), RGBcolor(0.35, 0.3, 0.22))

Definition at line 1379 of file Visualizer.py.

◆ setBackgroundColor()

None pyhelios.Visualizer.Visualizer.setBackgroundColor ( self,
RGBcolor color )

Set background color.

Parameters
colorBackground color as RGBcolor with values in range [0, 1]
Exceptions
VisualizerErrorIf color setting fails
ValueErrorIf color values are invalid

Definition at line 549 of file Visualizer.py.

◆ setBackgroundImage()

None pyhelios.Visualizer.Visualizer.setBackgroundImage ( self,
str texture_file )

Set custom background image texture (v1.3.53+).

Parameters
texture_filePath to background image file Can be absolute or relative to working directory
Exceptions
VisualizerErrorIf background image setting fails
ValueErrorIf texture file path is invalid

Definition at line 601 of file Visualizer.py.

◆ setBackgroundSkyTexture()

None pyhelios.Visualizer.Visualizer.setBackgroundSkyTexture ( self,
Optional[str] texture_file = None,
int divisions = 50 )

Set sky sphere texture background with automatic scaling (v1.3.53+).

   Creates a sky sphere that automatically scales with the scene.
   Replaces the deprecated addSkyDomeByCenter() method.
Parameters
texture_filePath to spherical/equirectangular texture image If None, uses default gradient sky texture
divisionsNumber of sphere tessellation divisions (default: 50) Higher values create smoother sphere but use more GPU
Exceptions
VisualizerErrorIf sky texture setting fails
ValueErrorIf parameters are invalid
Example
>>> visualizer.setBackgroundSkyTexture() # Default gradient sky >>> visualizer.setBackgroundSkyTexture("sky_hdri.jpg", divisions=100)

Definition at line 637 of file Visualizer.py.

◆ setBackgroundTransparent()

None pyhelios.Visualizer.Visualizer.setBackgroundTransparent ( self)

Enable transparent background mode (v1.3.53+).

   Sets the background to transparent with checkerboard pattern display.
   Requires PNG output format to preserve transparency.
Note
When using transparent background, use printWindow() with PNG format to save transparent images.
Exceptions
VisualizerErrorIf transparent background setting fails

Definition at line 579 of file Visualizer.py.

◆ setCameraFieldOfView()

None pyhelios.Visualizer.Visualizer.setCameraFieldOfView ( self,
float angle_FOV )

Set camera field of view angle.

Parameters
angle_FOVField of view angle in degrees
Exceptions
ValueErrorIf angle is invalid
VisualizerErrorIf operation fails

Definition at line 808 of file Visualizer.py.

◆ setCameraPosition()

None pyhelios.Visualizer.Visualizer.setCameraPosition ( self,
vec3 position,
vec3 lookAt )

Set camera position using Cartesian coordinates.

Parameters
positionCamera position as vec3 in world coordinates
lookAtCamera look-at point as vec3 in world coordinates
Exceptions
VisualizerErrorIf camera positioning fails
ValueErrorIf parameters are invalid

Definition at line 496 of file Visualizer.py.

◆ setCameraPositionSpherical()

None pyhelios.Visualizer.Visualizer.setCameraPositionSpherical ( self,
SphericalCoord angle,
vec3 lookAt )

Set camera position using spherical coordinates.

Parameters
angleCamera position as SphericalCoord (radius, elevation, azimuth)
lookAtCamera look-at point as vec3 in world coordinates
Exceptions
VisualizerErrorIf camera positioning fails
ValueErrorIf parameters are invalid

Definition at line 523 of file Visualizer.py.

◆ setColorbarFontColor()

None pyhelios.Visualizer.Visualizer.setColorbarFontColor ( self,
RGBcolor color )

Set colorbar font color.

Parameters
colorFont color
Exceptions
ValueErrorIf color is invalid
VisualizerErrorIf operation fails

Definition at line 2150 of file Visualizer.py.

◆ setColorbarFontSize()

None pyhelios.Visualizer.Visualizer.setColorbarFontSize ( self,
int font_size )

Set colorbar font size.

Parameters
font_sizeFont size
Exceptions
ValueErrorIf font size is invalid
VisualizerErrorIf operation fails

Definition at line 2173 of file Visualizer.py.

◆ setColorbarPosition()

None pyhelios.Visualizer.Visualizer.setColorbarPosition ( self,
vec3 position )

Set colorbar position.

Parameters
positionColorbar position
Exceptions
ValueErrorIf position is invalid
VisualizerErrorIf operation fails

Definition at line 2014 of file Visualizer.py.

◆ setColorbarRange()

None pyhelios.Visualizer.Visualizer.setColorbarRange ( self,
float min_val,
float max_val )

Set colorbar range.

   Setting a range explicitly stops the colorbar from auto-ranging over the data, including
   for the degenerate range ``setColorbarRange(0, 0)``.
Parameters
min_valMinimum value
max_valMaximum value. Must be greater than or equal to min_val; helios ignores an inverted range.
Exceptions
ValueErrorIf range is invalid
VisualizerErrorIf operation fails

Definition at line 2068 of file Visualizer.py.

◆ setColorbarSize()

None pyhelios.Visualizer.Visualizer.setColorbarSize ( self,
float width,
float height )

Set colorbar size.

Parameters
widthColorbar width
heightColorbar height
Exceptions
ValueErrorIf size is invalid
VisualizerErrorIf operation fails

Definition at line 2038 of file Visualizer.py.

◆ setColorbarTicks()

None pyhelios.Visualizer.Visualizer.setColorbarTicks ( self,
List[float] ticks )

Set colorbar tick marks.

Parameters
ticksList of tick values
Note
If a tick value falls outside the colorbar range, the range is automatically expanded to fit it. Because the colormap limits follow the colorbar range, this changes the colors shown as well as the labels. To keep an explicit range authoritative, call :meth:setColorbarRange after :meth:setColorbarTicks.
Exceptions
ValueErrorIf ticks are invalid
VisualizerErrorIf operation fails

Definition at line 2100 of file Visualizer.py.

◆ setColorbarTitle()

None pyhelios.Visualizer.Visualizer.setColorbarTitle ( self,
str title )

Set colorbar title.

Parameters
titleColorbar title
Exceptions
ValueErrorIf title is invalid
VisualizerErrorIf operation fails

Definition at line 2128 of file Visualizer.py.

◆ setColormap()

None pyhelios.Visualizer.Visualizer.setColormap ( self,
Union[int, str] colormap )

Set predefined colormap.

Parameters
colormapColormap ID (0-5) or name ("HOT", "COOL", "RAINBOW", "LAVA", "PARULA", "GRAY")
Exceptions
ValueErrorIf colormap is invalid
VisualizerErrorIf operation fails

Definition at line 2197 of file Visualizer.py.

◆ setCustomColormap()

None pyhelios.Visualizer.Visualizer.setCustomColormap ( self,
List[RGBcolor] colors,
List[float] divisions )

Set custom colormap.

Parameters
colorsList of RGB colors
divisionsList of division points (same length as colors)
Exceptions
ValueErrorIf parameters are invalid
VisualizerErrorIf operation fails

Definition at line 2233 of file Visualizer.py.

◆ setExposure()

None pyhelios.Visualizer.Visualizer.setExposure ( self,
float exposure )

Set the linear exposure multiplier applied before tone mapping.

   Only has an effect while the linear pipeline is enabled.
Parameters
exposureExposure multiplier; must be positive
Exceptions
ValueErrorIf exposure is not positive
VisualizerErrorIf the operation fails
Example
>>> vis.setExposure(1.5)

Definition at line 1270 of file Visualizer.py.

◆ setGeometryVertices()

None pyhelios.Visualizer.Visualizer.setGeometryVertices ( self,
int geometry_id,
List[vec3] vertices )

Set vertices of a geometry primitive.

   This allows dynamic modification of geometry shapes during visualization.
   Useful for animating geometry or adjusting shapes based on simulation results.
Parameters
geometry_idUnique identifier of the geometry primitive
verticesList of new vertices as vec3 objects
Exceptions
ValueErrorIf parameters are invalid
VisualizerErrorIf operation fails
Example
>>> # Modify vertices of an existing geometry >>> vertices = visualizer.getGeometryVertices(geometry_id) >>> # Scale all vertices by 2x >>> scaled_vertices = [vec3(v.x*2, v.y*2, v.z*2) for v in vertices] >>> visualizer.setGeometryVertices(geometry_id, scaled_vertices)

Definition at line 1858 of file Visualizer.py.

◆ setLightDirection()

None pyhelios.Visualizer.Visualizer.setLightDirection ( self,
vec3 direction )

Set light direction.

Parameters
directionLight direction vector as vec3 (will be normalized)
Exceptions
VisualizerErrorIf light direction setting fails
ValueErrorIf direction is invalid

Definition at line 678 of file Visualizer.py.

◆ setLightingModel()

None pyhelios.Visualizer.Visualizer.setLightingModel ( self,
Union[int, str] lighting_model )

Set lighting model.

Parameters
lighting_modelLighting model, either:
  • 0 or "none": No lighting
  • 1 or "phong": Phong shading
  • 2 or "phong_shadowed": Phong shading with shadows
Exceptions
VisualizerErrorIf lighting model setting fails
ValueErrorIf lighting model is invalid

Definition at line 709 of file Visualizer.py.

◆ setLightIntensityFactor()

None pyhelios.Visualizer.Visualizer.setLightIntensityFactor ( self,
float intensity_factor )

Set light intensity scaling factor.

Parameters
intensity_factorLight intensity scaling factor (typically 0.1 to 10.0)
Exceptions
ValueErrorIf intensity factor is invalid
VisualizerErrorIf operation fails

Definition at line 884 of file Visualizer.py.

◆ setPhongMaterial()

None pyhelios.Visualizer.Visualizer.setPhongMaterial ( self,
float ambient,
float diffuse,
float specular,
float shininess )

Set the Phong material parameters used to shade Context primitives.

   Surfaces are shaded as ``ambient*A + diffuse*max(0, N.L) +
   specular*max(0, N.H)^shininess``, where ``A`` is the hemispheric ambient term set
   by :meth:`setAmbientColors`. Setting ``specular`` to zero removes the highlight,
   recovering the appearance of helios-core versions before 1.3.83. Has no effect
   under ``LIGHTING_NONE``.

   Individual materials can override any of these parameters by attaching
   ``phong_ambient``, ``phong_diffuse``, ``phong_specular`` or ``phong_shininess``
   material data with :meth:`Context.setMaterialDataFloat`; each parameter falls
   back individually to the value set here.
Parameters
ambientAmbient reflectance weight
diffuseDiffuse reflectance weight
specularSpecular highlight strength
shininessSpecular exponent controlling highlight tightness
Exceptions
VisualizerErrorIf the operation fails
Example
>>> vis.setPhongMaterial(1.0, 0.8, 0.0, 32.0) # no specular highlight

Definition at line 1329 of file Visualizer.py.

◆ setPointCullingEnabled()

None pyhelios.Visualizer.Visualizer.setPointCullingEnabled ( self,
bool enabled )

Enable or disable point cloud culling optimization.

   Point culling improves rendering performance for large point clouds by
   selectively rendering only points that are visible based on distance
   and density criteria.
Parameters
enabledTrue to enable culling, False to disable (default: True)
Exceptions
ValueErrorIf enabled is not a boolean
VisualizerErrorIf operation fails
Example
>>> with Visualizer(800, 600) as vis: ... vis.setPointCullingEnabled(False) # Disable for highest quality ... vis.setPointCullingEnabled(True) # Enable for better performance

Definition at line 2564 of file Visualizer.py.

◆ setPointCullingThreshold()

None pyhelios.Visualizer.Visualizer.setPointCullingThreshold ( self,
int threshold )

Set the minimum number of points required to trigger culling.

   Culling is only activated when the total point count exceeds this threshold.
   This prevents unnecessary culling overhead for small point clouds.
Parameters
thresholdPoint count threshold (default: 10000). Set to 0 to always enable.
Exceptions
ValueErrorIf threshold is not a non-negative integer
VisualizerErrorIf operation fails
Example
>>> vis.setPointCullingThreshold(50000) # Only cull for >50k points >>> vis.setPointCullingThreshold(0) # Always enable culling

Definition at line 2593 of file Visualizer.py.

◆ setPointLODFactor()

None pyhelios.Visualizer.Visualizer.setPointLODFactor ( self,
float factor )

Set the level-of-detail factor for distance-based culling.

   Controls how aggressively points are culled based on distance from camera.
   Higher values result in more aggressive culling (better performance, lower quality).
   Lower values preserve more points (higher quality, lower performance).
Parameters
factorLOD factor (default: 10.0, typical range: 1.0-50.0). Must be positive.
Exceptions
ValueErrorIf factor is not positive
VisualizerErrorIf operation fails
Example
>>> vis.setPointLODFactor(5.0) # Conservative culling >>> vis.setPointLODFactor(10.0) # Default culling >>> vis.setPointLODFactor(25.0) # Aggressive culling
Note
The LOD factor determines the rate at which point density decreases with distance. Higher factors mean points are culled more quickly as distance increases.

Definition at line 2669 of file Visualizer.py.

◆ setPointMaxRenderDistance()

None pyhelios.Visualizer.Visualizer.setPointMaxRenderDistance ( self,
float distance )

Set the maximum rendering distance for points.

   Points beyond this distance from the camera are not rendered, improving
   performance for large scenes. The distance is measured in world units.
Parameters
distanceMaximum distance in world units. Use 0 for auto mode (scene_size * 5.0)
Exceptions
ValueErrorIf distance is negative
VisualizerErrorIf operation fails
Example
>>> vis.setPointMaxRenderDistance(0.0) # Auto mode >>> vis.setPointMaxRenderDistance(100.0) # Fixed distance
Note
Setting distance to 0 enables automatic mode, which calculates the render distance based on the scene bounding box dimensions.

Definition at line 2628 of file Visualizer.py.

◆ showNavigationGizmo()

None pyhelios.Visualizer.Visualizer.showNavigationGizmo ( self)

Show navigation gizmo (coordinate axes indicator in corner).

   The navigation gizmo shows XYZ axes orientation and can be clicked
   to snap the camera to standard views (top, front, side, etc.).
Note
Navigation gizmo is shown by default in v1.3.53+.
Exceptions
VisualizerErrorIf operation fails

Definition at line 2457 of file Visualizer.py.

◆ showWatermark()

None pyhelios.Visualizer.Visualizer.showWatermark ( self)

Show Helios logo watermark.

Exceptions
VisualizerErrorIf operation fails

Definition at line 2400 of file Visualizer.py.

◆ updateContextPrimitiveColors()

None pyhelios.Visualizer.Visualizer.updateContextPrimitiveColors ( self)

Update context primitive colors.

Exceptions
VisualizerErrorIf operation fails

Definition at line 1793 of file Visualizer.py.

◆ updateWatermark()

None pyhelios.Visualizer.Visualizer.updateWatermark ( self)

Update watermark geometry to match current window size.

Exceptions
VisualizerErrorIf operation fails

Definition at line 2415 of file Visualizer.py.

Member Data Documentation

◆ _context

pyhelios.Visualizer.Visualizer._context
protected

Definition at line 263 of file Visualizer.py.

◆ antialiasing_samples

pyhelios.Visualizer.Visualizer.antialiasing_samples = antialiasing_samples

Definition at line 187 of file Visualizer.py.

◆ COLORMAP_COOL

int pyhelios.Visualizer.Visualizer.COLORMAP_COOL = 1
static

Definition at line 145 of file Visualizer.py.

◆ COLORMAP_GRAY

int pyhelios.Visualizer.Visualizer.COLORMAP_GRAY = 5
static

Definition at line 149 of file Visualizer.py.

◆ COLORMAP_HOT

int pyhelios.Visualizer.Visualizer.COLORMAP_HOT = 0
static

Definition at line 144 of file Visualizer.py.

◆ COLORMAP_LAVA

int pyhelios.Visualizer.Visualizer.COLORMAP_LAVA = 3
static

Definition at line 147 of file Visualizer.py.

◆ COLORMAP_PARULA

int pyhelios.Visualizer.Visualizer.COLORMAP_PARULA = 4
static

Definition at line 148 of file Visualizer.py.

◆ COLORMAP_RAINBOW

int pyhelios.Visualizer.Visualizer.COLORMAP_RAINBOW = 2
static

Definition at line 146 of file Visualizer.py.

◆ headless

pyhelios.Visualizer.Visualizer.headless = headless

Definition at line 188 of file Visualizer.py.

◆ height

pyhelios.Visualizer.Visualizer.height = height

Definition at line 186 of file Visualizer.py.

◆ LIGHTING_NONE

pyhelios.Visualizer.Visualizer.LIGHTING_NONE = 0
static

Definition at line 139 of file Visualizer.py.

◆ LIGHTING_PHONG

pyhelios.Visualizer.Visualizer.LIGHTING_PHONG = 1
static

Definition at line 140 of file Visualizer.py.

◆ LIGHTING_PHONG_SHADOWED

int pyhelios.Visualizer.Visualizer.LIGHTING_PHONG_SHADOWED = 2
static

Definition at line 141 of file Visualizer.py.

◆ visualizer

pyhelios.Visualizer.Visualizer.visualizer = None

Definition at line 189 of file Visualizer.py.

◆ width

pyhelios.Visualizer.Visualizer.width = width

Definition at line 185 of file Visualizer.py.


The documentation for this class was generated from the following file: