@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 @@
|
|
|
1
|
+
{"version":3,"file":"box.js","sourceRoot":"","sources":["../../../../src/type/primitive/box.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Axis from './../../enum/axis';
|
|
2
|
+
import Vector3 from './../vector3';
|
|
3
|
+
import PrimitiveType from './../../enum/primitive-type';
|
|
4
|
+
type CylinderPrimitive = {
|
|
5
|
+
readonly type: PrimitiveType.CYLINDER;
|
|
6
|
+
readonly axis: Axis;
|
|
7
|
+
readonly center: Vector3;
|
|
8
|
+
readonly radius: number;
|
|
9
|
+
readonly length: number;
|
|
10
|
+
};
|
|
11
|
+
export default CylinderPrimitive;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cylinder.js","sourceRoot":"","sources":["../../../../src/type/primitive/cylinder.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Plane from './../../enum/plane';
|
|
2
|
+
import Vector3 from './../vector3';
|
|
3
|
+
import OpeningShape from './../../enum/opening-shape';
|
|
4
|
+
import PrimitiveType from './../../enum/primitive-type';
|
|
5
|
+
type RectangularOpeningPrimitive = {
|
|
6
|
+
readonly type: PrimitiveType.OPENING;
|
|
7
|
+
readonly shape: OpeningShape.RECTANGLE;
|
|
8
|
+
readonly plane: Plane;
|
|
9
|
+
readonly center: Vector3;
|
|
10
|
+
readonly depth: number;
|
|
11
|
+
readonly width: number;
|
|
12
|
+
readonly height: number;
|
|
13
|
+
};
|
|
14
|
+
type CircularOpeningPrimitive = {
|
|
15
|
+
readonly type: PrimitiveType.OPENING;
|
|
16
|
+
readonly shape: OpeningShape.CIRCLE;
|
|
17
|
+
readonly plane: Plane;
|
|
18
|
+
readonly center: Vector3;
|
|
19
|
+
readonly depth: number;
|
|
20
|
+
readonly radius: number;
|
|
21
|
+
};
|
|
22
|
+
type OpeningPrimitive = RectangularOpeningPrimitive | CircularOpeningPrimitive;
|
|
23
|
+
export { RectangularOpeningPrimitive, CircularOpeningPrimitive };
|
|
24
|
+
export default OpeningPrimitive;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opening.js","sourceRoot":"","sources":["../../../../src/type/primitive/opening.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polyline.js","sourceRoot":"","sources":["../../../../src/type/primitive/polyline.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sphere.js","sourceRoot":"","sources":["../../../../src/type/primitive/sphere.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitive-geometry.js","sourceRoot":"","sources":["../../../src/type/primitive-geometry.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import BoxPrimitive from './primitive/box';
|
|
2
|
+
import SpherePrimitive from './primitive/sphere';
|
|
3
|
+
import OpeningPrimitive from './primitive/opening';
|
|
4
|
+
import CylinderPrimitive from './primitive/cylinder';
|
|
5
|
+
import PolylinePrimitive from './primitive/polyline';
|
|
6
|
+
type Primitive = BoxPrimitive | CylinderPrimitive | SpherePrimitive | PolylinePrimitive | OpeningPrimitive;
|
|
7
|
+
export default Primitive;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitive.js","sourceRoot":"","sources":["../../../src/type/primitive.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-options.js","sourceRoot":"","sources":["../../../src/type/render-options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-point.js","sourceRoot":"","sources":["../../../src/type/screen-point.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ViewPreset from './../enum/view-preset';
|
|
2
|
+
type SidebarCallbacks = {
|
|
3
|
+
readonly onViewSelected: (preset: ViewPreset) => void;
|
|
4
|
+
readonly onPerspectiveChanged: (perspective: boolean) => void;
|
|
5
|
+
readonly onLabelsChanged: (show_labels: boolean) => void;
|
|
6
|
+
readonly onGroundChanged: (show_ground: boolean) => void;
|
|
7
|
+
readonly onVisibilityChanged: () => void;
|
|
8
|
+
};
|
|
9
|
+
export default SidebarCallbacks;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-callbacks.js","sourceRoot":"","sources":["../../../src/type/sidebar-callbacks.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stroke.js","sourceRoot":"","sources":["../../../src/type/stroke.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector3.js","sourceRoot":"","sources":["../../../src/type/vector3.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-orientation.js","sourceRoot":"","sources":["../../../src/type/view-orientation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport.js","sourceRoot":"","sources":["../../../src/type/viewport.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visibility-map.js","sourceRoot":"","sources":["../../../src/type/visibility-map.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Primitive from './primitive';
|
|
2
|
+
interface WireframeComponent {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly label?: string;
|
|
5
|
+
readonly note?: string;
|
|
6
|
+
readonly color?: string;
|
|
7
|
+
readonly alpha?: number;
|
|
8
|
+
readonly line_width?: number;
|
|
9
|
+
readonly visible?: boolean;
|
|
10
|
+
readonly primitives?: Primitive[];
|
|
11
|
+
readonly children?: WireframeComponent[];
|
|
12
|
+
}
|
|
13
|
+
export default WireframeComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireframe-component.js","sourceRoot":"","sources":["../../../src/type/wireframe-component.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import CameraState from './camera-state';
|
|
2
|
+
import WireframeComponent from './wireframe-component';
|
|
3
|
+
type WireframeScene = {
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly subtitle?: string;
|
|
6
|
+
readonly units?: string;
|
|
7
|
+
readonly components: WireframeComponent[];
|
|
8
|
+
readonly camera?: Partial<CameraState>;
|
|
9
|
+
};
|
|
10
|
+
export default WireframeScene;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireframe-scene.js","sourceRoot":"","sources":["../../../src/type/wireframe-scene.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-vectors.js","sourceRoot":"","sources":["../../../src/utility/add-vectors.ts"],"names":[],"mappings":";;AAEA,SAAS,UAAU,CAAC,CAAU,EAAE,CAAU;IACzC,OAAO;QACN,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACZ,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACZ,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KACZ,CAAC;AACH,CAAC;AAED,kBAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 subtract_vectors_1 = __importDefault(require("./subtract-vectors.js"));
|
|
9
|
+
const box_edge_index_pairs_1 = __importDefault(require("./../constant/box-edge-index-pairs.js"));
|
|
10
|
+
function buildBoxCorners(box) {
|
|
11
|
+
const half_size = (0, scale_vector_1.default)(box.size, 0.5);
|
|
12
|
+
const minimum = (0, subtract_vectors_1.default)(box.center, half_size);
|
|
13
|
+
const maximum = (0, add_vectors_1.default)(box.center, half_size);
|
|
14
|
+
return [
|
|
15
|
+
{ x: minimum.x, y: minimum.y, z: minimum.z },
|
|
16
|
+
{ x: maximum.x, y: minimum.y, z: minimum.z },
|
|
17
|
+
{ x: minimum.x, y: maximum.y, z: minimum.z },
|
|
18
|
+
{ x: maximum.x, y: maximum.y, z: minimum.z },
|
|
19
|
+
{ x: minimum.x, y: minimum.y, z: maximum.z },
|
|
20
|
+
{ x: maximum.x, y: minimum.y, z: maximum.z },
|
|
21
|
+
{ x: minimum.x, y: maximum.y, z: maximum.z },
|
|
22
|
+
{ x: maximum.x, y: maximum.y, z: maximum.z }
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
function buildBoxOutlines(box) {
|
|
26
|
+
const corners = buildBoxCorners(box);
|
|
27
|
+
return box_edge_index_pairs_1.default.map(([start_index, end_index]) => {
|
|
28
|
+
return [corners[start_index], corners[end_index]];
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
exports.default = buildBoxOutlines;
|
|
32
|
+
//# sourceMappingURL=build-box-outlines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-box-outlines.js","sourceRoot":"","sources":["../../../src/utility/build-box-outlines.ts"],"names":[],"mappings":";;;;;AAEA,sEAA6C;AAC7C,wEAA+C;AAE/C,gFAAuD;AACvD,yFAAiE;AAEjE,SAAS,eAAe,CAAC,GAAiB;IACzC,MAAM,SAAS,GAAG,IAAA,sBAAW,EAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,IAAA,0BAAe,EAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,IAAA,qBAAU,EAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAElD,OAAO;QACN,EAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAC;QAC1C,EAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAC;QAC1C,EAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAC;QAC1C,EAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAC;QAC1C,EAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAC;QAC1C,EAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAC;QAC1C,EAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAC;QAC1C,EAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAC;KAC1C,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAiB;IAC1C,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IAErC,OAAO,8BAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,EAAE;QAC5D,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Axis from './../enum/axis';
|
|
2
|
+
import Vector3 from './../type/vector3';
|
|
3
|
+
import Polyline from './../type/polyline';
|
|
4
|
+
declare function buildCircleOutline(center: Vector3, axis: Axis, radius: number, segment_count?: number): Polyline;
|
|
5
|
+
export default buildCircleOutline;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 rendering_defaults_1 = __importDefault(require("./../constant/rendering-defaults.js"));
|
|
7
|
+
const get_perpendicular_axes_1 = __importDefault(require("./get-perpendicular-axes.js"));
|
|
8
|
+
const offset_vector_along_axis_1 = __importDefault(require("./offset-vector-along-axis.js"));
|
|
9
|
+
function buildCircleOutline(center, axis, radius, segment_count = rendering_defaults_1.default.CIRCLE_SEGMENT_COUNT) {
|
|
10
|
+
const [u_axis, v_axis] = (0, get_perpendicular_axes_1.default)(axis);
|
|
11
|
+
const points = [];
|
|
12
|
+
let index = 0;
|
|
13
|
+
while (index <= segment_count) {
|
|
14
|
+
const angle = (index / segment_count) * Math.PI * 2;
|
|
15
|
+
const u_offset = radius * Math.cos(angle);
|
|
16
|
+
const v_offset = radius * Math.sin(angle);
|
|
17
|
+
const u_shifted = (0, offset_vector_along_axis_1.default)(center, u_axis, u_offset);
|
|
18
|
+
const point = (0, offset_vector_along_axis_1.default)(u_shifted, v_axis, v_offset);
|
|
19
|
+
points.push(point);
|
|
20
|
+
index++;
|
|
21
|
+
}
|
|
22
|
+
return points;
|
|
23
|
+
}
|
|
24
|
+
exports.default = buildCircleOutline;
|
|
25
|
+
//# sourceMappingURL=build-circle-outline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-circle-outline.js","sourceRoot":"","sources":["../../../src/utility/build-circle-outline.ts"],"names":[],"mappings":";;;;;AAGA,qFAA6D;AAC7D,4FAAkE;AAClE,gGAAqE;AAErE,SAAS,kBAAkB,CAC1B,MAAe,EACf,IAAU,EACV,MAAc,EACd,gBAAwB,4BAAkB,CAAC,oBAAoB;IAE/D,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAA,gCAAoB,EAAC,IAAI,CAAC,CAAC;IACpD,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,OAAO,KAAK,IAAI,aAAa,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,CAAC,KAAK,GAAG,aAAa,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,SAAS,GAAG,IAAA,kCAAqB,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAClE,MAAM,KAAK,GAAG,IAAA,kCAAqB,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEjE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,KAAK,EAAE,CAAC;IACT,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 build_circle_outline_1 = __importDefault(require("./build-circle-outline.js"));
|
|
7
|
+
const get_perpendicular_axes_1 = __importDefault(require("./get-perpendicular-axes.js"));
|
|
8
|
+
const offset_vector_along_axis_1 = __importDefault(require("./offset-vector-along-axis.js"));
|
|
9
|
+
const LONGITUDINAL_LINE_COUNT = 4;
|
|
10
|
+
function buildCylinderOutlines(cylinder) {
|
|
11
|
+
const { axis, center, radius, length } = cylinder;
|
|
12
|
+
const half_length = length / 2;
|
|
13
|
+
const start_center = (0, offset_vector_along_axis_1.default)(center, axis, half_length * -1);
|
|
14
|
+
const end_center = (0, offset_vector_along_axis_1.default)(center, axis, half_length);
|
|
15
|
+
const start_circle = (0, build_circle_outline_1.default)(start_center, axis, radius);
|
|
16
|
+
const end_circle = (0, build_circle_outline_1.default)(end_center, axis, radius);
|
|
17
|
+
const [u_axis, v_axis] = (0, get_perpendicular_axes_1.default)(axis);
|
|
18
|
+
const outlines = [start_circle, end_circle];
|
|
19
|
+
let index = 0;
|
|
20
|
+
while (index < LONGITUDINAL_LINE_COUNT) {
|
|
21
|
+
const angle = (index / LONGITUDINAL_LINE_COUNT) * Math.PI * 2;
|
|
22
|
+
const u_offset = radius * Math.cos(angle);
|
|
23
|
+
const v_offset = radius * Math.sin(angle);
|
|
24
|
+
const start_u = (0, offset_vector_along_axis_1.default)(start_center, u_axis, u_offset);
|
|
25
|
+
const start_point = (0, offset_vector_along_axis_1.default)(start_u, v_axis, v_offset);
|
|
26
|
+
const end_u = (0, offset_vector_along_axis_1.default)(end_center, u_axis, u_offset);
|
|
27
|
+
const end_point = (0, offset_vector_along_axis_1.default)(end_u, v_axis, v_offset);
|
|
28
|
+
outlines.push([start_point, end_point]);
|
|
29
|
+
index++;
|
|
30
|
+
}
|
|
31
|
+
return outlines;
|
|
32
|
+
}
|
|
33
|
+
exports.default = buildCylinderOutlines;
|
|
34
|
+
//# sourceMappingURL=build-cylinder-outlines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-cylinder-outlines.js","sourceRoot":"","sources":["../../../src/utility/build-cylinder-outlines.ts"],"names":[],"mappings":";;;;;AAEA,wFAA8D;AAC9D,4FAAkE;AAClE,gGAAqE;AAErE,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAElC,SAAS,qBAAqB,CAAC,QAA2B;IACzD,MAAM,EAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAC,GAAG,QAAQ,CAAC;IAChD,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,CAAC;IAC/B,MAAM,YAAY,GAAG,IAAA,kCAAqB,EAAC,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3E,MAAM,UAAU,GAAG,IAAA,kCAAqB,EAAC,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;IACpE,MAAM,YAAY,GAAG,IAAA,8BAAkB,EAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACpE,MAAM,UAAU,GAAG,IAAA,8BAAkB,EAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAChE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAA,gCAAoB,EAAC,IAAI,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAe,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAExD,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,OAAO,KAAK,GAAG,uBAAuB,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,CAAC,KAAK,GAAG,uBAAuB,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QAC9D,MAAM,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,OAAO,GAAG,IAAA,kCAAqB,EAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QACtE,MAAM,WAAW,GAAG,IAAA,kCAAqB,EAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QACrE,MAAM,KAAK,GAAG,IAAA,kCAAqB,EAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAClE,MAAM,SAAS,GAAG,IAAA,kCAAqB,EAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEjE,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;QACxC,KAAK,EAAE,CAAC;IACT,CAAC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED,kBAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function buildInitialVisibility(components) {
|
|
4
|
+
const visibility = new Map();
|
|
5
|
+
components.forEach((component) => {
|
|
6
|
+
visibility.set(component.id, component.initially_visible);
|
|
7
|
+
});
|
|
8
|
+
return visibility;
|
|
9
|
+
}
|
|
10
|
+
exports.default = buildInitialVisibility;
|
|
11
|
+
//# sourceMappingURL=build-initial-visibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-initial-visibility.js","sourceRoot":"","sources":["../../../src/utility/build-initial-visibility.ts"],"names":[],"mappings":";;AAGA,SAAS,sBAAsB,CAAC,UAA8B;IAC7D,MAAM,UAAU,GAAkB,IAAI,GAAG,EAAE,CAAC;IAE5C,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;QAChC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACnB,CAAC;AAED,kBAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 opening_shape_1 = __importDefault(require("./../enum/opening-shape.js"));
|
|
7
|
+
const get_plane_axes_1 = __importDefault(require("./get-plane-axes.js"));
|
|
8
|
+
const build_circle_outline_1 = __importDefault(require("./build-circle-outline.js"));
|
|
9
|
+
const build_rectangle_outline_1 = __importDefault(require("./build-rectangle-outline.js"));
|
|
10
|
+
const offset_vector_along_axis_1 = __importDefault(require("./offset-vector-along-axis.js"));
|
|
11
|
+
const FACE_DIRECTIONS = [-1, 1];
|
|
12
|
+
function buildOutlineOnFace(opening, face_center) {
|
|
13
|
+
const { u, v, normal } = (0, get_plane_axes_1.default)(opening.plane);
|
|
14
|
+
switch (opening.shape) {
|
|
15
|
+
case opening_shape_1.default.RECTANGLE:
|
|
16
|
+
return (0, build_rectangle_outline_1.default)(face_center, u, v, opening.width, opening.height);
|
|
17
|
+
case opening_shape_1.default.CIRCLE:
|
|
18
|
+
return (0, build_circle_outline_1.default)(face_center, normal, opening.radius);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function buildOpeningOutlines(opening) {
|
|
22
|
+
const { normal } = (0, get_plane_axes_1.default)(opening.plane);
|
|
23
|
+
const half_depth = opening.depth / 2;
|
|
24
|
+
return FACE_DIRECTIONS.map((direction) => {
|
|
25
|
+
const face_offset = half_depth * direction;
|
|
26
|
+
const face_center = (0, offset_vector_along_axis_1.default)(opening.center, normal, face_offset);
|
|
27
|
+
return buildOutlineOnFace(opening, face_center);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.default = buildOpeningOutlines;
|
|
31
|
+
//# sourceMappingURL=build-opening-outlines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-opening-outlines.js","sourceRoot":"","sources":["../../../src/utility/build-opening-outlines.ts"],"names":[],"mappings":";;;;;AAEA,uEAA8C;AAC9C,4EAAkD;AAElD,wFAA8D;AAC9D,8FAAoE;AACpE,gGAAqE;AAErE,MAAM,eAAe,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEhC,SAAS,kBAAkB,CAC1B,OAAyB,EACzB,WAAoB;IAEpB,MAAM,EAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAC,GAAG,IAAA,wBAAY,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAEnD,QAAQ,OAAO,CAAC,KAAK,EAAE,CAAC;QACvB,KAAK,uBAAY,CAAC,SAAS;YAC1B,OAAO,IAAA,iCAAqB,EAC3B,WAAW,EACX,CAAC,EACD,CAAC,EACD,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,MAAM,CACd,CAAC;QACH,KAAK,uBAAY,CAAC,MAAM;YACvB,OAAO,IAAA,8BAAkB,EAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC;AACF,CAAC;AAED,SAAS,oBAAoB,CAAC,OAAyB;IACtD,MAAM,EAAC,MAAM,EAAC,GAAG,IAAA,wBAAY,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;IAErC,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QACxC,MAAM,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;QAC3C,MAAM,WAAW,GAAG,IAAA,kCAAqB,EACxC,OAAO,CAAC,MAAM,EACd,MAAM,EACN,WAAW,CACX,CAAC;QAEF,OAAO,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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 build_box_outlines_1 = __importDefault(require("./build-box-outlines.js"));
|
|
8
|
+
const rendering_defaults_1 = __importDefault(require("./../constant/rendering-defaults.js"));
|
|
9
|
+
const get_primitive_anchor_1 = __importDefault(require("./get-primitive-anchor.js"));
|
|
10
|
+
const build_sphere_outlines_1 = __importDefault(require("./build-sphere-outlines.js"));
|
|
11
|
+
const build_opening_outlines_1 = __importDefault(require("./build-opening-outlines.js"));
|
|
12
|
+
const build_cylinder_outlines_1 = __importDefault(require("./build-cylinder-outlines.js"));
|
|
13
|
+
function buildPrimitiveGeometry(primitive) {
|
|
14
|
+
const anchor = (0, get_primitive_anchor_1.default)(primitive);
|
|
15
|
+
switch (primitive.type) {
|
|
16
|
+
case primitive_type_1.default.BOX: {
|
|
17
|
+
const outlines = (0, build_box_outlines_1.default)(primitive);
|
|
18
|
+
return { outlines, strokes: [], anchor };
|
|
19
|
+
}
|
|
20
|
+
case primitive_type_1.default.CYLINDER: {
|
|
21
|
+
const outlines = (0, build_cylinder_outlines_1.default)(primitive);
|
|
22
|
+
return { outlines, strokes: [], anchor };
|
|
23
|
+
}
|
|
24
|
+
case primitive_type_1.default.SPHERE: {
|
|
25
|
+
const outlines = (0, build_sphere_outlines_1.default)(primitive);
|
|
26
|
+
return { outlines, strokes: [], anchor };
|
|
27
|
+
}
|
|
28
|
+
case primitive_type_1.default.OPENING: {
|
|
29
|
+
const outlines = (0, build_opening_outlines_1.default)(primitive);
|
|
30
|
+
return { outlines, strokes: [], anchor };
|
|
31
|
+
}
|
|
32
|
+
case primitive_type_1.default.POLYLINE: {
|
|
33
|
+
const width = primitive.width ?? rendering_defaults_1.default.STROKE_WIDTH;
|
|
34
|
+
const stroke = { points: primitive.points, width };
|
|
35
|
+
return { outlines: [], strokes: [stroke], anchor };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.default = buildPrimitiveGeometry;
|
|
40
|
+
//# sourceMappingURL=build-primitive-geometry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-primitive-geometry.js","sourceRoot":"","sources":["../../../src/utility/build-primitive-geometry.ts"],"names":[],"mappings":";;;;;AACA,yEAAgD;AAChD,oFAA0D;AAE1D,qFAA6D;AAC7D,wFAA8D;AAC9D,0FAAgE;AAChE,4FAAkE;AAClE,8FAAoE;AAEpE,SAAS,sBAAsB,CAAC,SAAoB;IACnD,MAAM,MAAM,GAAG,IAAA,8BAAkB,EAAC,SAAS,CAAC,CAAC;IAE7C,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACxB,KAAK,wBAAa,CAAC,GAAG,CAAC,CAAC,CAAC;YACxB,MAAM,QAAQ,GAAG,IAAA,4BAAgB,EAAC,SAAS,CAAC,CAAC;YAE7C,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAC,CAAC;QACxC,CAAC;QACD,KAAK,wBAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC7B,MAAM,QAAQ,GAAG,IAAA,iCAAqB,EAAC,SAAS,CAAC,CAAC;YAElD,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAC,CAAC;QACxC,CAAC;QACD,KAAK,wBAAa,CAAC,MAAM,CAAC,CAAC,CAAC;YAC3B,MAAM,QAAQ,GAAG,IAAA,+BAAmB,EAAC,SAAS,CAAC,CAAC;YAEhD,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAC,CAAC;QACxC,CAAC;QACD,KAAK,wBAAa,CAAC,OAAO,CAAC,CAAC,CAAC;YAC5B,MAAM,QAAQ,GAAG,IAAA,gCAAoB,EAAC,SAAS,CAAC,CAAC;YAEjD,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAC,CAAC;QACxC,CAAC;QACD,KAAK,wBAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC7B,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,IAAI,4BAAkB,CAAC,YAAY,CAAC;YACjE,MAAM,MAAM,GAAG,EAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAC,CAAC;YAEjD,OAAO,EAAC,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAC,CAAC;QAClD,CAAC;IACF,CAAC;AACF,CAAC;AAED,kBAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Axis from './../enum/axis';
|
|
2
|
+
import Vector3 from './../type/vector3';
|
|
3
|
+
import Polyline from './../type/polyline';
|
|
4
|
+
declare function buildRectangleOutline(center: Vector3, u_axis: Axis, v_axis: Axis, width: number, height: number): Polyline;
|
|
5
|
+
export default buildRectangleOutline;
|