Draft Clone: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
Line 56: Line 56:
#* Use the keyboard shortcut: {{KEY|C}} then {{KEY|L}}.
#* Use the keyboard shortcut: {{KEY|C}} then {{KEY|L}}.
# If you have not yet selected an object: select an object in the [[3D_view|3D view]].
# If you have not yet selected an object: select an object in the [[3D_view|3D view]].
# For each selected object a separate clone is created.


==Properties== <!--T:26-->
==Properties== <!--T:26-->

Revision as of 14:48, 11 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 Clone

Menu location
Modification → 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

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.

Usage

  1. Optionally select one or more objects.
  2. There are several ways to invoke the command:
    • Press the Draft Clone button.
    • Select the Modification → Clone option from the menu.
    • Use the keyboard shortcut: C then L.
  3. If you have not yet selected an object: select an object in the 3D view.

Properties

See also: Property editor.

An object created with the Draft Clone command is derived from a Part Part2DObject object, a Part Feature object or, if an Arch Clone is created, from the object type of the source object. It inherits all properties from that object. It also has the following additional properties:

Data

Draft

  • DataObjects (LinkListGlobal): specifies the objects that are cloned.
  • DataScale (Vector): specifies the X, Y and Z scale factors.
  • DataFuse (Bool): specifies if overlapping shapes in the clone are fused or not.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To create a clone use the make_clone method (introduced in version 0.19) of the Draft module. This method replaces the deprecated clone method.

cloned_object = make_clone(obj, delta=None, forcedraft=False)
  • obj contains the objects to be cloned. It is either a single object or a list of objects.
  • delta is the displacement vector to be applied to the clone.
  • If forcedraft is False and obj contains a single Arch object an Arch Clone is created. Set forcedraft to True to create a Draft Clone instead.
  • cloned_object is returned with the clone object.

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

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

vector = App.Vector(2600, 500, 0)
cloned_object = Draft.clone([polygon1, polygon2], delta=vector)

cloned_object.Fuse = True

doc.recompute()