CoilSpring (hwx.inspire.motion)#

class CoilSpring(self, **kwds)#

Bases: MotionConnector

Creates a Coil Spring.

Coil Springs are used to apply a translational spring-damper force along the line of sight between two parts. Coil Springs provide a linear resistance and/or damping between two objects.

Changing any one of preload, installedLength, freeLength, or k will influence the other values:

  • Changing preload modifies freeLength.

  • Changing installedLength, k, or freeLength modifies the computed preload.

Example

from hwx import inspire
from hwx.inspire import motion

M44 = inspire.math.Matrix44
model = inspire.newModel()
block  = model.createSolidBlock(ground=True)
sphere = model.createSolidSphere(position=M44(origin=(0,0,-4)))
face = block.features[24]

spring = motion.CoilSpring(
   entity1   = face,
   location1 = (.5, .5), # Feature coords
   entity2   = sphere.features[0],
   location2 = (0,0,-3),
)

print("spring.k", spring.k.guiValue)
inspire.fitView()
property type#

Specifies the type of Coil Spring.

Coil Spring can be of type Spring Damper or only Spring or Damper, defaults to Spring Damper.

property parallelMounts#

If True, creates a Cylindrical or Translational joint at the two endpoints of the spring, which prevents the entities from separating during Motion Analysis, defaults to False.

property parallelMountsJoint#

Specifies what type of joint to be created if Parallel Mounts is enabled.

property springLimits#

Prevent the spring from expanding or collapsing beyond its natural limits.

property locked#

If True, prevents the spring from expanding or collapsing during Motion Analysis.

property k#

The stiffness value of the coil spring, defaults to 1000 N/m.

property c#

The damping value of the coil spring, dafaults to 1 N*s/m.

property klinear#

Enables linear stiffness with the value specified for property k, else uses interpolation methods to get stiffness value.

property ksplineMethod#

Specifies the type of interpolation method to use.

Types can be Akima, Cubic or Linear.

property clinear#

Enables linear damping with the value specified for property c, else uses interpolation methods to get damping value.

property csplineMethod#

Specifies the type of interpolation method to use.

Types can be Akima, Cubic or Linear.

property preload#

Specifies the force applied to the coil spring to expand or contract to reach its free length.

property installedLength#

Specifies the distance between the two endpoints of the coil spring.

This is an auto computed value, user cannot modify it.

property reverseDirection#

If True, reverses the direction of Preload force.

property compute#

Specifies whether the Preload or the Free length is auto computed.

By default Preload force is auto computed.

property entity1#

Specifies the starting endpoint of the coil spring is attached to a Feature, Joint or a Fastener.

property entity2#

Specifies the ending endpoint of the coil spring is attached to a Feature, Joint or a Fastener.

property location1#

The location of the starting endpoint of the coil spring.

property damperScale#

Use to increase the damper diameter relative to the spring diameter.

The value must be greater than 0, or less than or equal to 1, defaults to 0.5.

property diameter#

Used to change the diameter of the coil spring.

property coilColor#

Specifies the color of the coils around the spring.

property damperColor#

Specifies the color of the damper of the spring.

property mountColor#

Specifies the color of the mounts added to coil spring when Parallel Mounts is enabled.

property exponent#

Exponential value used to generate the stiffness.

This property is not specifiable when the coil spring is of type Damper.

property stiffness#

Specifies the spring stiffness.

This property is not specifiable when the coil spring is of type Damper, defaults to 1E+06 N/m.

property max_damping_coeff#

Specifies the maximum damping value of the coil spring, defaults to 100 N*s/m.

property max_penetration#

Specifies the maximum penetration depth of the coil spring, defaults to 0.0001 m.

property location2#

The location of the end endpoint of the coil spring.

property coilDiameter#

Specifies the diameter of the coil spring.

property wireDiameter#

Used to change the diameter of wired coils around the spring.

property coils#

Number of coils in the spring, defaults to 10.

This is not specifiable if the spring is of type Damper.

property freeLength#

Specifies the length of the coil spring at resting state.

flip()#

Swaps the two location end points of the connector.

property hasSpring#

Specifies if the coil spring has any springs.

property hasDamper#

Specifies if the coil spring has any dampers.

property lowerBound#

Minimum distance between end points if springLimits enabled.

property upperBound#

Maximum distance between end points if springLimits enabled.

property features#

Returns the features associated with the connector object.

property isGrounded#

Specifies if the coil spring is a grounded spring or not.