@mlightcad/libredwg-web 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7628,6 +7628,7 @@ class LibreDwgConverter {
7628
7628
  const commonAttrs = this.getCommonTableEntryAttrs(item, obj);
7629
7629
  const standardFlag = libredwg.dwg_dynapi_entity_value(item, "flag").data;
7630
7630
  const viewHeight = libredwg.dwg_dynapi_entity_value(item, "VIEWSIZE").data;
7631
+ const aspectRatio = libredwg.dwg_dynapi_entity_value(item, "aspect_ratio").data;
7631
7632
  const center = libredwg.dwg_dynapi_entity_value(item, "VIEWCTR").data;
7632
7633
  const viewTarget = libredwg.dwg_dynapi_entity_value(item, "view_target").data;
7633
7634
  const viewDirectionFromTarget = libredwg.dwg_dynapi_entity_value(
@@ -7692,6 +7693,7 @@ class LibreDwgConverter {
7692
7693
  frontClippingPlane,
7693
7694
  backClippingPlane,
7694
7695
  viewHeight,
7696
+ aspectRatio,
7695
7697
  snapRotationAngle,
7696
7698
  viewTwistAngle,
7697
7699
  circleSides,
@@ -7633,6 +7633,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7633
7633
  const commonAttrs = this.getCommonTableEntryAttrs(item, obj);
7634
7634
  const standardFlag = libredwg.dwg_dynapi_entity_value(item, "flag").data;
7635
7635
  const viewHeight = libredwg.dwg_dynapi_entity_value(item, "VIEWSIZE").data;
7636
+ const aspectRatio = libredwg.dwg_dynapi_entity_value(item, "aspect_ratio").data;
7636
7637
  const center = libredwg.dwg_dynapi_entity_value(item, "VIEWCTR").data;
7637
7638
  const viewTarget = libredwg.dwg_dynapi_entity_value(item, "view_target").data;
7638
7639
  const viewDirectionFromTarget = libredwg.dwg_dynapi_entity_value(
@@ -7697,6 +7698,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7697
7698
  frontClippingPlane,
7698
7699
  backClippingPlane,
7699
7700
  viewHeight,
7701
+ aspectRatio,
7700
7702
  snapRotationAngle,
7701
7703
  viewTwistAngle,
7702
7704
  circleSides,
@@ -682,8 +682,8 @@ export class LibreDwgConverter {
682
682
  .data;
683
683
  const viewHeight = libredwg.dwg_dynapi_entity_value(item, 'VIEWSIZE')
684
684
  .data;
685
- // BITCODE_BD view_width; // in DWG r13+, needed to calc. aspect_ratio
686
- // BITCODE_BD aspect_ratio; // DXF 41 = view_width / VIEWSIZE
685
+ const aspectRatio = libredwg.dwg_dynapi_entity_value(item, 'aspect_ratio')
686
+ .data;
687
687
  const center = libredwg.dwg_dynapi_entity_value(item, 'VIEWCTR')
688
688
  .data;
689
689
  const viewTarget = libredwg.dwg_dynapi_entity_value(item, 'view_target')
@@ -774,6 +774,7 @@ export class LibreDwgConverter {
774
774
  frontClippingPlane: frontClippingPlane,
775
775
  backClippingPlane: backClippingPlane,
776
776
  viewHeight: viewHeight,
777
+ aspectRatio: aspectRatio,
777
778
  snapRotationAngle: snapRotationAngle,
778
779
  viewTwistAngle: viewTwistAngle,
779
780
  circleSides: circleSides,
@@ -14,7 +14,13 @@ export interface DwgVPortTableEntry extends DwgCommonTableEntry {
14
14
  lensLength: number;
15
15
  frontClippingPlane: number;
16
16
  backClippingPlane: number;
17
+ /** View height in model-space DCS (DXF group 40 or 45). */
17
18
  viewHeight: number;
19
+ /**
20
+ * View width ÷ view height (VPORT table DXF group 41 only).
21
+ * Not VIEW-table width (group 41) or VIEWPORT-entity height (group 41).
22
+ */
23
+ aspectRatio?: number;
18
24
  snapRotationAngle: number;
19
25
  viewTwistAngle: number;
20
26
  circleSides: number;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A DWG/DXF JavaScript parser based on libredwg",
4
4
  "license": "GPL-3.0",
5
5
  "private": false,
6
- "version": "0.7.1",
6
+ "version": "0.7.2",
7
7
  "author": "MLight Lee <mlight.lee@outlook.com>",
8
8
  "type": "module",
9
9
  "repository": {
@@ -24,6 +24,21 @@
24
24
  "wasm",
25
25
  "webassembly"
26
26
  ],
27
+ "scripts": {
28
+ "demo": "live-server examples --entry-file=index.html",
29
+ "doc": "typedoc",
30
+ "build": "tsc && vite build && cp -rf wasm examples/ && cp -rf dist examples/",
31
+ "build:prepare": "mkdir -p ../../build-wasm && cd ../../build-wasm && emconfigure ../configure CFLAGS=\"-O2 -sUSE_ZLIB=1\" CC=emcc --enable-release --disable-docs --disable-write --disable-python --disable-bindings --disable-shared --disable-json --enable-partial --enable-experimental",
32
+ "build:obj": "cd ../../build-wasm && emmake make",
33
+ "build:wasm": "cd ../../build-wasm && emcc ../bindings/javascript/embind/*.cpp src/*.o -O2 -lembind -std=c++17 -Isrc -I../src -I../include -o libredwg-web.js -s ALLOW_MEMORY_GROWTH=1 -s EXPORT_ES6=1 -s MODULARIZE=1 -s EXPORT_NAME=\"createModule\" -sEXPORTED_RUNTIME_METHODS=FS,ENV,ccall,cwrap,UTF8ToString,stringToNewUTF8,setValue --emit-tsd libredwg-web.d.ts",
34
+ "clean": "rm -rf ../../build-wasm ./docs ./dist ./lib",
35
+ "copy": "cp -f ../../build-wasm/libredwg-web.d.ts ../../build-wasm/libredwg-web.js ../../build-wasm/libredwg-web.wasm wasm/ && cp -f ../../build-wasm/libredwg-web.js src/",
36
+ "format": "prettier --config ./.prettierrc.js --write src/**/*.{ts,js}",
37
+ "install:emsdk": "cd $EMSDK && ./emsdk install latest && ./emsdk activate latest",
38
+ "link": "node script/create-symlink.js ./wasm/libredwg-web.js ./src/libredwg-web.js",
39
+ "lint": "eslint src/",
40
+ "lint:fix": "eslint --fix --quiet src/"
41
+ },
27
42
  "files": [
28
43
  "dist",
29
44
  "lib/**/*.js",
@@ -65,20 +80,5 @@
65
80
  "*.md": [
66
81
  "prettier --config ./.prettierrc.js --write"
67
82
  ]
68
- },
69
- "scripts": {
70
- "demo": "live-server examples --entry-file=index.html",
71
- "doc": "typedoc",
72
- "build": "tsc && vite build && cp -rf wasm examples/ && cp -rf dist examples/",
73
- "build:prepare": "mkdir -p ../../build-wasm && cd ../../build-wasm && emconfigure ../configure CFLAGS=\"-O2 -sUSE_ZLIB=1\" CC=emcc --enable-release --disable-docs --disable-write --disable-python --disable-bindings --disable-shared --disable-json --enable-partial --enable-experimental",
74
- "build:obj": "cd ../../build-wasm && emmake make",
75
- "build:wasm": "cd ../../build-wasm && emcc ../bindings/javascript/embind/*.cpp src/*.o -O2 -lembind -std=c++17 -Isrc -I../src -I../include -o libredwg-web.js -s ALLOW_MEMORY_GROWTH=1 -s EXPORT_ES6=1 -s MODULARIZE=1 -s EXPORT_NAME=\"createModule\" -sEXPORTED_RUNTIME_METHODS=FS,ENV,ccall,cwrap,UTF8ToString,stringToNewUTF8,setValue --emit-tsd libredwg-web.d.ts",
76
- "clean": "rm -rf ../../build-wasm ./docs ./dist ./lib",
77
- "copy": "cp -f ../../build-wasm/libredwg-web.d.ts ../../build-wasm/libredwg-web.js ../../build-wasm/libredwg-web.wasm wasm/ && cp -f ../../build-wasm/libredwg-web.js src/",
78
- "format": "prettier --config ./.prettierrc.js --write src/**/*.{ts,js}",
79
- "install:emsdk": "cd $EMSDK && ./emsdk install latest && ./emsdk activate latest",
80
- "link": "node script/create-symlink.js ./wasm/libredwg-web.js ./src/libredwg-web.js",
81
- "lint": "eslint src/",
82
- "lint:fix": "eslint --fix --quiet src/"
83
83
  }
84
- }
84
+ }