Contact (hwx.inspire)#
- class Contact#
Bases:
FeaturesConnector
Connection between two parts by the contact of features.
Contacts indicate whether neighboring surfaces should be bonded, contacting, or have no contact.
# Name
Type
property
property
property
property
property
property
property
# Name
Description
getContactJoint
(self)Returns the joint that uses this contact.
setResolution
(self, resolution=’Low’)Set the resolution of the contact.
Example
from hwx import inspire model = inspire.openTutorialFile("Motion/PartFeatures_ForJoints.x_t") # Create Contact objects between all contacting part pairs # This can be slow for large models model.updateContacts() for contact in model.contacts: print(contact.name+":", " <-> ".join(map(str, contact.parts))) # Get the specific features that are touching print(contact.name + " features:", contact.primaryFeatures, "<->", contact.secondaryFeatures) # View contacts in context from hwx import gui gui.getAction('Contact_Action').ison = True
- property parts#
The parts in contact.
- property primaryPart#
The part associated with the primary features.
- property secondaryPart#
The part associated with the secondary features.
- setResolution(resolution='Low')#
Set the resolution of the contact.
- Parameters:
resolution (str) – Resolution of the contact. Valid values are- - Low - Medium - High
- property contactType#
Defines contact type.
The options are bonded, sliding, separating or none (No Contact in legend).
Select bonded if parts are bonded or glued together.
Select sliding if there is relative sliding between the parts.
Select Separating if the relative parts can separate.
Select none if parts are close but you don’t want them to have contact.
- property searchDistance#
The search distance is a global search threshold that uses default tolerances to find locations where joints can be created.
When the search distance is manually set, the contacts with a minimum separation equal to search distance or less are detected.
- property definitionType#
Returns the contact definition type, they can be of type ‘Unknown’, ‘Surface’ and ‘Part’.
- class Solver(value)#
Bases:
Enum
An enumeration.
# Name
Type
NONE
Solver
OptiStruct
Solver
SimSolid
Solver
- property solver#
OptiStruct or SimSolid
- Type:
str
- property contactData#
Information about the contact including the contact regions mesh.
Calling this can take a while the first time after opening an stmod or if the parts are modified and it needs recomputed.
Contact will be deleted if the parts are no longer touching!
- property minBoundingBox#
Oriented Box of the contact patch vertices.
See contactData.
Can be very slow to compute first time. Use axisAlignedBoundingBox for a more performant solution.
- Type:
math.Box
- property axisAlignedBoundingBox#
Computes a box where the parts are within self.searchDistance of each other.
Can return None if the Parts were separated but an updateContacts hasn’t occurred to delete the contact.
- Type:
math.Box
- property dirty#
(bool) True means querying contactData will be an expensive operation to compute the contact patch.
Becomes true when geometry changes, part moves.
True for contacts loaded from stmod since the contactData is not serialized!
- getContactJoint()#
Returns the joint that uses this contact.