Aligning
Clouds with Constraints
 |
This task shows you how to align a cloud of points with a target by
defining constraints (made of pairs of points, lines or planes) based on
canonic shapes (points, lines, planes, spheres, cylinders).
When such shapes can be used, this kind of alignment is quicker than the
other types (Align with Cloud, with Surface, with Points, with Spheres)
proposed by V5. |
 |
This operation is useful with mechanical shapes, where
canonic shapes can be defined.
You need to recognize canonic shapes
 | on the cloud to move (Quick Surface Reconstruction offers a Basic
Surface Recognition action), |
 | then on the target (by extracting faces or creating points, lines and
planes representing fixed constraints). |
These canonic shapes are not necessarily the same (any association of
points/lines/planes is possible).
Then match the canonic shapes by pair, one on the input cloud, the other
on the target.
It is possible to match one element of the input cloud with several
elements (whatever their type) of the target, or vice versa (a plane can be
matched with three different points in three different constraints, for
example).
Be careful to have consistent constraints, regarding the geometry and
the approximation tolerances. For example:
 | do not match three points with two different planes, |
 | if you match two normals to planes, be careful that they have the
same orientation, |
 | even if overconstraints are accepted, in some cases it might be
necessary that the constraints form an isostatic system: A 3D object has
6 degrees of freedom, i.e. 3 translations and 3 rotations. Creating an
isostatic system means that the 3 translations and the 3 rotations are
locked. Here are the degrees of freedom locked by each pair of
constraints: |
| |
point |
line |
plane |
| point |
3 translations |
2 translations |
1 translation |
| line |
2 translations |
2 translations and 2 rotations |
1 translation and 1 rotation |
| plane |
1 translation |
1 translation and 1 rotation |
1 translation and 2 rotations |
In a general case, you should combine the constraints to lock all the
degrees of freedom.
 | ... |
Open the
AlignConstraint1.CATPart model the from the samples directory. It
consists of one cloud to move, a set of primitives computed on the cloud, a
set of target primitives. |
|
-
Define New as the In Work Object.
-
Click the Align with Constraints icon
. A selection
dialog box is displayed.
-
Select the cloud to move (CloudToMove).
Selective display
can be
activated and/or de-activated at any time to hide the cloud and
make selection of the constraints easier.
Once the cloud is selected, the button Add becomes available.
-
Push the
button Add. Select the large cylinder recognized on the input
cloud, then the large cylinder on the target.
The colors of the elements picked change:
 |
A color is associated to each couple of elements that
define a constraint. |
 |
The element corresponding to the cloud to move is
displayed in a solid color, |
 |
The element corresponding to the target is displayed in
a transparent color, |
 |
Another color is associated to the next couple of
elements... |
The definition of the constraint created is displayed in
the dialog box.

Pairing two cylinders has created a line/line type
constraint, thus locking 2 rotations and 2 translations.
Pairing two spheres has created a point/point type
constraint, thus locking 3 translations. Since the point selected (center
of the sphere) does not belong to the line (axis of the cylinder), this
combination of constraints locks the remaining rotation too.
|
 |
 | The same constraint could have been defined by the two cylinder axes,
or one cylinder axis and one cylinder, etc... |
 | Always pick and element on the cloud to move, then one element on the
target. |
 | You must define at least one constraint. |
|
|
-
The
Clear All and
Delete buttons are now available:
 |
Use Clear All to delete all constraints from
the list without selecting them or |
 |
Select one constraint in the list and push the
Delete button to delete a given constraint. |
 |
If constraints are deleted, the intermediate
computation is erased. |
Click Apply to visualize the alignment.
The input cloud has been aligned with the large cylinder of the
target, but the whole alignment is not yet satisfactory.

-
Push the button Add to add another constraint.
Pick both spheres.
-
Push Add again and select the little cylinder
of the input cloud and the axis of the little cylinder on the target.

-
Click Apply. The input cloud is aligned
correctly on the target.
|
|
|
 |
When the alignment can not be computed, a information
message is displayed (Update error). You can :
 | delete constraints |
 | delete and add other constraints |
 | check the consistency of the constraints |
 | eventually, re-compute the basic shapes used. |
|
|
-
Once you
are satisfied with the alignment computed, click OK to
validate and exit the action.
A new cloud is created on the target, the input cloud is still
visible.
The new cloud is created in the specification tree,

as well as an Axis Systems containing:
 | AxisRef.x (system axis computed on the input cloud) and
|
 | AxisTrs.x (axis system created on the output cloud).
|

Those Axis Systems can be used with the
Axis to Axis action on other elements to align.
Align with previous transformation is
also available.
|
|
 |
|