@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.
Files changed (264) hide show
  1. package/LICENSE +673 -0
  2. package/README.md +123 -2
  3. package/bin/compile +55 -0
  4. package/bin/install +5 -0
  5. package/bin/lint +12 -0
  6. package/bin/postpublish +5 -0
  7. package/bin/precompile +71 -0
  8. package/bin/prepublish +7 -0
  9. package/bin/remap-paths +172 -0
  10. package/bin/test +9 -0
  11. package/bin/test-one +32 -0
  12. package/dist/.last-compile-time +1 -0
  13. package/dist/.last-publish-time +1 -0
  14. package/dist/src/camera.d.ts +26 -0
  15. package/dist/src/camera.js +90 -0
  16. package/dist/src/camera.js.map +1 -0
  17. package/dist/src/canvas-renderer.d.ts +22 -0
  18. package/dist/src/canvas-renderer.js +183 -0
  19. package/dist/src/canvas-renderer.js.map +1 -0
  20. package/dist/src/constant/axis-colors.d.ts +3 -0
  21. package/dist/src/constant/axis-colors.js +13 -0
  22. package/dist/src/constant/axis-colors.js.map +1 -0
  23. package/dist/src/constant/box-edge-index-pairs.d.ts +2 -0
  24. package/dist/src/constant/box-edge-index-pairs.js +18 -0
  25. package/dist/src/constant/box-edge-index-pairs.js.map +1 -0
  26. package/dist/src/constant/camera-limits.d.ts +7 -0
  27. package/dist/src/constant/camera-limits.js +10 -0
  28. package/dist/src/constant/camera-limits.js.map +1 -0
  29. package/dist/src/constant/default-camera-state.d.ts +3 -0
  30. package/dist/src/constant/default-camera-state.js +19 -0
  31. package/dist/src/constant/default-camera-state.js.map +1 -0
  32. package/dist/src/constant/default-palette.d.ts +2 -0
  33. package/dist/src/constant/default-palette.js +17 -0
  34. package/dist/src/constant/default-palette.js.map +1 -0
  35. package/dist/src/constant/interaction-rates.d.ts +5 -0
  36. package/dist/src/constant/interaction-rates.js +8 -0
  37. package/dist/src/constant/interaction-rates.js.map +1 -0
  38. package/dist/src/constant/rendering-defaults.d.ts +11 -0
  39. package/dist/src/constant/rendering-defaults.js +14 -0
  40. package/dist/src/constant/rendering-defaults.js.map +1 -0
  41. package/dist/src/constant/stylesheet.d.ts +2 -0
  42. package/dist/src/constant/stylesheet.js +140 -0
  43. package/dist/src/constant/stylesheet.js.map +1 -0
  44. package/dist/src/constant/theme.d.ts +9 -0
  45. package/dist/src/constant/theme.js +12 -0
  46. package/dist/src/constant/theme.js.map +1 -0
  47. package/dist/src/constant/view-orientations.d.ts +4 -0
  48. package/dist/src/constant/view-orientations.js +19 -0
  49. package/dist/src/constant/view-orientations.js.map +1 -0
  50. package/dist/src/enum/axis.d.ts +6 -0
  51. package/dist/src/enum/axis.js +10 -0
  52. package/dist/src/enum/axis.js.map +1 -0
  53. package/dist/src/enum/opening-shape.d.ts +5 -0
  54. package/dist/src/enum/opening-shape.js +9 -0
  55. package/dist/src/enum/opening-shape.js.map +1 -0
  56. package/dist/src/enum/plane.d.ts +6 -0
  57. package/dist/src/enum/plane.js +10 -0
  58. package/dist/src/enum/plane.js.map +1 -0
  59. package/dist/src/enum/primitive-type.d.ts +8 -0
  60. package/dist/src/enum/primitive-type.js +12 -0
  61. package/dist/src/enum/primitive-type.js.map +1 -0
  62. package/dist/src/enum/view-preset.d.ts +10 -0
  63. package/dist/src/enum/view-preset.js +14 -0
  64. package/dist/src/enum/view-preset.js.map +1 -0
  65. package/dist/src/enum/viewer-class-name.d.ts +15 -0
  66. package/dist/src/enum/viewer-class-name.js +19 -0
  67. package/dist/src/enum/viewer-class-name.js.map +1 -0
  68. package/dist/src/example/house-computer.d.ts +3 -0
  69. package/dist/src/example/house-computer.js +2081 -0
  70. package/dist/src/example/house-computer.js.map +1 -0
  71. package/dist/src/index.d.ts +20 -0
  72. package/dist/src/index.js +27 -0
  73. package/dist/src/index.js.map +1 -0
  74. package/dist/src/interaction-controller.d.ts +17 -0
  75. package/dist/src/interaction-controller.js +106 -0
  76. package/dist/src/interaction-controller.js.map +1 -0
  77. package/dist/src/sidebar.d.ts +24 -0
  78. package/dist/src/sidebar.js +121 -0
  79. package/dist/src/sidebar.js.map +1 -0
  80. package/dist/src/type/bounding-box.d.ts +6 -0
  81. package/dist/src/type/bounding-box.js +3 -0
  82. package/dist/src/type/bounding-box.js.map +1 -0
  83. package/dist/src/type/camera-state.d.ts +10 -0
  84. package/dist/src/type/camera-state.js +3 -0
  85. package/dist/src/type/camera-state.js.map +1 -0
  86. package/dist/src/type/display-component.d.ts +18 -0
  87. package/dist/src/type/display-component.js +3 -0
  88. package/dist/src/type/display-component.js.map +1 -0
  89. package/dist/src/type/drag-state.d.ts +6 -0
  90. package/dist/src/type/drag-state.js +3 -0
  91. package/dist/src/type/drag-state.js.map +1 -0
  92. package/dist/src/type/inherited-style.d.ts +8 -0
  93. package/dist/src/type/inherited-style.js +3 -0
  94. package/dist/src/type/inherited-style.js.map +1 -0
  95. package/dist/src/type/plane-axes.d.ts +7 -0
  96. package/dist/src/type/plane-axes.js +3 -0
  97. package/dist/src/type/plane-axes.js.map +1 -0
  98. package/dist/src/type/polyline.d.ts +3 -0
  99. package/dist/src/type/polyline.js +3 -0
  100. package/dist/src/type/polyline.js.map +1 -0
  101. package/dist/src/type/primitive/box.d.ts +8 -0
  102. package/dist/src/type/primitive/box.js +3 -0
  103. package/dist/src/type/primitive/box.js.map +1 -0
  104. package/dist/src/type/primitive/cylinder.d.ts +11 -0
  105. package/dist/src/type/primitive/cylinder.js +3 -0
  106. package/dist/src/type/primitive/cylinder.js.map +1 -0
  107. package/dist/src/type/primitive/opening.d.ts +24 -0
  108. package/dist/src/type/primitive/opening.js +3 -0
  109. package/dist/src/type/primitive/opening.js.map +1 -0
  110. package/dist/src/type/primitive/polyline.d.ts +8 -0
  111. package/dist/src/type/primitive/polyline.js +3 -0
  112. package/dist/src/type/primitive/polyline.js.map +1 -0
  113. package/dist/src/type/primitive/sphere.d.ts +8 -0
  114. package/dist/src/type/primitive/sphere.js +3 -0
  115. package/dist/src/type/primitive/sphere.js.map +1 -0
  116. package/dist/src/type/primitive-geometry.d.ts +9 -0
  117. package/dist/src/type/primitive-geometry.js +3 -0
  118. package/dist/src/type/primitive-geometry.js.map +1 -0
  119. package/dist/src/type/primitive.d.ts +7 -0
  120. package/dist/src/type/primitive.js +3 -0
  121. package/dist/src/type/primitive.js.map +1 -0
  122. package/dist/src/type/render-options.d.ts +5 -0
  123. package/dist/src/type/render-options.js +3 -0
  124. package/dist/src/type/render-options.js.map +1 -0
  125. package/dist/src/type/screen-point.d.ts +5 -0
  126. package/dist/src/type/screen-point.js +3 -0
  127. package/dist/src/type/screen-point.js.map +1 -0
  128. package/dist/src/type/sidebar-callbacks.d.ts +9 -0
  129. package/dist/src/type/sidebar-callbacks.js +3 -0
  130. package/dist/src/type/sidebar-callbacks.js.map +1 -0
  131. package/dist/src/type/stroke.d.ts +6 -0
  132. package/dist/src/type/stroke.js +3 -0
  133. package/dist/src/type/stroke.js.map +1 -0
  134. package/dist/src/type/vector3.d.ts +6 -0
  135. package/dist/src/type/vector3.js +3 -0
  136. package/dist/src/type/vector3.js.map +1 -0
  137. package/dist/src/type/view-orientation.d.ts +5 -0
  138. package/dist/src/type/view-orientation.js +3 -0
  139. package/dist/src/type/view-orientation.js.map +1 -0
  140. package/dist/src/type/viewport.d.ts +5 -0
  141. package/dist/src/type/viewport.js +3 -0
  142. package/dist/src/type/viewport.js.map +1 -0
  143. package/dist/src/type/visibility-map.d.ts +2 -0
  144. package/dist/src/type/visibility-map.js +3 -0
  145. package/dist/src/type/visibility-map.js.map +1 -0
  146. package/dist/src/type/wireframe-component.d.ts +13 -0
  147. package/dist/src/type/wireframe-component.js +3 -0
  148. package/dist/src/type/wireframe-component.js.map +1 -0
  149. package/dist/src/type/wireframe-scene.d.ts +10 -0
  150. package/dist/src/type/wireframe-scene.js +3 -0
  151. package/dist/src/type/wireframe-scene.js.map +1 -0
  152. package/dist/src/utility/add-vectors.d.ts +3 -0
  153. package/dist/src/utility/add-vectors.js +11 -0
  154. package/dist/src/utility/add-vectors.js.map +1 -0
  155. package/dist/src/utility/build-box-outlines.d.ts +4 -0
  156. package/dist/src/utility/build-box-outlines.js +32 -0
  157. package/dist/src/utility/build-box-outlines.js.map +1 -0
  158. package/dist/src/utility/build-circle-outline.d.ts +5 -0
  159. package/dist/src/utility/build-circle-outline.js +25 -0
  160. package/dist/src/utility/build-circle-outline.js.map +1 -0
  161. package/dist/src/utility/build-cylinder-outlines.d.ts +4 -0
  162. package/dist/src/utility/build-cylinder-outlines.js +34 -0
  163. package/dist/src/utility/build-cylinder-outlines.js.map +1 -0
  164. package/dist/src/utility/build-initial-visibility.d.ts +4 -0
  165. package/dist/src/utility/build-initial-visibility.js +11 -0
  166. package/dist/src/utility/build-initial-visibility.js.map +1 -0
  167. package/dist/src/utility/build-opening-outlines.d.ts +4 -0
  168. package/dist/src/utility/build-opening-outlines.js +31 -0
  169. package/dist/src/utility/build-opening-outlines.js.map +1 -0
  170. package/dist/src/utility/build-primitive-geometry.d.ts +4 -0
  171. package/dist/src/utility/build-primitive-geometry.js +40 -0
  172. package/dist/src/utility/build-primitive-geometry.js.map +1 -0
  173. package/dist/src/utility/build-rectangle-outline.d.ts +5 -0
  174. package/dist/src/utility/build-rectangle-outline.js +23 -0
  175. package/dist/src/utility/build-rectangle-outline.js.map +1 -0
  176. package/dist/src/utility/build-sphere-outlines.d.ts +4 -0
  177. package/dist/src/utility/build-sphere-outlines.js +16 -0
  178. package/dist/src/utility/build-sphere-outlines.js.map +1 -0
  179. package/dist/src/utility/clamp.d.ts +2 -0
  180. package/dist/src/utility/clamp.js +7 -0
  181. package/dist/src/utility/clamp.js.map +1 -0
  182. package/dist/src/utility/collect-display-points.d.ts +4 -0
  183. package/dist/src/utility/collect-display-points.js +13 -0
  184. package/dist/src/utility/collect-display-points.js.map +1 -0
  185. package/dist/src/utility/compute-bounding-box.d.ts +4 -0
  186. package/dist/src/utility/compute-bounding-box.js +29 -0
  187. package/dist/src/utility/compute-bounding-box.js.map +1 -0
  188. package/dist/src/utility/compute-centroid.d.ts +3 -0
  189. package/dist/src/utility/compute-centroid.js +17 -0
  190. package/dist/src/utility/compute-centroid.js.map +1 -0
  191. package/dist/src/utility/create-element.d.ts +2 -0
  192. package/dist/src/utility/create-element.js +11 -0
  193. package/dist/src/utility/create-element.js.map +1 -0
  194. package/dist/src/utility/fit-camera-to-bounding-box.d.ts +4 -0
  195. package/dist/src/utility/fit-camera-to-bounding-box.js +23 -0
  196. package/dist/src/utility/fit-camera-to-bounding-box.js.map +1 -0
  197. package/dist/src/utility/flatten-components.d.ts +4 -0
  198. package/dist/src/utility/flatten-components.js +70 -0
  199. package/dist/src/utility/flatten-components.js.map +1 -0
  200. package/dist/src/utility/get-bounding-box-center.d.ts +4 -0
  201. package/dist/src/utility/get-bounding-box-center.js +14 -0
  202. package/dist/src/utility/get-bounding-box-center.js.map +1 -0
  203. package/dist/src/utility/get-bounding-box-size.d.ts +4 -0
  204. package/dist/src/utility/get-bounding-box-size.js +12 -0
  205. package/dist/src/utility/get-bounding-box-size.js.map +1 -0
  206. package/dist/src/utility/get-focal-length.d.ts +2 -0
  207. package/dist/src/utility/get-focal-length.js +9 -0
  208. package/dist/src/utility/get-focal-length.js.map +1 -0
  209. package/dist/src/utility/get-perpendicular-axes.d.ts +3 -0
  210. package/dist/src/utility/get-perpendicular-axes.js +18 -0
  211. package/dist/src/utility/get-perpendicular-axes.js.map +1 -0
  212. package/dist/src/utility/get-plane-axes.d.ts +4 -0
  213. package/dist/src/utility/get-plane-axes.js +19 -0
  214. package/dist/src/utility/get-plane-axes.js.map +1 -0
  215. package/dist/src/utility/get-primitive-anchor.d.ts +4 -0
  216. package/dist/src/utility/get-primitive-anchor.js +20 -0
  217. package/dist/src/utility/get-primitive-anchor.js.map +1 -0
  218. package/dist/src/utility/get-vector-component.d.ts +4 -0
  219. package/dist/src/utility/get-vector-component.js +18 -0
  220. package/dist/src/utility/get-vector-component.js.map +1 -0
  221. package/dist/src/utility/get-vector-length.d.ts +3 -0
  222. package/dist/src/utility/get-vector-length.js +7 -0
  223. package/dist/src/utility/get-vector-length.js.map +1 -0
  224. package/dist/src/utility/has-hidden-ancestor.d.ts +4 -0
  225. package/dist/src/utility/has-hidden-ancestor.js +9 -0
  226. package/dist/src/utility/has-hidden-ancestor.js.map +1 -0
  227. package/dist/src/utility/inject-stylesheet.d.ts +2 -0
  228. package/dist/src/utility/inject-stylesheet.js +21 -0
  229. package/dist/src/utility/inject-stylesheet.js.map +1 -0
  230. package/dist/src/utility/is-component-shown.d.ts +4 -0
  231. package/dist/src/utility/is-component-shown.js +10 -0
  232. package/dist/src/utility/is-component-shown.js.map +1 -0
  233. package/dist/src/utility/offset-vector-along-axis.d.ts +4 -0
  234. package/dist/src/utility/offset-vector-along-axis.js +14 -0
  235. package/dist/src/utility/offset-vector-along-axis.js.map +1 -0
  236. package/dist/src/utility/pick-palette-color.d.ts +2 -0
  237. package/dist/src/utility/pick-palette-color.js +12 -0
  238. package/dist/src/utility/pick-palette-color.js.map +1 -0
  239. package/dist/src/utility/project-vector.d.ts +6 -0
  240. package/dist/src/utility/project-vector.js +30 -0
  241. package/dist/src/utility/project-vector.js.map +1 -0
  242. package/dist/src/utility/rotate-vector.d.ts +3 -0
  243. package/dist/src/utility/rotate-vector.js +17 -0
  244. package/dist/src/utility/rotate-vector.js.map +1 -0
  245. package/dist/src/utility/scale-vector.d.ts +3 -0
  246. package/dist/src/utility/scale-vector.js +11 -0
  247. package/dist/src/utility/scale-vector.js.map +1 -0
  248. package/dist/src/utility/subtract-vectors.d.ts +3 -0
  249. package/dist/src/utility/subtract-vectors.js +11 -0
  250. package/dist/src/utility/subtract-vectors.js.map +1 -0
  251. package/dist/src/utility/unrotate-vector.d.ts +3 -0
  252. package/dist/src/utility/unrotate-vector.js +17 -0
  253. package/dist/src/utility/unrotate-vector.js.map +1 -0
  254. package/dist/src/utility/validate-scene.d.ts +3 -0
  255. package/dist/src/utility/validate-scene.js +70 -0
  256. package/dist/src/utility/validate-scene.js.map +1 -0
  257. package/dist/src/utility/with-vector-component.d.ts +4 -0
  258. package/dist/src/utility/with-vector-component.js +18 -0
  259. package/dist/src/utility/with-vector-component.js.map +1 -0
  260. package/dist/src/wireframe-viewer.d.ts +27 -0
  261. package/dist/src/wireframe-viewer.js +144 -0
  262. package/dist/src/wireframe-viewer.js.map +1 -0
  263. package/dist/tsconfig.tsbuildinfo +1 -0
  264. package/package.json +44 -5
