There are two existing mirror animations in core, the
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
MirrorLineAnimation mentioned above respectively.
- This animation flips the
Snappers 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
Snapperwill highlight it and frame it blue.
- Clicking then flips/mirrors the
Snapperover the horizontal/vertical axis shown.
- If an unmirrorable
Snapperis selected, this will be the graphic shown.
- If there is a selection in
Space, hovering over the selection will highlight/mirror all
Snappers if they are mirrorable.
Properties: You can change the animation properties to use the horizontal/vertical axis.
Snappers across a line drawn in the
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
Snappers selected before
MirrorLineAnimationstarts, 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
Snappers 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
Snappers can be mirrored, you have to overwrite
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