LightBox#
- class ansys.speos.core.component.LightBox(name, parent_project, instance=None)#
Represent the Speos LightBox component feature.
By default, the global origin axis system is used to position the LightBox.
- Parameters:
- name
str Name of the feature.
- parent_project
ansys.speos.core.project.Project Project that will own the feature.
- instance
ansys.speos.core.component.LightBoxFileInstanceoransys.speos.core.kernel.scene.ProtoScene.SceneInstance,optional Source for the LightBox content.
If
None(default), an empty LightBox is created from scratch.If a
LightBoxFileInstance, the LightBox is loaded from that file.If a
ProtoScene.SceneInstance, the LightBox is reconstructed from an existing server scene instance.
- name
- Parameters:
name (str)
parent_project (ansys.speos.core.project.Project)
instance (Optional[Union[LightBoxFileInstance, ansys.speos.core.kernel.ProtoScene.SceneInstance]])
Overview#
Find feature(s) by name (possibility to use regex) and by feature type. |
|
Create the project root part feature. |
|
Create a new Source feature. |
|
Create a new Optical Property feature. |
|
Save the local feature data to the Speos server database. |
|
Save the LightBox feature as a LightBox file. |
|
Get LightBox information from its dictionary representation - read only. |
|
Reset local data from the Speos server database. |
|
Delete feature data from the Speos server database. |
Get LightBox visualization data. |
|
Get source paths for sources included in the LightBox. |
|
Get the LightBox name. |
|
Coordinate system of the LightBox in the parent scene. |
|
Location of the trajectory file. |
Return the string representation of the LightBox. |
Import detail#
from ansys.speos.core.component import LightBox
Property detail#
- property LightBox.visual_data: List[ansys.speos.core.generic.visualization_methods._VisualData]#
Get LightBox visualization data.
- Returns:
list[ansys.speos.core.generic.visualization_methods._VisualData]Visualization payload containing mesh and ray data in absolute coordinates.
- property LightBox.axis_system: List[float]#
Coordinate system of the LightBox in the parent scene.
Twelve-element list
[Ox Oy Oz Xx Xy Xz Yx Yy Yz Zx Zy Zz]that fully describes the origin and orientation of the LightBox.
- property LightBox.trajectory_file_uri: str#
Location of the trajectory file.
This property gets or sets the trajectory .JSON file applied to the lightbox, which describes its motion.
- Parameters:
- uri
Union[str,pathlib.Path] format file uri (json).
- uri
- Returns:
- uri
str format file uri (json).
- uri
Method detail#
- LightBox.find(name, name_regex=False, feature_type=None)#
Find feature(s) by name (possibility to use regex) and by feature type.
- Parameters:
- name
str Name of the feature.
- name_regexbool
Allows to use regex for name parameter. By default,
False, means that regex is not used for name parameter.- feature_type
type Type of the wanted features. Mandatory to fill for geometry features. By default,
None, means that all features will be considered (except geometry features).
- name
- Returns:
List[Union[ansys.speos.core.opt_prop.OptProp,ansys.speos.core.source.SourceSurface,ansys.speos.core.source.SourceRayFile,ansys.speos.core.source.SourceLuminaire,ansys.speos.core.source.SourceAmbientEnvironment,ansys.speos.core.source.SourceAmbientNaturalLight,ansys.speos.core.sensor.SensorCamera,ansys.speos.core.sensor.SensorRadiance,ansys.speos.core.sensor.SensorIrradiance,ansys.speos.core.sensor.Sensor3DIrradiance,ansys.speos.core.sensor.SensorXMPIntensity,ansys.speos.core.simulation.SimulationVirtualBSDF,ansys.speos.core.simulation.SimulationDirect,ansys.speos.core.simulation.SimulationInteractive,ansys.speos.core.simulation.SimulationInverse,ansys.speos.core.part.Part,ansys.speos.core.body.Body,ansys.speos.core.face.Face,ansys.speos.core.part.Part.SubPart,ansys.speos.core.ground_plane.GroundPlane]]Found features.
Examples
>>> # From name only >>> find(name="Camera.1") >>> # Specify feature type >>> find(name="Camera.1", feature_type=ansys.speos.core.sensor.SensorCamera) >>> # Using regex >>> find( >>> name="Camera.*", >>> name_regex=True, >>> feature_type=ansys.speos.core.sensor.SensorCamera, >>> ) Here some examples when looking for a geometry feature: (always precise feature_type)
>>> # Root part >>> find(name="", feature_type=ansys.speos.core.part.Part) >>> # Body in root part >>> find(name="BodyName", feature_type=ansys.speos.core.body.Body) >>> # Face from body in root part >>> find(name="BodyName/FaceName", feature_type=ansys.speos.core.face.Face) >>> # Sub part in root part >>> find(name="SubPartName", feature_type=ansys.speos.core.part.Part.SubPart) >>> # Face in a body from sub part in root part : >>> find(name="SubPartName/BodyName/FaceName", feature_type=ansys.speos.core.face.Face) >>> # Regex can be use at each level separated by "/" >>> find(name="Body.*/Face.*", name_regex=True, feature_type=ansys.speos.core.face.Face) >>> # All faces of a specific body >>> find(name="BodyName/.*", name_regex=True, feature_type=ansys.speos.core.face.Face) >>> # All geometry features at first level (whatever their type: body, face, sub part) >>> find(name=".*", name_regex=True, feature_type=ansys.speos.core.part.Part)
- LightBox.create_root_part(description='', metadata=None)#
Create the project root part feature.
If a root part is already created in the project, it is returned.
- Parameters:
- Returns:
ansys.speos.core.part.PartPart feature.
- LightBox.create_source(name, description='', feature_type=SourceSurface, metadata=None, parameters=None)#
Create a new Source feature.
- Parameters:
- name
str Name of the feature.
- description
str Description of the feature. By default,
"".- feature_type: type
Source type to be created. By default,
ansys.speos.core.source.SourceSurface. Allowed types: Union[ansys.speos.core.source.SourceSurface, ansys.speos.core.source.SourceRayFile, ansys.speos.core.source.SourceLuminaire, ansys.speos.core.source.SourceDisplay].- metadata
Optional[Mapping[str,str]] Metadata of the feature. By default,
{}.- parameters
Optional[Union[ansys.speos.core.generic.parameters.LuminaireSourceParameters,ansys.speos.core.generic.parameters.SurfaceSourceParameters,ansys.speos.core.generic.parameters.RayFileSourceParameters,ansys.speos.core.generic.parameters.DisplayParamaters]] Allows to provide parameters to overwrite default parameters.
- name
- Returns:
- LightBox.create_optical_property(name, description='', metadata=None, parameters=None)#
Create a new Optical Property feature.
- Parameters:
- name
str Name of the feature.
- description
str Description of the feature. By default,
"".- metadata
Optional[Mapping[str,str]] Metadata of the feature. By default,
{}.- parameters
Optional[ansys.speos.core.generic.parameters.OptPropParameters] Allows to provide parameters to overwrite default parameters.
- name
- Returns:
ansys.speos.core.opt_prop.OptPropOptProp feature.
- LightBox.commit()#
Save the local feature data to the Speos server database.
- Returns:
ansys.speos.core.component.LightBoxUpdated LightBox feature.
- LightBox.export(export_path, password=None, black_boxed=False)#
Save the LightBox feature as a LightBox file.
- Parameters:
- export_path
pathlib.Path|str Path of the LightBox file to be saved.
- password
str,optional Password to protect the LightBox file. By default,
None, which readsPYSPEOS_ENCRYPTED_PASSWORDenvironment variable or falls back to no password protection.- black_boxedbool,
optional Whether to save the LightBox file as black-boxed. By default,
False, which means the LightBox file will not be black-boxed.
- export_path
- Returns:
pathlib.PathPath to the exported LightBox file.
- LightBox.get(key='')#
Get LightBox information from its dictionary representation - read only.
- LightBox.__str__()#
Return the string representation of the LightBox.
- LightBox.reset()#
Reset local data from the Speos server database.
- Returns:
ansys.speos.core.component.LightBoxUpdated LightBox feature.
- LightBox.delete()#
Delete feature data from the Speos server database.
Local object data remain available after deletion.
- Returns:
ansys.speos.core.component.LightBoxUpdated LightBox feature.