Draft Mirror: Difference between revisions

From FreeCAD Documentation
No edit summary
(Updated Description)
Line 18: Line 18:
|MenuLocation=Modification → Mirror
|MenuLocation=Modification → Mirror
|Workbenches=[[Draft_Module|Draft]], [[Arch_Module|Arch]]
|Workbenches=[[Draft_Module|Draft]], [[Arch_Module|Arch]]
|SeeAlso=[[Draft_Scale|Draft Scale]], [[Draft_Clone|Draft Clone]]
|SeeAlso=[[Draft_Clone|Draft Clone]]
}}
}}


Line 24: Line 24:


<!--T:2-->
<!--T:2-->
The {{Button|[[Image:Draft Mirror.svg|16px]] [[Draft_Mirror|Draft Mirror]]}} tool produces a mirrored copy of a selected object, using the [[Part_Mirror|Part Mirror]] operation. The copy, just like a [[Draft_Clone|Draft Clone]], is linked to the original object. This means that if the original object changes its shape and properties, the mirrored shape changes as well.
The [[Image:Draft_Mirror.svg|24px]] '''Draft Mirror''' command creates mirrored copies, [[Part_Mirror|Part Mirror]] objects, from selected objects. A [[Part_Mirror|Part Mirror]] object is parametric, it will update if its source object changes.


<!--T:10-->
<!--T:10-->
The Mirror tool can be used on 2D shapes created with the [[Draft Workbench|Draft Workbench]], but can also be used on many types of 3D objects such as those created with the [[Part Workbench|Part]], [[PartDesign Workbench|PartDesign]], or [[Arch Workbench|Arch Workbench]]es.
The command can be used on 2D objects created with the [[Draft_Workbench|Draft Workbench]] or [[Sketcher_Workbench|Sketcher Workbench]], but also on many 3D objects such as those created with the [[Part_Workbench|Part Workbench]] or [[Arch_Workbench|Arch Workbench]].

<!--T:11-->
To create copies or clones, and manually place them use [[Draft Move|Draft Move]], [[Draft Rotate|Draft Rotate]], and [[Draft Clone|Draft Clone]].


</translate>
</translate>
Line 36: Line 33:
<translate>
<translate>
<!--T:3-->
<!--T:3-->
{{Caption|Mirrored object created using a mirroring line}}
{{Caption|Mirroring an object}}


==Usage== <!--T:20-->
==Usage== <!--T:20-->

Revision as of 16:37, 13 June 2021

This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.

Draft Mirror

Menu location
Modification → Mirror
Workbenches
Draft, Arch
Default shortcut
None
Introduced in version
-
See also
Draft Clone

Description

The Draft Mirror command creates mirrored copies, Part Mirror objects, from selected objects. A Part Mirror object is parametric, it will update if its source object changes.

The command can be used on 2D objects created with the Draft Workbench or Sketcher Workbench, but also on many 3D objects such as those created with the Part Workbench or Arch Workbench.

Mirroring an object

Usage

See also: Draft Snap and Draft Constrain.

  1. Optionally select one or more objects.
  2. There are several ways to invoke the command:
    • Press the Draft Mirror button.
    • Select the Modification → Mirror option from the menu.
    • Use the keyboard shortcut: M then I.
  3. If you have not yet selected an object: select an object in the 3D view.
  4. The Mirror task panel opens. See Options for more information.
  5. Pick the first point of the mirror plane in the 3D view, or type coordinates and press the Enter point button.
  6. Pick the second point of the mirror plane in the 3D view, or type coordinates and press the Enter point button.
  7. The mirror plane is defined by the selected points and the normal of the Draft working plane.

Options

The single character keyboard shortcuts mentioned here can be changed. See Draft Preferences.

  • To manually enter coordinates enter the X, Y and Z component, and press Enter after each. Or you can press the Enter point button when you have the desired values. It is advisable to move the pointer out of the 3D view before entering coordinates.
  • Press R or click the Relative checkbox to toggle relative mode. If relative mode is on, the coordinates of the second point are relative to the first point, else they are relative to the coordinate system origin.
  • Press G or click the Global checkbox to toggle global mode. If global mode is on, coordinates are relative to the global coordinate system, else they are relative to the working plane coordinate system. introduced in version 0.20
  • The Continue checkbox has no purpose for this command.
  • The Modify subelements checkbox has no purpose for this command.
  • Press Esc or the Close button to abort the command.

Notes

Preferences

See also: Preferences Editor and Draft Preferences.

  • To change the number of decimals used for the input of coordinates: Edit → Preferences... → General → Units → Units settings → Number of decimals.

Properties

See also: Property editor.

A Part Mirror object is derived from a Part Feature object and inherits all its properties. It also has the following additional properties:

Data

Base

  • DataSource (Link): specifies the object that is mirrored.

Plane

  • DataBase (Vector): specifies the base point of the mirror plane.
  • DataNormal (Vector): specifies the normal direction of the mirror plane.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To mirror objects use the mirror method of the Draft module.

mirrored_list = mirror(objlist, p1, p2)
  • objlist contains the objects to be mirrored. It is either a single object or a list of objects.
  • p1 is the first point of the mirror plane.
  • p2 is the second point of the mirror plane.
  • If the Draft working plane is available the alignment of the mirror plane is determined by its normal, else the view direction of the camera in the active 3D view is used. If the graphical interface is not available the Z axis is used.
  • mirrored_list is returned with the new Part::Mirroring objects. It is either a single object or a list of objects, depending on objlist.

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

place = App.Placement(FreeCAD.Vector(1000, 0, 0), App.Rotation())
polygon1 = Draft.make_polygon(3, 750)
polygon2 = Draft.make_polygon(5, 750, placement=place)

p1 = App.Vector(2000, -1000, 0)
p2 = App.Vector(2000, 1000, 0)

line1 = Draft.make_line(p1, p2)
mirrored1 = Draft.mirror(polygon1, p1, p2)

Line2 = Draft.make_line(-p1, -p2)
mirrored2 = Draft.mirror([polygon1, polygon2], -p1, -p2)

doc.recompute()