Draft Polygon: Difference between revisions

From FreeCAD Documentation
(<translate>)
(Marked this version for translation)
Line 1: Line 1:
<translate>
<translate>
<!--T:1-->
{{GuiCommand|Name=Draft Polygon|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]|MenuLocation=Draft -> Polygon|Shortcut=P G}}
{{GuiCommand|Name=Draft Polygon|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]|MenuLocation=Draft -> Polygon|Shortcut=P G}}


==Description==
==Description== <!--T:2-->
The polygon tool creates a regular polygon by picking two points, the center and a second point defining a radius. It takes the [[Draft Linestyle|linewidth and color]] previously set on the Tasks tab.
The polygon tool creates a regular polygon by picking two points, the center and a second point defining a radius. It takes the [[Draft Linestyle|linewidth and color]] previously set on the Tasks tab.


<!--T:3-->
[[Image:Draft_polygon_example.jpg|400px]]
[[Image:Draft_polygon_example.jpg|400px]]


==How to use==
==How to use== <!--T:4-->
# Press the {{KEY|[[Image:Draft Polygon.png|16px]] [[Draft Polygon]]}} button, or press {{KEY|P}} then {{KEY|G}} keys
# Press the {{KEY|[[Image:Draft Polygon.png|16px]] [[Draft Polygon]]}} button, or press {{KEY|P}} then {{KEY|G}} keys
# Click a first point on the 3D view, or type a [[Draft_Coordinates|coordinate]] to indicate the center
# Click a first point on the 3D view, or type a [[Draft_Coordinates|coordinate]] to indicate the center
Line 13: Line 15:
# Click another point on the 3D view, or type a radius value to define the polygon radius. The polygon will also be a face, even if it appears as wireframe.
# Click another point on the 3D view, or type a radius value to define the polygon radius. The polygon will also be a face, even if it appears as wireframe.


==Options==
==Options== <!--T:5-->
* 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.
* Press {{KEY|T}} or click the checkbox to check/uncheck the {{KEY|'''Continue'''}} button. If continue mode is on, the Polygon tool will restart after you finish or close it, allowing you to draw another one without pressing the Polygon button again.
* Press {{KEY|T}} or click the checkbox to check/uncheck the {{KEY|'''Continue'''}} button. If continue mode is on, the Polygon tool will restart after you finish or close it, allowing you to draw another one without pressing the Polygon button again.
Line 21: Line 23:
* Press {{KEY|ESC}} or the {{KEY|'''Cancel'''}} button to abort the current command.
* Press {{KEY|ESC}} or the {{KEY|'''Cancel'''}} button to abort the current command.


==Properties==
==Properties== <!--T:6-->
* {{PropertyData|Radius}}: The radius of the defining circle
* {{PropertyData|Radius}}: The radius of the defining circle
* {{PropertyData|Draw Mode}}: Specifies if the polygon is inscribed or circumscribed around the defining circle
* {{PropertyData|Draw Mode}}: Specifies if the polygon is inscribed or circumscribed around the defining circle
Line 27: Line 29:
* {{PropertyData|Fillet Radius}}: Specifies a curvature radius to give to the corners of the rectangle
* {{PropertyData|Fillet Radius}}: Specifies a curvature radius to give to the corners of the rectangle


==Scripting==
==Scripting== <!--T:7-->
The Polygon tool can by used in [[macros]] and from the python console by using the following function:
The Polygon tool can by used in [[macros]] and from the python console by using the following function:


Line 35: Line 37:
</syntaxhighlight>
</syntaxhighlight>
<translate>
<translate>
<!--T:8-->
* Creates a polygon object with the given number of faces and the radius.
* Creates a polygon object with the given number of faces and the radius.
* If inscribed is False, the polygon is circumscribed around a circle with the given radius, otherwise it is inscribed.
* If inscribed is False, the polygon is circumscribed around a circle with the given radius, otherwise it is inscribed.
Line 40: Line 43:
* Returns the newly created object.
* Returns the newly created object.


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

Revision as of 20:53, 11 January 2014

Draft Polygon

Menu location
Draft -> Polygon
Workbenches
Draft, Arch
Default shortcut
P G
Introduced in version
-
See also
None

Description

The polygon tool creates a regular polygon by picking two points, the center and a second point defining a radius. It takes the linewidth and color previously set on the Tasks tab.

How to use

  1. Press the Draft Polygon button, or press P then G keys
  2. Click a first point on the 3D view, or type a coordinate to indicate the center
  3. Adjust the desired number of sides in the options dialog,
  4. Click another point on the 3D view, or type a radius value to define the polygon radius. The polygon will also be a face, even if it appears as wireframe.

Options

  • 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 check/uncheck the Continue button. If continue mode is on, the Polygon tool will restart after you finish or close it, allowing you to draw another one without pressing the Polygon 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 next point horizontally or vertically in relation to the last one.
  • Press I or the Filled button to have the polygon to appear as a face after it has been closed. This simply sets the View->Property of the Rectangle to "Flat lines" or "Wireframe", so it can easily be changed later.
  • Press ESC or the Cancel button to abort the current command.

Properties

  • DataRadius: The radius of the defining circle
  • DataDraw Mode: Specifies if the polygon is inscribed or circumscribed around the defining circle
  • DataFaces Number: The number of sides of the polygon
  • DataFillet Radius: Specifies a curvature radius to give to the corners of the rectangle

Scripting

The Polygon tool can by used in macros and from the python console by using the following function:

 '''makePolygon(nfaces,[radius],[inscribed],[placement],[face])'''
  • Creates a polygon object with the given number of faces and the radius.
  • If inscribed is False, the polygon is circumscribed around a circle with the given radius, otherwise it is inscribed.
  • If face is True, the resulting shape is displayed as a face, otherwise as a wireframe.
  • Returns the newly created object.

Example:

 import Draft
 Draft.makePolygon(5,radius=3)