Draft Arc: Difference between revisions

From FreeCAD Documentation
(bullet point one level)
(See also, basic scripting, code)
Line 44: Line 44:


==Scripting== <!--T:7-->
==Scripting== <!--T:7-->
{{emphasis|See also:}} [[FreeCAD Scripting Basics]], [[Draft API]], and the [https://www.freecadweb.org/api autogenerated API documentation].
The Circle tool can also be used to create arcs in [[macros]] and from the python console by using the following function, giving it additional arguments:

The Arc tool can also be used in [[macros]] and from the [[Python]] console by using the same function to create circles, giving it additional arguments:
</translate>
</translate>

{{Code|code=
{{Code|code=
makeCircle (radius, [placement], [facemode], [startangle], [endangle])
Circle = makeCircle(radius, placement=None, face=None, startangle=None, endangle=None, support=None)
Circle = makeCircle(Part.Edge, placement=None, face=None, startangle=None, endangle=None, support=None)
}}
}}
<translate>
<translate>
<!--T:8-->
<!--T:8-->
* Creates a circle object with given radius.
* Creates a {{incode|Circle}} object with given {{incode|radius}}.
** {{incode|radius}} can also be a {{incode|Part.Edge}}, whose {{incode|Curve}} object must be a {{incode|Part.Circle}}
* If a placement is given, it is used. If facemode is False, the circle is shown as a wireframe, otherwise as a face.
* If a {{incode|placement}} is given, it is used.
* If startangle AND endangle are given (in degrees), they are used and the object appears as an arc.
* If {{incode|face}} is {{incode|True}}, the circle will make a face, that is, it will appear filled.
* Returns the newly created object.
* If {{incode|startangle}} and {{incode|endangle}} are given (in degrees), and have different values, they are used and the object appears as an arc, not as a circle.


<!--T:9-->
<!--T:9-->
Line 61: Line 66:
{{Code|code=
{{Code|code=
import Draft
import Draft
myArc = Draft.makeCircle(2,startangle=0,endangle=90)


Arc1 = Draft.makeCircle(200, startangle=0, endangle=90)
Arc2 = Draft.makeCircle(500, startangle=0, endangle=90)
Arc2 = Draft.makeCircle(750, startangle=0, endangle=90)
}}
}}
{{clear}}
{{clear}}
[[Category:Draft]]

Revision as of 04:40, 6 November 2018

Draft Arc

Menu location
Draft → Arc
Workbenches
Draft, Arch
Default shortcut
A R
Introduced in version
-
See also
Draft Circle

Description

The Arc tool creates an arc in the current work plane by entering four points, the center, the radius, the first point and the last point, or by picking tangents, or any combination of those. It uses the Draft Linestyle set on the Draft Tray. This tool works the same way as the Draft Circle tool, but adds start and end angles.

How to use

  1. Press the Draft Arc button, or press A then R keys
  2. Click a first point on the 3D view, or type a coordinate
  3. Click a second point on the 3D view, or enter a radius value
  4. Click a third point in the 3D view, or enter a start angle
  5. Click a fourth point in the 3D view, or enter an aperture angle

The arc can be turned into a circle after creation, by setting its first angle and last angle properties to the same value.

Options

  • The primary use of the arc tool is by picking four points: the centre, a point on the circumference, the start of the arc, and its end.
    • By pressing Alt, you can select a tangent instead of picking point, to define the base circle of the arc. You can therefore construct several types of circles by selecting one, two or three tangents.
  • The direction of the arc depends on the movement you are doing with your mouse. If you start to move clockwise after the third point is entered, your arc will go clockwise. To go counter-clockwise, simply move your mouse back over the third point, until the arc starts drawing in the other direction.
  • To enter coordinates manually, simply enter the numbers, then press Enter between each X, Y and Z component.
  • Press T or click the checkbox to toggle continue mode. If continue mode is on, the Arc tool will restart after you finish the arc, allowing you to draw another one without pressing the tool button again.
  • Press Ctrl while drawing to force snapping your point to the nearest snap location, independently of the distance.
  • Press Shift while drawing to constrain your point horizontally or vertically in relation to the center.
  • Press Esc or the Cancel button to abort the current command.

Properties

An Arc object shares all properties from a Draft Circle, but some properties only make sense for the circle.

Data

  • DataFirst Angle: specifies the angle of the first point of the arc.
  • DataLast Angle: specifies the angle of the last point of the arc.
  • DataRadius: specifies the radius of the arc.
  • DataMake Face: specifies if the arc makes a face or not. This property only works if the shape is a full circle.
To make an arc a full circle set the DataFirst Angle and DataLast Angle to the same value. The values 0° and 360° aren't considered the same, so if these two values are used, the circle will not form a face.

View

  • ViewPattern: specifies a Draft Pattern with which to fill the face of the arc. This property only works if the arc is a full circle, and if DataMake Face is true.
  • ViewPattern Size: specifies the size of the Draft Pattern.

Scripting

See also: FreeCAD Scripting Basics, Draft API, and the autogenerated API documentation.

The Arc tool can also be used in macros and from the Python console by using the same function to create circles, giving it additional arguments:

Circle = makeCircle(radius, placement=None, face=None, startangle=None, endangle=None, support=None)
Circle = makeCircle(Part.Edge, placement=None, face=None, startangle=None, endangle=None, support=None)
  • Creates a Circle object with given radius.
    • radius can also be a Part.Edge, whose Curve object must be a Part.Circle
  • If a placement is given, it is used.
  • If face is True, the circle will make a face, that is, it will appear filled.
  • If startangle and endangle are given (in degrees), and have different values, they are used and the object appears as an arc, not as a circle.

Example:

import Draft

Arc1 = Draft.makeCircle(200, startangle=0, endangle=90)
Arc2 = Draft.makeCircle(500, startangle=0, endangle=90)
Arc2 = Draft.makeCircle(750, startangle=0, endangle=90)