@fc3/wireframe-renderer 0.0.0-stage → 0.1.0
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.
- package/LICENSE +673 -0
- package/README.md +123 -2
- package/bin/compile +55 -0
- package/bin/install +5 -0
- package/bin/lint +12 -0
- package/bin/postpublish +5 -0
- package/bin/precompile +71 -0
- package/bin/prepublish +7 -0
- package/bin/remap-paths +172 -0
- package/bin/test +9 -0
- package/bin/test-one +32 -0
- package/dist/.last-compile-time +1 -0
- package/dist/.last-publish-time +1 -0
- package/dist/src/camera.d.ts +26 -0
- package/dist/src/camera.js +90 -0
- package/dist/src/camera.js.map +1 -0
- package/dist/src/canvas-renderer.d.ts +22 -0
- package/dist/src/canvas-renderer.js +183 -0
- package/dist/src/canvas-renderer.js.map +1 -0
- package/dist/src/constant/axis-colors.d.ts +3 -0
- package/dist/src/constant/axis-colors.js +13 -0
- package/dist/src/constant/axis-colors.js.map +1 -0
- package/dist/src/constant/box-edge-index-pairs.d.ts +2 -0
- package/dist/src/constant/box-edge-index-pairs.js +18 -0
- package/dist/src/constant/box-edge-index-pairs.js.map +1 -0
- package/dist/src/constant/camera-limits.d.ts +7 -0
- package/dist/src/constant/camera-limits.js +10 -0
- package/dist/src/constant/camera-limits.js.map +1 -0
- package/dist/src/constant/default-camera-state.d.ts +3 -0
- package/dist/src/constant/default-camera-state.js +19 -0
- package/dist/src/constant/default-camera-state.js.map +1 -0
- package/dist/src/constant/default-palette.d.ts +2 -0
- package/dist/src/constant/default-palette.js +17 -0
- package/dist/src/constant/default-palette.js.map +1 -0
- package/dist/src/constant/interaction-rates.d.ts +5 -0
- package/dist/src/constant/interaction-rates.js +8 -0
- package/dist/src/constant/interaction-rates.js.map +1 -0
- package/dist/src/constant/rendering-defaults.d.ts +11 -0
- package/dist/src/constant/rendering-defaults.js +14 -0
- package/dist/src/constant/rendering-defaults.js.map +1 -0
- package/dist/src/constant/stylesheet.d.ts +2 -0
- package/dist/src/constant/stylesheet.js +140 -0
- package/dist/src/constant/stylesheet.js.map +1 -0
- package/dist/src/constant/theme.d.ts +9 -0
- package/dist/src/constant/theme.js +12 -0
- package/dist/src/constant/theme.js.map +1 -0
- package/dist/src/constant/view-orientations.d.ts +4 -0
- package/dist/src/constant/view-orientations.js +19 -0
- package/dist/src/constant/view-orientations.js.map +1 -0
- package/dist/src/enum/axis.d.ts +6 -0
- package/dist/src/enum/axis.js +10 -0
- package/dist/src/enum/axis.js.map +1 -0
- package/dist/src/enum/opening-shape.d.ts +5 -0
- package/dist/src/enum/opening-shape.js +9 -0
- package/dist/src/enum/opening-shape.js.map +1 -0
- package/dist/src/enum/plane.d.ts +6 -0
- package/dist/src/enum/plane.js +10 -0
- package/dist/src/enum/plane.js.map +1 -0
- package/dist/src/enum/primitive-type.d.ts +8 -0
- package/dist/src/enum/primitive-type.js +12 -0
- package/dist/src/enum/primitive-type.js.map +1 -0
- package/dist/src/enum/view-preset.d.ts +10 -0
- package/dist/src/enum/view-preset.js +14 -0
- package/dist/src/enum/view-preset.js.map +1 -0
- package/dist/src/enum/viewer-class-name.d.ts +15 -0
- package/dist/src/enum/viewer-class-name.js +19 -0
- package/dist/src/enum/viewer-class-name.js.map +1 -0
- package/dist/src/example/house-computer.d.ts +3 -0
- package/dist/src/example/house-computer.js +2081 -0
- package/dist/src/example/house-computer.js.map +1 -0
- package/dist/src/index.d.ts +20 -0
- package/dist/src/index.js +27 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/interaction-controller.d.ts +17 -0
- package/dist/src/interaction-controller.js +106 -0
- package/dist/src/interaction-controller.js.map +1 -0
- package/dist/src/sidebar.d.ts +24 -0
- package/dist/src/sidebar.js +121 -0
- package/dist/src/sidebar.js.map +1 -0
- package/dist/src/type/bounding-box.d.ts +6 -0
- package/dist/src/type/bounding-box.js +3 -0
- package/dist/src/type/bounding-box.js.map +1 -0
- package/dist/src/type/camera-state.d.ts +10 -0
- package/dist/src/type/camera-state.js +3 -0
- package/dist/src/type/camera-state.js.map +1 -0
- package/dist/src/type/display-component.d.ts +18 -0
- package/dist/src/type/display-component.js +3 -0
- package/dist/src/type/display-component.js.map +1 -0
- package/dist/src/type/drag-state.d.ts +6 -0
- package/dist/src/type/drag-state.js +3 -0
- package/dist/src/type/drag-state.js.map +1 -0
- package/dist/src/type/inherited-style.d.ts +8 -0
- package/dist/src/type/inherited-style.js +3 -0
- package/dist/src/type/inherited-style.js.map +1 -0
- package/dist/src/type/plane-axes.d.ts +7 -0
- package/dist/src/type/plane-axes.js +3 -0
- package/dist/src/type/plane-axes.js.map +1 -0
- package/dist/src/type/polyline.d.ts +3 -0
- package/dist/src/type/polyline.js +3 -0
- package/dist/src/type/polyline.js.map +1 -0
- package/dist/src/type/primitive/box.d.ts +8 -0
- package/dist/src/type/primitive/box.js +3 -0
- package/dist/src/type/primitive/box.js.map +1 -0
- package/dist/src/type/primitive/cylinder.d.ts +11 -0
- package/dist/src/type/primitive/cylinder.js +3 -0
- package/dist/src/type/primitive/cylinder.js.map +1 -0
- package/dist/src/type/primitive/opening.d.ts +24 -0
- package/dist/src/type/primitive/opening.js +3 -0
- package/dist/src/type/primitive/opening.js.map +1 -0
- package/dist/src/type/primitive/polyline.d.ts +8 -0
- package/dist/src/type/primitive/polyline.js +3 -0
- package/dist/src/type/primitive/polyline.js.map +1 -0
- package/dist/src/type/primitive/sphere.d.ts +8 -0
- package/dist/src/type/primitive/sphere.js +3 -0
- package/dist/src/type/primitive/sphere.js.map +1 -0
- package/dist/src/type/primitive-geometry.d.ts +9 -0
- package/dist/src/type/primitive-geometry.js +3 -0
- package/dist/src/type/primitive-geometry.js.map +1 -0
- package/dist/src/type/primitive.d.ts +7 -0
- package/dist/src/type/primitive.js +3 -0
- package/dist/src/type/primitive.js.map +1 -0
- package/dist/src/type/render-options.d.ts +5 -0
- package/dist/src/type/render-options.js +3 -0
- package/dist/src/type/render-options.js.map +1 -0
- package/dist/src/type/screen-point.d.ts +5 -0
- package/dist/src/type/screen-point.js +3 -0
- package/dist/src/type/screen-point.js.map +1 -0
- package/dist/src/type/sidebar-callbacks.d.ts +9 -0
- package/dist/src/type/sidebar-callbacks.js +3 -0
- package/dist/src/type/sidebar-callbacks.js.map +1 -0
- package/dist/src/type/stroke.d.ts +6 -0
- package/dist/src/type/stroke.js +3 -0
- package/dist/src/type/stroke.js.map +1 -0
- package/dist/src/type/vector3.d.ts +6 -0
- package/dist/src/type/vector3.js +3 -0
- package/dist/src/type/vector3.js.map +1 -0
- package/dist/src/type/view-orientation.d.ts +5 -0
- package/dist/src/type/view-orientation.js +3 -0
- package/dist/src/type/view-orientation.js.map +1 -0
- package/dist/src/type/viewport.d.ts +5 -0
- package/dist/src/type/viewport.js +3 -0
- package/dist/src/type/viewport.js.map +1 -0
- package/dist/src/type/visibility-map.d.ts +2 -0
- package/dist/src/type/visibility-map.js +3 -0
- package/dist/src/type/visibility-map.js.map +1 -0
- package/dist/src/type/wireframe-component.d.ts +13 -0
- package/dist/src/type/wireframe-component.js +3 -0
- package/dist/src/type/wireframe-component.js.map +1 -0
- package/dist/src/type/wireframe-scene.d.ts +10 -0
- package/dist/src/type/wireframe-scene.js +3 -0
- package/dist/src/type/wireframe-scene.js.map +1 -0
- package/dist/src/utility/add-vectors.d.ts +3 -0
- package/dist/src/utility/add-vectors.js +11 -0
- package/dist/src/utility/add-vectors.js.map +1 -0
- package/dist/src/utility/build-box-outlines.d.ts +4 -0
- package/dist/src/utility/build-box-outlines.js +32 -0
- package/dist/src/utility/build-box-outlines.js.map +1 -0
- package/dist/src/utility/build-circle-outline.d.ts +5 -0
- package/dist/src/utility/build-circle-outline.js +25 -0
- package/dist/src/utility/build-circle-outline.js.map +1 -0
- package/dist/src/utility/build-cylinder-outlines.d.ts +4 -0
- package/dist/src/utility/build-cylinder-outlines.js +34 -0
- package/dist/src/utility/build-cylinder-outlines.js.map +1 -0
- package/dist/src/utility/build-initial-visibility.d.ts +4 -0
- package/dist/src/utility/build-initial-visibility.js +11 -0
- package/dist/src/utility/build-initial-visibility.js.map +1 -0
- package/dist/src/utility/build-opening-outlines.d.ts +4 -0
- package/dist/src/utility/build-opening-outlines.js +31 -0
- package/dist/src/utility/build-opening-outlines.js.map +1 -0
- package/dist/src/utility/build-primitive-geometry.d.ts +4 -0
- package/dist/src/utility/build-primitive-geometry.js +40 -0
- package/dist/src/utility/build-primitive-geometry.js.map +1 -0
- package/dist/src/utility/build-rectangle-outline.d.ts +5 -0
- package/dist/src/utility/build-rectangle-outline.js +23 -0
- package/dist/src/utility/build-rectangle-outline.js.map +1 -0
- package/dist/src/utility/build-sphere-outlines.d.ts +4 -0
- package/dist/src/utility/build-sphere-outlines.js +16 -0
- package/dist/src/utility/build-sphere-outlines.js.map +1 -0
- package/dist/src/utility/clamp.d.ts +2 -0
- package/dist/src/utility/clamp.js +7 -0
- package/dist/src/utility/clamp.js.map +1 -0
- package/dist/src/utility/collect-display-points.d.ts +4 -0
- package/dist/src/utility/collect-display-points.js +13 -0
- package/dist/src/utility/collect-display-points.js.map +1 -0
- package/dist/src/utility/compute-bounding-box.d.ts +4 -0
- package/dist/src/utility/compute-bounding-box.js +29 -0
- package/dist/src/utility/compute-bounding-box.js.map +1 -0
- package/dist/src/utility/compute-centroid.d.ts +3 -0
- package/dist/src/utility/compute-centroid.js +17 -0
- package/dist/src/utility/compute-centroid.js.map +1 -0
- package/dist/src/utility/create-element.d.ts +2 -0
- package/dist/src/utility/create-element.js +11 -0
- package/dist/src/utility/create-element.js.map +1 -0
- package/dist/src/utility/fit-camera-to-bounding-box.d.ts +4 -0
- package/dist/src/utility/fit-camera-to-bounding-box.js +23 -0
- package/dist/src/utility/fit-camera-to-bounding-box.js.map +1 -0
- package/dist/src/utility/flatten-components.d.ts +4 -0
- package/dist/src/utility/flatten-components.js +70 -0
- package/dist/src/utility/flatten-components.js.map +1 -0
- package/dist/src/utility/get-bounding-box-center.d.ts +4 -0
- package/dist/src/utility/get-bounding-box-center.js +14 -0
- package/dist/src/utility/get-bounding-box-center.js.map +1 -0
- package/dist/src/utility/get-bounding-box-size.d.ts +4 -0
- package/dist/src/utility/get-bounding-box-size.js +12 -0
- package/dist/src/utility/get-bounding-box-size.js.map +1 -0
- package/dist/src/utility/get-focal-length.d.ts +2 -0
- package/dist/src/utility/get-focal-length.js +9 -0
- package/dist/src/utility/get-focal-length.js.map +1 -0
- package/dist/src/utility/get-perpendicular-axes.d.ts +3 -0
- package/dist/src/utility/get-perpendicular-axes.js +18 -0
- package/dist/src/utility/get-perpendicular-axes.js.map +1 -0
- package/dist/src/utility/get-plane-axes.d.ts +4 -0
- package/dist/src/utility/get-plane-axes.js +19 -0
- package/dist/src/utility/get-plane-axes.js.map +1 -0
- package/dist/src/utility/get-primitive-anchor.d.ts +4 -0
- package/dist/src/utility/get-primitive-anchor.js +20 -0
- package/dist/src/utility/get-primitive-anchor.js.map +1 -0
- package/dist/src/utility/get-vector-component.d.ts +4 -0
- package/dist/src/utility/get-vector-component.js +18 -0
- package/dist/src/utility/get-vector-component.js.map +1 -0
- package/dist/src/utility/get-vector-length.d.ts +3 -0
- package/dist/src/utility/get-vector-length.js +7 -0
- package/dist/src/utility/get-vector-length.js.map +1 -0
- package/dist/src/utility/has-hidden-ancestor.d.ts +4 -0
- package/dist/src/utility/has-hidden-ancestor.js +9 -0
- package/dist/src/utility/has-hidden-ancestor.js.map +1 -0
- package/dist/src/utility/inject-stylesheet.d.ts +2 -0
- package/dist/src/utility/inject-stylesheet.js +21 -0
- package/dist/src/utility/inject-stylesheet.js.map +1 -0
- package/dist/src/utility/is-component-shown.d.ts +4 -0
- package/dist/src/utility/is-component-shown.js +10 -0
- package/dist/src/utility/is-component-shown.js.map +1 -0
- package/dist/src/utility/offset-vector-along-axis.d.ts +4 -0
- package/dist/src/utility/offset-vector-along-axis.js +14 -0
- package/dist/src/utility/offset-vector-along-axis.js.map +1 -0
- package/dist/src/utility/pick-palette-color.d.ts +2 -0
- package/dist/src/utility/pick-palette-color.js +12 -0
- package/dist/src/utility/pick-palette-color.js.map +1 -0
- package/dist/src/utility/project-vector.d.ts +6 -0
- package/dist/src/utility/project-vector.js +30 -0
- package/dist/src/utility/project-vector.js.map +1 -0
- package/dist/src/utility/rotate-vector.d.ts +3 -0
- package/dist/src/utility/rotate-vector.js +17 -0
- package/dist/src/utility/rotate-vector.js.map +1 -0
- package/dist/src/utility/scale-vector.d.ts +3 -0
- package/dist/src/utility/scale-vector.js +11 -0
- package/dist/src/utility/scale-vector.js.map +1 -0
- package/dist/src/utility/subtract-vectors.d.ts +3 -0
- package/dist/src/utility/subtract-vectors.js +11 -0
- package/dist/src/utility/subtract-vectors.js.map +1 -0
- package/dist/src/utility/unrotate-vector.d.ts +3 -0
- package/dist/src/utility/unrotate-vector.js +17 -0
- package/dist/src/utility/unrotate-vector.js.map +1 -0
- package/dist/src/utility/validate-scene.d.ts +3 -0
- package/dist/src/utility/validate-scene.js +70 -0
- package/dist/src/utility/validate-scene.js.map +1 -0
- package/dist/src/utility/with-vector-component.d.ts +4 -0
- package/dist/src/utility/with-vector-component.js +18 -0
- package/dist/src/utility/with-vector-component.js.map +1 -0
- package/dist/src/wireframe-viewer.d.ts +27 -0
- package/dist/src/wireframe-viewer.js +144 -0
- package/dist/src/wireframe-viewer.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +44 -5
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const offset_vector_along_axis_1 = __importDefault(require("./offset-vector-along-axis.js"));
|
|
7
|
+
function buildRectangleOutline(center, u_axis, v_axis, width, height) {
|
|
8
|
+
const half_width = width / 2;
|
|
9
|
+
const half_height = height / 2;
|
|
10
|
+
const corner_offsets = [
|
|
11
|
+
[half_width * -1, half_height * -1],
|
|
12
|
+
[half_width, half_height * -1],
|
|
13
|
+
[half_width, half_height],
|
|
14
|
+
[half_width * -1, half_height],
|
|
15
|
+
[half_width * -1, half_height * -1]
|
|
16
|
+
];
|
|
17
|
+
return corner_offsets.map(([u_offset, v_offset]) => {
|
|
18
|
+
const u_shifted = (0, offset_vector_along_axis_1.default)(center, u_axis, u_offset);
|
|
19
|
+
return (0, offset_vector_along_axis_1.default)(u_shifted, v_axis, v_offset);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
exports.default = buildRectangleOutline;
|
|
23
|
+
//# sourceMappingURL=build-rectangle-outline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-rectangle-outline.js","sourceRoot":"","sources":["../../../src/utility/build-rectangle-outline.ts"],"names":[],"mappings":";;;;;AAGA,gGAAqE;AAErE,SAAS,qBAAqB,CAC7B,MAAe,EACf,MAAY,EACZ,MAAY,EACZ,KAAa,EACb,MAAc;IAEd,MAAM,UAAU,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7B,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,CAAC;IAE/B,MAAM,cAAc,GAAuB;QAC1C,CAAC,UAAU,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC;QACnC,CAAC,UAAU,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC;QAC9B,CAAC,UAAU,EAAE,WAAW,CAAC;QACzB,CAAC,UAAU,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC;QAC9B,CAAC,UAAU,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC;KACnC,CAAC;IAEF,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE;QAClD,MAAM,SAAS,GAAG,IAAA,kCAAqB,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAElE,OAAO,IAAA,kCAAqB,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const axis_1 = __importDefault(require("./../enum/axis.js"));
|
|
7
|
+
const build_circle_outline_1 = __importDefault(require("./build-circle-outline.js"));
|
|
8
|
+
function buildSphereOutlines(sphere) {
|
|
9
|
+
const { center, radius } = sphere;
|
|
10
|
+
const axes = Object.values(axis_1.default);
|
|
11
|
+
return axes.map((axis) => {
|
|
12
|
+
return (0, build_circle_outline_1.default)(center, axis, radius);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
exports.default = buildSphereOutlines;
|
|
16
|
+
//# sourceMappingURL=build-sphere-outlines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-sphere-outlines.js","sourceRoot":"","sources":["../../../src/utility/build-sphere-outlines.ts"],"names":[],"mappings":";;;;;AAAA,qDAA6B;AAG7B,wFAA8D;AAE9D,SAAS,mBAAmB,CAAC,MAAuB;IACnD,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,MAAM,CAAC;IAChC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,cAAI,CAAC,CAAC;IAEjC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,OAAO,IAAA,8BAAkB,EAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clamp.js","sourceRoot":"","sources":["../../../src/utility/clamp.ts"],"names":[],"mappings":";;AAAA,SAAS,KAAK,CAAC,KAAa,EAAE,OAAe,EAAE,OAAe;IAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,kBAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function collectDisplayPoints(components) {
|
|
4
|
+
return components.flatMap((component) => {
|
|
5
|
+
const outline_points = component.outlines.flat();
|
|
6
|
+
const stroke_points = component.strokes.flatMap((stroke) => {
|
|
7
|
+
return stroke.points;
|
|
8
|
+
});
|
|
9
|
+
return [...outline_points, ...stroke_points];
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
exports.default = collectDisplayPoints;
|
|
13
|
+
//# sourceMappingURL=collect-display-points.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect-display-points.js","sourceRoot":"","sources":["../../../src/utility/collect-display-points.ts"],"names":[],"mappings":";;AAGA,SAAS,oBAAoB,CAAC,UAA8B;IAC3D,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;QACvC,MAAM,cAAc,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAEjD,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC1D,OAAO,MAAM,CAAC,MAAM,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,cAAc,EAAE,GAAG,aAAa,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const EMPTY_BOUNDING_BOX = {
|
|
4
|
+
minimum: { x: 0, y: 0, z: 0 },
|
|
5
|
+
maximum: { x: 0, y: 0, z: 0 }
|
|
6
|
+
};
|
|
7
|
+
function computeBoundingBox(points) {
|
|
8
|
+
const [first_point, ...remaining_points] = points;
|
|
9
|
+
if (first_point === undefined) {
|
|
10
|
+
return EMPTY_BOUNDING_BOX;
|
|
11
|
+
}
|
|
12
|
+
let minimum = first_point;
|
|
13
|
+
let maximum = first_point;
|
|
14
|
+
remaining_points.forEach((point) => {
|
|
15
|
+
minimum = {
|
|
16
|
+
x: Math.min(minimum.x, point.x),
|
|
17
|
+
y: Math.min(minimum.y, point.y),
|
|
18
|
+
z: Math.min(minimum.z, point.z)
|
|
19
|
+
};
|
|
20
|
+
maximum = {
|
|
21
|
+
x: Math.max(maximum.x, point.x),
|
|
22
|
+
y: Math.max(maximum.y, point.y),
|
|
23
|
+
z: Math.max(maximum.z, point.z)
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
return { minimum, maximum };
|
|
27
|
+
}
|
|
28
|
+
exports.default = computeBoundingBox;
|
|
29
|
+
//# sourceMappingURL=compute-bounding-box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute-bounding-box.js","sourceRoot":"","sources":["../../../src/utility/compute-bounding-box.ts"],"names":[],"mappings":";;AAGA,MAAM,kBAAkB,GAAgB;IACvC,OAAO,EAAE,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC;IAC3B,OAAO,EAAE,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC;CAC3B,CAAC;AAEF,SAAS,kBAAkB,CAAC,MAAiB;IAC5C,MAAM,CAAC,WAAW,EAAE,GAAG,gBAAgB,CAAC,GAAG,MAAM,CAAC;IAElD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAED,IAAI,OAAO,GAAG,WAAW,CAAC;IAC1B,IAAI,OAAO,GAAG,WAAW,CAAC;IAE1B,gBAAgB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAClC,OAAO,GAAG;YACT,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;YAC/B,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;YAC/B,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;SAC/B,CAAC;QAEF,OAAO,GAAG;YACT,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;YAC/B,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;YAC/B,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;SAC/B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,CAAC;AAC3B,CAAC;AAED,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const add_vectors_1 = __importDefault(require("./add-vectors.js"));
|
|
7
|
+
const scale_vector_1 = __importDefault(require("./scale-vector.js"));
|
|
8
|
+
const ORIGIN = { x: 0, y: 0, z: 0 };
|
|
9
|
+
function computeCentroid(points) {
|
|
10
|
+
if (points.length === 0) {
|
|
11
|
+
return ORIGIN;
|
|
12
|
+
}
|
|
13
|
+
const sum = points.reduce(add_vectors_1.default, ORIGIN);
|
|
14
|
+
return (0, scale_vector_1.default)(sum, 1 / points.length);
|
|
15
|
+
}
|
|
16
|
+
exports.default = computeCentroid;
|
|
17
|
+
//# sourceMappingURL=compute-centroid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute-centroid.js","sourceRoot":"","sources":["../../../src/utility/compute-centroid.ts"],"names":[],"mappings":";;;;;AACA,sEAA6C;AAC7C,wEAA+C;AAE/C,MAAM,MAAM,GAAY,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC,CAAC;AAE3C,SAAS,eAAe,CAAC,MAAiB;IACzC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC;IACf,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAU,EAAE,MAAM,CAAC,CAAC;IAE9C,OAAO,IAAA,sBAAW,EAAC,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function createElement(tag, class_name = null) {
|
|
4
|
+
const element = document.createElement(tag);
|
|
5
|
+
if (class_name !== null) {
|
|
6
|
+
element.className = class_name;
|
|
7
|
+
}
|
|
8
|
+
return element;
|
|
9
|
+
}
|
|
10
|
+
exports.default = createElement;
|
|
11
|
+
//# sourceMappingURL=create-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-element.js","sourceRoot":"","sources":["../../../src/utility/create-element.ts"],"names":[],"mappings":";;AAAA,SAAS,aAAa,CACrB,GAAQ,EACR,aAA4B,IAAI;IAEhC,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAE5C,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACzB,OAAO,CAAC,SAAS,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const camera_limits_1 = __importDefault(require("./../constant/camera-limits.js"));
|
|
7
|
+
const get_vector_length_1 = __importDefault(require("./get-vector-length.js"));
|
|
8
|
+
const rendering_defaults_1 = __importDefault(require("./../constant/rendering-defaults.js"));
|
|
9
|
+
const get_bounding_box_size_1 = __importDefault(require("./get-bounding-box-size.js"));
|
|
10
|
+
const get_bounding_box_center_1 = __importDefault(require("./get-bounding-box-center.js"));
|
|
11
|
+
function fitCameraToBoundingBox(camera, bounding_box) {
|
|
12
|
+
const target = (0, get_bounding_box_center_1.default)(bounding_box);
|
|
13
|
+
const size = (0, get_bounding_box_size_1.default)(bounding_box);
|
|
14
|
+
const diagonal = (0, get_vector_length_1.default)(size);
|
|
15
|
+
const radius = diagonal / 2;
|
|
16
|
+
const half_angle = camera.field_of_view / 2;
|
|
17
|
+
const fitted_distance = radius / Math.sin(half_angle);
|
|
18
|
+
const padded_distance = fitted_distance * rendering_defaults_1.default.FIT_DISTANCE_FACTOR;
|
|
19
|
+
const distance = Math.max(camera_limits_1.default.MINIMUM_DISTANCE, padded_distance);
|
|
20
|
+
return { ...camera, target, distance };
|
|
21
|
+
}
|
|
22
|
+
exports.default = fitCameraToBoundingBox;
|
|
23
|
+
//# sourceMappingURL=fit-camera-to-bounding-box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fit-camera-to-bounding-box.js","sourceRoot":"","sources":["../../../src/utility/fit-camera-to-bounding-box.ts"],"names":[],"mappings":";;;;;AAEA,2EAAmD;AACnD,kFAAwD;AACxD,qFAA6D;AAC7D,0FAA+D;AAC/D,8FAAmE;AAEnE,SAAS,sBAAsB,CAC9B,MAAmB,EACnB,YAAyB;IAEzB,MAAM,MAAM,GAAG,IAAA,iCAAoB,EAAC,YAAY,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,IAAA,+BAAkB,EAAC,YAAY,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,IAAA,2BAAe,EAAC,IAAI,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,QAAQ,GAAG,CAAC,CAAC;IAC5B,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC;IAC5C,MAAM,eAAe,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACtD,MAAM,eAAe,GACpB,eAAe,GAAG,4BAAkB,CAAC,mBAAmB,CAAC;IAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,uBAAa,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAE3E,OAAO,EAAC,GAAG,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAC,CAAC;AACtC,CAAC;AAED,kBAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const default_palette_1 = __importDefault(require("./../constant/default-palette.js"));
|
|
7
|
+
const compute_centroid_1 = __importDefault(require("./compute-centroid.js"));
|
|
8
|
+
const pick_palette_color_1 = __importDefault(require("./pick-palette-color.js"));
|
|
9
|
+
const rendering_defaults_1 = __importDefault(require("./../constant/rendering-defaults.js"));
|
|
10
|
+
const build_primitive_geometry_1 = __importDefault(require("./build-primitive-geometry.js"));
|
|
11
|
+
function flattenComponent(component, inherited) {
|
|
12
|
+
const color = component.color ?? inherited.color;
|
|
13
|
+
const alpha = component.alpha ?? inherited.alpha;
|
|
14
|
+
const line_width = component.line_width ?? inherited.line_width;
|
|
15
|
+
const label = component.label ?? component.id;
|
|
16
|
+
const note = component.note ?? '';
|
|
17
|
+
const initially_visible = component.visible ?? true;
|
|
18
|
+
const primitives = component.primitives ?? [];
|
|
19
|
+
const children = component.children ?? [];
|
|
20
|
+
const outlines = [];
|
|
21
|
+
const strokes = [];
|
|
22
|
+
const anchors = [];
|
|
23
|
+
primitives.forEach((primitive) => {
|
|
24
|
+
const geometry = (0, build_primitive_geometry_1.default)(primitive);
|
|
25
|
+
outlines.push(...geometry.outlines);
|
|
26
|
+
strokes.push(...geometry.strokes);
|
|
27
|
+
anchors.push(geometry.anchor);
|
|
28
|
+
});
|
|
29
|
+
const centroid = (0, compute_centroid_1.default)(anchors);
|
|
30
|
+
const display_component = {
|
|
31
|
+
id: component.id,
|
|
32
|
+
label,
|
|
33
|
+
note,
|
|
34
|
+
color,
|
|
35
|
+
alpha,
|
|
36
|
+
line_width,
|
|
37
|
+
depth: inherited.depth,
|
|
38
|
+
initially_visible,
|
|
39
|
+
ancestor_ids: inherited.ancestor_ids,
|
|
40
|
+
outlines,
|
|
41
|
+
strokes,
|
|
42
|
+
centroid
|
|
43
|
+
};
|
|
44
|
+
const child_style = {
|
|
45
|
+
color,
|
|
46
|
+
alpha,
|
|
47
|
+
line_width,
|
|
48
|
+
depth: inherited.depth + 1,
|
|
49
|
+
ancestor_ids: [...inherited.ancestor_ids, component.id]
|
|
50
|
+
};
|
|
51
|
+
const descendants = children.flatMap((child) => {
|
|
52
|
+
return flattenComponent(child, child_style);
|
|
53
|
+
});
|
|
54
|
+
return [display_component, ...descendants];
|
|
55
|
+
}
|
|
56
|
+
function flattenComponents(components, palette = default_palette_1.default) {
|
|
57
|
+
return components.flatMap((component, index) => {
|
|
58
|
+
const color = (0, pick_palette_color_1.default)(index, palette);
|
|
59
|
+
const root_style = {
|
|
60
|
+
color,
|
|
61
|
+
alpha: rendering_defaults_1.default.ALPHA,
|
|
62
|
+
line_width: rendering_defaults_1.default.LINE_WIDTH,
|
|
63
|
+
depth: 0,
|
|
64
|
+
ancestor_ids: []
|
|
65
|
+
};
|
|
66
|
+
return flattenComponent(component, root_style);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
exports.default = flattenComponents;
|
|
70
|
+
//# sourceMappingURL=flatten-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flatten-components.js","sourceRoot":"","sources":["../../../src/utility/flatten-components.ts"],"names":[],"mappings":";;;;;AAIA,+EAAuD;AACvD,gFAAuD;AAEvD,oFAA0D;AAE1D,qFAA6D;AAC7D,gGAAsE;AAEtE,SAAS,gBAAgB,CACxB,SAA6B,EAC7B,SAAyB;IAEzB,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,KAAK,CAAC;IACjD,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,KAAK,CAAC;IACjD,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,IAAI,SAAS,CAAC,UAAU,CAAC;IAChE,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,EAAE,CAAC;IAC9C,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC;IAClC,MAAM,iBAAiB,GAAG,SAAS,CAAC,OAAO,IAAI,IAAI,CAAC;IACpD,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,IAAI,EAAE,CAAC;IAC9C,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,IAAI,EAAE,CAAC;IAC1C,MAAM,QAAQ,GAAe,EAAE,CAAC;IAChC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAc,EAAE,CAAC;IAE9B,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;QAChC,MAAM,QAAQ,GAAG,IAAA,kCAAsB,EAAC,SAAS,CAAC,CAAC;QAEnD,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAA,0BAAe,EAAC,OAAO,CAAC,CAAC;IAE1C,MAAM,iBAAiB,GAAqB;QAC3C,EAAE,EAAE,SAAS,CAAC,EAAE;QAChB,KAAK;QACL,IAAI;QACJ,KAAK;QACL,KAAK;QACL,UAAU;QACV,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,iBAAiB;QACjB,YAAY,EAAE,SAAS,CAAC,YAAY;QACpC,QAAQ;QACR,OAAO;QACP,QAAQ;KACR,CAAC;IAEF,MAAM,WAAW,GAAmB;QACnC,KAAK;QACL,KAAK;QACL,UAAU;QACV,KAAK,EAAE,SAAS,CAAC,KAAK,GAAG,CAAC;QAC1B,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,CAAC;KACvD,CAAC;IAEF,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC9C,OAAO,gBAAgB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,iBAAiB,EAAE,GAAG,WAAW,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,iBAAiB,CACzB,UAAgC,EAChC,UAAoB,yBAAe;IAEnC,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE;QAC9C,MAAM,KAAK,GAAG,IAAA,4BAAgB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAE/C,MAAM,UAAU,GAAmB;YAClC,KAAK;YACL,KAAK,EAAE,4BAAkB,CAAC,KAAK;YAC/B,UAAU,EAAE,4BAAkB,CAAC,UAAU;YACzC,KAAK,EAAE,CAAC;YACR,YAAY,EAAE,EAAE;SAChB,CAAC;QAEF,OAAO,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const add_vectors_1 = __importDefault(require("./add-vectors.js"));
|
|
7
|
+
const scale_vector_1 = __importDefault(require("./scale-vector.js"));
|
|
8
|
+
function getBoundingBoxCenter(bounding_box) {
|
|
9
|
+
const { minimum, maximum } = bounding_box;
|
|
10
|
+
const sum = (0, add_vectors_1.default)(minimum, maximum);
|
|
11
|
+
return (0, scale_vector_1.default)(sum, 0.5);
|
|
12
|
+
}
|
|
13
|
+
exports.default = getBoundingBoxCenter;
|
|
14
|
+
//# sourceMappingURL=get-bounding-box-center.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-bounding-box-center.js","sourceRoot":"","sources":["../../../src/utility/get-bounding-box-center.ts"],"names":[],"mappings":";;;;;AACA,sEAA6C;AAE7C,wEAA+C;AAE/C,SAAS,oBAAoB,CAAC,YAAyB;IACtD,MAAM,EAAC,OAAO,EAAE,OAAO,EAAC,GAAG,YAAY,CAAC;IACxC,MAAM,GAAG,GAAG,IAAA,qBAAU,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAEzC,OAAO,IAAA,sBAAW,EAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC9B,CAAC;AAED,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const subtract_vectors_1 = __importDefault(require("./subtract-vectors.js"));
|
|
7
|
+
function getBoundingBoxSize(bounding_box) {
|
|
8
|
+
const { minimum, maximum } = bounding_box;
|
|
9
|
+
return (0, subtract_vectors_1.default)(maximum, minimum);
|
|
10
|
+
}
|
|
11
|
+
exports.default = getBoundingBoxSize;
|
|
12
|
+
//# sourceMappingURL=get-bounding-box-size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-bounding-box-size.js","sourceRoot":"","sources":["../../../src/utility/get-bounding-box-size.ts"],"names":[],"mappings":";;;;;AAEA,gFAAuD;AAEvD,SAAS,kBAAkB,CAAC,YAAyB;IACpD,MAAM,EAAC,OAAO,EAAE,OAAO,EAAC,GAAG,YAAY,CAAC;IAExC,OAAO,IAAA,0BAAe,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function getFocalLength(field_of_view, viewport_height) {
|
|
4
|
+
const half_height = viewport_height / 2;
|
|
5
|
+
const half_angle = field_of_view / 2;
|
|
6
|
+
return half_height / Math.tan(half_angle);
|
|
7
|
+
}
|
|
8
|
+
exports.default = getFocalLength;
|
|
9
|
+
//# sourceMappingURL=get-focal-length.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-focal-length.js","sourceRoot":"","sources":["../../../src/utility/get-focal-length.ts"],"names":[],"mappings":";;AAAA,SAAS,cAAc,CACtB,aAAqB,EACrB,eAAuB;IAEvB,MAAM,WAAW,GAAG,eAAe,GAAG,CAAC,CAAC;IACxC,MAAM,UAAU,GAAG,aAAa,GAAG,CAAC,CAAC;IAErC,OAAO,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AAED,kBAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const axis_1 = __importDefault(require("./../enum/axis.js"));
|
|
7
|
+
function getPerpendicularAxes(axis) {
|
|
8
|
+
switch (axis) {
|
|
9
|
+
case axis_1.default.X:
|
|
10
|
+
return [axis_1.default.Y, axis_1.default.Z];
|
|
11
|
+
case axis_1.default.Y:
|
|
12
|
+
return [axis_1.default.X, axis_1.default.Z];
|
|
13
|
+
case axis_1.default.Z:
|
|
14
|
+
return [axis_1.default.X, axis_1.default.Y];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = getPerpendicularAxes;
|
|
18
|
+
//# sourceMappingURL=get-perpendicular-axes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-perpendicular-axes.js","sourceRoot":"","sources":["../../../src/utility/get-perpendicular-axes.ts"],"names":[],"mappings":";;;;;AAAA,qDAA6B;AAE7B,SAAS,oBAAoB,CAAC,IAAU;IACvC,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,cAAI,CAAC,CAAC;YACV,OAAO,CAAC,cAAI,CAAC,CAAC,EAAE,cAAI,CAAC,CAAC,CAAC,CAAC;QACzB,KAAK,cAAI,CAAC,CAAC;YACV,OAAO,CAAC,cAAI,CAAC,CAAC,EAAE,cAAI,CAAC,CAAC,CAAC,CAAC;QACzB,KAAK,cAAI,CAAC,CAAC;YACV,OAAO,CAAC,cAAI,CAAC,CAAC,EAAE,cAAI,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;AACF,CAAC;AAED,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const axis_1 = __importDefault(require("./../enum/axis.js"));
|
|
7
|
+
const plane_1 = __importDefault(require("./../enum/plane.js"));
|
|
8
|
+
function getPlaneAxes(plane) {
|
|
9
|
+
switch (plane) {
|
|
10
|
+
case plane_1.default.XY:
|
|
11
|
+
return { u: axis_1.default.X, v: axis_1.default.Y, normal: axis_1.default.Z };
|
|
12
|
+
case plane_1.default.XZ:
|
|
13
|
+
return { u: axis_1.default.X, v: axis_1.default.Z, normal: axis_1.default.Y };
|
|
14
|
+
case plane_1.default.YZ:
|
|
15
|
+
return { u: axis_1.default.Y, v: axis_1.default.Z, normal: axis_1.default.X };
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = getPlaneAxes;
|
|
19
|
+
//# sourceMappingURL=get-plane-axes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-plane-axes.js","sourceRoot":"","sources":["../../../src/utility/get-plane-axes.ts"],"names":[],"mappings":";;;;;AAAA,qDAA6B;AAC7B,uDAA+B;AAG/B,SAAS,YAAY,CAAC,KAAY;IACjC,QAAQ,KAAK,EAAE,CAAC;QACf,KAAK,eAAK,CAAC,EAAE;YACZ,OAAO,EAAC,CAAC,EAAE,cAAI,CAAC,CAAC,EAAE,CAAC,EAAE,cAAI,CAAC,CAAC,EAAE,MAAM,EAAE,cAAI,CAAC,CAAC,EAAC,CAAC;QAC/C,KAAK,eAAK,CAAC,EAAE;YACZ,OAAO,EAAC,CAAC,EAAE,cAAI,CAAC,CAAC,EAAE,CAAC,EAAE,cAAI,CAAC,CAAC,EAAE,MAAM,EAAE,cAAI,CAAC,CAAC,EAAC,CAAC;QAC/C,KAAK,eAAK,CAAC,EAAE;YACZ,OAAO,EAAC,CAAC,EAAE,cAAI,CAAC,CAAC,EAAE,CAAC,EAAE,cAAI,CAAC,CAAC,EAAE,MAAM,EAAE,cAAI,CAAC,CAAC,EAAC,CAAC;IAChD,CAAC;AACF,CAAC;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const primitive_type_1 = __importDefault(require("./../enum/primitive-type.js"));
|
|
7
|
+
const compute_centroid_1 = __importDefault(require("./compute-centroid.js"));
|
|
8
|
+
function getPrimitiveAnchor(primitive) {
|
|
9
|
+
if (primitive.type === primitive_type_1.default.POLYLINE) {
|
|
10
|
+
const middle_index = Math.floor(primitive.points.length / 2);
|
|
11
|
+
const middle_point = primitive.points[middle_index];
|
|
12
|
+
if (middle_point === undefined) {
|
|
13
|
+
return (0, compute_centroid_1.default)([]);
|
|
14
|
+
}
|
|
15
|
+
return middle_point;
|
|
16
|
+
}
|
|
17
|
+
return primitive.center;
|
|
18
|
+
}
|
|
19
|
+
exports.default = getPrimitiveAnchor;
|
|
20
|
+
//# sourceMappingURL=get-primitive-anchor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-primitive-anchor.js","sourceRoot":"","sources":["../../../src/utility/get-primitive-anchor.ts"],"names":[],"mappings":";;;;;AAEA,yEAAgD;AAChD,gFAAuD;AAEvD,SAAS,kBAAkB,CAAC,SAAoB;IAC/C,IAAI,SAAS,CAAC,IAAI,KAAK,wBAAa,CAAC,QAAQ,EAAE,CAAC;QAC/C,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC7D,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAEpD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YAChC,OAAO,IAAA,0BAAe,EAAC,EAAE,CAAC,CAAC;QAC5B,CAAC;QAED,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,OAAO,SAAS,CAAC,MAAM,CAAC;AACzB,CAAC;AAED,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const axis_1 = __importDefault(require("./../enum/axis.js"));
|
|
7
|
+
function getVectorComponent(vector, axis) {
|
|
8
|
+
switch (axis) {
|
|
9
|
+
case axis_1.default.X:
|
|
10
|
+
return vector.x;
|
|
11
|
+
case axis_1.default.Y:
|
|
12
|
+
return vector.y;
|
|
13
|
+
case axis_1.default.Z:
|
|
14
|
+
return vector.z;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = getVectorComponent;
|
|
18
|
+
//# sourceMappingURL=get-vector-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-vector-component.js","sourceRoot":"","sources":["../../../src/utility/get-vector-component.ts"],"names":[],"mappings":";;;;;AAAA,qDAA6B;AAG7B,SAAS,kBAAkB,CAAC,MAAe,EAAE,IAAU;IACtD,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,cAAI,CAAC,CAAC;YACV,OAAO,MAAM,CAAC,CAAC,CAAC;QACjB,KAAK,cAAI,CAAC,CAAC;YACV,OAAO,MAAM,CAAC,CAAC,CAAC;QACjB,KAAK,cAAI,CAAC,CAAC;YACV,OAAO,MAAM,CAAC,CAAC,CAAC;IAClB,CAAC;AACF,CAAC;AAED,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-vector-length.js","sourceRoot":"","sources":["../../../src/utility/get-vector-length.ts"],"names":[],"mappings":";;AAEA,SAAS,eAAe,CAAC,MAAe;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function hasHiddenAncestor(component, visibility) {
|
|
4
|
+
return component.ancestor_ids.some((id) => {
|
|
5
|
+
return visibility.get(id) === false;
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
exports.default = hasHiddenAncestor;
|
|
9
|
+
//# sourceMappingURL=has-hidden-ancestor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-hidden-ancestor.js","sourceRoot":"","sources":["../../../src/utility/has-hidden-ancestor.ts"],"names":[],"mappings":";;AAGA,SAAS,iBAAiB,CACzB,SAA2B,EAC3B,UAAyB;IAEzB,OAAO,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE;QACzC,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC;IACrC,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const stylesheet_1 = __importDefault(require("./../constant/stylesheet.js"));
|
|
7
|
+
const create_element_1 = __importDefault(require("./create-element.js"));
|
|
8
|
+
const viewer_class_name_1 = __importDefault(require("./../enum/viewer-class-name.js"));
|
|
9
|
+
const STYLE_ELEMENT_ID = `${viewer_class_name_1.default.ROOT}-stylesheet`;
|
|
10
|
+
function injectStylesheet() {
|
|
11
|
+
const existing_element = document.getElementById(STYLE_ELEMENT_ID);
|
|
12
|
+
if (existing_element !== null) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const style_element = (0, create_element_1.default)('style');
|
|
16
|
+
style_element.id = STYLE_ELEMENT_ID;
|
|
17
|
+
style_element.textContent = stylesheet_1.default;
|
|
18
|
+
document.head.appendChild(style_element);
|
|
19
|
+
}
|
|
20
|
+
exports.default = injectStylesheet;
|
|
21
|
+
//# sourceMappingURL=inject-stylesheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-stylesheet.js","sourceRoot":"","sources":["../../../src/utility/inject-stylesheet.ts"],"names":[],"mappings":";;;;;AAAA,qEAA6C;AAC7C,4EAAmD;AACnD,+EAAqD;AAErD,MAAM,gBAAgB,GAAG,GAAG,2BAAe,CAAC,IAAI,aAAa,CAAC;AAE9D,SAAS,gBAAgB;IACxB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAEnE,IAAI,gBAAgB,KAAK,IAAI,EAAE,CAAC;QAC/B,OAAO;IACR,CAAC;IAED,MAAM,aAAa,GAAG,IAAA,wBAAa,EAAC,OAAO,CAAC,CAAC;IAE7C,aAAa,CAAC,EAAE,GAAG,gBAAgB,CAAC;IACpC,aAAa,CAAC,WAAW,GAAG,oBAAU,CAAC;IACvC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;AAC1C,CAAC;AAED,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function isComponentShown(component, visibility) {
|
|
4
|
+
const lineage_ids = [...component.ancestor_ids, component.id];
|
|
5
|
+
return lineage_ids.every((id) => {
|
|
6
|
+
return visibility.get(id) === true;
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
exports.default = isComponentShown;
|
|
10
|
+
//# sourceMappingURL=is-component-shown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-component-shown.js","sourceRoot":"","sources":["../../../src/utility/is-component-shown.ts"],"names":[],"mappings":";;AAGA,SAAS,gBAAgB,CACxB,SAA2B,EAC3B,UAAyB;IAEzB,MAAM,WAAW,GAAG,CAAC,GAAG,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IAE9D,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE;QAC/B,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IACpC,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const get_vector_component_1 = __importDefault(require("./get-vector-component.js"));
|
|
7
|
+
const with_vector_component_1 = __importDefault(require("./with-vector-component.js"));
|
|
8
|
+
function offsetVectorAlongAxis(vector, axis, offset) {
|
|
9
|
+
const current_value = (0, get_vector_component_1.default)(vector, axis);
|
|
10
|
+
const new_value = current_value + offset;
|
|
11
|
+
return (0, with_vector_component_1.default)(vector, axis, new_value);
|
|
12
|
+
}
|
|
13
|
+
exports.default = offsetVectorAlongAxis;
|
|
14
|
+
//# sourceMappingURL=offset-vector-along-axis.js.map
|