Draft Mirror/tr: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
{{Page_in_progress}}
<languages/>
<languages/>

{{Docnav
{{Docnav
|[[Draft_Drawing|Drawing]]
|[[Draft_Scale|Scale]]
|[[Draft_Stretch|Stretch]]
|[[Draft_Offset|Offset]]
|[[Draft_Module|Draft]]
|[[Draft_Module|Draft]]
|IconL=Draft_Drawing.svg
|IconL=Draft_Scale.svg
|IconR=Draft_Stretch.svg
|IconR=Draft_Offset.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
Line 36: Line 38:


==Options==
==Options==

* Press {{KEY|X}}, {{KEY|Y}} or {{KEY|Z}} after the first point to constrain the second point on the given axis.
* Press {{KEY|X}}, {{KEY|Y}} or {{KEY|Z}} after the first point to constrain the second point on the given axis.
* To enter coordinates manually, simply enter the numbers, then press {{KEY|Enter}} between each X, Y and Z component.
* To enter coordinates manually, simply enter the numbers, then press {{KEY|Enter}} between each X, Y and Z component.
Line 45: Line 48:


==Properties==
==Properties==

* {{PropertyData|Source}}: specifies the object to mirror,
* {{PropertyData|Source}}: specifies the object to mirror,
* {{PropertyData|Base}}: specifies the base point of the mirror plane.
* {{PropertyData|Base}}: specifies the base point of the mirror plane.
* {{PropertyData|Normal}}: specifies the normal direction of the mirror plane.
* {{PropertyData|Normal}}: specifies the normal direction of the mirror plane.


==Scripting==
== Scripting ==

{{Emphasis|See also:}} [[Draft API|Draft API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
See also: [https://www.freecadweb.org/api Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].

To mirror objects use the {{incode|mirror}} method of the Draft module.


The Mirror tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using the following function:
{{Code|code=
{{Code|code=
mirrored_list = mirror(objlist, p1, p2)
mirrored_list = mirror(objlist, p1, p2)
}}
}}


* Creates [[Part Mirror|Part Mirror]] objects from {{incode|objlist}}, which can be a single object or a list of objects.
* {{incode|objlist}} contains the objects to be mirrored. It is either a single object or a list of objects.
* {{incode|p1}} indicates the first point of the mirror plane.
* 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|p2}} indicates the second point of the mirror plane.
* If the [[Draft_SelectPlane|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|3D view]] is used. If the graphical interface is not available the Z axis is used.
** {{incode|mirrored_list}} is either a single object or a list of objects, depending on the input {{incode|objlist}}.
* {{incode|mirrored_list}} is returned with the new {{incode|Part::Mirroring}} objects. It is either a single object or a list of objects, depending on {{incode|objlist}}.


Example:
Example:


{{Code|code=
{{Code|code=
import FeeCAD, Draft
import FreeCAD as App
import Draft


doc = App.newDocument()
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)
place = App.Placement(FreeCAD.Vector(1000, 0, 0), App.Rotation())
polygon1 = Draft.make_polygon(3, 750)
p2 = FreeCAD.Vector(2000, 1000, 0)
polygon2 = Draft.make_polygon(5, 750, placement=place)


Line1 = Draft.makeLine(p1, p2)
p1 = App.Vector(2000, -1000, 0)
mirrored1 = Draft.mirror(Polygon1, p1, p2)
p2 = App.Vector(2000, 1000, 0)


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

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

doc.recompute()
}}
}}



{{Docnav
{{Docnav
|[[Draft_Drawing|Drawing]]
|[[Draft_Scale|Scale]]
|[[Draft_Stretch|Stretch]]
|[[Draft_Offset|Offset]]
|[[Draft_Module|Draft]]
|[[Draft_Module|Draft]]
|IconL=Draft_Drawing.svg
|IconL=Draft_Scale.svg
|IconR=Draft_Stretch.svg
|IconR=Draft_Offset.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
Line 92: Line 105:
{{Draft Tools navi{{#translation:}}}}
{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Revision as of 09:50, 20 May 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.

Yansıt

Menü konumu
Draft → Mirror
Tezgahlar
Draft, Arch
Varsayılan kısayol
Hiçbiri
Versiyonda tanıtıldı
-
Ayrıca bkz
Draft Scale

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

  • VeriSource: specifies the object to mirror,
  • VeriBase: specifies the base point of the mirror plane.
  • VeriNormal: 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 indicates the first point of the mirror plane.
  • p2 indicates 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()