Created
October 14, 2025 10:35
-
-
Save stephensmitchell/e0282ab2f93268ca56308a3b85b438ca to your computer and use it in GitHub Desktop.
Polygon Incircle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #https://help.alibre.com/articles/#!alibre-help-v28/polygon-incircle | |
| 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment