Torque (hwx.inspire)#
- class Torque(features, location=None, direction=None, magnitude=None, isRemote=False, **kwds)#
Bases:
BoundaryCondition
A torque is a twisting force.
It is a type of load and can be applied either to a face or the center of a hole, in which case it acts on the interior face of the hole.
# Name
Type
icon
str
# Name
Description
updatePosition
(self, m44)Update the position by multiplying input M44 matrix.
Example
from hwx import inspire model = inspire.newModel() cyl1 = model.createSolidCylinder(location=(5, 5, 0),radius=1,height=6,) cyl2 = model.createSolidCylinder(location=(5, 5, 0),radius=0.7,height=6,) # boolean subtract cyl2 from cyl1 cyl1.booleanSubtract(cyl2) # filter out the available cylindrical faces cylSurfaces = [x for x in cyl1.features if isinstance(x, inspire.FeatureCylindrical)] face=cylSurfaces[1] # apply torque on a face feature torqueOnFace = inspire.Torque( face, direction=[0, 0, -1], magnitude=10.0, loadCase='current' ) # filter out the available cylindrical edges circles= [x for x in cyl1.features if isinstance(x, inspire.FeatureCircular)] edge=circles[0] # apply torque on a edge feature torqueOnEdge = inspire.Torque( edge, direction=[0, 1, 0], magnitude=10.0, loadCase='current' ) print("Some torques values:") print("Torque on face, direction:", torqueOnEdge.direction) print("Torque on edge, location:", torqueOnFace.magnitude) # modify torques by changing their attributes torqueOnEdge.direction = [-1, 1, 0] torqueOnFace.magnitude= 59.0 inspire.orientView(direction="top") inspire.fitView() print("") print("Torques values after modification:") print("Torque on face, direction:", torqueOnEdge.direction) print("Torque on edge, location:", torqueOnFace.magnitude)
- property magnitude#
Returns the magnitude of the torque.
- updatePosition(m44)#
Update the position by multiplying input M44 matrix.