MotionContact (hwx.inspire.motion)#

class MotionContact(self, parts1=[], parts2=[], **kwds)#

Bases: MotionObject

Creates an object that generates a contact force between a collection of parts.

Typical use cases include latches, cams, and other parts that have persistent or intermittent contact behavior including friction effects.

Attribute Table#

Name

Type

collisionType

Enum

computedAtType

Enum

damping

Double

enableFriction

Bool

exponent

Double

folder

str

frictionTransitionVelocity

Double

frictionType

Enum

icon

str

keepForceResults

Enum

layerDepth

Double

location

property

measureClearance

Bool

muDynamic

Double

muStatic

Double

newStepSize

Double

normalVelocity

Double

parts

List

parts1

List

parts2

List

penalty

Double

penetrationDepth

Double

preciseContactEvent

Bool

previousClassNames

tuple

refineStepSize

Bool

restitutionCoefficient

Double

stictionTransitionVelocity

Double

stiffness

NonLinearStiffness

tolerance

Double

Method Table#

Name

Description

arePartsContacted (part1, part2)

Determines if there is a contact between the specified parts.

arePartsContacted (part1, part2)

Determines if there is a contact between the specified parts.

getContactingPartPairs (self)

Returns a generator of pairs (Features or Parts) that are in contact.

getIntersectingParts (self)

Finds the parts of the contact that intersect.

getIntersections (visibleOnly=True)

Finds the parts of the all contacts that intersect.

hideContacts ()

Hides graphics for the contact while in the context.

isValidPart (part)

Determines if the specified part is valid for creating a motion contact.

showContacts (on=True)

Shows graphics for the contact while in the context.

Example

from hwx import inspire
from hwx.inspire import motion

M44 = inspire.math.Matrix44
model = inspire.newModel()
floor = model.createSolidBlock(z=.1, ground=True)
ball1  = model.createSolidSphere(radius=.2, position=M44(origin=(0,0,1)))
ball2  = model.createSolidSphere(radius=.1, position=M44(origin=(0,0,2)))
ghost  = model.createSolidBlock(x=.1,y=.1,z=.1,position=M44(origin=(0,0,3)))
ghost.setValues(
   color='blue',
   transparency=.5,
)

# Floor and balls can all contact each other
contact1 = motion.MotionContact(parts1=[floor, ball1, ball2], damping=1)
# Ghost bounces on floor but goes through the balls
contact2 = motion.MotionContact(parts1=[floor], parts2=[ghost], damping=1)

print("contact1.collisionType", contact1.collisionType)

inspire.fitView()
property parts1#

The first part or feature entity used to create a contact.

property parts2#

The second part or feature entity used to create a contact.

property parts#

List of entities used to create the contact.

property enableFriction#

If True, enables friction between entities.

property collisionType#

Type of collision upon contact between entities.

Collision type can be Impact, Poisson and Volume.

property penalty#

Determines the local stiffness properties between materials.

Larger values lead to reduced penetration between two bodies. By default penalty value is 5e+06 N/m. This property is specifiable when the contact collision type is Poisson.

property restitutionCoefficient#

The ratio of the final to initial relative velocity between two entities after they collide.

  • 0 for a perfectly plastic collision

  • 1 for a perfectly elastic collision

By default the value is 0.8. This property is specifiable when the contact collision type is Poisson.

property normalVelocity#

Velocity limit after which full damping force is applied.

By default the value is 0.001. This property is specifiable when the contact collision type is Poisson.

property exponent#

The exponent of the force deformation characteristic.

This value is used to generate the stiffness. It defaults to 2.1 and this property is specifiable when the contact collision type is Impact or Volume.

property stiffness#

The stiffness of the boundary surface interaction. The nonlinear effect of the Exponent parameter will be accounted for automatically. It defaults to 1000 N/m and this property is specifiable when the contact collision is of type Impact.

property damping#

Specifies the maximum damping coefficient.

It defaults to 100 N*s/m and this property is specifiable when the contact collision is of type Impact or Volume.

property penetrationDepth#

The depth beyond which full damping is applied.

It defaults to 0.0001 m and this property is specifiable when the contact collision is of type Impact.

property layerDepth#

The layer depth of material.

This is used to calculate the contact stiffness and it defaults to 1 m. This property is specifiable when the contact collision is of type Volume.

property frictionType#

Specifies the type of friction upon contact.

Type of friction can be Static and Dynamic or Dynamic only. This property is specifiable when friction is enabled.

property muStatic#

The static coefficient of friction, which has to be overcome by a body before it can move.

This property is specifiable when friction is enabled.

property muDynamic#

The dynamic coefficient of friction, which the body experiences while in motion.

This property is specifiable when friction is enabled.

property stictionTransitionVelocity#

The velocity of the entity after overcoming the static friction upon contact.

This property is specifiable when friction is enabled.

property frictionTransitionVelocity#

The velocity at which transition occurs between a stationary entity and a moving entity.

This property is specifiable when friction is enabled.

property measureClearance#

If True, allows proximity between parts to be computed.

This will provide additional outputs during Motion Analysis, which is used

in plotting.

property preciseContactEvent#

If True, enables monitoring of the collision of two entities upon contact with greater accuracy.

property tolerance#

If Precise Contact Event is enabled then the tolerance value represents a band around the current integrator step size, its value is expressed as a percentage of the current integrator step size, defaults to 0.01.

property refineStepSize#

If True, this property along with the value of New Step Size, the solver will use it as the maximum step size for the simulation after the contact is detected.

property newStepSize#

Specifies the new step size used by the solver after the contact is detected. Defaults to 0.0005 s.

property keepForceResults#

This allows to limit the number of contact forces that are stored in the model after Motion Analysis.

They can be Default, All, Region Only, or None

property computedAtType#

Specifies how the contact force will be computed.

When parts come into contact, the contact normal force is applied at the element center, then the force computation type should be selected Element Center. If the parts come into contact, the contact normal force is applied at the nodes of the element, then force computation type should be selected Nodes.

property location#

Specifies the midpoint of the all the parts center of gravity.

getContactingPartPairs()#

Returns a generator of pairs (Features or Parts) that are in contact.

getIntersectingParts()#

Finds the parts of the contact that intersect.

Returns:

A list of pair of parts that intersect.

Return type:

list(tuple(Part))