|Drafting → Polygon|
|Introduced in version|
The Draft Polygon command creates a regular polygon in the current working plane from a center and a radius. The radius can be defined by picking a point.
A Draft Polygon can be switched from inscribed to circumscribed by changing its DataDraw Mode property. The corners of a Draft Polygon can be filleted (rounded) or chamfered by changing its DataFillet Radius or DataChamfer Size respectively.
Regular polygon defined by two points, center and radius
See also: Draft Tray, Draft Snap and Draft Constrain.
- 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.
- The Polygon task panel opens. See Options for more information.
- Adjust the desired number of Sides.
- Pick the first point, the center of the polygon, in the 3D view, or type coordinates and press the Enter point button.
- Pick the second point in the 3D view, or enter a Radius.
The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts.
- To manually enter the coordinates for the center enter the X, Y and Z component, and press Enter after each. Or you can press the Enter point button when you have the desired values. It is advisable to move the pointer out of the 3D view before entering coordinates.
- Press G or click the Global checkbox to toggle global mode. If global mode is on, coordinates are relative to the global coordinate system, else they are relative to the working plane coordinate system. introduced in version 0.20
- Press L or click the Filled checkbox to toggle filled mode. If filled mode is on, the created polygon will have DataMake Face set to
trueand will have a filled face.
- Press T or click the Continue checkbox to toggle continue mode. If continue mode is on, the command will restart after finishing, allowing you to continue creating polygons.
- Press S to switch Draft snapping on or off.
- Press Esc or the Close button to abort the command.
- A Draft Polygon can be edited with the Draft Edit command.
See also: Preferences Editor and Draft Preferences.
- To change the number of decimals used for the input of coordinates and radii: Edit → Preferences... → General → Units → Units settings → Number of decimals.
- To change the initial value of filled mode: Edit → Preferences... → Draft → General settings → Draft tools options → Fill objects with faces whenever possible. Changing the filled mode in a task panel will override this preference for the current FreeCAD session.
- If the Edit → Preferences... → Draft → General settings → Draft tools options → Use Part Primitives when available option is checked, the command will create a Part RegularPolygon instead of a Draft Polygon.
See also: Property editor.
A Draft Polygon object is derived from a Part Part2DObject and inherits all its properties. It also has the following additional properties:
- DataArea (
Area): (read-only) specifies the area of the face of the polygon. The value will be
0.0if DataMake Face if
- DataChamfer Size (
Length): specifies the length of the chamfers at the corners of the polygon.
- DataDraw Mode (
Enumeration): specifies if the polygon is
inscribedin a circle or
circumscribedaround a circle.
- DataFaces Number (
Integer): specifies the number of sides of the polygon.
- DataFillet Radius (
Length): specifies the radius of the fillets at the corners of the polygon.
- DataMake Face (
Bool): specifies if the polygon makes a face or not. If it is
truea face is created, otherwise only the perimeter is considered part of the object.
- DataRadius (
Length): specifies the radius of the circle that defines the polygon.
- ViewPattern (
Enumeration): specifies the Draft Pattern with which to fill the face of the polygon. This property only works if DataMake Face is
trueand if ViewDisplay Mode is
- ViewPattern Size (
Float): specifies the size of the Draft Pattern.
See also: Autogenerated API documentation and FreeCAD Scripting Basics.
To create a Draft Polygon use the
make_polygon method (introduced in version 0.19) of the Draft module. This method replaces the deprecated
polygon = make_polygon(nfaces, radius=1, inscribed=True, placement=None, face=None, support=None)
- Creates a
polygonobject with the given number of faces (
nfaces), and based on a circle of
True, the polygon is inscribed in the circle, otherwise it will be circumscribed.
Nonethe polygon is created at the origin and one of its vertices will lie on the X axis.
True, the polygon will make a face, that is, it will appear filled.
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()
- Drafting: Line, Polyline, Fillet, Arc, Arc by 3 points, Circle, Ellipse, Rectangle, Polygon, B-spline, Cubic Bézier curve, Bézier curve, Point, Facebinder, ShapeString, Hatch
- Annotation: Text, Dimension, Label, Annotation styles, Annotation scale
- Modification: Move, Rotate, Scale, Mirror, Offset, Trimex, Stretch, Clone, Array, Polar array, Circular array, Path array, Path Link array, Point Array, Point Link array, Edit, Subelement highlight, Join, Split, Upgrade, Downgrade, Wire to B-spline, Draft to Sketch, Set slope, Flip dimension, Shape 2D view
- Draft Tray: Select Plane, Set style, Toggle construction mode, AutoGroup
- Snapping: Snap Lock, Snap Endpoint, Snap Midpoint, Snap Center, Snap Angle, Snap Intersection, Snap Perpendicular, Snap Extension, Snap Parallel, Snap Special, Snap Near, Snap Ortho, Snap Grid, Snap WorkingPlane, Snap Dimensions, Toggle Grid
- Miscellaneous: Apply current style, Layer, Manage layers, Add a new named group, Move to group, Select group, Add to Construction group, Toggle normal/wireframe display, Create working plane proxy, Heal, Toggle continue mode, Show snap toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Layer container: Merge layer duplicates, Add new layer
- Layer: Activate this layer, Select layer contents
- Working plane proxy: Write camera position, Write objects state
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Draft, FEM, Image, Inspection, Mesh, OpenSCAD, Part, PartDesign, Path, Points, Raytracing, Reverse Engineering, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Deprecated or unmaintained workbenches: Complete, Drawing, Robot
- Hubs: User hub, Power users hub, Developer hub