Draft Polygon

From FreeCAD Documentation
Revision as of 23:06, 6 November 2018 by Vocx (talk | contribs) (More details)

Draft Polygon

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

Description

The Polygon tool creates a regular polygon inscribed in a circumference by picking two points, the center and the radius. It uses the Draft Linestyle set on the Draft Tray.

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.

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 toggle continue mode. If continue mode is on, the Polygon tool will restart after you finish it, allowing you to draw another one without pressing the tool button again.
  • Press L or click the checkbox to toggle filled mode. If filled mode is on, the polygon will create a filled face (DataMake Face true); if not, the polygon will not make a face (DataMake Face false).
  • 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 second point horizontally or vertically in relation to the first one.
  • 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
  • DataChamfer Size: Specifies the size of chamfered corners
  • DataFillet Radius: Specifies a curvature radius to give to the corners of the rectangle
  • DataMake Face: Fills the polygon with a face
  • ViewPattern: Specifies a hatch pattern to fill the wire with
  • ViewPattern Size: Specifies the size of the hatch pattern

See also Draft Pattern page.

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)