@@ -0,0 +1,8 @@
1
+ import Vector3 from './../vector3';
2
+ import PrimitiveType from './../../enum/primitive-type';
3
+ type BoxPrimitive = {
4
+ readonly type: PrimitiveType.BOX;
5
+ readonly center: Vector3;
6
+ readonly size: Vector3;
7
+ };
8
+ export default BoxPrimitive;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=box.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=cylinder.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=opening.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opening.js","sourceRoot":"","sources":["../../../../src/type/primitive/opening.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import Vector3 from './../vector3';
2
+ import PrimitiveType from './../../enum/primitive-type';
3
+ type PolylinePrimitive = {
4
+ readonly type: PrimitiveType.POLYLINE;
5
+ readonly points: Vector3[];
6
+ readonly width?: number;
7
+ };
8
+ export default PolylinePrimitive;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=polyline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyline.js","sourceRoot":"","sources":["../../../../src/type/primitive/polyline.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import Vector3 from './../vector3';
2
+ import PrimitiveType from './../../enum/primitive-type';
3
+ type SpherePrimitive = {
4
+ readonly type: PrimitiveType.SPHERE;
5
+ readonly center: Vector3;
6
+ readonly radius: number;
7
+ };
8
+ export default SpherePrimitive;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=sphere.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sphere.js","sourceRoot":"","sources":["../../../../src/type/primitive/sphere.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import Stroke from './stroke';
2
+ import Vector3 from './vector3';
3
+ import Polyline from './polyline';
4
+ type PrimitiveGeometry = {
5
+ readonly outlines: Polyline[];
6
+ readonly strokes: Stroke[];
7
+ readonly anchor: Vector3;
8
+ };
9
+ export default PrimitiveGeometry;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=primitive-geometry.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=primitive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive.js","sourceRoot":"","sources":["../../../src/type/primitive.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ type RenderOptions = {
2
+ readonly show_labels: boolean;
3
+ readonly show_ground: boolean;
4
+ };
5
+ export default RenderOptions;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=render-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-options.js","sourceRoot":"","sources":["../../../src/type/render-options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ type ScreenPoint = {
2
+ readonly x: number;
3
+ readonly y: number;
4
+ };
5
+ export default ScreenPoint;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=screen-point.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=sidebar-callbacks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-callbacks.js","sourceRoot":"","sources":["../../../src/type/sidebar-callbacks.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import Polyline from './polyline';
2
+ type Stroke = {
3
+ readonly points: Polyline;
4
+ readonly width: number;
5
+ };
6
+ export default Stroke;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=stroke.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stroke.js","sourceRoot":"","sources":["../../../src/type/stroke.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ type Vector3 = {
2
+ readonly x: number;
3
+ readonly y: number;
4
+ readonly z: number;
5
+ };
6
+ export default Vector3;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=vector3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vector3.js","sourceRoot":"","sources":["../../../src/type/vector3.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ type ViewOrientation = {
2
+ readonly yaw: number;
3
+ readonly elevation: number;
4
+ };
5
+ export default ViewOrientation;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=view-orientation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-orientation.js","sourceRoot":"","sources":["../../../src/type/view-orientation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ type Viewport = {
2
+ readonly width: number;
3
+ readonly height: number;
4
+ };
5
+ export default Viewport;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=viewport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport.js","sourceRoot":"","sources":["../../../src/type/viewport.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ type VisibilityMap = Map<string, boolean>;
2
+ export default VisibilityMap;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=visibility-map.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=wireframe-component.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=wireframe-scene.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wireframe-scene.js","sourceRoot":"","sources":["../../../src/type/wireframe-scene.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import Vector3 from './../type/vector3';
2
+ declare function addVectors(a: Vector3, b: Vector3): Vector3;
3
+ export default addVectors;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function addVectors(a, b) {
4
+ return {
5
+ x: a.x + b.x,
6
+ y: a.y + b.y,
7
+ z: a.z + b.z
8
+ };
9
+ }
10
+ exports.default = addVectors;
11
+ //# sourceMappingURL=add-vectors.js.map
@@ -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,4 @@
1
+ import Polyline from './../type/polyline';
2
+ import BoxPrimitive from './../type/primitive/box';
3
+ declare function buildBoxOutlines(box: BoxPrimitive): Polyline[];
4
+ export default buildBoxOutlines;
@@ -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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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,4 @@
1
+ import Polyline from './../type/polyline';
2
+ import CylinderPrimitive from './../type/primitive/cylinder';
3
+ declare function buildCylinderOutlines(cylinder: CylinderPrimitive): Polyline[];
4
+ export default buildCylinderOutlines;
@@ -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,gGAA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AC,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,4 @@
1
+ import VisibilityMap from './../type/visibility-map';
2
+ import DisplayComponent from './../type/display-component';
3
+ declare function buildInitialVisibility(components: DisplayComponent[]): VisibilityMap;
4
+ export default buildInitialVisibility;
@@ -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,4 @@
1
+ import Polyline from './../type/polyline';
2
+ import OpeningPrimitive from './../type/primitive/opening';
3
+ declare function buildOpeningOutlines(opening: OpeningPrimitive): Polyline[];
4
+ export default buildOpeningOutlines;
@@ -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,4 @@
1
+ import Primitive from './../type/primitive';
2
+ import PrimitiveGeometry from './../type/primitive-geometry';
3
+ declare function buildPrimitiveGeometry(primitive: Primitive): PrimitiveGeometry;
4
+ export default buildPrimitiveGeometry;
@@ -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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AAM,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;