Texture3DMappingFile#
- class ansys.speos.core.input_files.texture_3d.Texture3DMappingFile(patterns=None, uniform_scale=False)#
Bases:
ansys.speos.core.input_files._base.SpeosTextFileFormatSpeos
*.OPT3DMappingfile, laying out the patterns of a 3D Texture.The pattern count opens the file, then each pattern takes one line,
x y z ix iy iz jx jy jz kx ky kz.- Parameters:
- patterns
List[TexturePattern],optional Patterns of the texture. By default,
[].- uniform_scalebool,
optional Whether to write a single scale factor per pattern instead of one per direction. By default,
False. Reading a file sets this from the number of columns found.
- patterns
- Parameters:
patterns (List[TexturePattern] | None)
uniform_scale (bool)
Notes
The pattern list is copied on assignment and access, while pattern objects stay shared. Setters check the current uniform-scale constraint before storing values, and
Texture3DMappingFile.validate()rechecks it after child edits. Empty lists permit drafts, not saved files.Examples
>>> from ansys.speos.core.input_files.texture_3d import ( ... Texture3DMappingFile, ... TexturePattern, ... ) >>> patterns = [TexturePattern(position=(x * 0.5, 0.0, 0.0)) for x in range(10)] >>> Texture3DMappingFile(patterns=patterns).save("prisms.OPT3DMapping")
Overview#
Check the mapping against the constraints of the |
Pattern collection with a copied container and shared patterns. |
|
Whether the mapping writes one scale factor per pattern. |
Usual file extension of the format. |
Import detail#
from ansys.speos.core.input_files.texture_3d import Texture3DMappingFile
Property detail#
- property Texture3DMappingFile.patterns: List[TexturePattern]#
Pattern collection with a copied container and shared patterns.
- Parameters:
- values
List[TexturePattern] New patterns of the texture.
- values
- Returns:
List[TexturePattern]Validated pattern objects.
Attribute detail#
- Texture3DMappingFile.EXTENSION = '.OPT3DMapping'#
Usual file extension of the format.
Method detail#
- Texture3DMappingFile.validate()#
Check the mapping against the constraints of the
*.OPT3DMappingformat.- Raises:
ValueErrorIf the mapping holds no pattern, or if
Texture3DMappingFile.uniform_scaleis set while a pattern scales differently along X, Y and Z.