{"action":"created","issue":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/2412","labels_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/2412/labels{/name}","comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/2412/comments","events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/2412/events","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/2412","id":54815457,"number":2412,"title":"Fix PolygonGeometry winding order with holes.","user":{"login":"mramato","id":1495196,"avatar_url":"https://avatars.githubusercontent.com/u/1495196?v=3","gravatar_id":"","url":"https://api.github.com/users/mramato","html_url":"https://github.com/mramato","followers_url":"https://api.github.com/users/mramato/followers","following_url":"https://api.github.com/users/mramato/following{/other_user}","gists_url":"https://api.github.com/users/mramato/gists{/gist_id}","starred_url":"https://api.github.com/users/mramato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mramato/subscriptions","organizations_url":"https://api.github.com/users/mramato/orgs","repos_url":"https://api.github.com/users/mramato/repos","events_url":"https://api.github.com/users/mramato/events{/privacy}","received_events_url":"https://api.github.com/users/mramato/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-19T21:37:29Z","updated_at":"2015-01-20T00:18:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/2412","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/2412","diff_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/2412.diff","patch_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/2412.patch"},"body":"Fixes #2404 \r\n\r\nIs there an easy way to unit test this?  It's easy to test in Sandcastle, but obviously a unit test would be better."},"comment":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/comments/70583986","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/2412#issuecomment-70583986","issue_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/2412","id":70583986,"user":{"login":"mramato","id":1495196,"avatar_url":"https://avatars.githubusercontent.com/u/1495196?v=3","gravatar_id":"","url":"https://api.github.com/users/mramato","html_url":"https://github.com/mramato","followers_url":"https://api.github.com/users/mramato/followers","following_url":"https://api.github.com/users/mramato/following{/other_user}","gists_url":"https://api.github.com/users/mramato/gists{/gist_id}","starred_url":"https://api.github.com/users/mramato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mramato/subscriptions","organizations_url":"https://api.github.com/users/mramato/orgs","repos_url":"https://api.github.com/users/mramato/repos","events_url":"https://api.github.com/users/mramato/events{/privacy}","received_events_url":"https://api.github.com/users/mramato/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T00:18:06Z","updated_at":"2015-01-20T00:18:06Z","body":"It's up to you. I agree a test would be good, but I'm not familiar enough with this are to be able to write one.  If you or @bagnell want to take a stab at it, go ahead (or you can just merge).  \r\n\r\nFor the record, here's the test I wrote but didn't submit because it passes in master.\r\n```\r\n    it('holes have correct winding order', function() {\r\n        var clockwise = {\r\n                positions : Cartesian3.fromDegreesArray([\r\n                    -124.0, 35.0,\r\n                    -124.0, 40.0,\r\n                    -110.0, 40.0,\r\n                    -110.0, 35.0\r\n                ]),\r\n                holes : [{\r\n                    positions : Cartesian3.fromDegreesArray([\r\n                        -122.0, 36.0,\r\n                        -112.0, 36.0,\r\n                        -112.0, 39.0,\r\n                        -122.0, 39.0\r\n                    ]),\r\n                    holes : [{\r\n                        positions : Cartesian3.fromDegreesArray([\r\n                            -120.0, 36.5,\r\n                            -120.0, 38.5,\r\n                            -114.0, 38.5,\r\n                            -114.0, 36.5\r\n                        ])\r\n                    }]\r\n                }]\r\n            };\r\n\r\n        var counterClockwise = {\r\n            positions : clockwise.positions,\r\n            holes : [{\r\n                positions : clockwise.holes[0].positions.slice(0).reverse(),\r\n                holes : [{\r\n                    positions : clockwise.holes[0].holes[0].positions.slice(0).reverse()\r\n                }]\r\n            }]\r\n        };\r\n\r\n        CesiumMath.setRandomNumberSeed(0);\r\n        var clockwiseGeometry = PolygonGeometry.createGeometry(new PolygonGeometry({\r\n            vertexformat : VertexFormat.POSITION_ONLY,\r\n            polygonHierarchy : clockwise,\r\n            granularity : CesiumMath.PI_OVER_THREE,\r\n            extrudedHeight : 10\r\n        }));\r\n\r\n        CesiumMath.setRandomNumberSeed(0);\r\n        var counterClockwiseGeometry = PolygonGeometry.createGeometry(new PolygonGeometry({\r\n            vertexformat : VertexFormat.POSITION_ONLY,\r\n            polygonHierarchy : counterClockwise,\r\n            granularity : CesiumMath.PI_OVER_THREE,\r\n            extrudedHeight : 10\r\n        }));\r\n\r\n        expect(clockwiseGeometry.indices).toEqual(counterClockwiseGeometry.indices);\r\n    });\r\n```"}}