Draft Mirror: Difference between revisions

From FreeCAD Documentation
({{Draft Tools navi}} and {{Userdocnavi}})
(Marked this version for translation)
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
<!--T:16-->
{{Docnav
|[[Draft_Drawing|Drawing]]
|[[Draft_Stretch|Stretch]]
|[[Draft_Module|Draft]]
|IconL=Draft_Drawing.svg
|IconC=Workbench_Draft.svg
|IconR=Draft_Stretch.svg
}}

<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand
Line 6: Line 16:
|MenuLocation=Draft → Mirror
|MenuLocation=Draft → Mirror
|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]
|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]
|SeeAlso=[[Draft Scale|Draft Scale]], [[Draft Clone]]
|SeeAlso=[[Draft Scale|Draft Scale]], [[Draft Clone|Draft Clone]]
}}
}}


==Description== <!--T:2-->
==Description== <!--T:19-->
The Mirror tool produces a mirrored copy of a selected object, using the [[Part Mirror]] operation. The copy, just like a [[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.


<!--T:2-->
The Mirror tool can be used on 2D shapes created with the [[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]]es.
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.


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


<!--T:3-->
<!--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>
[[Image:Draft_Mirror_example.jpg|400px]]
[[Image:Draft_Mirror_example.jpg|400px]]
<translate>
<!--T:3-->
{{Caption|Mirrored object created using a mirroring line}}

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


==How to use== <!--T:4-->
<!--T:4-->
# Select an object that you wish to mirror.
# Select an object that you wish to mirror.
# Press the {{Button|[[Image:Draft Mirror.svg|16px]] [[Draft Mirror]]}} button. If no object is selected, you will be invited to select one.
# Press the {{Button|[[Image:Draft Mirror.svg|16px]] [[Draft Mirror|Draft Mirror]]}} button. If no object is selected, you will be invited to select one.
# Click the first point of the mirror line on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button.
# Click a first point on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button.
# Click the second point of the mirror line on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button.
# Click a second point on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button. These points define a line, which together with the camera view, define a mirroring plane that is used to create the mirrored object.


<!--T:12-->
After creating the mirrored copy, its binding with the original object can be removed using the {{Button|[[Image:Tree_Part.svg|16px]] [[Part_CreateSimpleCopy|Part Create simple copy]]}} tool.
After creating the mirrored copy, its binding with the original object can be removed using the {{Button|[[Image:Tree_Part.svg|16px]] [[Part_SimpleCopy|Part Create simple copy]]}} tool.


<!--T:13-->
A mirrored copy of a Draft object can be turned into a [[Draft Wire]], by using {{Button|[[Image:Draft Downgrade.svg|16px]] [[Draft Downgrade]]}} then {{Button|[[Image:Draft Upgrade.svg|16px]] [[Draft Upgrade]]}}.
A mirrored copy of a Draft object can be turned into a [[Draft Wire|Draft Wire]], by using {{Button|[[Image:Draft Downgrade.svg|16px]] [[Draft Downgrade]]}} then {{Button|[[Image:Draft Upgrade.svg|16px]] [[Draft Upgrade|Draft Upgrade]]}}.


==Options== <!--T:6-->
==Options== <!--T:6-->
Line 44: Line 65:


==Scripting== <!--T:7-->
==Scripting== <!--T:7-->
{{Emphasis|See also:}} [[Draft API]] and [[FreeCAD Scripting Basics]].
{{Emphasis|See also:}} [[Draft API|Draft API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].


<!--T:14-->
The Clone tool can be used in [[macros]] and from the [[Python]] console by using the following function:
The Mirror tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using the following function:
</translate>
</translate>
{{Code|code=
{{Code|code=
Line 54: Line 76:


<!--T:8-->
<!--T:8-->
* Creates [[Part Mirror]] objects from {{incode|objlist}}, which can be a single object or a list of objects.
* Creates [[Part Mirror|Part Mirror]] objects from {{incode|objlist}}, which can be a single object or a list of objects.
* The mirroring plane is defined by the line built with points {{incode|p1}} and {{incode|p2}}, and parallel to the current view.
* The mirroring plane is defined by the line built with points {{incode|p1}} and {{incode|p2}}, and parallel to the current view.
* {{incode|mirrored_list}} is returned with the new objects.
* {{incode|mirrored_list}} is returned with the new objects.
** {{incode|mirrored_list}} is either a single object or a list of objects, depending on the input {{incode|objlist}}.
** {{incode|mirrored_list}} is either a single object or a list of objects, depending on the input {{incode|objlist}}.



<!--T:9-->
<!--T:9-->
Example:
Example:

</translate>
</translate>
{{Code|code=
{{Code|code=
Line 79: Line 101:
mirrored2 = Draft.mirror([Polygon1, Polygon2], -p1, -p2)
mirrored2 = Draft.mirror([Polygon1, Polygon2], -p1, -p2)
}}
}}
<translate>

<!--T:15-->
{{Docnav
|[[Draft_Drawing|Drawing]]
|[[Draft_Stretch|Stretch]]
|[[Draft_Module|Draft]]
|IconL=Draft_Drawing.svg
|IconC=Workbench_Draft.svg
|IconR=Draft_Stretch.svg
}}

</translate>
{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}
{{clear}}
{{Draft Tools navi}}
{{Userdocnavi}}

Revision as of 20:29, 21 February 2020

Draft Mirror

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

Description

The Draft Mirror tool produces a mirrored copy of a selected object, using the Part Mirror operation. The copy, just like a 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 Mirror tool can be used on 2D shapes created with the Draft Workbench, but can also be used on many types of 3D objects such as those created with the Part, PartDesign, or Arch Workbenches.

To create copies or clones, and manually place them use Draft Move, Draft Rotate, and Draft Clone.

Mirrored object created using a mirroring line

Usage

  1. Select an object that you wish to mirror.
  2. Press the Draft Mirror button. If no object is selected, you will be invited to select one.
  3. Click a first point on the 3D view, or type a coordinate and press the add point button.
  4. Click a second point on the 3D view, or type a coordinate and press the add point button. These points define a line, which together with the camera view, define a mirroring plane that is used to create the mirrored object.

After creating the mirrored copy, its binding with the original object can be removed using the Part Create simple copy tool.

A mirrored copy of a Draft object can be turned into a Draft Wire, by using Draft Downgrade then Draft Upgrade.

Options

  • Press X, Y or Z after the first point to constrain the second point on the given axis.
  • To enter coordinates manually, simply enter the numbers, then press Enter between each X, Y and Z component.
  • Press R or click the checkbox to toggle relative mode. If relative mode is on, the coordinates of the second point are relative to the first one; if not, they are absolute, taken from the origin (0,0,0).
  • Press T or click the checkbox to toggle continue mode. If continue mode is on, the Mirror tool will restart after you give the second point, allowing you to put another object without pressing the tool button again.
  • Hold Ctrl while drawing to force snapping your point to the nearest snap location, independently of the distance.
  • Hold Shift while drawing to constrain your second point horizontally or vertically in relation to the first one.
  • Press Esc or the Close button to abort the current command.

Properties

  • DataSource: specifies the object to mirror,
  • DataBase: specifies the base point of the mirror plane.
  • DataNormal: specifies the normal direction of the mirror plane.

Scripting

See also: Draft API and FreeCAD Scripting Basics.

The Mirror tool can be used in macros and from the Python console by using the following function:

mirrored_list = mirror(objlist, p1, p2)
  • Creates Part Mirror objects from objlist, which can be a single object or a list of objects.
  • The mirroring plane is defined by the line built with points p1 and p2, and parallel to the current view.
  • mirrored_list is returned with the new objects.
    • mirrored_list is either a single object or a list of objects, depending on the input objlist.

Example:

import FeeCAD, Draft

place = FreeCAD.Placement(FreeCAD.Vector(1000, 0, 0), FreeCAD.Rotation())
Polygon1 = Draft.makePolygon(3, 750)
Polygon2 = Draft.makePolygon(5, 750, placement=place)

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

Line1 = Draft.makeLine(p1, p2)
mirrored1 = Draft.mirror(Polygon1, p1, p2)

Line2 = Draft.makeLine(-p1, -p2)
mirrored2 = Draft.mirror([Polygon1, Polygon2], -p1, -p2)