Draft Clone: Difference between revisions

From FreeCAD Documentation
m (clone - escale)
(Marked this version for translation)
(42 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<languages/>
{{GuiCommand|Name=Draft Clone|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]|MenuLocation=Draft -> Clone|SeeAlso=[[Draft Scale]]}}
<translate>
<!--T:19-->
{{Docnav
|[[Draft_PointArray|Point Array]]
|[[Draft_Drawing|Drawing]]
|[[Draft_Module|Draft]]
|IconL=Draft_PointArray.svg
|IconC=Workbench_Draft.svg
|IconR=Draft_Drawing.svg
}}


<!--T:1-->
==Description==
{{GuiCommand
|Name=Draft Clone
|MenuLocation=Draft → Clone
|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]
|SeeAlso=[[Draft Move|Draft Move]], [[Draft Scale|Draft Scale]]
}}


==Description== <!--T:22-->
This tool produces a clone (a copy that is parametrically bound to the original object) of a selected object. If the original object changes, the clone changes too, but keeps its position, rotation and scale.


<!--T:2-->
The {{Button|[[Image:Draft Clone.svg|16px]] [[Draft Clone|Draft Clone]]}} tool produces linked copies of a selected shape. This means that if the original object changes its shape and properties, all clones change as well. Nevertheless, each clone retains its unique position, rotation, and scale, as well as its view properties like shape color, line width, and transparency.

<!--T:10-->
The Clone 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:11-->
To create simple copies, that are completely independent from an original object, use [[Draft Move|Draft Move]], [[Draft Rotate|Draft Rotate]], and [[Draft Scale|Draft Scale]]. To position copies in an orthogonal array use [[Draft Array|Draft Array]]; to position copies along a path use [[Draft PathArray|Draft PathArray]]; to position copies at specified points use [[Draft PointArray|Draft PointArray]].

</translate>
[[Image:Draft_Clone_example.jpg|400px]]
[[Image:Draft_Clone_example.jpg|400px]]
<translate>
<!--T:3-->
{{Caption|Clone next to the original object}}


==Usage== <!--T:23-->
==How to use==


<!--T:4-->
# Select objects you wish to clone
# Select an object that you wish to clone.
# Press the {{KEY|[[Image:Draft Clone.png|16px]] [[Draft Clone]]}} button
# Press the {{Button|[[Image:Draft Clone.svg|16px]] [[Draft Clone|Draft Clone]]}} button.


<!--T:12-->
==Properties==
Depending on its options, the {{Button|[[Image:Draft Scale.svg|16px]] [[Draft Scale|Draft Scale]]}} tool also creates a clone at a specified scale.


<!--T:13-->
* {{PropertyData|Scale}}: Specifies an optional scale factor for the clone
Clones of 2D objects created with the [[Draft Workbench|Draft]] or [[Sketcher Workbench|Sketcher Workbench]]es will also be 2D objects, and therefore can be used as such for the [[PartDesign Workbench|PartDesign Workbench]].
* The result of the [[Draft Scale]] tool is also a clone


<!--T:14-->
==Scripting==
All [[Arch Workbench|Arch Workbench]] objects have the possibility to behave as clones by using their {{PropertyData|CloneOf}} property. If you use the Draft Clone tool on a selected Arch object, you will produce such an Arch clone instead of a regular Draft clone.


===Limitations === <!--T:15-->
The Clone tool can by used in [[macros]] and from the python console by using the following function:
Currently, [[Sketcher Workbench|Sketcher Sketches]] cannot be mapped to the faces of a clone.


==Options== <!--T:9-->
'''clone (obj,[delta])''': makes a clone of the given object(s). The clone is an exact, linked copy of the given object.
There are no options for this tool. Either it works with the selected objects or not.
If the original object changes, the final object changes too. Optionally, you can give a delta Vector to move the
clone away from the original position.


==Properties== <!--T:5-->
* {{PropertyData|Objects}}: specifies a list of base objects which are being cloned.
* {{PropertyData|Scale}}: specifies the scaling factor for the clone, in each X, Y, and Z direction.
* {{PropertyData|Fuse}}: if it is {{TRUE}} and {{PropertyData|Objects}} includes many shapes that intersect each other, the resulting clone will be fuse them together into a single shape, or make a compound of them. {{Version|0.17}}

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

