dxf-viewer
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "dxf-viewer", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "JavaScript DXF file viewer", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -264,2 +264,5 @@ import {DynamicBuffer, NativeType} from "./DynamicBuffer" | ||
let numSegments = Math.floor(aAbs / this.options.arcTessellationAngle) | ||
if (numSegments < this.options.minArcTessellationSubdivisions) { | ||
numSegments = this.options.minArcTessellationSubdivisions | ||
} | ||
if (numSegments > 1) { | ||
@@ -658,3 +661,10 @@ const startAngle = Math.atan2(startVtx.y - center.y, startVtx.x - center.x) | ||
*_DecomposePolyline(entity, blockCtx = null) { | ||
const verticesCount = entity.vertices.length | ||
let entityVertices, verticesCount | ||
if (entity.includesCurveFitVertices || entity.includesSplineFitVertices) { | ||
entityVertices = entity.vertices.filter(v => v.splineVertex || v.curveFittingVertex) | ||
verticesCount = entityVertices.length | ||
} else { | ||
entityVertices = entity.vertices | ||
verticesCount = entity.vertices.length | ||
} | ||
if (verticesCount < 2) { | ||
@@ -667,4 +677,4 @@ return | ||
let startIdx = 0 | ||
let curPlainLine = this._IsPlainLine(entity.vertices[0]) | ||
let curLineType = this._GetLineType(entity, entity.vertices[0], blockCtx) | ||
let curPlainLine = this._IsPlainLine(entityVertices[0]) | ||
let curLineType = this._GetLineType(entity, entityVertices[0], blockCtx) | ||
let curVertices = null | ||
@@ -681,16 +691,16 @@ | ||
if (vertices === null) { | ||
vertices = entity.vertices | ||
vertices = entityVertices | ||
} | ||
} else if (endIdx === verticesCount - 1 && startIdx === 0) { | ||
if (vertices === null) { | ||
vertices = entity.vertices | ||
vertices = entityVertices | ||
} | ||
} else if (endIdx === verticesCount) { | ||
if (vertices === null) { | ||
vertices = entity.vertices.slice(startIdx, endIdx) | ||
vertices.push(entity.vertices[0]) | ||
vertices = entityVertices.slice(startIdx, endIdx) | ||
vertices.push(entityVertices[0]) | ||
} | ||
} else { | ||
if (vertices === null) { | ||
vertices = entity.vertices.slice(startIdx, endIdx + 1) | ||
vertices = entityVertices.slice(startIdx, endIdx + 1) | ||
} | ||
@@ -712,4 +722,4 @@ } | ||
if (endIdx !== verticesCount) { | ||
curPlainLine = _this._IsPlainLine(entity.vertices[endIdx]) | ||
curLineType = _this._GetLineType(entity, entity.vertices[endIdx]) | ||
curPlainLine = _this._IsPlainLine(entityVertices[endIdx]) | ||
curLineType = _this._GetLineType(entity, entityVertices[endIdx]) | ||
} | ||
@@ -720,3 +730,3 @@ curVertices = null | ||
for (let vIdx = 1; vIdx <= verticesCount; vIdx++) { | ||
const prevVtx = entity.vertices[vIdx - 1] | ||
const prevVtx = entityVertices[vIdx - 1] | ||
let vtx | ||
@@ -728,5 +738,5 @@ if (vIdx === verticesCount) { | ||
} | ||
vtx = entity.vertices[0] | ||
vtx = entityVertices[0] | ||
} else { | ||
vtx = entity.vertices[vIdx] | ||
vtx = entityVertices[vIdx] | ||
} | ||
@@ -736,3 +746,3 @@ | ||
if (curVertices === null) { | ||
curVertices = entity.vertices.slice(startIdx, vIdx) | ||
curVertices = entityVertices.slice(startIdx, vIdx) | ||
} | ||
@@ -1676,4 +1686,6 @@ this._GenerateBulgeVertices(curVertices, prevVtx, vtx, prevVtx.bulge) | ||
arcTessellationAngle: 10 / 180 * Math.PI, | ||
/** Divide arc to at least the specified number of segments. */ | ||
minArcTessellationSubdivisions: 8, | ||
/** Text rendering options. */ | ||
textOptions: TextRenderer.DefaultOptions | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8017124
37
6446