Draft Polygon

From FreeCAD Documentation
Revision as of 13:55, 17 March 2021 by Roy 043 (talk | contribs)
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 Polygon

Menu location
Drafting → Polygon
Workbenches
Draft, Arch
Default shortcut
P G
Introduced in version
0.7
See also
None

Description

The Draft Polygon command creates a regular polygon inscribed in a circle. It uses the Draft Linestyle set on the Draft Tray.

A Draft Polygon can be switched from inscribed to circumscribed by changing its DataDraw Mode property.

Regular polygon defined by the center point and the radius

Usage

  1. There are several ways to invoke the command:
    • Press the Draft Polygon button.
    • Select the Drafting → Polygon option from the menu.
    • Use the keyboard shortcut: P then G.
  2. Adjust the desired number of Sides in the options dialog.
  3. Click the first point in the 3D view, or type coordinates and press the Enter point button.
  4. Click another point in 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. You can press the Enter point button when you have the desired values to insert the point.
  • Press T or click the checkbox to toggle continue mode. If continue mode is on, the Polygon command will restart after you finish it, allowing you to draw another one without pressing the command 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).
  • Hold Ctrl while drawing to force snapping your point to the nearest snap location, independently of the distance.
  • Hold Shift while drawing to constrain your second point horizontally or vertically in relation to the first one.
  • Press Esc or the Close button to abort the current command.

Notes

  • A Draft Polygon can be edited with the Draft Edit command.

Properties

Data

  • DataRadius: specifies the radius of the circle that defines the polygon.
  • DataDraw Mode: specifies if the polygon is inscribed in a circle, or circumscribed around a circle.
  • DataFaces Number: specifies the number of sides of the polygon.
  • DataChamfer Size: specifies the size of the chamfers (straight segments) created on the corners of the polygon.
  • DataFillet Radius: specifies the radius of the fillets (arc segments) created on the corners of the polygon.
  • DataMake Face: specifies if the shape makes a face or not. If it is true a face is created, otherwise only the perimeter is considered part of the object.

View

  • ViewPattern: specifies a Draft Pattern with which to fill the face of the polygon. This property only works if DataMake Face is true, and if ViewDisplay Mode is "Flat Lines".
  • ViewPattern Size: specifies the size of the Draft Pattern.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To create a Draft Polygon use the make_polygon method of the Draft module:

polygon = make_polygon(nfaces, radius=1, inscribed=True, placement=None, face=None, support=None)
  • Creates a polygon object with the given number of faces (nfaces), and based on a circle of radius in millimeters.
  • If inscribed is True, the polygon is inscribed in the circle, otherwise it will be circumscribed.
  • If placement is None the shape is created at the origin and one of its vertices will lie on the X axis.
  • If face is True, the shape will make a face, that is, it will appear filled.

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

polygon1 = Draft.make_polygon(4, radius=500)
polygon2 = Draft.make_polygon(5, radius=750)

zaxis = App.Vector(0, 0, 1)
p3 = App.Vector(1000, 1000, 0)
place3 = App.Placement(p3, App.Rotation(zaxis, 90))

Polygon3 = Draft.make_polygon(6, radius=1450, placement=place3)

doc.recompute()