dxf-viewer
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "dxf-viewer", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "JavaScript DXF file viewer", | ||
"main": "src/index.js", | ||
"author": "Artyom Lebedev<arlebedev@ugcs.com>", | ||
"author": "Artyom Lebedev<artyom.lebedev@gmail.com>", | ||
"license": "Mozilla Public License 2.0", | ||
@@ -18,3 +18,3 @@ "repository": "https://github.com/vagran/dxf-viewer", | ||
"dependencies": { | ||
"three": "^0.125.2", | ||
"three": "^0.127.0", | ||
"loglevel": "^1.7.1", | ||
@@ -21,0 +21,0 @@ "opentype.js": "^1.3.3" |
@@ -44,2 +44,6 @@ # DXF viewer | ||
* Stream parsing for input file. Currently, mostly relying on dxf-parser package which is not | ||
stream parser and thus buffers whole the file before parsing. This prevents from supporting big | ||
DXF file (above gigabyte) due to string size limit in JS engine (also making unnecessary memory | ||
waste for the buffer). | ||
* Multiline text blocks (MTEXT group). | ||
@@ -46,0 +50,0 @@ * Text styling. Currently, text rendering is using just the specified fonts in the specified order. |
@@ -443,7 +443,7 @@ import {DynamicBuffer, NativeType} from "./DynamicBuffer" | ||
yield new Entity({ | ||
type: Entity.Type.POINTS, | ||
vertices: [entity.position], | ||
layer, color, | ||
lineType: null | ||
}) | ||
type: Entity.Type.POINTS, | ||
vertices: [entity.position], | ||
layer, color, | ||
lineType: null | ||
}) | ||
return | ||
@@ -455,6 +455,6 @@ } | ||
yield new Entity({ | ||
type: Entity.Type.LINE_SEGMENTS, | ||
vertices, layer, color, | ||
lineType: null | ||
}) | ||
type: Entity.Type.LINE_SEGMENTS, | ||
vertices, layer, color, | ||
lineType: null | ||
}) | ||
} | ||
@@ -508,2 +508,4 @@ | ||
}) | ||
/* Fix block origin at zero. */ | ||
this.pointShapeBlock.offset = new Vector2(0, 0) | ||
const blockCtx = this.pointShapeBlock.DefinitionContext() | ||
@@ -516,6 +518,6 @@ | ||
const entity = new Entity({ | ||
type: Entity.Type.LINE_SEGMENTS, | ||
vertices, | ||
color: ColorCode.BY_BLOCK | ||
}) | ||
type: Entity.Type.LINE_SEGMENTS, | ||
vertices, | ||
color: ColorCode.BY_BLOCK | ||
}) | ||
this._ProcessEntity(entity, blockCtx) | ||
@@ -533,6 +535,6 @@ } | ||
const entity = new Entity({ | ||
type: Entity.Type.POLYLINE, vertices, | ||
color: ColorCode.BY_BLOCK, | ||
shape: true | ||
}) | ||
type: Entity.Type.POLYLINE, vertices, | ||
color: ColorCode.BY_BLOCK, | ||
shape: true | ||
}) | ||
this._ProcessEntity(entity, blockCtx) | ||
@@ -546,6 +548,6 @@ } | ||
const entity = new Entity({ | ||
type: Entity.Type.POLYLINE, vertices, | ||
color: ColorCode.BY_BLOCK, | ||
shape: true | ||
}) | ||
type: Entity.Type.POLYLINE, vertices, | ||
color: ColorCode.BY_BLOCK, | ||
shape: true | ||
}) | ||
this._ProcessEntity(entity, blockCtx) | ||
@@ -1092,6 +1094,3 @@ } | ||
this.batches.insert(batch) | ||
if (key.blockName !== null && | ||
key.geometryType !== BatchingKey.GeometryType.BLOCK_INSTANCE && | ||
key.geometryType !== BatchingKey.GeometryType.POINT_INSTANCE) { | ||
if (key.blockName !== null && !key.IsInstanced()) { | ||
/* Block definition batch. */ | ||
@@ -1098,0 +1097,0 @@ const block = this.blocks.get(key.blockName) |
@@ -758,4 +758,6 @@ import * as three from "three" | ||
//XXX line type | ||
const materialFactory = this.key.geometryType === BatchingKey.GeometryType.POINTS ? | ||
this.viewer._GetSimplePointMaterial : this.viewer._GetSimpleColorMaterial | ||
const materialFactory = | ||
this.key.geometryType === BatchingKey.GeometryType.POINTS || | ||
this.key.geometryType === BatchingKey.GeometryType.POINT_INSTANCE ? | ||
this.viewer._GetSimplePointMaterial : this.viewer._GetSimpleColorMaterial | ||
@@ -768,2 +770,4 @@ const material = materialFactory.call(this.viewer, this.viewer._TransformColor(color), | ||
case BatchingKey.GeometryType.POINTS: | ||
/* This method also called for creating dots for shaped point instances. */ | ||
case BatchingKey.GeometryType.POINT_INSTANCE: | ||
objConstructor = three.Points | ||
@@ -831,3 +835,3 @@ break | ||
/* Dots for point shapes. */ | ||
yield this._CreatePointsObject(null) | ||
yield* this._CreateObjects() | ||
} | ||
@@ -834,0 +838,0 @@ } |
@@ -60,3 +60,4 @@ import {DxfFetcher} from "./DxfFetcher" | ||
} catch (error) { | ||
resp.error = error | ||
console.log(error) | ||
resp.error = String(error) | ||
} | ||
@@ -63,0 +64,0 @@ this.worker.postMessage(resp, transfers) |
@@ -10,4 +10,2 @@ import {DxfScene, Entity} from "./DxfScene" | ||
* * Support DXF text styles and weight. | ||
* * Support text formatting and rotation. | ||
* * Direct TTF files processing using opentype.js | ||
* * Bitmap fonts generation in texture atlas for more optimal rendering. | ||
@@ -398,4 +396,4 @@ */ | ||
* @param rotation {?number} Rotation attribute, deg. | ||
* @param widthFactor {?number} Relative X scale factor (group 41) | ||
* @param hAlign {?number} Horizontal text justification type code (group 72) | ||
* @param widthFactor {?number} Relative X scale factor (group 41). | ||
* @param hAlign {?number} Horizontal text justification type code (group 72). | ||
* @param vAlign {?number} Vertical text justification type code (group 73). | ||
@@ -402,0 +400,0 @@ * @param color {number} |
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
6503
64
246498
+ Addedthree@0.127.0(transitive)
- Removedthree@0.125.2(transitive)
Updatedthree@^0.127.0