From 3f52fda1c9272660e90f830e940337415f908ace Mon Sep 17 00:00:00 2001 From: Ben Zuill-Smith Date: Thu, 28 Nov 2019 22:43:05 -0800 Subject: [PATCH] Fixes #50 - bulge value gets incorrect value sometimes --- src/DxfParser.js | 2 ++ src/entities/polyline.js | 10 +++++++++- src/entities/vertex.js | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/DxfParser.js b/src/DxfParser.js index cd72d27..3922ce7 100644 --- a/src/DxfParser.js +++ b/src/DxfParser.js @@ -494,7 +494,9 @@ DxfParser.prototype._parse = function(dxfString) { curr = scanner.next(); break; case 63: + break; case 421: + break; case 431: viewPort.ambientColor = curr.value; curr = scanner.next(); diff --git a/src/entities/polyline.js b/src/entities/polyline.js index 34b75dd..9a886e7 100644 --- a/src/entities/polyline.js +++ b/src/entities/polyline.js @@ -13,13 +13,17 @@ EntityParser.prototype.parseEntity = function(scanner, curr) { if(curr.code === 0) break; switch(curr.code) { - case 10: // always 0 + case 10: // always 0 + break; case 20: // always 0 + break; case 30: // elevation + break; case 39: // thickness entity.thickness = curr.value; break; case 40: // start width + break; case 41: // end width break; case 70: @@ -33,9 +37,13 @@ EntityParser.prototype.parseEntity = function(scanner, curr) { entity.hasContinuousLinetypePattern = (curr.value & 128) !== 0; break; case 71: // Polygon mesh M vertex count + break; case 72: // Polygon mesh N vertex count + break; case 73: // Smooth surface M density + break; case 74: // Smooth surface N density + break; case 75: // Curves and smooth surface type break; case 210: diff --git a/src/entities/vertex.js b/src/entities/vertex.js index 6aba936..3e012c4 100644 --- a/src/entities/vertex.js +++ b/src/entities/vertex.js @@ -22,7 +22,9 @@ EntityParser.prototype.parseEntity = function(scanner, curr) { entity.z = curr.value; break; case 40: // start width + break; case 41: // end width + break; case 42: // bulge if(curr.value != 0) entity.bulge = curr.value; break; @@ -36,6 +38,7 @@ EntityParser.prototype.parseEntity = function(scanner, curr) { entity.polyfaceMeshVertex = (curr.value & 128) !== 0; break; case 50: // curve fit tangent direction + break; case 71: // polyface mesh vertex index entity.faceA = curr.value; break;