*ConstraintMate()
Creates a primitive geometry based general mating constraint.
Syntax
*ConstraintMate(varname,label, type1, type2, type3, b1, b2, origin, origin2, [align_meth1,align_pt1|align_vec1], [align_meth2,align_pt2|align_vec2])
Arguments
- varname
- The variable name of the Constraint Mate joint.
- label
- The descriptive label of the joint.
- type1
- The type of constraint mate. Valid choices are: DISTANCE|COINCIDENT|TANGENT
- type2
- A keyword that indicates the type of geometry for the constraint on Body b1. Valid keywords are: POINT|SPHERE|LINE|CYLINDER|PLANE and depend on keyword type1. See Comments below.
- type3
- A keyword that indicates the type of geometry for the constraint on Body b2. Valid keywords are: POINT|SPHERE|LINE|CYLINDER|PLANE|CONE and depend upon keyword type1 and type2. See Comments below.
- b1
- The first body constrained by the joint.
- b2
- The second body constrained by the joint.
- origin
- The origin of the primitive geometry on the first body b1 .
- origin2
- The origin of the primitive geometry on the second body b2 .
- align_meth1
- A keyword that indicates the data type of the entity used to align the joint's I marker. Valid choices are POINT or VECTOR. See Comments below.
- alignpt1|align_vec1
- An entity variable referring to a Point or Vector which is based on the above keyword. If align_meth1 has a value POINT, a variable or expression resolving to a Point entity is expected. If align_meth1 has a value VECTOR, a variable or expression resolving to a Vector entity is expected.
- algin_meth2
- A keyword that indicates the data type of the entity used to align the joint's J marker. Valid choices are POINT or VECTOR. See Comments below.
- align_pt2|align_vec2
- An entity variable referring to a Point or Vector which is based on the above keyword. If align_meth2 has a value POINT , a variable or expression resolving to a Point entity is expected. If align_meth2 has a value VECTOR , a variable or expression resolving to a Vector entity is expected.
Example
The example below shows one example of a point-to-line distance constraint joint:
*Point( p_cg, "Body CG" )
*Body( b_body, "Body", p_cg )
*SetPoint( p_cg, 50, 0, 0 )
*SetBodyInertia( b_body, 1, 1000, 1000, 1000 )
*Set( b_body.usecm, true )
*ConstraintMate( aj_cons_mate, "Point-Line Constraint",
DISTANCE, POINT, LINE, b_body, B_Ground,
p_cg, P_Global_Origin, VECTOR, V_Global_Z )
*SetMate( aj_cons_mate, 50.00 )
Context
Properties
Property | Returns Data Type | Description |
---|---|---|
align_meth1 | keyword | POINT|VECTOR |
align_meth2 | keyword | POINT|VECTOR |
align_pt1 | Point | Point defining orientation geometry at first location. |
align_pt2 | Point | Point defining orientation geometry at second location. |
align_vec1 | Vector | Vector defining orientation geometry at first location. |
align_vec2 | Vector | Vector defining orientation geometry at second location. |
b1 | Body | The first connecting body of the joint. |
b2 | Body | The second connecting body of the joint. |
distance | real | The distance value (if type1 is DISTANCE). |
height | real | The height of the CONE of the second geometry. |
i | Marker | Implicit marker I created on the first body at the origin location. |
id | integer | The numeric ID assigned to the entity. |
idstring | string | The assigned ID in string format. |
iradius | real | The radius of the CYLINDER of the first geometry. |
j | Marker | Implicit marker J created on the second body at the origin2 location. |
jradius | real | The radius of the CYLINDER of the second geometry or the base radius of the CONE of the second geometry. |
label | string | The descriptive label of the joint. |
num | integer | The last digit of the ID. |
origin | Point | Origin of geometry on the first body. |
origin2 | Point | Origin of geometry on the second body. |
state | boolean | Returns True or False (True if the entity is active, otherwise False). |
type | string | Type of advanced joint type. Returns ConstraintMate. |
type1 | keyword | DISTANCE|COINCIDENT|TANGENT |
type2 | keyword | POINT|SPHERE|LINE|CYLINDER|PLANE |
type3 | keyword | POINT|SPHERE|LINE|CYLINDER|PLANE|CONE |
varname | varname | The variable name of the joint. |
Comments
This MDL statement can be used to create primitive geometry based constraints between two bodies. For example, a constraint that maintains a constant distance between two points on different bodies. Another example is to maintain tangency between a plane on one body with a cylinder on another body.
Three types of mate constraint can be defined: Distance, Coincident and Tangent, described by the keyword type1. Based on type1, valid choices of type2 and type3 are subsequently restricted. For example, POINT is not a valid keyword choice for type2 when TANGENT is specified for type1. Refer to table below for valid keyword combinations for type1, type2, and type3. The primitive geometry is defined by the location and orientation of the I marker and J marker (implicit marker on body b1 and b2 respectively). Attributes origin and origin2 define the location of I marker and J marker respectively.
If type2 has any of the values LINE, CYLINDER, or PLANE, then align_pt1 or align_vec1 is required, accompanied by align_meth1. The Z axis of the I marker is oriented along the direction of align_pt1 (or align_vec1) from origin.
Similarly, if type3 has any of the values of LINE, CYLINDER, PLANE, or CONE, then align_pt2 or align_vec2 is required, accompanied by align_meth2. The Z axis of the J marker is oriented along the direction of align_pt2 (or align_vec2) from origin2. The above alignment information is not required for constraint types POINT and SPHERE.
In addition, the geometry information is completed for CYLINDER, CONE, and SPHERE types using the *SetMate() statement. The primitive geometry is a mathematical representation (graphics for visualization are not created). Line geometry is represented as an infinite line.
Similarly, Cylinder and Cone geometry extend to infinity along the z-axis of their associated marker.
Table listing valid combination of choices for type1, type2, and type3:
type1type2type3
DISTANCEPOINTPOINT
SPHERE
LINE
CYLINDER
SPHERESPHERE
LINE
CYLINDER
CONE
PLANE
LINELINE
CYLINDER
PLANE
CYLINDERCYLINDER
PLANECONE
CYLINDER
COINCIDENTPOINTCYLINDER
SPHERE
POINT
LINE
CONE
LINECYLINDER
PLANE
LINE
TANGENTSPHERELINE
CYLINDER
PLANE
CONE
SPHERE
LINECYLINDER
CYLINDERCYLINDER
PLANECYLINDER
CONE