scale_factor#

tensor.scale_factor(p0: float) int#

Sets the scale factor to be applied to the tensor glyph.

The factor is applied to major, middle, and minor eigenvectors.
Args:
p0:

‘value’ the scale factor that to apply to the tensor glyph

Examples:
#
# Activating a tensor variable
#
ensight.variables.activate("uniaxial_tensor")
#
# Selecting all parts as parents
#
ensight.part.select_all()
#
# Grouping a bunch of tensor attribute commands
# (One of which is the scale factor)
# 
ensight.tensor.begin()
ensight.tensor.variable("uniaxial_tensor")
ensight.tensor.scale_factor(1.6700e+00)
ensight.tensor.display_compression("ON")
ensight.tensor.display_tension("ON")
ensight.tensor.display_major("ON")
ensight.tensor.display_minor("ON")
ensight.tensor.display_middle("ON")
ensight.tensor.tip_shape("triangle")
ensight.tensor.tip_size(1.0000e-01)
ensight.tensor.color_by("direction")
ensight.tensor.compression_rgb(1.0000e+00,0.0000e+00,4.0000e-01)
ensight.tensor.tension_rgb(0.0000e+00,8.0000e-01,1.0000e+00)
ensight.tensor.line_width_by("direction")
ensight.tensor.compression_line_width(2)
ensight.tensor.tension_line_width(4)
ensight.tensor.end()
#
# Creating the tensor glyph part
#
ensight.tensor.create()
#
# Now selecting the tensor glyph part
#
ensight.part.select_begin(5)
#
# And changing the scale factor back to 1
#
ensight.part.modify_begin()
ensight.tensor.scale_factor(1.0000e+00)
ensight.part.modify_end()
Returns:

zero on success, non-zero on error