Skip to main content
Ctrl+K
ansys-speos-core 0.9.0 documentation - Home ansys-speos-core 0.9.0 documentation - Home
  • Home
  • Overview
  • Getting started
  • API reference
  • Examples
    • Contribute
    • Release notes
Ctrl+K
  • GitHub
  • Home
  • Overview
  • Getting started
  • API reference
  • Examples
  • Contribute
  • Release notes
Ctrl+K
  • GitHub

Section Navigation

  • ansys.speos.core
    • generic
    • kernel
    • workflow
    • body
    • bsdf
    • component
      • LightBoxFileInstance
      • LightBox
    • face
    • geo_ref
    • ground_plane
    • intensity
    • launcher
    • logger
    • lxp
    • opt_prop
    • part
    • project
    • proto_message_utils
    • sensor
    • simulation
    • source
    • spectrum
    • speos
  • API reference
  • The ansys.speos.core library
  • The component.py module
  • LightBox

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:
namestr

Name of the feature.

parent_projectansys.speos.core.project.Project

Project that will own the feature.

instanceansys.speos.core.component.LightBoxFileInstance or ansys.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.

Parameters:
  • name (str)

  • parent_project (ansys.speos.core.project.Project)

  • instance (Optional[Union[LightBoxFileInstance, ansys.speos.core.kernel.ProtoScene.SceneInstance]])

Overview#

find

Find feature(s) by name (possibility to use regex) and by feature type.

create_root_part

Create the project root part feature.

create_source

Create a new Source feature.

create_optical_property

Create a new Optical Property feature.

commit

Save the local feature data to the Speos server database.

export

Save the LightBox feature as a LightBox file.

get

Get LightBox information from its dictionary representation - read only.

reset

Reset local data from the Speos server database.

delete

Delete feature data from the Speos server database.

visual_data

Get LightBox visualization data.

source_paths

Get source paths for sources included in the LightBox.

name

Get the LightBox name.

axis_system

Coordinate system of the LightBox in the parent scene.

trajectory_file_uri

Location of the trajectory file.

__str__

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.source_paths: List[str]#

Get source paths for sources included in the LightBox.

Returns:
list[str]

Source paths in the form /.

property LightBox.name: str#

Get the LightBox name.

Returns:
str

Name of the lightbox feature.

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.

Parameters:
axis_systemlist[float]

New coordinate system values.

Returns:
list[float]

Current coordinate system values.

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:
uriUnion[str, pathlib.Path]

format file uri (json).

Returns:
uristr

format file uri (json).

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:
namestr

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_typetype

Type of the wanted features. Mandatory to fill for geometry features. By default, None, means that all features will be considered (except geometry features).

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:
descriptionstr

Description of the feature. By default, "".

metadataOptional[Mapping[str, str]]

Metadata of the feature. By default, {}.

Returns:
ansys.speos.core.part.Part

Part feature.

LightBox.create_source(name, description='', feature_type=SourceSurface, metadata=None, parameters=None)#

Create a new Source feature.

Parameters:
namestr

Name of the feature.

descriptionstr

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].

metadataOptional[Mapping[str, str]]

Metadata of the feature. By default, {}.

parametersOptional[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.

Returns:
Union[ansys.speos.core.source.SourceSurface, ansys.speos.core.source.SourceRayFile, ansys.speos.core.source.SourceLuminaire, ansys.speos.core.source.SourceDisplay]

Source class instance.

LightBox.create_optical_property(name, description='', metadata=None, parameters=None)#

Create a new Optical Property feature.

Parameters:
namestr

Name of the feature.

descriptionstr

Description of the feature. By default, "".

metadataOptional[Mapping[str, str]]

Metadata of the feature. By default, {}.

parametersOptional[ansys.speos.core.generic.parameters.OptPropParameters]

Allows to provide parameters to overwrite default parameters.

Returns:
ansys.speos.core.opt_prop.OptProp

OptProp feature.

LightBox.commit()#

Save the local feature data to the Speos server database.

Returns:
ansys.speos.core.component.LightBox

Updated LightBox feature.

LightBox.export(export_path, password=None, black_boxed=False)#

Save the LightBox feature as a LightBox file.

Parameters:
export_pathpathlib.Path | str

Path of the LightBox file to be saved.

passwordstr, optional

Password to protect the LightBox file. By default, None, which reads PYSPEOS_ENCRYPTED_PASSWORD environment 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.

Returns:
pathlib.Path

Path to the exported LightBox file.

LightBox.get(key='')#

Get LightBox information from its dictionary representation - read only.

Parameters:
keystr, optional

Key prefix used to look up a value. By default, "", which returns the full dictionary.

Returns:
str | dict

Value found for the given key, or the full dictionary when key is empty.

LightBox.__str__()#

Return the string representation of the LightBox.

LightBox.reset()#

Reset local data from the Speos server database.

Returns:
ansys.speos.core.component.LightBox

Updated LightBox feature.

LightBox.delete()#

Delete feature data from the Speos server database.

Local object data remain available after deletion.

Returns:
ansys.speos.core.component.LightBox

Updated LightBox feature.

On this page
  • ansys.speos.core.component.LightBox
  • Overview
  • Import detail
  • Property detail
    • visual_data
    • source_paths
    • name
    • axis_system
    • trajectory_file_uri
  • Method detail
    • find()
    • create_root_part()
    • create_source()
    • create_optical_property()
    • commit()
    • export()
    • get()
    • __str__()
    • reset()
    • delete()
  • Show Source

© Copyright (c) 2026 ANSYS, Inc. All rights reserved.

Created using Sphinx 8.1.3.

Built with the Ansys Sphinx Theme 1.8.2.
Last updated on