![]() |
0.1.8
|
Central simulation environment for PyHelios that manages 3D primitives and their data. More...
Central simulation environment for PyHelios that manages 3D primitives and their data.
The Context class provides methods for:
Key features:
Examples
Definition at line 77 of file Context.py.
Public Member Functions | |
__init__ (self) | |
__enter__ (self) | |
__exit__ (self, exc_type, exc_value, traceback) | |
getNativePtr (self) | |
markGeometryClean (self) | |
markGeometryDirty (self) | |
bool | isGeometryDirty (self) |
int | addPatch (self, vec3 center=vec3(0, 0, 0), vec2 size=vec2(1, 1), Optional[SphericalCoord] rotation=None, Optional[RGBcolor] color=None) |
int | addTriangle (self, vec3 vertex0, vec3 vertex1, vec3 vertex2, Optional[RGBcolor] color=None) |
Add a triangle primitive to the context. | |
int | addTriangleTextured (self, vec3 vertex0, vec3 vertex1, vec3 vertex2, str texture_file, vec2 uv0, vec2 uv1, vec2 uv2) |
Add a textured triangle primitive to the context. | |
PrimitiveType | getPrimitiveType (self, int uuid) |
float | getPrimitiveArea (self, int uuid) |
vec3 | getPrimitiveNormal (self, int uuid) |
List[vec3] | getPrimitiveVertices (self, int uuid) |
RGBcolor | getPrimitiveColor (self, int uuid) |
int | getPrimitiveCount (self) |
List[int] | getAllUUIDs (self) |
int | getObjectCount (self) |
List[int] | getAllObjectIDs (self) |
PrimitiveInfo | getPrimitiveInfo (self, int uuid) |
Get physical properties and geometry information for a single primitive. | |
List[PrimitiveInfo] | getAllPrimitiveInfo (self) |
Get physical properties and geometry information for all primitives in the context. | |
List[PrimitiveInfo] | getPrimitivesInfoForObject (self, int object_id) |
Get physical properties and geometry information for all primitives belonging to a specific object. | |
List[int] | addTile (self, vec3 center=vec3(0, 0, 0), vec2 size=vec2(1, 1), Optional[SphericalCoord] rotation=None, int2 subdiv=int2(1, 1), Optional[RGBcolor] color=None) |
Add a subdivided patch (tile) to the context. | |
List[int] | addSphere (self, vec3 center=vec3(0, 0, 0), float radius=1.0, int ndivs=10, Optional[RGBcolor] color=None) |
Add a sphere to the context. | |
List[int] | addTube (self, List[vec3] nodes, Union[float, List[float]] radii, int ndivs=6, Optional[Union[RGBcolor, List[RGBcolor]]] colors=None) |
Add a tube (pipe/cylinder) to the context. | |
List[int] | addBox (self, vec3 center=vec3(0, 0, 0), vec3 size=vec3(1, 1, 1), int3 subdiv=int3(1, 1, 1), Optional[RGBcolor] color=None) |
Add a rectangular box to the context. | |
List[int] | loadPLY (self, str filename, Optional[vec3] origin=None, Optional[float] height=None, Optional[SphericalCoord] rotation=None, Optional[RGBcolor] color=None, str upaxis="YUP", bool silent=False) |
Load geometry from a PLY (Stanford Polygon) file. | |
List[int] | loadOBJ (self, str filename, Optional[vec3] origin=None, Optional[float] height=None, Optional[vec3] scale=None, Optional[SphericalCoord] rotation=None, Optional[RGBcolor] color=None, str upaxis="YUP", bool silent=False) |
Load geometry from an OBJ (Wavefront) file. | |
List[int] | loadXML (self, str filename, bool quiet=False) |
Load geometry from a Helios XML file. | |
None | writePLY (self, str filename, Optional[List[int]] UUIDs=None) |
Write geometry to a PLY (Stanford Polygon) file. | |
None | writeOBJ (self, str filename, Optional[List[int]] UUIDs=None, Optional[List[str]] primitive_data_fields=None, bool write_normals=False, bool silent=False) |
Write geometry to an OBJ (Wavefront) file. | |
List[int] | addTrianglesFromArrays (self, np.ndarray vertices, np.ndarray faces, Optional[np.ndarray] colors=None) |
Add triangles from NumPy arrays (compatible with trimesh, Open3D format). | |
List[int] | addTrianglesFromArraysTextured (self, np.ndarray vertices, np.ndarray faces, np.ndarray uv_coords, Union[str, List[str]] texture_files, Optional[np.ndarray] material_ids=None) |
Add textured triangles from NumPy arrays with support for multiple textures. | |
None | setPrimitiveDataInt (self, int uuid, str label, int value) |
Set primitive data as signed 32-bit integer. | |
None | setPrimitiveDataUInt (self, int uuid, str label, int value) |
Set primitive data as unsigned 32-bit integer. | |
None | setPrimitiveDataFloat (self, int uuid, str label, float value) |
Set primitive data as 32-bit float. | |
None | setPrimitiveDataString (self, int uuid, str label, str value) |
Set primitive data as string. | |
getPrimitiveData (self, int uuid, str label, type data_type=None) | |
Get primitive data for a specific primitive. | |
bool | doesPrimitiveDataExist (self, int uuid, str label) |
Check if primitive data exists for a specific primitive and label. | |
float | getPrimitiveDataFloat (self, int uuid, str label) |
Convenience method to get float primitive data. | |
int | getPrimitiveDataType (self, int uuid, str label) |
Get the Helios data type of primitive data. | |
int | getPrimitiveDataSize (self, int uuid, str label) |
Get the size/length of primitive data (for vector data). | |
np.ndarray | getPrimitiveDataArray (self, List[int] uuids, str label) |
Get primitive data values for multiple primitives as a NumPy array. | |
colorPrimitiveByDataPseudocolor (self, List[int] uuids, str primitive_data, str colormap="hot", int ncolors=10, Optional[float] max_val=None, Optional[float] min_val=None) | |
Color primitives based on primitive data values using pseudocolor mapping. | |
setTime (self, int hour, int minute=0, int second=0) | |
Set the simulation time. | |
setDate (self, int year, int month, int day) | |
Set the simulation date. | |
setDateJulian (self, int julian_day, int year) | |
Set the simulation date using Julian day number. | |
getTime (self) | |
Get the current simulation time. | |
getDate (self) | |
Get the current simulation date. | |
List[str] | get_available_plugins (self) |
Get list of available plugins for this PyHelios instance. | |
bool | is_plugin_available (self, str plugin_name) |
Check if a specific plugin is available. | |
dict | get_plugin_capabilities (self) |
Get detailed information about available plugin capabilities. | |
print_plugin_status (self) | |
Print detailed plugin status information. | |
List[str] | get_missing_plugins (self, List[str] requested_plugins) |
Get list of requested plugins that are not available. | |
Public Attributes | |
context = None | |
Protected Member Functions | |
_check_context_available (self) | |
Helper method to check if context is available with detailed error messages. | |
_validate_uuid (self, int uuid) | |
Validate that a UUID exists in this context. | |
str | _validate_file_path (self, str filename, List[str] expected_extensions=None) |
Validate and normalize file path for security. | |
str | _validate_output_file_path (self, str filename, List[str] expected_extensions=None) |
Validate and normalize output file path for security. | |
Protected Attributes | |
_plugin_registry = get_plugin_registry() | |
str | _lifecycle_state = 'initializing' |
pyhelios.Context.Context.__init__ | ( | self | ) |
Definition at line 79 of file Context.py.
pyhelios.Context.Context.__enter__ | ( | self | ) |
Definition at line 284 of file Context.py.
pyhelios.Context.Context.__exit__ | ( | self, | |
exc_type, | |||
exc_value, | |||
traceback ) |
Definition at line 287 of file Context.py.
|
protected |
Helper method to check if context is available with detailed error messages.
Definition at line 132 of file Context.py.
|
protected |
Validate and normalize file path for security.
filename | File path to validate |
expected_extensions | List of allowed file extensions (e.g., ['.ply', '.obj']) |
ValueError | If path is invalid or potentially dangerous |
FileNotFoundError | If file does not exist |
Definition at line 211 of file Context.py.
|
protected |
Validate and normalize output file path for security.
filename | Output file path to validate |
expected_extensions | List of allowed file extensions (e.g., ['.ply', '.obj']) |
ValueError | If path is invalid or potentially dangerous |
PermissionError | If output directory is not writable |
Definition at line 254 of file Context.py.
|
protected |
Validate that a UUID exists in this context.
uuid | The UUID to validate |
RuntimeError | If UUID is invalid or doesn't exist in context |
Definition at line 176 of file Context.py.
List[int] pyhelios.Context.Context.addBox | ( | self, | |
vec3 | center = vec3(0, 0, 0), | ||
vec3 | size = vec3(1, 1, 1), | ||
int3 | subdiv = int3(1, 1, 1), | ||
Optional[RGBcolor] | color = None ) |
Add a rectangular box to the context.
The box is subdivided into patches on each face based on the specified subdivisions.
center | 3D coordinates of box center (default: origin) |
size | Width, height, and depth of the box (default: 1x1x1) |
subdiv | Number of subdivisions in x, y, and z directions (default: 1x1x1) Higher values create more detailed surfaces |
color | Color of the box (default: white) |
Examples
Definition at line 733 of file Context.py.
int pyhelios.Context.Context.addPatch | ( | self, | |
vec3 | center = vec3(0, 0, 0), | ||
vec2 | size = vec2(1, 1), | ||
Optional[SphericalCoord] | rotation = None, | ||
Optional[RGBcolor] | color = None ) |
Definition at line 311 of file Context.py.
List[int] pyhelios.Context.Context.addSphere | ( | self, | |
vec3 | center = vec3(0, 0, 0), | ||
float | radius = 1.0, | ||
int | ndivs = 10, | ||
Optional[RGBcolor] | color = None ) |
Add a sphere to the context.
The sphere is tessellated into triangular faces based on the specified number of divisions.
center | 3D coordinates of sphere center (default: origin) |
radius | Radius of the sphere (default: 1.0) |
ndivs | Number of divisions for tessellation (default: 10) Higher values create smoother spheres but more triangles |
color | Color of the sphere (default: white) |
Examples
Definition at line 590 of file Context.py.
List[int] pyhelios.Context.Context.addTile | ( | self, | |
vec3 | center = vec3(0, 0, 0), | ||
vec2 | size = vec2(1, 1), | ||
Optional[SphericalCoord] | rotation = None, | ||
int2 | subdiv = int2(1, 1), | ||
Optional[RGBcolor] | color = None ) |
Add a subdivided patch (tile) to the context.
A tile is a patch subdivided into a regular grid of smaller patches, useful for creating detailed surfaces or terrain.
center | 3D coordinates of tile center (default: origin) |
size | Width and height of the tile (default: 1x1) |
rotation | Orientation of the tile (default: no rotation) |
subdiv | Number of subdivisions in x and y directions (default: 1x1) |
color | Color of the tile (default: white) |
Examples
Definition at line 520 of file Context.py.
int pyhelios.Context.Context.addTriangle | ( | self, | |
vec3 | vertex0, | ||
vec3 | vertex1, | ||
vec3 | vertex2, | ||
Optional[RGBcolor] | color = None ) |
Add a triangle primitive to the context.
vertex0 | First vertex of the triangle |
vertex1 | Second vertex of the triangle |
vertex2 | Third vertex of the triangle |
color | Optional triangle color (defaults to white) |
Definition at line 331 of file Context.py.
List[int] pyhelios.Context.Context.addTrianglesFromArrays | ( | self, | |
np.ndarray | vertices, | ||
np.ndarray | faces, | ||
Optional[np.ndarray] | colors = None ) |
Add triangles from NumPy arrays (compatible with trimesh, Open3D format).
vertices | NumPy array of shape (N, 3) containing vertex coordinates as float32/float64 |
faces | NumPy array of shape (M, 3) containing triangle vertex indices as int32/int64 |
colors | Optional NumPy array of shape (N, 3) or (M, 3) containing RGB colors as float32/float64 If shape (N, 3): per-vertex colors If shape (M, 3): per-triangle colors |
ValueError | If array dimensions are invalid |
Definition at line 989 of file Context.py.
List[int] pyhelios.Context.Context.addTrianglesFromArraysTextured | ( | self, | |
np.ndarray | vertices, | ||
np.ndarray | faces, | ||
np.ndarray | uv_coords, | ||
Union[str, List[str]] | texture_files, | ||
Optional[np.ndarray] | material_ids = None ) |
Add textured triangles from NumPy arrays with support for multiple textures.
This method supports both single-texture and multi-texture workflows: - Single texture: Pass a single texture file string, all faces use the same texture - Multiple textures: Pass a list of texture files and material_ids array specifying which texture each face uses
vertices | NumPy array of shape (N, 3) containing vertex coordinates as float32/float64 |
faces | NumPy array of shape (M, 3) containing triangle vertex indices as int32/int64 |
uv_coords | NumPy array of shape (N, 2) containing UV texture coordinates as float32/float64 |
texture_files | Single texture file path (str) or list of texture file paths (List[str]) |
material_ids | Optional NumPy array of shape (M,) containing material ID for each face. If None and texture_files is a list, all faces use texture 0. If None and texture_files is a string, this parameter is ignored. |
ValueError | If array dimensions are invalid or material IDs are out of range |
Examples
Definition at line 1082 of file Context.py.
int pyhelios.Context.Context.addTriangleTextured | ( | self, | |
vec3 | vertex0, | ||
vec3 | vertex1, | ||
vec3 | vertex2, | ||
str | texture_file, | ||
vec2 | uv0, | ||
vec2 | uv1, | ||
vec2 | uv2 ) |
Add a textured triangle primitive to the context.
Creates a triangle with texture mapping. The texture image is mapped to the triangle surface using UV coordinates, where (0,0) represents the top-left corner of the image and (1,1) represents the bottom-right corner.
vertex0 | First vertex of the triangle |
vertex1 | Second vertex of the triangle |
vertex2 | Third vertex of the triangle |
texture_file | Path to texture image file (supports PNG, JPG, JPEG, TGA, BMP) |
uv0 | UV texture coordinates for first vertex |
uv1 | UV texture coordinates for second vertex |
uv2 | UV texture coordinates for third vertex |
ValueError | If texture file path is invalid |
FileNotFoundError | If texture file doesn't exist |
RuntimeError | If context is in mock mode |
Examples
Definition at line 375 of file Context.py.
List[int] pyhelios.Context.Context.addTube | ( | self, | |
List[vec3] | nodes, | ||
Union[float, List[float]] | radii, | ||
int | ndivs = 6, | ||
Optional[Union[RGBcolor, List[RGBcolor]]] | colors = None ) |
Add a tube (pipe/cylinder) to the context.
The tube is defined by a series of nodes (path) with radius at each node. It's tessellated into triangular faces based on the number of radial divisions.
nodes | List of 3D points defining the tube path (at least 2 nodes) |
radii | Radius at each node. Can be:
|
ndivs | Number of radial divisions (default: 6) Higher values create smoother tubes but more triangles |
colors | Colors at each node. Can be: |
Examples
Definition at line 652 of file Context.py.
pyhelios.Context.Context.colorPrimitiveByDataPseudocolor | ( | self, | |
List[int] | uuids, | ||
str | primitive_data, | ||
str | colormap = "hot", | ||
int | ncolors = 10, | ||
Optional[float] | max_val = None, | ||
Optional[float] | min_val = None ) |
Color primitives based on primitive data values using pseudocolor mapping.
This method applies a pseudocolor mapping to primitives based on the values of specified primitive data. The primitive colors are updated to reflect the data values using a color map.
uuids | List of primitive UUIDs to color |
primitive_data | Name of primitive data to use for coloring (e.g., "radiation_flux_SW") |
colormap | Color map name - options include "hot", "cool", "parula", "rainbow", "gray", "lava" |
ncolors | Number of discrete colors in color map (default: 10) |
max_val | Maximum value for color scale (auto-determined if None) |
min_val | Minimum value for color scale (auto-determined if None) |
Definition at line 1484 of file Context.py.
bool pyhelios.Context.Context.doesPrimitiveDataExist | ( | self, | |
int | uuid, | ||
str | label ) |
Check if primitive data exists for a specific primitive and label.
uuid | UUID of the primitive |
label | String key for the data |
Definition at line 1314 of file Context.py.
List[str] pyhelios.Context.Context.get_available_plugins | ( | self | ) |
Get list of available plugins for this PyHelios instance.
Definition at line 1598 of file Context.py.
List[str] pyhelios.Context.Context.get_missing_plugins | ( | self, | |
List[str] | requested_plugins ) |
Get list of requested plugins that are not available.
requested_plugins | List of plugin names to check |
Definition at line 1635 of file Context.py.
dict pyhelios.Context.Context.get_plugin_capabilities | ( | self | ) |
Get detailed information about available plugin capabilities.
Definition at line 1619 of file Context.py.
List[int] pyhelios.Context.Context.getAllObjectIDs | ( | self | ) |
Definition at line 434 of file Context.py.
List[PrimitiveInfo] pyhelios.Context.Context.getAllPrimitiveInfo | ( | self | ) |
Get physical properties and geometry information for all primitives in the context.
Definition at line 473 of file Context.py.
List[int] pyhelios.Context.Context.getAllUUIDs | ( | self | ) |
Definition at line 424 of file Context.py.
pyhelios.Context.Context.getDate | ( | self | ) |
Get the current simulation date.
NotImplementedError | If time/date functions not available in current library build |
Examples
Definition at line 1588 of file Context.py.
pyhelios.Context.Context.getNativePtr | ( | self | ) |
Definition at line 293 of file Context.py.
int pyhelios.Context.Context.getObjectCount | ( | self | ) |
Definition at line 430 of file Context.py.
float pyhelios.Context.Context.getPrimitiveArea | ( | self, | |
int | uuid ) |
Definition at line 396 of file Context.py.
RGBcolor pyhelios.Context.Context.getPrimitiveColor | ( | self, | |
int | uuid ) |
Definition at line 415 of file Context.py.
int pyhelios.Context.Context.getPrimitiveCount | ( | self | ) |
Definition at line 420 of file Context.py.
pyhelios.Context.Context.getPrimitiveData | ( | self, | |
int | uuid, | ||
str | label, | ||
type | data_type = None ) |
Get primitive data for a specific primitive.
If data_type is provided, it works like before. If data_type is None, it automatically detects the type and returns the appropriate value.
uuid | UUID of the primitive |
label | String key for the data |
data_type | Optional. Python type to retrieve (int, uint, float, double, bool, str, vec2, vec3, vec4, int2, int3, int4, etc.) If None, auto-detects the type using C++ getPrimitiveDataType(). |
Definition at line 1241 of file Context.py.
np.ndarray pyhelios.Context.Context.getPrimitiveDataArray | ( | self, | |
List[int] | uuids, | ||
str | label ) |
Get primitive data values for multiple primitives as a NumPy array.
This method retrieves primitive data for a list of UUIDs and returns the values as a NumPy array. The output array has the same length as the input UUID list, with each index corresponding to the primitive data value for that UUID.
uuids | List of primitive UUIDs to get data for |
label | String key for the primitive data to retrieve |
ValueError | If UUID list is empty or UUIDs don't exist |
RuntimeError | If context is in mock mode or data doesn't exist for some UUIDs |
Definition at line 1381 of file Context.py.
float pyhelios.Context.Context.getPrimitiveDataFloat | ( | self, | |
int | uuid, | ||
str | label ) |
Convenience method to get float primitive data.
uuid | UUID of the primitive |
label | String key for the data |
Definition at line 1327 of file Context.py.
int pyhelios.Context.Context.getPrimitiveDataSize | ( | self, | |
int | uuid, | ||
str | label ) |
Get the size/length of primitive data (for vector data).
uuid | UUID of the primitive |
label | String key for the data |
Definition at line 1353 of file Context.py.
int pyhelios.Context.Context.getPrimitiveDataType | ( | self, | |
int | uuid, | ||
str | label ) |
Get the Helios data type of primitive data.
uuid | UUID of the primitive |
label | String key for the data |
Definition at line 1340 of file Context.py.
PrimitiveInfo pyhelios.Context.Context.getPrimitiveInfo | ( | self, | |
int | uuid ) |
Get physical properties and geometry information for a single primitive.
uuid | UUID of the primitive |
Definition at line 449 of file Context.py.
vec3 pyhelios.Context.Context.getPrimitiveNormal | ( | self, | |
int | uuid ) |
Definition at line 400 of file Context.py.
List[PrimitiveInfo] pyhelios.Context.Context.getPrimitivesInfoForObject | ( | self, | |
int | object_id ) |
Get physical properties and geometry information for all primitives belonging to a specific object.
object_id | ID of the object |
Definition at line 486 of file Context.py.
PrimitiveType pyhelios.Context.Context.getPrimitiveType | ( | self, | |
int | uuid ) |
Definition at line 391 of file Context.py.
List[vec3] pyhelios.Context.Context.getPrimitiveVertices | ( | self, | |
int | uuid ) |
Definition at line 406 of file Context.py.
pyhelios.Context.Context.getTime | ( | self | ) |
Get the current simulation time.
NotImplementedError | If time/date functions not available in current library build |
Examples
Definition at line 1570 of file Context.py.
bool pyhelios.Context.Context.is_plugin_available | ( | self, | |
str | plugin_name ) |
Check if a specific plugin is available.
plugin_name | Name of the plugin to check |
Definition at line 1610 of file Context.py.
bool pyhelios.Context.Context.isGeometryDirty | ( | self | ) |
Definition at line 306 of file Context.py.
List[int] pyhelios.Context.Context.loadOBJ | ( | self, | |
str | filename, | ||
Optional[vec3] | origin = None, | ||
Optional[float] | height = None, | ||
Optional[vec3] | scale = None, | ||
Optional[SphericalCoord] | rotation = None, | ||
Optional[RGBcolor] | color = None, | ||
str | upaxis = "YUP", | ||
bool | silent = False ) |
Load geometry from an OBJ (Wavefront) file.
filename | Path to the OBJ file to load |
origin | Origin point for positioning the geometry (optional) |
height | Height scaling factor (optional, alternative to scale) |
scale | Scale factor for all dimensions (optional, alternative to height) |
rotation | Rotation to apply to the geometry (optional) |
color | Default color for geometry without color data (optional) |
upaxis | Up axis orientation ("YUP" or "ZUP") |
silent | If True, suppress loading output messages |
Definition at line 826 of file Context.py.
List[int] pyhelios.Context.Context.loadPLY | ( | self, | |
str | filename, | ||
Optional[vec3] | origin = None, | ||
Optional[float] | height = None, | ||
Optional[SphericalCoord] | rotation = None, | ||
Optional[RGBcolor] | color = None, | ||
str | upaxis = "YUP", | ||
bool | silent = False ) |
Load geometry from a PLY (Stanford Polygon) file.
filename | Path to the PLY file to load |
origin | Origin point for positioning the geometry (optional) |
height | Height scaling factor (optional) |
rotation | Rotation to apply to the geometry (optional) |
color | Default color for geometry without color data (optional) |
upaxis | Up axis orientation ("YUP" or "ZUP") |
silent | If True, suppress loading output messages |
Definition at line 778 of file Context.py.
List[int] pyhelios.Context.Context.loadXML | ( | self, | |
str | filename, | ||
bool | quiet = False ) |
Load geometry from a Helios XML file.
filename | Path to the XML file to load |
quiet | If True, suppress loading output messages |
Definition at line 866 of file Context.py.
pyhelios.Context.Context.markGeometryClean | ( | self | ) |
Definition at line 297 of file Context.py.
pyhelios.Context.Context.markGeometryDirty | ( | self | ) |
Definition at line 301 of file Context.py.
pyhelios.Context.Context.print_plugin_status | ( | self | ) |
Print detailed plugin status information.
Definition at line 1623 of file Context.py.
pyhelios.Context.Context.setDate | ( | self, | |
int | year, | ||
int | month, | ||
int | day ) |
Set the simulation date.
year | Year (1900-3000) |
month | Month (1-12) |
day | Day (1-31) |
ValueError | If date values are out of range |
NotImplementedError | If time/date functions not available in current library build |
Examples
Definition at line 1533 of file Context.py.
pyhelios.Context.Context.setDateJulian | ( | self, | |
int | julian_day, | ||
int | year ) |
Set the simulation date using Julian day number.
julian_day | Julian day (1-366) |
year | Year (1900-3000) |
ValueError | If values are out of range |
NotImplementedError | If time/date functions not available in current library build |
Examples
Definition at line 1552 of file Context.py.
None pyhelios.Context.Context.setPrimitiveDataFloat | ( | self, | |
int | uuid, | ||
str | label, | ||
float | value ) |
Set primitive data as 32-bit float.
uuid | UUID of the primitive |
label | String key for the data |
value | Float value |
Definition at line 1214 of file Context.py.
None pyhelios.Context.Context.setPrimitiveDataInt | ( | self, | |
int | uuid, | ||
str | label, | ||
int | value ) |
Set primitive data as signed 32-bit integer.
uuid | UUID of the primitive |
label | String key for the data |
value | Signed integer value |
Definition at line 1190 of file Context.py.
None pyhelios.Context.Context.setPrimitiveDataString | ( | self, | |
int | uuid, | ||
str | label, | ||
str | value ) |
Set primitive data as string.
uuid | UUID of the primitive |
label | String key for the data |
value | String value |
Definition at line 1225 of file Context.py.
None pyhelios.Context.Context.setPrimitiveDataUInt | ( | self, | |
int | uuid, | ||
str | label, | ||
int | value ) |
Set primitive data as unsigned 32-bit integer.
Critical for properties like 'twosided_flag' which must be uint in C++.
uuid | UUID of the primitive |
label | String key for the data |
value | Unsigned integer value (will be cast to uint32) |
Definition at line 1203 of file Context.py.
pyhelios.Context.Context.setTime | ( | self, | |
int | hour, | ||
int | minute = 0, | ||
int | second = 0 ) |
Set the simulation time.
hour | Hour (0-23) |
minute | Minute (0-59), defaults to 0 |
second | Second (0-59), defaults to 0 |
ValueError | If time values are out of range |
NotImplementedError | If time/date functions not available in current library build |
Examples
Definition at line 1513 of file Context.py.
None pyhelios.Context.Context.writeOBJ | ( | self, | |
str | filename, | ||
Optional[List[int]] | UUIDs = None, | ||
Optional[List[str]] | primitive_data_fields = None, | ||
bool | write_normals = False, | ||
bool | silent = False ) |
Write geometry to an OBJ (Wavefront) file.
filename | Path to the output OBJ file |
UUIDs | Optional list of primitive UUIDs to export. If None, exports all primitives |
primitive_data_fields | Optional list of primitive data field names to export |
write_normals | Whether to include vertex normals in the output |
silent | Whether to suppress output messages during export |
ValueError | If filename is invalid, UUIDs are invalid, or data fields don't exist |
PermissionError | If output directory is not writable |
FileNotFoundError | If UUIDs do not exist in context |
RuntimeError | If Context is in mock mode |
Examples
Definition at line 936 of file Context.py.
None pyhelios.Context.Context.writePLY | ( | self, | |
str | filename, | ||
Optional[List[int]] | UUIDs = None ) |
Write geometry to a PLY (Stanford Polygon) file.
filename | Path to the output PLY file |
UUIDs | Optional list of primitive UUIDs to export. If None, exports all primitives |
ValueError | If filename is invalid or UUIDs are invalid |
PermissionError | If output directory is not writable |
FileNotFoundError | If UUIDs do not exist in context |
RuntimeError | If Context is in mock mode |
Examples
Definition at line 892 of file Context.py.
|
protected |
Definition at line 84 of file Context.py.
|
protected |
Definition at line 81 of file Context.py.
pyhelios.Context.Context.context = None |
Definition at line 92 of file Context.py.