OptProp#
- class ansys.speos.core.opt_prop.OptProp(project, name, description='', metadata=None, default_parameters=None)#
Bases:
BaseVop,BaseSopSpeos 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:
- project
ansys.speos.core.project.Project Project that will own the feature.
- name
str Name of the feature.
- description
str,optional Description of the feature. Default is an empty string.
- metadata
Optional[Mapping[str,str]],optional Metadata of the feature. Default is
None.- default_parameters
Optional[ansys.speos.core.generic.parameters.OptPropParameters],optional Default optical property parameters to initialize the OptProp. Default is
None.
- project
- Parameters:
project (OptProp.__init__.project)
name (str)
description (str)
default_parameters (Optional[ansys.speos.core.generic.parameters.OptPropParameters])
Overview#
Create a new texture layer with default parameters and a default name. |
|
Get a value or the whole dictionary representation. |
|
Commit the material instance and templates to the server scene. |
|
Reset local templates and material instance from the server. |
|
Delete templates and remove the material instance from the scene. |
Geometries to which this material is applied. |
|
List of texture layers used in this material. |
Link object for the sop template in database. |
|
Link object for the vop template in database. |
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”;
Nonemeans “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
Nonewhen not set.
Attribute detail#
- OptProp.sop_template_link = None#
Link object for the sop template in database.
- OptProp.vop_template_link = None#
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.TextureLayerThe newly created texture layer.
- OptProp.get(key='')#
Get a value or the whole dictionary representation.
- Parameters:
- key
str,optional If provided, tries to find a JSON key that starts with
keyand returns the best match. Default is empty string.
- key
- Returns:
- OptProp.__str__()#
Return the string representation of the optical property.
- Returns:
strReadable string representation of the material instance.
- OptProp.commit()#
Commit the material instance and templates to the server scene.
- Returns:
OptPropReturns self after committing.
- OptProp.reset()#
Reset local templates and material instance from the server.
- Returns:
OptPropReturns self after resetting.
- OptProp.delete()#
Delete templates and remove the material instance from the scene.
- Returns:
ansys.speos.core.opt_prop.OptPropReturns self after deletion and cleanup.