Aligning parts using rotation scripts
2021-12-16, 8:31 (This post was last modified: 2021-12-16, 8:59 by David Manley.)
2021-12-16, 8:31 (This post was last modified: 2021-12-16, 8:59 by David Manley.)
3. Single Part Rotation
Note that the functionality described in this section can be achieved using equivalent capabilities which already exist within LDCad, albeit with a slightly different approach. This functionality was added to provide a slightly simpler point-and-click approach.
Description
Four parts are required for this action, as illustrated in Figure 1:
Figure 1 – Single Part Rotation Reference
Existing LDCad Approach
Until recently, the approach I used in LDCad is to temporarily add three extra parts, at positions which correspond to 1, 2 and 3, and then select all three parts in sequence. Via the right mouse click on the first part, I then choose the Selection Info/Show Info menu option as illustrated in Figure 2 (albeit with all other parts / sub-files hidden for the sake of clarity) …
Figure 2 – Initial part selection
… to toggle the menu item “Show info” from “No” to “Yes” (Figure 3). Once angles are being displayed, the significant angle (highlighted by the red box) can be copied to the clipboard just be clicking on the angle.
Figure 3 – Displaying angles
The next step is to apply the rotation angle to the appropriate part/sub-file. In this case (illustrated in Figure 4), the first part and the fourth part/sub-file are selected and the Manual rotation dialog invoked via its shortcut key (usually CTRL+r). Selecting the first part as well as the fourth part helps to ensure the fourth part is rotated according to the origin of the first part rather than the origin of the fourth part.
Figure 4 – Manual Rotation of part
Now for the whoops moment. I often forget which way the positive and negative value for the rotation angle cause an anti-clockwise or clockwise rotation of parts within LDCad. In this case, entering a value of 19.58 caused the part to rotate in the wrong direction so a quick undo (CTRL-z) followed by CTRL+r and making the angle a negative value (i.e. -19.58) results in the desired alignment (Figure 5).
Figure 5 – Desired part alignment
Note that the functionality described in this section can be achieved using equivalent capabilities which already exist within LDCad, albeit with a slightly different approach. This functionality was added to provide a slightly simpler point-and-click approach.
Description
Four parts are required for this action, as illustrated in Figure 1:
- a part to rotate around,
- an alignment part for the part to be rotated,
- a fixed part to be rotated to and
- the part to be rotated
Figure 1 – Single Part Rotation Reference
Existing LDCad Approach
Until recently, the approach I used in LDCad is to temporarily add three extra parts, at positions which correspond to 1, 2 and 3, and then select all three parts in sequence. Via the right mouse click on the first part, I then choose the Selection Info/Show Info menu option as illustrated in Figure 2 (albeit with all other parts / sub-files hidden for the sake of clarity) …
Figure 2 – Initial part selection
… to toggle the menu item “Show info” from “No” to “Yes” (Figure 3). Once angles are being displayed, the significant angle (highlighted by the red box) can be copied to the clipboard just be clicking on the angle.
Figure 3 – Displaying angles
The next step is to apply the rotation angle to the appropriate part/sub-file. In this case (illustrated in Figure 4), the first part and the fourth part/sub-file are selected and the Manual rotation dialog invoked via its shortcut key (usually CTRL+r). Selecting the first part as well as the fourth part helps to ensure the fourth part is rotated according to the origin of the first part rather than the origin of the fourth part.
Figure 4 – Manual Rotation of part
Now for the whoops moment. I often forget which way the positive and negative value for the rotation angle cause an anti-clockwise or clockwise rotation of parts within LDCad. In this case, entering a value of 19.58 caused the part to rotate in the wrong direction so a quick undo (CTRL-z) followed by CTRL+r and making the angle a negative value (i.e. -19.58) results in the desired alignment (Figure 5).
Figure 5 – Desired part alignment