# Polygon Incircle

Compatible with WizoScript versions: 2.51

Polygons in Geomagic Design can be defined by an “exterior” or “interior” circle. The interior circle is typically used for bolt heads. The circle is called an “incircle”. This script shows how to draw a polygon by defining the incircle diameter.

import math # diameter of circle that fits inside polygon Diameter = 100 # number of sides Sides = 6 # calculate exterior diameter of polygon EDia = Diameter / math.cos(math.pi / Sides) # create part, create polygon sketch, extrude P = Part("Hex") S = P.AddSketch("Hexagon", P.GetPlane("XY-Plane")) S.AddPolygon(0, 0, EDia, Sides, False) P.AddExtrudeBoss("Hex Head", S, 10, False)