GCM_alignment option
The constraint type (GCM_c_type) is the main feature of a constraint, which is sufficient to state if object positions satisfy this constraint type or not. However, participation of orientable objects, such as a plane or line, in the constraint allow for different variants of the same GCM_c_type type. For example, based on two faces of a body within the same plane, we can state that they satisfy the coincidence constraint (GCM_COINCIDENT). However, this statement allows for two coincidence variants, when normal face vectors have the same direction or opposite directions. Figures 1, 2 demonstrate alternative alignment variants for two bodies using the GCM_COINCIDENT constraint that binds a pair of colored faces.
{width=”50%”}
Fig. 1
{width=”50%”}
Fig. 2
By default, the solver fulfill the coincidence and keeps the orientation of geometric objects as close to their original state as possible (see Initial approximation). Therefore, one of the two variants is selected automatically based on the minimum rotation principle. However, if necessary, a certain mutual orientation of vectors can be implemented. For this purpose, GCM_AddBinConstraint, GCM_AddDistance, GCM_AddConstraint methods support the GCM_alignment option, whose values can be found in the table.
GCM_alignment adds a condition to the constraint type info (GCM_c_type) that excludes any ambiguity when selecting a solution for the constraint. GCM_COORIENTED and GCM_OPPOSITE values affect the constraints with parallel Z vectors of their arguments. For example, perpendicularity of a plane and a line means that normal vectors of the plane and the line are parallel. Another example: two coincident planes mean that normals of their faces have either the same direction (1) or the opposite direction (2). Other alignment option values are applied in more complicated cases together with such constraints as tangency, linear and angular patterns, where the selection range includes more than 2 solutions. For example, tangency of two toroids by their circles means eight solutions which, in addition to codirected vectors, vary in the tangency side with respect to Z axes, and the location of one toroid outside or inside the other.
Table 1 - GCM_alignment option values.
Name |
Value |
|---|---|
GCM_NO_ALIGNMENT |
Unspecified orientation. The GCM_NO_ALIGNMENT value is applied when a constraint is not affected by orientation of geometric objects (for example, coincidence of two points) or when object orientation should remain free. For example, if you specify GCM_NO_ALIGNMENT in angular or linear patterns, the “sample” orientation will not affect the “copied instance”. |
GCM_CLOSEST |
The solution is selected automatically. It should be as close to the initial position of geometric objects as possible. |
GCM_COORIENTED |
Sets cooriented Z vectors of constraint arguments. |
GCM_OPPOSITE |
Sets opposite Z vectors of constraint arguments. |
GCM_ALIGNED_0 GCM_ALIGNED_1 GCM_ALIGNED_2 GCM_ALIGNED_3 |
Solution variants for constraints with cooriented Z vectors of constraint arguments (GCM_COORIENTED subvariants). |
GCM_ALIGNED_0 GCM_ALIGNED_1 GCM_ALIGNED_2 GCM_ALIGNED_3 |
Solution variants for constraints with opposite Z vectors of constraint arguments (GCM_OPPOSITE subvariants). |
GCM_ALIGNED |
Creates the same orientation of LCS objects (coorientation along Z and X axes) for such constraints as GCM_SYMMETRIC and GCM_PATTERNED. This means that such constraints as symmetry, angular and linear patterns with this option will orient the “copied instance” in the same way as the “sample”, and their positioning will follow the respective rules for copying. |
GCM_ROTATED |
It is applied for the GCM_PATTERNED constraint of the GCM_ANGULAR_PATTERN angular pattern. This means that LCS of the “copied instance” and the “sample” become fully coincident by rotating the pattern around its axis. |
GCM_ALIGN_WITH_AXIAL_GEOM |
It is applied as an additional option for angular and linear patterns in GCM_AddLinearPattern, GCM_AddAngularPattern functions. |
In summary, GCM_alignment is an additional condition when GCM_c_type allows for more than one variant of a constraint execution.