Skip to content
This repository was archived by the owner on Jul 24, 2022. It is now read-only.

Commit accac07

Browse files
z3devkaosat-dev
authored andcommitted
fix(dxf-serializer): corrected polygonToTriangles when polygon has less then 3 vertices (#68)
1 parent 1008de5 commit accac07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/dxf-serializer/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ const PolygonsTo3DFaces = function (csg, options) {
229229
// NOTE: This only works for CONVEX polygons
230230
const polygonToTriangles = (polygon) => {
231231
let length = polygon.vertices.length - 2
232-
if (length <= 1) return [polygon]
232+
if (length < 1) return []
233233

234234
let pivot = polygon.vertices[0]
235235
let triangles = []

0 commit comments

Comments
 (0)