Skip to content

Commit

Permalink
Fixes gdsestimating#50 - bulge value gets incorrect value sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
bzuillsmith committed Nov 29, 2019
1 parent 6e98869 commit 3f52fda
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/DxfParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 9 additions & 1 deletion src/entities/polyline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions src/entities/vertex.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 3f52fda

Please sign in to comment.