<!--T:16-->
The Clone tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using the following function:

</translate>
{{Code|code=
cloned_object = clone(obj, delta=None, forcedraft=False)
}}
<translate>

<!--T:7-->
* Creates a {{incode|cloned_object}} from {{incode|obj}}, which can be a single object or a list of objects.
* If given, {{incode|delta}} is a {{incode|FreeCAD.Vector}} that moves the new clone away from the original position of the base object.
* If {{incode|forcedraft}} is {{incode|True}}, the resulting object will be a Draft clone, and not an Arch clone, even if {{incode|obj}} is an [[Arch Workbench|Arch Workbench]] object.

<!--T:17-->
The fusion of the objects that are part of the clone can be achieved by setting its {{incode|Fuse}} attribute to {{incode|True}}.

<!--T:8-->
Example:
Example:


</translate>
import Draft
{{Code|code=
Draft.clone(FreeCAD.ActiveDocument.ActiveObject)
import FreeCAD, Draft

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

obj = [Polygon1, Polygon2]
vector = FreeCAD.Vector(2600, 500, 0)
cloned_object = Draft.clone(obj, delta=vector)

cloned_object.Fuse = True
FreeCAD.ActiveDocument.recompute()
}}
<translate>

<!--T:18-->
{{Docnav
|[[Draft_PointArray|Point Array]]
|[[Draft_Drawing|Drawing]]
|[[Draft_Module|Draft]]
|IconL=Draft_PointArray.svg
|IconC=Workbench_Draft.svg
|IconR=Draft_Drawing.svg
}}


</translate>
{{languages | {{es|Draft_Clone/es}} }}
{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Revision as of 17:52, 21 February 2020

Draft Clone

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

Description

The Draft Clone tool produces linked copies of a selected shape. This means that if the original object changes its shape and properties, all clones change as well. Nevertheless, each clone retains its unique position, rotation, and scale, as well as its view properties like shape color, line width, and transparency.

The Clone 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 simple copies, that are completely independent from an original object, use Draft Move, Draft Rotate, and Draft Scale. To position copies in an orthogonal array use Draft Array; to position copies along a path use Draft PathArray; to position copies at specified points use Draft PointArray.

Clone next to the original object

Usage

  1. Select an object that you wish to clone.
  2. Press the Draft Clone button.

Depending on its options, the Draft Scale tool also creates a clone at a specified scale.

Clones of 2D objects created with the Draft or Sketcher Workbenches will also be 2D objects, and therefore can be used as such for the PartDesign Workbench.

All Arch Workbench objects have the possibility to behave as clones by using their DataCloneOf property. If you use the Draft Clone tool on a selected Arch object, you will produce such an Arch clone instead of a regular Draft clone.

Limitations

Currently, Sketcher Sketches cannot be mapped to the faces of a clone.

Options

There are no options for this tool. Either it works with the selected objects or not.

Properties

  • DataObjects: specifies a list of base objects which are being cloned.
  • DataScale: specifies the scaling factor for the clone, in each X, Y, and Z direction.
  • DataFuse: if it is true and DataObjects includes many shapes that intersect each other, the resulting clone will be fuse them together into a single shape, or make a compound of them. introduced in version 0.17

Scripting

See also: Draft API and FreeCAD Scripting Basics.

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

cloned_object = clone(obj, delta=None, forcedraft=False)
  • Creates a cloned_object from obj, which can be a single object or a list of objects.
  • If given, delta is a FreeCAD.Vector that moves the new clone away from the original position of the base object.
  • If forcedraft is True, the resulting object will be a Draft clone, and not an Arch clone, even if obj is an Arch Workbench object.

The fusion of the objects that are part of the clone can be achieved by setting its Fuse attribute to True.

Example:

import FreeCAD, Draft

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

obj = [Polygon1, Polygon2]
vector = FreeCAD.Vector(2600, 500, 0)
cloned_object = Draft.clone(obj, delta=vector)

cloned_object.Fuse = True
FreeCAD.ActiveDocument.recompute()