colah/ImplicitCAD — Issue #6: Issues with polygon primitive
Author: cgranade
Created: 2012-02-14 05:12:16+00:00
State: open

Using ExtOpenSCAD rendering mode, ImplicitScad seems to produce some very odd results with the polygon primitive. For instance, with latest git clone, using the following code to render a triangle:
```
scale(100) polygon(points=[[1.0, 0.0], [-0.5, 0.8660254038], [-0.5, -0.8660254038], [1.0, 0.0]]);
```
produces an empty SVG output:
```

```

The same output is produced for a square and a hexagon as well. Bizarrely, however, if I increase the numerical precision of the points on a hexagon, I obtain an octagon:
```
scale(100) polygon(points=[[1.0, 0.0], [0.50000000000000011102230246251565404236316680908203125, 0.8660254037844385965883020617184229195117950439453125], [-0.4999999999999997779553950749686919152736663818359375, 0.86602540378443870761060452423407696187496185302734375], [-1.0, 0.000000000000000122464679914735320717376402945839660462569212467758006379625612680683843791484832763671875], [-0.500000000000000444089209850062616169452667236328125, -0.86602540378443837454369713668711483478546142578125], [0.4999999999999993338661852249060757458209991455078125, -0.8660254037844390406775119117810390889644622802734375], [1.0, -0.00000000000000024492935982947064143475280589167932092513842493551601275925122536136768758296966552734375]]
);
```
produces:
```

```
Thanks for helping me figure this all out!