There are two existing mirror animations in core, the MirrorFlipAnimation
and MirrorLineAnimation
. The code for these can be found in base/cm/abstract/draw/...
In the FIKA and InstantPlannerPro extensions you may find these icons in the toolbox:
These are the MirrorFlipAnimation
and MirrorLineAnimation
mentioned above respectively.
MirrorFlipAnimation
- This animation flips the
Snapper
s across the horizontal/vertical axis (absolute, not relative to the snapper). An x/y-axis is shown in 2D while a "mirror" is shown in 3D. - Hovering over a
Snapper
will highlight it and frame it blue. - Clicking then flips/mirrors the
Snapper
over the horizontal/vertical axis shown. - If an unmirrorable
Snapper
is selected, this will be the graphic shown. - If there is a selection in
Space
, hovering over the selection will highlight/mirror allSnapper
s if they are mirrorable.
Properties: You can change the animation properties to use the horizontal/vertical axis.
MirrorLineAnimation
Mirrors a SpaceSelection
of Snapper
s across a line drawn in the Animation
.
It will spawn a SpaceSelection
if you do not already have one when the Animation
starts. You can hold the ctrl-key down to continue selecting.
- If there are no
Snapper
s selected beforeMirrorLineAnimation
starts, the animation starts off with a rectangle select. You may click or draw a rectangle for selection. Holding the ctrl-key down allows you to make multiple selections. Clicking with a selection or making a selection without the ctrl-key down brings us to the next step. - Graphic showing the 'steps' is shown in 2D and mirror glass is shown in 3D.
- Clicking turns the first point solid and allows you to start drawing the "mirror line". The animation shows a preview for the mirror result using the
Snapper
's bound (for performance reasons). - Moving the cursor around shows the mirror line and preview (A plane is shown in 3D).
- Clicking again completes the mirror.
- If unmirrorable
Snapper
s are selected, the will be highlighted red and shown in the toolbox.
Properties: You can change the animation properties to keep the original object after mirroring and setting the angle of the line.
Using Mirror Tools for Your Own Extension
You can simply add the mirror tools to your extension toolbox using an AnimationLimb
like this:
// Within a container: limb AnimationLimb mFlip(pkg=#"cm.abstract.draw", "MirrorFlipAnimation", image=icon("draw3D/mirrorFlip")); limb AnimationLimb mLine(pkg=#"cm.abstract.draw", "MirrorSelectionAnimation", image=icon("draw3D/mirrorLine"));
To make it so your Snapper
s can be mirrored, you have to overwrite allowMirror
in Snapper
and implement the necessary interfaces as necessary for an accurate mirror.
See here for more information on how to implement mirror for your own Snapper
s.
Comments
0 comments
Please sign in to leave a comment.