OptProp#

class ansys.speos.core.opt_prop.OptProp(project, name, description='', metadata=None, default_parameters=None)#

Bases: BaseVop, BaseSop

Speos feature wrapper for an optical property (SOP + VOP + geometries).

By default, an OptProp is a 100% mirror surface with no volume optical property and no geometries assigned.

Parameters:
projectansys.speos.core.project.Project

Project that will own the feature.

namestr

Name of the feature.

descriptionstr, optional

Description of the feature. Default is an empty string.

metadataOptional[Mapping[str, str]], optional

Metadata of the feature. Default is None.

default_parametersOptional[ansys.speos.core.generic.parameters.OptPropParameters], optional

Default optical property parameters to initialize the OptProp. Default is None.

Parameters:

Overview#

create_texture_layer

Create a new texture layer with default parameters and a default name.

get

Get a value or the whole dictionary representation.

commit

Commit the material instance and templates to the server scene.

reset

Reset local templates and material instance from the server.

delete

Delete templates and remove the material instance from the scene.

geometries

Geometries to which this material is applied.

texture

List of texture layers used in this material.

sop_template_link

Link object for the sop template in database.

vop_template_link

Link object for the vop template in database.

__str__

Return the string representation of the optical property.

Import detail#

from ansys.speos.core.opt_prop import OptProp

Property detail#

property OptProp.geometries: List[str]#

Geometries to which this material is applied.

An empty list means “all geometries”; None means “no geometry”.

Returns:
List[str]

List of geometry references used by this material.

property OptProp.texture: list[TextureLayer] | None#

List of texture layers used in this material.

Returns:
Optional[list[ansys.speos.core.opt_prop.TextureLayer]]

Texture layers or None when not set.

Attribute detail#

Link object for the sop template in database.

Link object for the vop template in database.

Method detail#

OptProp.create_texture_layer()#

Create a new texture layer with default parameters and a default name.

The default name is generated as “LayerX” where X is the index of the layer in the texture list.

Returns:
ansys.speos.core.opt_prop.TextureLayer

The newly created texture layer.

OptProp.get(key='')#

Get a value or the whole dictionary representation.

Parameters:
keystr, optional

If provided, tries to find a JSON key that starts with key and returns the best match. Default is empty string.

Returns:
str or dict

If key is empty, returns the full dict representation. If a match for key is found, returns the corresponding value. Otherwise, prints available keys and returns None implicitly.

OptProp.__str__()#

Return the string representation of the optical property.

Returns:
str

Readable string representation of the material instance.

OptProp.commit()#

Commit the material instance and templates to the server scene.

Returns:
OptProp

Returns self after committing.

OptProp.reset()#

Reset local templates and material instance from the server.

Returns:
OptProp

Returns self after resetting.

OptProp.delete()#

Delete templates and remove the material instance from the scene.

Returns:
ansys.speos.core.opt_prop.OptProp

Returns self after deletion and cleanup.