![]() |
0.1.19
|
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:
Definition at line 78 of file Context.py.
Public Member Functions | |
| __init__ (self) | |
| __enter__ (self) | |
| __exit__ (self, exc_type, exc_value, traceback) | |
| __del__ (self) | |
| Destructor to ensure C++ resources freed even without 'with' statement. | |
| getNativePtr (self) | |
| markGeometryClean (self) | |
| markGeometryDirty (self) | |
| bool | isGeometryDirty (self) |
| seedRandomGenerator (self, int seed) | |
| Seed the random number generator for reproducible stochastic results. | |
| int | addPatch (self, vec3 center=vec3(0, 0, 0), vec2 size=vec2(1, 1), Optional[SphericalCoord] rotation=None, Optional[RGBcolor] color=None) |
| int | addPatchTextured (self, vec3 center, vec2 size, str texture_file, Optional[SphericalCoord] rotation=None, Optional[vec2] uv_center=None, Optional[vec2] uv_size=None) |
| Add a textured patch primitive to the context. | |
| 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. | |
| getPrimitiveType (self, uuid) | |
| Get the type of a primitive or multiple primitives. | |
| getPrimitiveArea (self, uuid) | |
| Get the area of a primitive or multiple primitives. | |
| getPrimitiveNormal (self, uuid) | |
| Get the normal vector of a primitive or multiple primitives. | |
| getPrimitiveVertices (self, uuid) | |
| Get vertices of a primitive or multiple primitives. | |
| getPrimitiveColor (self, uuid) | |
| Get the color of a primitive or multiple primitives. | |
| int | getPrimitiveCount (self) |
| bool | doesPrimitiveExist (self, uuid) |
| Check if a primitive exists for a given UUID or list of UUIDs. | |
| 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] | addDisk (self, vec3 center=vec3(0, 0, 0), vec2 size=vec2(1, 1), Union[int, int2] ndivs=20, Optional[SphericalCoord] rotation=None, Optional[Union[RGBcolor, RGBAcolor]] color=None) |
| Add a disk (circular or elliptical surface) to the context. | |
| List[int] | addCone (self, vec3 node0, vec3 node1, float radius0, float radius1, int ndivs=20, Optional[RGBcolor] color=None) |
| Add a cone (or cylinder/frustum) to the context. | |
| int | addSphereObject (self, vec3 center=vec3(0, 0, 0), Union[float, vec3] radius=1.0, int ndivs=20, Optional[RGBcolor] color=None, Optional[str] texturefile=None) |
| Add a spherical or ellipsoidal compound object to the context. | |
| int | addTileObject (self, vec3 center=vec3(0, 0, 0), vec2 size=vec2(1, 1), SphericalCoord rotation=SphericalCoord(1, 0, 0), int2 subdiv=int2(1, 1), Optional[RGBcolor] color=None, Optional[str] texturefile=None, Optional[int2] texture_repeat=None) |
| Add a tiled patch (subdivided patch) as a compound object to the context. | |
| int | addBoxObject (self, vec3 center=vec3(0, 0, 0), vec3 size=vec3(1, 1, 1), int3 subdiv=int3(1, 1, 1), Optional[RGBcolor] color=None, Optional[str] texturefile=None, bool reverse_normals=False) |
| Add a rectangular box (prism) as a compound object to the context. | |
| int | addConeObject (self, vec3 node0, vec3 node1, float radius0, float radius1, int ndivs=20, Optional[RGBcolor] color=None, Optional[str] texturefile=None) |
| Add a cone/cylinder/frustum as a compound object to the context. | |
| int | addDiskObject (self, vec3 center=vec3(0, 0, 0), vec2 size=vec2(1, 1), Union[int, int2] ndivs=20, Optional[SphericalCoord] rotation=None, Optional[Union[RGBcolor, RGBAcolor]] color=None, Optional[str] texturefile=None) |
| Add a disk as a compound object to the context. | |
| int | addTubeObject (self, int ndivs, List[vec3] nodes, List[float] radii, Optional[List[RGBcolor]] colors=None, Optional[str] texturefile=None, Optional[List[float]] texture_uv=None) |
| Add a tube as a compound object to the context. | |
| Union[int, List[int]] | copyPrimitive (self, Union[int, List[int]] UUID) |
| Copy one or more primitives. | |
| None | copyPrimitiveData (self, int sourceUUID, int destinationUUID) |
| Copy all primitive data from source to destination primitive. | |
| Union[int, List[int]] | copyObject (self, Union[int, List[int]] ObjID) |
| Copy one or more compound objects. | |
| None | copyObjectData (self, int source_objID, int destination_objID) |
| Copy all object data from source to destination compound object. | |
| None | translatePrimitive (self, Union[int, List[int]] UUID, vec3 shift) |
| Translate one or more primitives by a shift vector. | |
| None | translateObject (self, Union[int, List[int]] ObjID, vec3 shift) |
| Translate one or more compound objects by a shift vector. | |
| None | rotatePrimitive (self, Union[int, List[int]] UUID, float angle, Union[str, vec3] axis, Optional[vec3] origin=None) |
| Rotate one or more primitives. | |
| None | rotateObject (self, Union[int, List[int]] ObjID, float angle, Union[str, vec3] axis, Optional[vec3] origin=None, bool about_origin=False) |
| Rotate one or more objects. | |
| None | scalePrimitive (self, Union[int, List[int]] UUID, vec3 scale, Optional[vec3] point=None) |
| Scale one or more primitives. | |
| None | scaleObject (self, Union[int, List[int]] ObjID, vec3 scale, Optional[vec3] point=None, bool about_center=False, bool about_origin=False) |
| Scale one or more objects. | |
| None | scaleConeObjectLength (self, int ObjID, float scale_factor) |
| Scale the length of a Cone object by scaling the distance between its two nodes. | |
| None | scaleConeObjectGirth (self, int ObjID, float scale_factor) |
| Scale the girth of a Cone object by scaling the radii at both nodes. | |
| 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. | |
| None | writePrimitiveData (self, str filename, List[str] column_labels, Optional[List[int]] UUIDs=None, bool print_header=False) |
| Write primitive data to an ASCII text 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, uuids_or_uuid, str label, int value) |
| Set primitive data as signed 32-bit integer for one or multiple primitives. | |
| None | setPrimitiveDataUInt (self, uuids_or_uuid, str label, int value) |
| Set primitive data as unsigned 32-bit integer for one or multiple primitives. | |
| None | setPrimitiveDataFloat (self, uuids_or_uuid, str label, float value) |
| Set primitive data as 32-bit float for one or multiple primitives. | |
| None | setPrimitiveDataDouble (self, uuids_or_uuid, str label, float value) |
| Set primitive data as 64-bit double for one or multiple primitives. | |
| None | setPrimitiveDataString (self, uuids_or_uuid, str label, str value) |
| Set primitive data as string for one or multiple primitives. | |
| None | setPrimitiveDataVec2 (self, uuids_or_uuid, str label, x_or_vec, float y=None) |
| Set primitive data as vec2 for one or multiple primitives. | |
| None | setPrimitiveDataVec3 (self, uuids_or_uuid, str label, x_or_vec, float y=None, float z=None) |
| Set primitive data as vec3 for one or multiple primitives. | |
| None | setPrimitiveDataVec4 (self, uuids_or_uuid, str label, x_or_vec, float y=None, float z=None, float w=None) |
| Set primitive data as vec4 for one or multiple primitives. | |
| None | setPrimitiveDataInt2 (self, uuids_or_uuid, str label, x_or_vec, int y=None) |
| Set primitive data as int2 for one or multiple primitives. | |
| None | setPrimitiveDataInt3 (self, uuids_or_uuid, str label, x_or_vec, int y=None, int z=None) |
| Set primitive data as int3 for one or multiple primitives. | |
| None | setPrimitiveDataInt4 (self, uuids_or_uuid, str label, x_or_vec, int y=None, int z=None, int w=None) |
| Set primitive data as int4 for one or multiple primitives. | |
| 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. | |
| addTimeseriesData (self, str label, float value, 'Date' date, 'Time' time) | |
| Add a data point to a timeseries variable. | |
| updateTimeseriesData (self, str label, 'Date' date, 'Time' time, float new_value) | |
| Update the value of an existing timeseries data point. | |
| setCurrentTimeseriesPoint (self, str label, int index) | |
| Set the Context date and time from a timeseries data point index. | |
| float | queryTimeseriesData (self, str label, 'Date' date=None, 'Time' time=None, int index=None) |
| Query a timeseries data value. | |
| 'Time' | queryTimeseriesTime (self, str label, int index) |
| Get the Time associated with a timeseries data point. | |
| 'Date' | queryTimeseriesDate (self, str label, int index) |
| Get the Date associated with a timeseries data point. | |
| int | getTimeseriesLength (self, str label) |
| Get the number of data points in a timeseries variable. | |
| bool | doesTimeseriesVariableExist (self, str label) |
| Check whether a timeseries variable exists. | |
| List[str] | listTimeseriesVariables (self) |
| List all existing timeseries variables. | |
| clearTimeseriesData (self) | |
| Clear all timeseries data from the Context. | |
| loadTabularTimeseriesData (self, str data_file, List[str] column_labels, str delimiter=",", str date_string_format="YYYYMMDD", int headerlines=0) | |
| Load tabular timeseries data from a text file. | |
| None | deletePrimitive (self, Union[int, List[int]] uuids_or_uuid) |
| Delete one or more primitives from the context. | |
| None | deleteObject (self, Union[int, List[int]] objIDs_or_objID) |
| Delete one or more compound objects from the context. | |
| 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. | |
| addMaterial (self, str material_label) | |
| Create a new material for sharing visual properties across primitives. | |
| bool | doesMaterialExist (self, str material_label) |
| Check if a material with the given label exists. | |
| List[str] | listMaterials (self) |
| Get list of all material labels in the context. | |
| deleteMaterial (self, str material_label) | |
| Delete a material from the context. | |
| getMaterialColor (self, str material_label) | |
| Get the RGBA color of a material. | |
| setMaterialColor (self, str material_label, color) | |
| Set the RGBA color of a material. | |
| str | getMaterialTexture (self, str material_label) |
| Get the texture file path for a material. | |
| setMaterialTexture (self, str material_label, str texture_file) | |
| Set the texture file for a material. | |
| bool | isMaterialTextureColorOverridden (self, str material_label) |
| Check if material texture color is overridden by material color. | |
| setMaterialTextureColorOverride (self, str material_label, bool override) | |
| Set whether material color overrides texture color. | |
| int | getMaterialTwosidedFlag (self, str material_label) |
| Get the two-sided rendering flag for a material (0 = one-sided, 1 = two-sided). | |
| setMaterialTwosidedFlag (self, str material_label, int twosided_flag) | |
| Set the two-sided rendering flag for a material (0 = one-sided, 1 = two-sided). | |
| assignMaterialToPrimitive (self, uuid, str material_label) | |
| Assign a material to primitive(s). | |
| assignMaterialToObject (self, objID, str material_label) | |
| Assign a material to all primitives in compound object(s). | |
| getPrimitiveMaterialLabel (self, uuid) | |
| Get the material label assigned to a primitive or multiple primitives. | |
| int | getPrimitiveTwosidedFlag (self, int uuid, int default_value=1) |
| Get two-sided rendering flag for a primitive. | |
| List[int] | getPrimitivesUsingMaterial (self, str material_label) |
| Get all primitive UUIDs that use a specific material. | |
| getPrimitiveTextureFile (self, uuid) | |
| Get the texture file path of a primitive or multiple primitives. | |
| resolveMaterialTextures (self, uuids, colors_np) | |
| Resolve material texture suppression for export. | |
| packGPUBuffers (self, uuids) | |
| Pack GPU-ready geometry buffers for a set of primitives in a single C++ pass. | |
| None | setPrimitiveTextureFile (self, int uuid, str texture_file) |
| Set the texture file path of a primitive. | |
| int2 | getPrimitiveTextureSize (self, int uuid) |
| Get the texture size (width, height) of a primitive. | |
| getPrimitiveTextureUV (self, uuid) | |
| Get the texture UV coordinates of a primitive or multiple primitives. | |
| bool | primitiveTextureHasTransparencyChannel (self, int uuid) |
| Check if primitive texture has a transparency channel. | |
| getPrimitiveSolidFraction (self, uuid) | |
| Get the solid fraction of a primitive or multiple primitives. | |
| None | overridePrimitiveTextureColor (self, int uuid) |
| Override texture color with constant RGB color for a primitive. | |
| None | usePrimitiveTextureColor (self, int uuid) |
| Use texture map color instead of constant RGB for a primitive. | |
| bool | isPrimitiveTextureColorOverridden (self, int uuid) |
| Check if primitive texture color is overridden. | |
| 'np.ndarray' | getAllPrimitiveNormals (self) |
| Get normals for all primitives. | |
| 'np.ndarray' | getAllPrimitiveColors (self) |
| Get colors for all primitives. | |
| 'np.ndarray' | getAllPrimitiveAreas (self) |
| Get areas for all primitives. | |
| 'np.ndarray' | getAllPrimitiveTypes (self) |
| Get types for all primitives. | |
| 'np.ndarray' | getAllPrimitiveSolidFractions (self) |
| Get solid fractions for all primitives. | |
| getAllPrimitiveVertices (self) | |
| Get vertices for all primitives. | |
| List[str] | getAllPrimitiveTextureFiles (self) |
| Get texture files for all primitives. | |
| List[str] | getAllPrimitiveMaterialLabels (self) |
| Get material labels for all primitives. | |
| None | hidePrimitive (self, uuids_or_uuid) |
| Hide one or more primitives. | |
| None | showPrimitive (self, uuids_or_uuid) |
| Show one or more previously hidden primitives. | |
| bool | isPrimitiveHidden (self, int uuid) |
| Check if a primitive is hidden. | |
| None | hideObject (self, objids_or_objid) |
| Hide one or more compound objects (and all their primitives). | |
| None | showObject (self, objids_or_objid) |
| Show one or more previously hidden compound objects. | |
| bool | isObjectHidden (self, int objID) |
| Check if a compound object is hidden. | |
| None | setObjectDataInt (self, objids_or_objid, str label, int value) |
| Set object data as signed 32-bit integer for one or multiple objects. | |
| None | setObjectDataUInt (self, objids_or_objid, str label, int value) |
| Set object data as unsigned 32-bit integer for one or multiple objects. | |
| None | setObjectDataFloat (self, objids_or_objid, str label, float value) |
| Set object data as 32-bit float for one or multiple objects. | |
| None | setObjectDataDouble (self, objids_or_objid, str label, float value) |
| Set object data as 64-bit double for one or multiple objects. | |
| None | setObjectDataString (self, objids_or_objid, str label, str value) |
| Set object data as string for one or multiple objects. | |
| None | setObjectDataVec2 (self, objids_or_objid, str label, x_or_vec, float y=None) |
| Set object data as vec2. | |
| None | setObjectDataVec3 (self, objids_or_objid, str label, x_or_vec, float y=None, float z=None) |
| Set object data as vec3. | |
| None | setObjectDataVec4 (self, objids_or_objid, str label, x_or_vec, float y=None, float z=None, float w=None) |
| Set object data as vec4. | |
| None | setObjectDataInt2 (self, objids_or_objid, str label, x_or_vec, int y=None) |
| Set object data as int2. | |
| None | setObjectDataInt3 (self, objids_or_objid, str label, x_or_vec, int y=None, int z=None) |
| Set object data as int3. | |
| None | setObjectDataInt4 (self, objids_or_objid, str label, x_or_vec, int y=None, int z=None, int w=None) |
| Set object data as int4. | |
| getObjectData (self, int objID, str label, type data_type=None) | |
| Get object data with optional type specification. | |
| float | getObjectDataFloat (self, int objID, str label) |
| Get float object data. | |
| int | getObjectDataInt (self, int objID, str label) |
| Get int object data. | |
| str | getObjectDataString (self, int objID, str label) |
| Get string object data. | |
| int | getObjectDataType (self, int objID, str label) |
| Get the HeliosDataType enum for object data. | |
| int | getObjectDataSize (self, int objID, str label) |
| Get the size of object data array. | |
| bool | doesObjectDataExist (self, int objID, str label) |
| Check if object data exists. | |
| None | clearObjectData (self, objids_or_objid, str label) |
| Clear object data. | |
| List[str] | listObjectData (self, int objID) |
| List all data labels on a specific object. | |
| List[str] | listAllObjectDataLabels (self) |
| List all object data labels in context. | |
| None | duplicateObjectData (self, int objID, str old_label, str new_label) |
| Copy object data to a new label. | |
| None | renameObjectData (self, int objID, str old_label, str new_label) |
| Rename an object data label. | |
| List[int] | filterObjectsByData (self, List[int] objIDs, str label, value, str comparator="=") |
| Filter objects by data value. | |
| None | setGlobalDataInt (self, str label, int value) |
| Set global data as signed 32-bit integer. | |
| None | setGlobalDataUInt (self, str label, int value) |
| Set global data as unsigned 32-bit integer. | |
| None | setGlobalDataFloat (self, str label, float value) |
| Set global data as 32-bit float. | |
| None | setGlobalDataDouble (self, str label, float value) |
| Set global data as 64-bit double. | |
| None | setGlobalDataString (self, str label, str value) |
| Set global data as string. | |
| None | setGlobalDataVec2 (self, str label, x_or_vec, float y=None) |
| Set global data as vec2. | |
| None | setGlobalDataVec3 (self, str label, x_or_vec, float y=None, float z=None) |
| Set global data as vec3. | |
| None | setGlobalDataVec4 (self, str label, x_or_vec, float y=None, float z=None, float w=None) |
| Set global data as vec4. | |
| None | setGlobalDataInt2 (self, str label, x_or_vec, int y=None) |
| Set global data as int2. | |
| None | setGlobalDataInt3 (self, str label, x_or_vec, int y=None, int z=None) |
| Set global data as int3. | |
| None | setGlobalDataInt4 (self, str label, x_or_vec, int y=None, int z=None, int w=None) |
| Set global data as int4. | |
| getGlobalData (self, str label, type data_type=None) | |
| Get global data with optional type specification. | |
| float | getGlobalDataFloat (self, str label) |
| Get float global data. | |
| int | getGlobalDataInt (self, str label) |
| Get int global data. | |
| str | getGlobalDataString (self, str label) |
| Get string global data. | |
| int | getGlobalDataType (self, str label) |
| Get the HeliosDataType enum for global data. | |
| int | getGlobalDataSize (self, str label) |
| Get the size of global data array. | |
| bool | doesGlobalDataExist (self, str label) |
| Check if global data exists. | |
| None | clearGlobalData (self, str label) |
| Clear global data. | |
| None | renameGlobalData (self, str old_label, str new_label) |
| Rename a global data label. | |
| None | duplicateGlobalData (self, str old_label, str new_label) |
| Duplicate global data to a new label. | |
| List[str] | listGlobalData (self) |
| List all global data labels. | |
| None | incrementGlobalData (self, str label, increment) |
| Increment global data. | |
| calculatePrimitiveDataMean (self, List[int] uuids, str label, type return_type=float) | |
| Calculate arithmetic mean of primitive data across UUIDs. | |
| calculatePrimitiveDataAreaWeightedMean (self, List[int] uuids, str label, type return_type=float) | |
| Calculate area-weighted mean of primitive data. | |
| calculatePrimitiveDataSum (self, List[int] uuids, str label, type return_type=float) | |
| Calculate sum of primitive data across UUIDs. | |
| calculatePrimitiveDataAreaWeightedSum (self, List[int] uuids, str label, type return_type=float) | |
| Calculate area-weighted sum of primitive data. | |
| None | scalePrimitiveData (self, uuids_or_label, label_or_factor, factor=None) |
| Scale primitive data by a factor. | |
| None | incrementPrimitiveData (self, List[int] uuids, str label, increment) |
| Increment primitive data. | |
| None | aggregatePrimitiveDataSum (self, List[int] uuids, List[str] labels, str result_label) |
| Sum multiple primitive data fields into a new field. | |
| None | aggregatePrimitiveDataProduct (self, List[int] uuids, List[str] labels, str result_label) |
| Multiply multiple primitive data fields into a new field. | |
| float | sumPrimitiveSurfaceArea (self, List[int] uuids) |
| Calculate total one-sided surface area for a set of primitives. | |
| List[int] | filterPrimitivesByData (self, List[int] uuids, str label, value, str comparator="=") |
| Filter primitives by data value. | |
| int | getObjectType (self, int objID) |
Return the integer-coded helios::ObjectType of a compound object. | |
| vec3 | getObjectCenter (self, int objID) |
| getObjectBoundingBox (self, objIDs) | |
| Get axis-aligned bounding box for one object or a list of objects. | |
| List[int] | getObjectPrimitiveUUIDs (self, objIDs) |
| Get flattened primitive UUIDs for one object, a list of objects, or a list-of-lists. | |
| getTileObjectAreaRatio (self, objIDs) | |
| Get tile-object area ratio for one or multiple tile objects. | |
| vec3 | getTileObjectCenter (self, int objID) |
| vec2 | getTileObjectSize (self, int objID) |
| int2 | getTileObjectSubdivisionCount (self, int objID) |
| vec3 | getTileObjectNormal (self, int objID) |
| List[vec2] | getTileObjectTextureUV (self, int objID) |
| List[vec3] | getTileObjectVertices (self, int objID) |
| vec3 | getSphereObjectCenter (self, int objID) |
| vec3 | getSphereObjectRadius (self, int objID) |
| Get per-axis radii of a sphere object. | |
| int | getSphereObjectSubdivisionCount (self, int objID) |
| float | getSphereObjectVolume (self, int objID) |
| vec3 | getBoxObjectCenter (self, int objID) |
| vec3 | getBoxObjectSize (self, int objID) |
| int3 | getBoxObjectSubdivisionCount (self, int objID) |
| float | getBoxObjectVolume (self, int objID) |
| vec3 | getDiskObjectCenter (self, int objID) |
| vec2 | getDiskObjectSize (self, int objID) |
| int | getDiskObjectSubdivisionCount (self, int objID) |
| int | getTubeObjectSubdivisionCount (self, int objID) |
| int | getTubeObjectNodeCount (self, int objID) |
| List[vec3] | getTubeObjectNodes (self, int objID) |
| List[float] | getTubeObjectNodeRadii (self, int objID) |
| List[RGBcolor] | getTubeObjectNodeColors (self, int objID) |
| float | getTubeObjectVolume (self, int objID) |
| float | getTubeObjectSegmentVolume (self, int objID, int segment_index) |
| int | getConeObjectSubdivisionCount (self, int objID) |
| List[vec3] | getConeObjectNodes (self, int objID) |
| List[float] | getConeObjectNodeRadii (self, int objID) |
| vec3 | getConeObjectNode (self, int objID, int number) |
| float | getConeObjectNodeRadius (self, int objID, int number) |
| vec3 | getConeObjectAxisUnitVector (self, int objID) |
| float | getConeObjectLength (self, int objID) |
| float | getConeObjectVolume (self, int objID) |
| vec3 | getPatchCenter (self, int uuid) |
| vec2 | getPatchSize (self, int uuid) |
| vec3 | getTriangleVertex (self, int uuid, int number) |
| vec3 | getVoxelCenter (self, int uuid) |
| vec3 | getVoxelSize (self, int uuid) |
| int | getPatchCount (self, bool include_hidden=True) |
| int | getTriangleCount (self, bool include_hidden=True) |
| getPrimitiveBoundingBox (self, uuids) | |
| Get axis-aligned bounding box for one primitive or a list of primitives. | |
| None | setPrimitiveColor (self, uuids, color) |
| Set the RGB or RGBA color of one primitive or a list of primitives. | |
| None | clearPrimitiveData (self, uuids, str label) |
| Remove a named data field from one primitive or a list of primitives. | |
| List[str] | listPrimitiveData (self, int uuid) |
| List all data labels attached to a primitive. | |
| None | cropDomainX (self, vec2 xbounds) |
| None | cropDomainY (self, vec2 ybounds) |
| None | cropDomainZ (self, vec2 zbounds) |
| Optional[List[int]] | cropDomain (self, *args) |
| Crop the context domain to the given XYZ bounds. | |
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 80 of file Context.py.
| pyhelios.Context.Context.__del__ | ( | self | ) |
Destructor to ensure C++ resources freed even without 'with' statement.
Definition at line 295 of file Context.py.
| pyhelios.Context.Context.__enter__ | ( | self | ) |
Definition at line 285 of file Context.py.
| pyhelios.Context.Context.__exit__ | ( | self, | |
| exc_type, | |||
| exc_value, | |||
| traceback ) |
Definition at line 288 of file Context.py.
|
protected |
Helper method to check if context is available with detailed error messages.
Definition at line 133 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 212 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 255 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 177 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) |
Definition at line 934 of file Context.py.
| int pyhelios.Context.Context.addBoxObject | ( | self, | |
| vec3 | center = vec3(0, 0, 0), | ||
| vec3 | size = vec3(1, 1, 1), | ||
| int3 | subdiv = int3(1, 1, 1), | ||
| Optional[RGBcolor] | color = None, | ||
| Optional[str] | texturefile = None, | ||
| bool | reverse_normals = False ) |
Add a rectangular box (prism) as a compound object to the context.
| center | Center position (default: origin) |
| size | Size in x, y, z directions (default: 1x1x1) |
| subdiv | Subdivisions in x, y, z (default: 1x1x1) |
| color | Optional RGB color |
| texturefile | Optional texture file path |
| reverse_normals | Reverse normal directions (default: False) |
Definition at line 1362 of file Context.py.
| List[int] pyhelios.Context.Context.addCone | ( | self, | |
| vec3 | node0, | ||
| vec3 | node1, | ||
| float | radius0, | ||
| float | radius1, | ||
| int | ndivs = 20, | ||
| Optional[RGBcolor] | color = None ) |
Add a cone (or cylinder/frustum) to the context.
A cone is a 3D shape connecting two circular cross-sections with potentially different radii. When radii are equal, creates a cylinder. When one radius is zero, creates a true cone.
| node0 | 3D coordinates of the base center |
| node1 | 3D coordinates of the apex center |
| radius0 | Radius at base (node0). Use 0 for pointed end. |
| radius1 | Radius at apex (node1). Use 0 for pointed end. |
| ndivs | Number of radial divisions for tessellation (default: 20) |
| color | Color of the cone (default: white) |
Definition at line 1139 of file Context.py.
| int pyhelios.Context.Context.addConeObject | ( | self, | |
| vec3 | node0, | ||
| vec3 | node1, | ||
| float | radius0, | ||
| float | radius1, | ||
| int | ndivs = 20, | ||
| Optional[RGBcolor] | color = None, | ||
| Optional[str] | texturefile = None ) |
Add a cone/cylinder/frustum as a compound object to the context.
| node0 | Base position |
| node1 | Top position |
| radius0 | Radius at base |
| radius1 | Radius at top |
| ndivs | Number of radial divisions (default: 20) |
| color | Optional RGB color |
| texturefile | Optional texture file path |
Definition at line 1406 of file Context.py.
| List[int] pyhelios.Context.Context.addDisk | ( | self, | |
| vec3 | center = vec3(0, 0, 0), | ||
| vec2 | size = vec2(1, 1), | ||
| Union[int, int2] | ndivs = 20, | ||
| Optional[SphericalCoord] | rotation = None, | ||
| Optional[Union[RGBcolor, RGBAcolor]] | color = None ) |
Add a disk (circular or elliptical surface) to the context.
A disk is a flat circular or elliptical surface tessellated into triangular faces. Supports both uniform radial subdivisions and separate radial/azimuthal subdivisions for finer control.
| center | 3D coordinates of disk center (default: origin) |
| size | Semi-major and semi-minor radii of the disk (default: 1x1 circle) |
| ndivs | Number of radial divisions (int) or [radial, azimuthal] divisions (int2) (default: 20). Higher values create smoother circles but more triangles. |
| rotation | Orientation of the disk (default: horizontal, normal = +z) |
| color | Color of the disk (default: white). Can be RGBcolor or RGBAcolor for transparency. |
Definition at line 1010 of file Context.py.
| int pyhelios.Context.Context.addDiskObject | ( | self, | |
| vec3 | center = vec3(0, 0, 0), | ||
| vec2 | size = vec2(1, 1), | ||
| Union[int, int2] | ndivs = 20, | ||
| Optional[SphericalCoord] | rotation = None, | ||
| Optional[Union[RGBcolor, RGBAcolor]] | color = None, | ||
| Optional[str] | texturefile = None ) |
Add a disk as a compound object to the context.
| center | Center position (default: origin) |
| size | Semi-major and semi-minor radii (default: 1x1) |
| ndivs | int (uniform) or int2 (polar/radial subdivisions) (default: 20) |
| rotation | Optional spherical rotation |
| color | Optional RGB or RGBA color |
| texturefile | Optional texture file path |
Definition at line 1444 of file Context.py.
| pyhelios.Context.Context.addMaterial | ( | self, | |
| str | material_label ) |
Create a new material for sharing visual properties across primitives.
Materials enable efficient memory usage by allowing multiple primitives to share rendering properties. Changes to a material affect all primitives using it.
| material_label | Unique label for the material |
| RuntimeError | If material label already exists |
Definition at line 3541 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 337 of file Context.py.
| int pyhelios.Context.Context.addPatchTextured | ( | self, | |
| vec3 | center, | ||
| vec2 | size, | ||
| str | texture_file, | ||
| Optional[SphericalCoord] | rotation = None, | ||
| Optional[vec2] | uv_center = None, | ||
| Optional[vec2] | uv_size = None ) |
Add a textured patch primitive to the context.
Creates a rectangular patch with a texture image mapped to its surface.
| center | 3D position of the patch center |
| size | Width and height of the patch |
| texture_file | Path to texture image file (supports PNG, JPG, JPEG, TGA, BMP) |
| rotation | Optional spherical rotation (defaults to no rotation) |
| uv_center | Optional UV center of texture map (required if uv_size is provided) |
| uv_size | Optional UV size of texture map (required if uv_center is provided) |
| ValueError | If arguments have wrong types or UV params are partially specified |
| FileNotFoundError | If texture file doesn't exist |
| RuntimeError | If context is in mock mode |
Definition at line 373 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) |
Definition at line 795 of file Context.py.
| int pyhelios.Context.Context.addSphereObject | ( | self, | |
| vec3 | center = vec3(0, 0, 0), | ||
| Union[float, vec3] | radius = 1.0, | ||
| int | ndivs = 20, | ||
| Optional[RGBcolor] | color = None, | ||
| Optional[str] | texturefile = None ) |
Add a spherical or ellipsoidal compound object to the context.
Creates a sphere or ellipsoid as a compound object with a trackable object ID. Primitives within the object are registered as children of the object.
| center | Center position of sphere/ellipsoid (default: origin) |
| radius | Radius as float (sphere) or vec3 (ellipsoid) (default: 1.0) |
| ndivs | Number of tessellation divisions (default: 20) |
| color | Optional RGB color |
| texturefile | Optional texture image file path |
| ValueError | If parameters are invalid |
| NotImplementedError | If object-returning functions unavailable |
Definition at line 1209 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) |
Definition at line 727 of file Context.py.
| int pyhelios.Context.Context.addTileObject | ( | self, | |
| vec3 | center = vec3(0, 0, 0), | ||
| vec2 | size = vec2(1, 1), | ||
| SphericalCoord | rotation = SphericalCoord(1, 0, 0), | ||
| int2 | subdiv = int2(1, 1), | ||
| Optional[RGBcolor] | color = None, | ||
| Optional[str] | texturefile = None, | ||
| Optional[int2] | texture_repeat = None ) |
Add a tiled patch (subdivided patch) as a compound object to the context.
Creates a rectangular patch subdivided into a grid of smaller patches, registered as a compound object with a trackable object ID.
| center | Center position of tile (default: origin) |
| size | Size in x and y directions (default: 1x1) |
| rotation | Spherical rotation (default: no rotation) |
| subdiv | Number of subdivisions in x and y (default: 1x1) |
| color | Optional RGB color |
| texturefile | Optional texture image file path |
| texture_repeat | Optional texture repetitions in x and y |
| ValueError | If parameters are invalid |
| NotImplementedError | If object-returning functions unavailable |
Definition at line 1299 of file Context.py.
| pyhelios.Context.Context.addTimeseriesData | ( | self, | |
| str | label, | ||
| float | value, | ||
| 'Date' | date, | ||
| 'Time' | time ) |
Add a data point to a timeseries variable.
| label | Name of the timeseries variable (e.g., "temperature") |
| value | Value of the data point |
| time | Time of the data point |
| ValueError | If label is empty, or date/time are wrong types |
| NotImplementedError | If timeseries functions not available |
Definition at line 3073 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 424 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 2316 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 |
>>> uuids = context.addTrianglesFromArraysTextured(vertices, faces, uvs, "texture.png")
>>> texture_files = ["wood.png", "metal.png", "glass.png"] >>> material_ids = np.array([0, 0, 1, 1, 2, 2]) # 6 faces using different textures >>> uuids = context.addTrianglesFromArraysTextured(vertices, faces, uvs, texture_files, material_ids)
Definition at line 2407 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 |
Definition at line 466 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: |
Definition at line 855 of file Context.py.
| int pyhelios.Context.Context.addTubeObject | ( | self, | |
| int | ndivs, | ||
| List[vec3] | nodes, | ||
| List[float] | radii, | ||
| Optional[List[RGBcolor]] | colors = None, | ||
| Optional[str] | texturefile = None, | ||
| Optional[List[float]] | texture_uv = None ) |
Add a tube as a compound object to the context.
| ndivs | Number of radial subdivisions |
| nodes | List of vec3 positions defining tube segments |
| radii | List of radii at each node |
| colors | Optional list of RGB colors for each segment |
| texturefile | Optional texture file path |
| texture_uv | Optional UV coordinates for texture mapping |
Definition at line 1490 of file Context.py.
| None pyhelios.Context.Context.aggregatePrimitiveDataProduct | ( | self, | |
| List[int] | uuids, | ||
| List[str] | labels, | ||
| str | result_label ) |
Multiply multiple primitive data fields into a new field.
Definition at line 4440 of file Context.py.
| None pyhelios.Context.Context.aggregatePrimitiveDataSum | ( | self, | |
| List[int] | uuids, | ||
| List[str] | labels, | ||
| str | result_label ) |
Sum multiple primitive data fields into a new field.
Definition at line 4436 of file Context.py.
| pyhelios.Context.Context.assignMaterialToObject | ( | self, | |
| objID, | |||
| str | material_label ) |
Assign a material to all primitives in compound object(s).
| objID | Single object ID (int) or list of object IDs (List[int]) |
| material_label | Label of the material to assign |
| RuntimeError | If object or material doesn't exist |
Definition at line 3690 of file Context.py.
| pyhelios.Context.Context.assignMaterialToPrimitive | ( | self, | |
| uuid, | |||
| str | material_label ) |
Assign a material to primitive(s).
| uuid | Single UUID (int) or list of UUIDs (List[int]) |
| material_label | Label of the material to assign |
| RuntimeError | If primitive or material doesn't exist |
Definition at line 3669 of file Context.py.
| pyhelios.Context.Context.calculatePrimitiveDataAreaWeightedMean | ( | self, | |
| List[int] | uuids, | ||
| str | label, | ||
| type | return_type = float ) |
Calculate area-weighted mean of primitive data.
Definition at line 4392 of file Context.py.
| pyhelios.Context.Context.calculatePrimitiveDataAreaWeightedSum | ( | self, | |
| List[int] | uuids, | ||
| str | label, | ||
| type | return_type = float ) |
Calculate area-weighted sum of primitive data.
Definition at line 4408 of file Context.py.
| pyhelios.Context.Context.calculatePrimitiveDataMean | ( | self, | |
| List[int] | uuids, | ||
| str | label, | ||
| type | return_type = float ) |
Calculate arithmetic mean of primitive data across UUIDs.
| uuids | List of primitive UUIDs. |
| label | Data label. |
| return_type | float (default), "double", or vec3. |
Definition at line 4380 of file Context.py.
| pyhelios.Context.Context.calculatePrimitiveDataSum | ( | self, | |
| List[int] | uuids, | ||
| str | label, | ||
| type | return_type = float ) |
Calculate sum of primitive data across UUIDs.
Definition at line 4399 of file Context.py.
| None pyhelios.Context.Context.clearGlobalData | ( | self, | |
| str | label ) |
Clear global data.
Definition at line 4347 of file Context.py.
| None pyhelios.Context.Context.clearObjectData | ( | self, | |
| objids_or_objid, | |||
| str | label ) |
| None pyhelios.Context.Context.clearPrimitiveData | ( | self, | |
| uuids, | |||
| str | label ) |
Remove a named data field from one primitive or a list of primitives.
Definition at line 4756 of file Context.py.
| pyhelios.Context.Context.clearTimeseriesData | ( | self | ) |
Clear all timeseries data from the Context.
Removes all timeseries variables and their associated date/time values.
| NotImplementedError | If timeseries functions not available |
Definition at line 3342 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 2955 of file Context.py.
| Union[int, List[int]] pyhelios.Context.Context.copyObject | ( | self, | |
| Union[int, List[int]] | ObjID ) |
Copy one or more compound objects.
Creates a duplicate of the specified compound object(s) with all associated primitives and data. The copy is placed at the same location as the original.
| ObjID | Single object ID or list of object IDs to copy |
Definition at line 1613 of file Context.py.
| None pyhelios.Context.Context.copyObjectData | ( | self, | |
| int | source_objID, | ||
| int | destination_objID ) |
Copy all object data from source to destination compound object.
Copies all associated data (object data fields) from the source compound object to the destination object. Both objects must already exist.
| source_objID | Object ID of the source compound object |
| destination_objID | Object ID of the destination compound object |
Definition at line 1641 of file Context.py.
| Union[int, List[int]] pyhelios.Context.Context.copyPrimitive | ( | self, | |
| Union[int, List[int]] | UUID ) |
Copy one or more primitives.
Creates a duplicate of the specified primitive(s) with all associated data. The copy is placed at the same location as the original.
| UUID | Single primitive UUID or list of UUIDs to copy |
Definition at line 1553 of file Context.py.
| None pyhelios.Context.Context.copyPrimitiveData | ( | self, | |
| int | sourceUUID, | ||
| int | destinationUUID ) |
Copy all primitive data from source to destination primitive.
Copies all associated data (primitive data fields) from the source primitive to the destination primitive. Both primitives must already exist.
| sourceUUID | UUID of the source primitive |
| destinationUUID | UUID of the destination primitive |
Definition at line 1581 of file Context.py.
| Optional[List[int]] pyhelios.Context.Context.cropDomain | ( | self, | |
| * | args ) |
Crop the context domain to the given XYZ bounds.
Two call forms:
cropDomain vec2, ybounds: vec2, zbounds: vec2)
-> crop ALL primitives; returns None.
cropDomain List[int], xbounds: vec2, ybounds: vec2, zbounds: vec2)
-> crop only the given primitives; returns the list of primitives
that survived (in-bounds UUIDs). The input list is NOT mutated.
Definition at line 4797 of file Context.py.
| None pyhelios.Context.Context.cropDomainX | ( | self, | |
| vec2 | xbounds ) |
Definition at line 4770 of file Context.py.
| None pyhelios.Context.Context.cropDomainY | ( | self, | |
| vec2 | ybounds ) |
Definition at line 4776 of file Context.py.
| None pyhelios.Context.Context.cropDomainZ | ( | self, | |
| vec2 | zbounds ) |
Definition at line 4782 of file Context.py.
| pyhelios.Context.Context.deleteMaterial | ( | self, | |
| str | material_label ) |
Delete a material from the context.
Primitives using this material will be reassigned to the default material.
| material_label | Label of the material to delete |
| RuntimeError | If material doesn't exist |
Definition at line 3563 of file Context.py.
| None pyhelios.Context.Context.deleteObject | ( | self, | |
| Union[int, List[int]] | objIDs_or_objID ) |
Delete one or more compound objects from the context.
This removes the compound object(s) AND all their child primitives. Use this when you want to delete an entire object hierarchy at once.
| objIDs_or_objID | Single object ID (int) or list of object IDs to delete |
| RuntimeError | If any object ID doesn't exist in the context |
| ValueError | If object ID is invalid (negative) |
| NotImplementedError | If delete functions not available in current library build |
Definition at line 3460 of file Context.py.
| None pyhelios.Context.Context.deletePrimitive | ( | self, | |
| Union[int, List[int]] | uuids_or_uuid ) |
Delete one or more primitives from the context.
This removes the primitive(s) entirely from the context. If a primitive belongs to a compound object, it will be removed from that object. If the object becomes empty after removal, it is automatically deleted.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to delete |
| RuntimeError | If any UUID doesn't exist in the context |
| ValueError | If UUID is invalid (negative) |
| NotImplementedError | If delete functions not available in current library build |
Definition at line 3425 of file Context.py.
| bool pyhelios.Context.Context.doesGlobalDataExist | ( | self, | |
| str | label ) |
Check if global data exists.
Definition at line 4343 of file Context.py.
| bool pyhelios.Context.Context.doesMaterialExist | ( | self, | |
| str | material_label ) |
Check if a material with the given label exists.
Definition at line 3545 of file Context.py.
| bool pyhelios.Context.Context.doesObjectDataExist | ( | self, | |
| int | objID, | ||
| str | label ) |
Check if object data exists.
Definition at line 4180 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 2785 of file Context.py.
| bool pyhelios.Context.Context.doesPrimitiveExist | ( | self, | |
| uuid ) |
Check if a primitive exists for a given UUID or list of UUIDs.
| uuid | A single UUID (int) or a list of UUIDs. |
Definition at line 611 of file Context.py.
| bool pyhelios.Context.Context.doesTimeseriesVariableExist | ( | self, | |
| str | label ) |
Check whether a timeseries variable exists.
| label | Name of the timeseries variable |
| ValueError | If label is empty |
| NotImplementedError | If timeseries functions not available |
Definition at line 3304 of file Context.py.
| None pyhelios.Context.Context.duplicateGlobalData | ( | self, | |
| str | old_label, | ||
| str | new_label ) |
Duplicate global data to a new label.
Definition at line 4355 of file Context.py.
| None pyhelios.Context.Context.duplicateObjectData | ( | self, | |
| int | objID, | ||
| str | old_label, | ||
| str | new_label ) |
Copy object data to a new label.
Definition at line 4199 of file Context.py.
| List[int] pyhelios.Context.Context.filterObjectsByData | ( | self, | |
| List[int] | objIDs, | ||
| str | label, | ||
| value, | |||
| str | comparator = "=" ) |
Filter objects by data value.
Auto-dispatches based on value type.
Definition at line 4207 of file Context.py.
| List[int] pyhelios.Context.Context.filterPrimitivesByData | ( | self, | |
| List[int] | uuids, | ||
| str | label, | ||
| value, | |||
| str | comparator = "=" ) |
Filter primitives by data value.
Auto-dispatches based on value type.
| uuids | UUIDs to filter. |
| label | Data label to compare. |
| value | Filter value (float, int, or str). |
| comparator | Comparison operator ("=", "<", ">", "<=", ">="). Not used for strings. |
Definition at line 4455 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 3480 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 3517 of file Context.py.
| dict pyhelios.Context.Context.get_plugin_capabilities | ( | self | ) |
Get detailed information about available plugin capabilities.
Definition at line 3501 of file Context.py.
| List[int] pyhelios.Context.Context.getAllObjectIDs | ( | self | ) |
Definition at line 628 of file Context.py.
| 'np.ndarray' pyhelios.Context.Context.getAllPrimitiveAreas | ( | self | ) |
Get areas for all primitives.
Returns ndarray of shape (N,).
Definition at line 3930 of file Context.py.
| 'np.ndarray' pyhelios.Context.Context.getAllPrimitiveColors | ( | self | ) |
Get colors for all primitives.
Returns ndarray of shape (N, 3).
Definition at line 3926 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 682 of file Context.py.
| List[str] pyhelios.Context.Context.getAllPrimitiveMaterialLabels | ( | self | ) |
Get material labels for all primitives.
Returns list of strings.
Definition at line 3950 of file Context.py.
| 'np.ndarray' pyhelios.Context.Context.getAllPrimitiveNormals | ( | self | ) |
Get normals for all primitives.
Returns ndarray of shape (N, 3).
Definition at line 3922 of file Context.py.
| 'np.ndarray' pyhelios.Context.Context.getAllPrimitiveSolidFractions | ( | self | ) |
Get solid fractions for all primitives.
Returns ndarray of shape (N,).
Definition at line 3938 of file Context.py.
| List[str] pyhelios.Context.Context.getAllPrimitiveTextureFiles | ( | self | ) |
Get texture files for all primitives.
Returns list of strings.
Definition at line 3946 of file Context.py.
| 'np.ndarray' pyhelios.Context.Context.getAllPrimitiveTypes | ( | self | ) |
Get types for all primitives.
Returns ndarray of shape (N,) uint32.
Definition at line 3934 of file Context.py.
| pyhelios.Context.Context.getAllPrimitiveVertices | ( | self | ) |
Get vertices for all primitives.
Returns (flat_data, offsets) tuple.
Definition at line 3942 of file Context.py.
| List[int] pyhelios.Context.Context.getAllUUIDs | ( | self | ) |
Definition at line 618 of file Context.py.
| vec3 pyhelios.Context.Context.getBoxObjectCenter | ( | self, | |
| int | objID ) |
Definition at line 4576 of file Context.py.
| vec3 pyhelios.Context.Context.getBoxObjectSize | ( | self, | |
| int | objID ) |
Definition at line 4581 of file Context.py.
| int3 pyhelios.Context.Context.getBoxObjectSubdivisionCount | ( | self, | |
| int | objID ) |
Definition at line 4586 of file Context.py.
| float pyhelios.Context.Context.getBoxObjectVolume | ( | self, | |
| int | objID ) |
Definition at line 4591 of file Context.py.
| vec3 pyhelios.Context.Context.getConeObjectAxisUnitVector | ( | self, | |
| int | objID ) |
Definition at line 4664 of file Context.py.
| float pyhelios.Context.Context.getConeObjectLength | ( | self, | |
| int | objID ) |
Definition at line 4669 of file Context.py.
| vec3 pyhelios.Context.Context.getConeObjectNode | ( | self, | |
| int | objID, | ||
| int | number ) |
Definition at line 4655 of file Context.py.
| List[float] pyhelios.Context.Context.getConeObjectNodeRadii | ( | self, | |
| int | objID ) |
Definition at line 4651 of file Context.py.
| float pyhelios.Context.Context.getConeObjectNodeRadius | ( | self, | |
| int | objID, | ||
| int | number ) |
Definition at line 4660 of file Context.py.
| List[vec3] pyhelios.Context.Context.getConeObjectNodes | ( | self, | |
| int | objID ) |
Definition at line 4646 of file Context.py.
| int pyhelios.Context.Context.getConeObjectSubdivisionCount | ( | self, | |
| int | objID ) |
Definition at line 4642 of file Context.py.
| float pyhelios.Context.Context.getConeObjectVolume | ( | self, | |
| int | objID ) |
Definition at line 4673 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 |
Definition at line 3049 of file Context.py.
| vec3 pyhelios.Context.Context.getDiskObjectCenter | ( | self, | |
| int | objID ) |
Definition at line 4596 of file Context.py.
| vec2 pyhelios.Context.Context.getDiskObjectSize | ( | self, | |
| int | objID ) |
Definition at line 4601 of file Context.py.
| int pyhelios.Context.Context.getDiskObjectSubdivisionCount | ( | self, | |
| int | objID ) |
Definition at line 4606 of file Context.py.
| pyhelios.Context.Context.getGlobalData | ( | self, | |
| str | label, | ||
| type | data_type = None ) |
Get global data with optional type specification.
Auto-detects type if not specified.
Definition at line 4288 of file Context.py.
| float pyhelios.Context.Context.getGlobalDataFloat | ( | self, | |
| str | label ) |
Get float global data.
Definition at line 4323 of file Context.py.
| int pyhelios.Context.Context.getGlobalDataInt | ( | self, | |
| str | label ) |
Get int global data.
Definition at line 4327 of file Context.py.
| int pyhelios.Context.Context.getGlobalDataSize | ( | self, | |
| str | label ) |
Get the size of global data array.
Definition at line 4339 of file Context.py.
| str pyhelios.Context.Context.getGlobalDataString | ( | self, | |
| str | label ) |
Get string global data.
Definition at line 4331 of file Context.py.
| int pyhelios.Context.Context.getGlobalDataType | ( | self, | |
| str | label ) |
Get the HeliosDataType enum for global data.
Definition at line 4335 of file Context.py.
| pyhelios.Context.Context.getMaterialColor | ( | self, | |
| str | material_label ) |
Get the RGBA color of a material.
| material_label | Label of the material |
| RuntimeError | If material doesn't exist |
Definition at line 3578 of file Context.py.
| str pyhelios.Context.Context.getMaterialTexture | ( | self, | |
| str | material_label ) |
Get the texture file path for a material.
| material_label | Label of the material |
| RuntimeError | If material doesn't exist |
Definition at line 3621 of file Context.py.
| int pyhelios.Context.Context.getMaterialTwosidedFlag | ( | self, | |
| str | material_label ) |
Get the two-sided rendering flag for a material (0 = one-sided, 1 = two-sided).
Definition at line 3648 of file Context.py.
| pyhelios.Context.Context.getNativePtr | ( | self | ) |
Definition at line 305 of file Context.py.
| pyhelios.Context.Context.getObjectBoundingBox | ( | self, | |
| objIDs ) |
Get axis-aligned bounding box for one object or a list of objects.
| objIDs | Single object ID (int) or list of object IDs. |
Definition at line 4489 of file Context.py.
| vec3 pyhelios.Context.Context.getObjectCenter | ( | self, | |
| int | objID ) |
Definition at line 4476 of file Context.py.
| int pyhelios.Context.Context.getObjectCount | ( | self | ) |
Definition at line 624 of file Context.py.
| pyhelios.Context.Context.getObjectData | ( | self, | |
| int | objID, | ||
| str | label, | ||
| type | data_type = None ) |
Get object data with optional type specification.
Auto-detects type if not specified.
Definition at line 4125 of file Context.py.
| float pyhelios.Context.Context.getObjectDataFloat | ( | self, | |
| int | objID, | ||
| str | label ) |
Get float object data.
Definition at line 4160 of file Context.py.
| int pyhelios.Context.Context.getObjectDataInt | ( | self, | |
| int | objID, | ||
| str | label ) |
Get int object data.
Definition at line 4164 of file Context.py.
| int pyhelios.Context.Context.getObjectDataSize | ( | self, | |
| int | objID, | ||
| str | label ) |
Get the size of object data array.
Definition at line 4176 of file Context.py.
| str pyhelios.Context.Context.getObjectDataString | ( | self, | |
| int | objID, | ||
| str | label ) |
Get string object data.
Definition at line 4168 of file Context.py.
| int pyhelios.Context.Context.getObjectDataType | ( | self, | |
| int | objID, | ||
| str | label ) |
Get the HeliosDataType enum for object data.
Definition at line 4172 of file Context.py.
| List[int] pyhelios.Context.Context.getObjectPrimitiveUUIDs | ( | self, | |
| objIDs ) |
Get flattened primitive UUIDs for one object, a list of objects, or a list-of-lists.
| objIDs | int, List[int], or List[List[int]]. |
Definition at line 4505 of file Context.py.
| int pyhelios.Context.Context.getObjectType | ( | self, | |
| int | objID ) |
Return the integer-coded helios::ObjectType of a compound object.
Values follow the C++ `helios::ObjectType` enum (0=tile, 1=sphere, 2=tube, 3=box, 4=disk, 5=polymesh, 6=cone).
Definition at line 4472 of file Context.py.
| vec3 pyhelios.Context.Context.getPatchCenter | ( | self, | |
| int | uuid ) |
Definition at line 4679 of file Context.py.
| int pyhelios.Context.Context.getPatchCount | ( | self, | |
| bool | include_hidden = True ) |
Definition at line 4704 of file Context.py.
| vec2 pyhelios.Context.Context.getPatchSize | ( | self, | |
| int | uuid ) |
Definition at line 4684 of file Context.py.
| pyhelios.Context.Context.getPrimitiveArea | ( | self, | |
| uuid ) |
Get the area of a primitive or multiple primitives.
| uuid | Single UUID (int) or list of UUIDs |
Definition at line 518 of file Context.py.
| pyhelios.Context.Context.getPrimitiveBoundingBox | ( | self, | |
| uuids ) |
Get axis-aligned bounding box for one primitive or a list of primitives.
| uuids | Single UUID (int) or list of UUIDs. |
Definition at line 4720 of file Context.py.
| pyhelios.Context.Context.getPrimitiveColor | ( | self, | |
| uuid ) |
Get the color of a primitive or multiple primitives.
| uuid | Single UUID (int) or list of UUIDs |
Definition at line 586 of file Context.py.
| int pyhelios.Context.Context.getPrimitiveCount | ( | self | ) |
Definition at line 598 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 2712 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 2852 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 2798 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 2824 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 2811 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 643 of file Context.py.
| pyhelios.Context.Context.getPrimitiveMaterialLabel | ( | self, | |
| uuid ) |
Get the material label assigned to a primitive or multiple primitives.
| uuid | Single UUID (int) or list of UUIDs |
| RuntimeError | If primitive doesn't exist |
Definition at line 3707 of file Context.py.
| pyhelios.Context.Context.getPrimitiveNormal | ( | self, | |
| uuid ) |
Get the normal vector of a primitive or multiple primitives.
| uuid | Single UUID (int) or list of UUIDs |
Definition at line 537 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 695 of file Context.py.
| pyhelios.Context.Context.getPrimitiveSolidFraction | ( | self, | |
| uuid ) |
Get the solid fraction of a primitive or multiple primitives.
| uuid | Single UUID (int) or list of UUIDs |
Definition at line 3876 of file Context.py.
| List[int] pyhelios.Context.Context.getPrimitivesUsingMaterial | ( | self, | |
| str | material_label ) |
Get all primitive UUIDs that use a specific material.
| material_label | Label of the material |
| RuntimeError | If material doesn't exist |
Definition at line 3746 of file Context.py.
| pyhelios.Context.Context.getPrimitiveTextureFile | ( | self, | |
| uuid ) |
Get the texture file path of a primitive or multiple primitives.
| uuid | Single UUID (int) or list of UUIDs |
Definition at line 3761 of file Context.py.
| int2 pyhelios.Context.Context.getPrimitiveTextureSize | ( | self, | |
| int | uuid ) |
Get the texture size (width, height) of a primitive.
| uuid | UUID of the primitive |
Definition at line 3829 of file Context.py.
| pyhelios.Context.Context.getPrimitiveTextureUV | ( | self, | |
| uuid ) |
Get the texture UV coordinates of a primitive or multiple primitives.
| uuid | Single UUID (int) or list of UUIDs |
Definition at line 3842 of file Context.py.
| int pyhelios.Context.Context.getPrimitiveTwosidedFlag | ( | self, | |
| int | uuid, | ||
| int | default_value = 1 ) |
Get two-sided rendering flag for a primitive.
Checks material first, then primitive data if no material assigned.
| uuid | UUID of the primitive |
| default_value | Default value if no material/data (default 1 = two-sided) |
Definition at line 3731 of file Context.py.
| pyhelios.Context.Context.getPrimitiveType | ( | self, | |
| uuid ) |
Get the type of a primitive or multiple primitives.
| uuid | Single UUID (int) or list of UUIDs |
Definition at line 498 of file Context.py.
| pyhelios.Context.Context.getPrimitiveVertices | ( | self, | |
| uuid ) |
Get vertices of a primitive or multiple primitives.
| uuid | Single UUID (int) or list of UUIDs |
Definition at line 560 of file Context.py.
| vec3 pyhelios.Context.Context.getSphereObjectCenter | ( | self, | |
| int | objID ) |
Definition at line 4552 of file Context.py.
| vec3 pyhelios.Context.Context.getSphereObjectRadius | ( | self, | |
| int | objID ) |
Get per-axis radii of a sphere object.
Definition at line 4562 of file Context.py.
| int pyhelios.Context.Context.getSphereObjectSubdivisionCount | ( | self, | |
| int | objID ) |
Definition at line 4567 of file Context.py.
| float pyhelios.Context.Context.getSphereObjectVolume | ( | self, | |
| int | objID ) |
Definition at line 4571 of file Context.py.
| pyhelios.Context.Context.getTileObjectAreaRatio | ( | self, | |
| objIDs ) |
Get tile-object area ratio for one or multiple tile objects.
Definition at line 4515 of file Context.py.
| vec3 pyhelios.Context.Context.getTileObjectCenter | ( | self, | |
| int | objID ) |
Definition at line 4521 of file Context.py.
| vec3 pyhelios.Context.Context.getTileObjectNormal | ( | self, | |
| int | objID ) |
Definition at line 4536 of file Context.py.
| vec2 pyhelios.Context.Context.getTileObjectSize | ( | self, | |
| int | objID ) |
Definition at line 4526 of file Context.py.
| int2 pyhelios.Context.Context.getTileObjectSubdivisionCount | ( | self, | |
| int | objID ) |
Definition at line 4531 of file Context.py.
| List[vec2] pyhelios.Context.Context.getTileObjectTextureUV | ( | self, | |
| int | objID ) |
Definition at line 4541 of file Context.py.
| List[vec3] pyhelios.Context.Context.getTileObjectVertices | ( | self, | |
| int | objID ) |
Definition at line 4546 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 |
Definition at line 3033 of file Context.py.
| int pyhelios.Context.Context.getTimeseriesLength | ( | self, | |
| str | label ) |
Get the number of data points in a timeseries variable.
| label | Name of the timeseries variable |
| ValueError | If label is empty |
| NotImplementedError | If timeseries functions not available |
Definition at line 3280 of file Context.py.
| int pyhelios.Context.Context.getTriangleCount | ( | self, | |
| bool | include_hidden = True ) |
Definition at line 4708 of file Context.py.
| vec3 pyhelios.Context.Context.getTriangleVertex | ( | self, | |
| int | uuid, | ||
| int | number ) |
Definition at line 4689 of file Context.py.
| List[RGBcolor] pyhelios.Context.Context.getTubeObjectNodeColors | ( | self, | |
| int | objID ) |
Definition at line 4628 of file Context.py.
| int pyhelios.Context.Context.getTubeObjectNodeCount | ( | self, | |
| int | objID ) |
Definition at line 4615 of file Context.py.
| List[float] pyhelios.Context.Context.getTubeObjectNodeRadii | ( | self, | |
| int | objID ) |
Definition at line 4624 of file Context.py.
| List[vec3] pyhelios.Context.Context.getTubeObjectNodes | ( | self, | |
| int | objID ) |
Definition at line 4619 of file Context.py.
| float pyhelios.Context.Context.getTubeObjectSegmentVolume | ( | self, | |
| int | objID, | ||
| int | segment_index ) |
Definition at line 4637 of file Context.py.
| int pyhelios.Context.Context.getTubeObjectSubdivisionCount | ( | self, | |
| int | objID ) |
Definition at line 4611 of file Context.py.
| float pyhelios.Context.Context.getTubeObjectVolume | ( | self, | |
| int | objID ) |
Definition at line 4633 of file Context.py.
| vec3 pyhelios.Context.Context.getVoxelCenter | ( | self, | |
| int | uuid ) |
Definition at line 4694 of file Context.py.
| vec3 pyhelios.Context.Context.getVoxelSize | ( | self, | |
| int | uuid ) |
Definition at line 4699 of file Context.py.
| None pyhelios.Context.Context.hideObject | ( | self, | |
| objids_or_objid ) |
Hide one or more compound objects (and all their primitives).
| objids_or_objid | Single object ID (int) or list of object IDs to hide. |
Definition at line 3993 of file Context.py.
| None pyhelios.Context.Context.hidePrimitive | ( | self, | |
| uuids_or_uuid ) |
Hide one or more primitives.
Hidden primitives are excluded from getAllUUIDs().
| uuids_or_uuid | Single UUID (int) or list of UUIDs to hide. |
Definition at line 3960 of file Context.py.
| None pyhelios.Context.Context.incrementGlobalData | ( | self, | |
| str | label, | ||
| increment ) |
Increment global data.
Auto-dispatches based on increment type.
Definition at line 4363 of file Context.py.
| None pyhelios.Context.Context.incrementPrimitiveData | ( | self, | |
| List[int] | uuids, | ||
| str | label, | ||
| increment ) |
Increment primitive data.
Auto-dispatches based on increment type.
Definition at line 4427 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 3492 of file Context.py.
| bool pyhelios.Context.Context.isGeometryDirty | ( | self | ) |
Definition at line 318 of file Context.py.
| bool pyhelios.Context.Context.isMaterialTextureColorOverridden | ( | self, | |
| str | material_label ) |
Check if material texture color is overridden by material color.
Definition at line 3640 of file Context.py.
| bool pyhelios.Context.Context.isObjectHidden | ( | self, | |
| int | objID ) |
Check if a compound object is hidden.
| objID | Object ID. |
Definition at line 4018 of file Context.py.
| bool pyhelios.Context.Context.isPrimitiveHidden | ( | self, | |
| int | uuid ) |
Check if a primitive is hidden.
| uuid | UUID of the primitive. |
Definition at line 3985 of file Context.py.
| bool pyhelios.Context.Context.isPrimitiveTextureColorOverridden | ( | self, | |
| int | uuid ) |
Check if primitive texture color is overridden.
| uuid | UUID of the primitive |
Definition at line 3913 of file Context.py.
| List[str] pyhelios.Context.Context.listAllObjectDataLabels | ( | self | ) |
List all object data labels in context.
Definition at line 4195 of file Context.py.
| List[str] pyhelios.Context.Context.listGlobalData | ( | self | ) |
List all global data labels.
Definition at line 4359 of file Context.py.
| List[str] pyhelios.Context.Context.listMaterials | ( | self | ) |
Get list of all material labels in the context.
Definition at line 3549 of file Context.py.
| List[str] pyhelios.Context.Context.listObjectData | ( | self, | |
| int | objID ) |
List all data labels on a specific object.
Definition at line 4191 of file Context.py.
| List[str] pyhelios.Context.Context.listPrimitiveData | ( | self, | |
| int | uuid ) |
List all data labels attached to a primitive.
Definition at line 4764 of file Context.py.
| List[str] pyhelios.Context.Context.listTimeseriesVariables | ( | self | ) |
List all existing timeseries variables.
| NotImplementedError | If timeseries functions not available |
Definition at line 3325 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 2091 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 2034 of file Context.py.
| pyhelios.Context.Context.loadTabularTimeseriesData | ( | self, | |
| str | data_file, | ||
| List[str] | column_labels, | ||
| str | delimiter = ",", | ||
| str | date_string_format = "YYYYMMDD", | ||
| int | headerlines = 0 ) |
Load tabular timeseries data from a text file.
The file should contain columns of data with dates/times and measured values. Column labels specify how each column should be interpreted. Special labels include "year", "DOY", "date", "datetime", "hour", "minute", "second", "time". Other labels become timeseries variable names.
| data_file | Path to the text file containing tabular data |
| column_labels | List of column label strings specifying what each column contains |
| delimiter | Column delimiter string (default: ",") |
| date_string_format | Format of date strings in the file. Supported formats: "YYYYMMDD", "YYYYMMDDHH", "YYYYMMDDHHMM", "DD/MM/YYYY", "MM/DD/YYYY", "DDMMYYYY", "YYYY-MM-DD", "DD/MM/YYYY HH:MM", "MM/DD/YYYY HH:MM", "ISO8601" (default: "YYYYMMDD") |
| headerlines | Number of header lines to skip (default: 0) |
| ValueError | If data_file is empty, column_labels is empty, or delimiter is empty |
| RuntimeError | If the file cannot be read or parsed |
| NotImplementedError | If timeseries functions not available |
Definition at line 3378 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 2142 of file Context.py.
| pyhelios.Context.Context.markGeometryClean | ( | self | ) |
Definition at line 309 of file Context.py.
| pyhelios.Context.Context.markGeometryDirty | ( | self | ) |
Definition at line 313 of file Context.py.
| None pyhelios.Context.Context.overridePrimitiveTextureColor | ( | self, | |
| int | uuid ) |
Override texture color with constant RGB color for a primitive.
| uuid | UUID of the primitive |
Definition at line 3892 of file Context.py.
| pyhelios.Context.Context.packGPUBuffers | ( | self, | |
| uuids ) |
Pack GPU-ready geometry buffers for a set of primitives in a single C++ pass.
Produces a binary blob containing contiguous typed arrays (positions, colors, uvs, indices, faceToUuid) grouped by texture, ready for zero-copy loading into Three.js BufferGeometry attributes.
| uuids | List of primitive UUIDs |
Definition at line 3805 of file Context.py.
| bool pyhelios.Context.Context.primitiveTextureHasTransparencyChannel | ( | self, | |
| int | uuid ) |
Check if primitive texture has a transparency channel.
| uuid | UUID of the primitive |
Definition at line 3864 of file Context.py.
| pyhelios.Context.Context.print_plugin_status | ( | self | ) |
Print detailed plugin status information.
Definition at line 3505 of file Context.py.
| float pyhelios.Context.Context.queryTimeseriesData | ( | self, | |
| str | label, | ||
| 'Date' | date = None, | ||
| 'Time' | time = None, | ||
| int | index = None ) |
Query a timeseries data value.
Three modes of operation: - With date and time: returns interpolated value at the specified date/time - With index: returns value at the specified data point index - With neither: returns value at the current Context date/time
| label | Name of the timeseries variable |
| time | Time to query at (requires date as well) |
| index | Index of the data point (0 = earliest) |
| ValueError | If both date/time and index are provided, or if date without time |
| NotImplementedError | If timeseries functions not available |
Definition at line 3175 of file Context.py.
| 'Date' pyhelios.Context.Context.queryTimeseriesDate | ( | self, | |
| str | label, | ||
| int | index ) |
Get the Date associated with a timeseries data point.
| label | Name of the timeseries variable |
| index | Index of the data point (0 = earliest) |
| ValueError | If label is empty or index is negative |
| NotImplementedError | If timeseries functions not available |
Definition at line 3253 of file Context.py.
| 'Time' pyhelios.Context.Context.queryTimeseriesTime | ( | self, | |
| str | label, | ||
| int | index ) |
Get the Time associated with a timeseries data point.
| label | Name of the timeseries variable |
| index | Index of the data point (0 = earliest) |
| ValueError | If label is empty or index is negative |
| NotImplementedError | If timeseries functions not available |
Definition at line 3225 of file Context.py.
| None pyhelios.Context.Context.renameGlobalData | ( | self, | |
| str | old_label, | ||
| str | new_label ) |
Rename a global data label.
Definition at line 4351 of file Context.py.
| None pyhelios.Context.Context.renameObjectData | ( | self, | |
| int | objID, | ||
| str | old_label, | ||
| str | new_label ) |
Rename an object data label.
Definition at line 4203 of file Context.py.
| pyhelios.Context.Context.resolveMaterialTextures | ( | self, | |
| uuids, | |||
| colors_np ) |
Resolve material texture suppression for export.
For each primitive, applies material-based texture suppression rules: 1. If primitive has texture but material has no texture -> suppress texture, use material color 2. If both have texture and textureColorOverride -> prefix "mask:", use material color 3. Otherwise -> leave unchanged
| uuids | List of primitive UUIDs |
| colors_np | numpy float32 array of shape (N, 3), modified IN-PLACE |
Definition at line 3787 of file Context.py.
| None pyhelios.Context.Context.rotateObject | ( | self, | |
| Union[int, List[int]] | ObjID, | ||
| float | angle, | ||
| Union[str, vec3] | axis, | ||
| Optional[vec3] | origin = None, | ||
| bool | about_origin = False ) |
Rotate one or more objects.
| ObjID | Single object ID or list of object IDs to rotate |
| angle | Rotation angle in radians |
| axis | Rotation axis - either 'x', 'y', 'z' or a vec3 direction vector |
| origin | Optional rotation origin point. If None, rotates about object center. If provided with string axis, raises ValueError. |
| about_origin | If True, rotate about global origin (0,0,0). Cannot be used with origin parameter. |
| ValueError | If axis is invalid or if origin and about_origin are both specified |
Definition at line 1792 of file Context.py.
| None pyhelios.Context.Context.rotatePrimitive | ( | self, | |
| Union[int, List[int]] | UUID, | ||
| float | angle, | ||
| Union[str, vec3] | axis, | ||
| Optional[vec3] | origin = None ) |
Rotate one or more primitives.
| UUID | Single UUID or list of UUIDs to rotate |
| angle | Rotation angle in radians |
| axis | Rotation axis - either 'x', 'y', 'z' or a vec3 direction vector |
| origin | Optional rotation origin point. If None, rotates about primitive center. If provided with string axis, raises ValueError. |
| ValueError | If axis is invalid or if origin is provided with string axis |
Definition at line 1729 of file Context.py.
| None pyhelios.Context.Context.scaleConeObjectGirth | ( | self, | |
| int | ObjID, | ||
| float | scale_factor ) |
Scale the girth of a Cone object by scaling the radii at both nodes.
| ObjID | Object ID of the Cone to scale |
| scale_factor | Factor by which to scale the cone girth (e.g., 2.0 doubles girth) |
| ValueError | If ObjID is not an integer or scale_factor is invalid |
| HeliosRuntimeError | If operation fails (e.g., ObjID is not a Cone object) |
Definition at line 2009 of file Context.py.
| None pyhelios.Context.Context.scaleConeObjectLength | ( | self, | |
| int | ObjID, | ||
| float | scale_factor ) |
Scale the length of a Cone object by scaling the distance between its two nodes.
| ObjID | Object ID of the Cone to scale |
| scale_factor | Factor by which to scale the cone length (e.g., 2.0 doubles length) |
| ValueError | If ObjID is not an integer or scale_factor is invalid |
| HeliosRuntimeError | If operation fails (e.g., ObjID is not a Cone object) |
Definition at line 1980 of file Context.py.
| None pyhelios.Context.Context.scaleObject | ( | self, | |
| Union[int, List[int]] | ObjID, | ||
| vec3 | scale, | ||
| Optional[vec3] | point = None, | ||
| bool | about_center = False, | ||
| bool | about_origin = False ) |
Scale one or more objects.
| ObjID | Single object ID or list of object IDs to scale |
| scale | Scale factors as vec3(x, y, z) |
| point | Optional point to scale about |
| about_center | If True, scale about object center (default behavior) |
| about_origin | If True, scale about global origin (0,0,0) |
| ValueError | If parameters are invalid or conflicting options specified |
Definition at line 1909 of file Context.py.
| None pyhelios.Context.Context.scalePrimitive | ( | self, | |
| Union[int, List[int]] | UUID, | ||
| vec3 | scale, | ||
| Optional[vec3] | point = None ) |
Scale one or more primitives.
| UUID | Single UUID or list of UUIDs to scale |
| scale | Scale factors as vec3(x, y, z) |
| point | Optional point to scale about. If None, scales about primitive center. |
| ValueError | If scale or point parameters are invalid |
Definition at line 1867 of file Context.py.
| None pyhelios.Context.Context.scalePrimitiveData | ( | self, | |
| uuids_or_label, | |||
| label_or_factor, | |||
| factor = None ) |
Scale primitive data by a factor.
Definition at line 4420 of file Context.py.
| pyhelios.Context.Context.seedRandomGenerator | ( | self, | |
| int | seed ) |
Seed the random number generator for reproducible stochastic results.
| seed | Integer seed value for random number generation |
Definition at line 332 of file Context.py.
| pyhelios.Context.Context.setCurrentTimeseriesPoint | ( | self, | |
| str | label, | ||
| int | index ) |
Set the Context date and time from a timeseries data point index.
| label | Name of the timeseries variable |
| index | Index of the data point (0 = earliest, chronologically ordered) |
| ValueError | If label is empty or index is negative |
| NotImplementedError | If timeseries functions not available |
Definition at line 3137 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 |
Definition at line 3000 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 |
Definition at line 3017 of file Context.py.
| None pyhelios.Context.Context.setGlobalDataDouble | ( | self, | |
| str | label, | ||
| float | value ) |
Set global data as 64-bit double.
Definition at line 4232 of file Context.py.
| None pyhelios.Context.Context.setGlobalDataFloat | ( | self, | |
| str | label, | ||
| float | value ) |
Set global data as 32-bit float.
Definition at line 4228 of file Context.py.
| None pyhelios.Context.Context.setGlobalDataInt | ( | self, | |
| str | label, | ||
| int | value ) |
Set global data as signed 32-bit integer.
Definition at line 4220 of file Context.py.
| None pyhelios.Context.Context.setGlobalDataInt2 | ( | self, | |
| str | label, | ||
| x_or_vec, | |||
| int | y = None ) |
Set global data as int2.
Definition at line 4264 of file Context.py.
| None pyhelios.Context.Context.setGlobalDataInt3 | ( | self, | |
| str | label, | ||
| x_or_vec, | |||
| int | y = None, | ||
| int | z = None ) |
Set global data as int3.
Definition at line 4272 of file Context.py.
| None pyhelios.Context.Context.setGlobalDataInt4 | ( | self, | |
| str | label, | ||
| x_or_vec, | |||
| int | y = None, | ||
| int | z = None, | ||
| int | w = None ) |
Set global data as int4.
Definition at line 4280 of file Context.py.
| None pyhelios.Context.Context.setGlobalDataString | ( | self, | |
| str | label, | ||
| str | value ) |
Set global data as string.
Definition at line 4236 of file Context.py.
| None pyhelios.Context.Context.setGlobalDataUInt | ( | self, | |
| str | label, | ||
| int | value ) |
Set global data as unsigned 32-bit integer.
Definition at line 4224 of file Context.py.
| None pyhelios.Context.Context.setGlobalDataVec2 | ( | self, | |
| str | label, | ||
| x_or_vec, | |||
| float | y = None ) |
Set global data as vec2.
Definition at line 4240 of file Context.py.
| None pyhelios.Context.Context.setGlobalDataVec3 | ( | self, | |
| str | label, | ||
| x_or_vec, | |||
| float | y = None, | ||
| float | z = None ) |
Set global data as vec3.
Definition at line 4248 of file Context.py.
| None pyhelios.Context.Context.setGlobalDataVec4 | ( | self, | |
| str | label, | ||
| x_or_vec, | |||
| float | y = None, | ||
| float | z = None, | ||
| float | w = None ) |
Set global data as vec4.
Definition at line 4256 of file Context.py.
| pyhelios.Context.Context.setMaterialColor | ( | self, | |
| str | material_label, | ||
| color ) |
Set the RGBA color of a material.
This affects all primitives that reference this material.
| material_label | Label of the material |
| color | RGBAcolor object or tuple/list of (r, g, b, a) values |
| RuntimeError | If material doesn't exist |
Definition at line 3600 of file Context.py.
| pyhelios.Context.Context.setMaterialTexture | ( | self, | |
| str | material_label, | ||
| str | texture_file ) |
Set the texture file for a material.
This affects all primitives that reference this material.
| material_label | Label of the material |
| texture_file | Path to texture image file |
| RuntimeError | If material doesn't exist or texture file not found |
Definition at line 3636 of file Context.py.
| pyhelios.Context.Context.setMaterialTextureColorOverride | ( | self, | |
| str | material_label, | ||
| bool | override ) |
Set whether material color overrides texture color.
Definition at line 3644 of file Context.py.
| pyhelios.Context.Context.setMaterialTwosidedFlag | ( | self, | |
| str | material_label, | ||
| int | twosided_flag ) |
Set the two-sided rendering flag for a material (0 = one-sided, 1 = two-sided).
Definition at line 3652 of file Context.py.
| None pyhelios.Context.Context.setObjectDataDouble | ( | self, | |
| objids_or_objid, | |||
| str | label, | ||
| float | value ) |
Set object data as 64-bit double for one or multiple objects.
Definition at line 4045 of file Context.py.
| None pyhelios.Context.Context.setObjectDataFloat | ( | self, | |
| objids_or_objid, | |||
| str | label, | ||
| float | value ) |
Set object data as 32-bit float for one or multiple objects.
Definition at line 4038 of file Context.py.
| None pyhelios.Context.Context.setObjectDataInt | ( | self, | |
| objids_or_objid, | |||
| str | label, | ||
| int | value ) |
Set object data as signed 32-bit integer for one or multiple objects.
Definition at line 4024 of file Context.py.
| None pyhelios.Context.Context.setObjectDataInt2 | ( | self, | |
| objids_or_objid, | |||
| str | label, | ||
| x_or_vec, | |||
| int | y = None ) |
Set object data as int2.
Accepts int2 object or x,y components.
Definition at line 4092 of file Context.py.
| None pyhelios.Context.Context.setObjectDataInt3 | ( | self, | |
| objids_or_objid, | |||
| str | label, | ||
| x_or_vec, | |||
| int | y = None, | ||
| int | z = None ) |
Set object data as int3.
Accepts int3 object or x,y,z components.
Definition at line 4103 of file Context.py.
| None pyhelios.Context.Context.setObjectDataInt4 | ( | self, | |
| objids_or_objid, | |||
| str | label, | ||
| x_or_vec, | |||
| int | y = None, | ||
| int | z = None, | ||
| int | w = None ) |
Set object data as int4.
Accepts int4 object or x,y,z,w components.
Definition at line 4114 of file Context.py.
| None pyhelios.Context.Context.setObjectDataString | ( | self, | |
| objids_or_objid, | |||
| str | label, | ||
| str | value ) |
Set object data as string for one or multiple objects.
Definition at line 4052 of file Context.py.
| None pyhelios.Context.Context.setObjectDataUInt | ( | self, | |
| objids_or_objid, | |||
| str | label, | ||
| int | value ) |
Set object data as unsigned 32-bit integer for one or multiple objects.
Definition at line 4031 of file Context.py.
| None pyhelios.Context.Context.setObjectDataVec2 | ( | self, | |
| objids_or_objid, | |||
| str | label, | ||
| x_or_vec, | |||
| float | y = None ) |
Set object data as vec2.
Accepts vec2 object or x,y components.
Definition at line 4059 of file Context.py.
| None pyhelios.Context.Context.setObjectDataVec3 | ( | self, | |
| objids_or_objid, | |||
| str | label, | ||
| x_or_vec, | |||
| float | y = None, | ||
| float | z = None ) |
Set object data as vec3.
Accepts vec3 object or x,y,z components.
Definition at line 4070 of file Context.py.
| None pyhelios.Context.Context.setObjectDataVec4 | ( | self, | |
| objids_or_objid, | |||
| str | label, | ||
| x_or_vec, | |||
| float | y = None, | ||
| float | z = None, | ||
| float | w = None ) |
Set object data as vec4.
Accepts vec4 object or x,y,z,w components.
Definition at line 4081 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveColor | ( | self, | |
| uuids, | |||
| color ) |
Set the RGB or RGBA color of one primitive or a list of primitives.
Definition at line 4736 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveDataDouble | ( | self, | |
| uuids_or_uuid, | |||
| str | label, | ||
| float | value ) |
Set primitive data as 64-bit double for one or multiple primitives.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to set data for |
| label | String key for the data |
| value | Double value (broadcast to all UUIDs if list provided) |
Definition at line 2559 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveDataFloat | ( | self, | |
| uuids_or_uuid, | |||
| str | label, | ||
| float | value ) |
Set primitive data as 32-bit float for one or multiple primitives.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to set data for |
| label | String key for the data |
| value | Float value (broadcast to all UUIDs if list provided) |
Definition at line 2545 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveDataInt | ( | self, | |
| uuids_or_uuid, | |||
| str | label, | ||
| int | value ) |
Set primitive data as signed 32-bit integer for one or multiple primitives.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to set data for |
| label | String key for the data |
| value | Signed integer value (broadcast to all UUIDs if list provided) |
Definition at line 2515 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveDataInt2 | ( | self, | |
| uuids_or_uuid, | |||
| str | label, | ||
| x_or_vec, | |||
| int | y = None ) |
Set primitive data as int2 for one or multiple primitives.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to set data for |
| label | String key for the data |
| x_or_vec | Either x component (int) or int2 object |
| y | Y component (if x_or_vec is int) |
Definition at line 2648 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveDataInt3 | ( | self, | |
| uuids_or_uuid, | |||
| str | label, | ||
| x_or_vec, | |||
| int | y = None, | ||
| int | z = None ) |
Set primitive data as int3 for one or multiple primitives.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to set data for |
| label | String key for the data |
| x_or_vec | Either x component (int) or int3 object |
| y | Y component (if x_or_vec is int) |
| z | Z component (if x_or_vec is int) |
Definition at line 2668 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveDataInt4 | ( | self, | |
| uuids_or_uuid, | |||
| str | label, | ||
| x_or_vec, | |||
| int | y = None, | ||
| int | z = None, | ||
| int | w = None ) |
Set primitive data as int4 for one or multiple primitives.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to set data for |
| label | String key for the data |
| x_or_vec | Either x component (int) or int4 object |
| y | Y component (if x_or_vec is int) |
| z | Z component (if x_or_vec is int) |
| w | W component (if x_or_vec is int) |
Definition at line 2689 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveDataString | ( | self, | |
| uuids_or_uuid, | |||
| str | label, | ||
| str | value ) |
Set primitive data as string for one or multiple primitives.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to set data for |
| label | String key for the data |
| value | String value (broadcast to all UUIDs if list provided) |
Definition at line 2573 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveDataUInt | ( | self, | |
| uuids_or_uuid, | |||
| str | label, | ||
| int | value ) |
Set primitive data as unsigned 32-bit integer for one or multiple primitives.
Critical for properties like 'twosided_flag' which must be uint in C++.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to set data for |
| label | String key for the data |
| value | Unsigned integer value (broadcast to all UUIDs if list provided) |
Definition at line 2531 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveDataVec2 | ( | self, | |
| uuids_or_uuid, | |||
| str | label, | ||
| x_or_vec, | |||
| float | y = None ) |
Set primitive data as vec2 for one or multiple primitives.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to set data for |
| label | String key for the data |
| x_or_vec | Either x component (float) or vec2 object |
| y | Y component (if x_or_vec is float) |
Definition at line 2588 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveDataVec3 | ( | self, | |
| uuids_or_uuid, | |||
| str | label, | ||
| x_or_vec, | |||
| float | y = None, | ||
| float | z = None ) |
Set primitive data as vec3 for one or multiple primitives.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to set data for |
| label | String key for the data |
| x_or_vec | Either x component (float) or vec3 object |
| y | Y component (if x_or_vec is float) |
| z | Z component (if x_or_vec is float) |
Definition at line 2608 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveDataVec4 | ( | self, | |
| uuids_or_uuid, | |||
| str | label, | ||
| x_or_vec, | |||
| float | y = None, | ||
| float | z = None, | ||
| float | w = None ) |
Set primitive data as vec4 for one or multiple primitives.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to set data for |
| label | String key for the data |
| x_or_vec | Either x component (float) or vec4 object |
| y | Y component (if x_or_vec is float) |
| z | Z component (if x_or_vec is float) |
| w | W component (if x_or_vec is float) |
Definition at line 2629 of file Context.py.
| None pyhelios.Context.Context.setPrimitiveTextureFile | ( | self, | |
| int | uuid, | ||
| str | texture_file ) |
Set the texture file path of a primitive.
| uuid | UUID of the primitive |
| texture_file | Path to the texture file |
Definition at line 3817 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 |
Definition at line 2982 of file Context.py.
| None pyhelios.Context.Context.showObject | ( | self, | |
| objids_or_objid ) |
Show one or more previously hidden compound objects.
| objids_or_objid | Single object ID (int) or list of object IDs to show. |
Definition at line 4004 of file Context.py.
| None pyhelios.Context.Context.showPrimitive | ( | self, | |
| uuids_or_uuid ) |
Show one or more previously hidden primitives.
| uuids_or_uuid | Single UUID (int) or list of UUIDs to show. |
Definition at line 3971 of file Context.py.
| float pyhelios.Context.Context.sumPrimitiveSurfaceArea | ( | self, | |
| List[int] | uuids ) |
Calculate total one-sided surface area for a set of primitives.
Definition at line 4444 of file Context.py.
| None pyhelios.Context.Context.translateObject | ( | self, | |
| Union[int, List[int]] | ObjID, | ||
| vec3 | shift ) |
Translate one or more compound objects by a shift vector.
Moves the specified compound object(s) and all their constituent primitives by the given shift vector without changing orientation or size.
| ObjID | Single object ID or list of object IDs to translate |
| shift | 3D vector representing the translation [x, y, z] |
Definition at line 1702 of file Context.py.
| None pyhelios.Context.Context.translatePrimitive | ( | self, | |
| Union[int, List[int]] | UUID, | ||
| vec3 | shift ) |
Translate one or more primitives by a shift vector.
Moves the specified primitive(s) by the given shift vector without changing their orientation or size.
| UUID | Single primitive UUID or list of UUIDs to translate |
| shift | 3D vector representing the translation [x, y, z] |
Definition at line 1669 of file Context.py.
| pyhelios.Context.Context.updateTimeseriesData | ( | self, | |
| str | label, | ||
| 'Date' | date, | ||
| 'Time' | time, | ||
| float | new_value ) |
Update the value of an existing timeseries data point.
| label | Name of the timeseries variable (must already exist) |
| time | Time of the existing point (must match exactly) |
| new_value | Replacement value |
| ValueError | If label is empty, or date/time are wrong types |
| HeliosRuntimeError | If the variable does not exist or no point matches the (date, time) |
| NotImplementedError | If timeseries functions not available |
Definition at line 3107 of file Context.py.
| None pyhelios.Context.Context.usePrimitiveTextureColor | ( | self, | |
| int | uuid ) |
Use texture map color instead of constant RGB for a primitive.
| uuid | UUID of the primitive |
Definition at line 3901 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 |
Definition at line 2208 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 |
Definition at line 2166 of file Context.py.
| None pyhelios.Context.Context.writePrimitiveData | ( | self, | |
| str | filename, | ||
| List[str] | column_labels, | ||
| Optional[List[int]] | UUIDs = None, | ||
| bool | print_header = False ) |
Write primitive data to an ASCII text file.
Outputs a space-separated text file where each row corresponds to a primitive and each column corresponds to a primitive data label.
| filename | Path to the output file |
| column_labels | List of primitive data labels to include as columns. Use "UUID" to include primitive UUIDs as a column. The order determines the column order in the output file. |
| UUIDs | Optional list of primitive UUIDs to include. If None, includes all primitives. |
| print_header | If True, writes column labels as the first line of the file |
| ValueError | If filename is invalid, column_labels is empty, or UUIDs list is empty when provided |
| HeliosFileIOError | If file cannot be written |
| HeliosRuntimeError | If a column label doesn't exist for any primitive |
Definition at line 2274 of file Context.py.
|
protected |
Definition at line 85 of file Context.py.
|
protected |
Definition at line 82 of file Context.py.
| pyhelios.Context.Context.context = None |
Definition at line 93 of file Context.py.