@ifiwas/standard-view 2.0.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/.prettierignore +67 -0
- package/.prettierrc +12 -0
- package/CHANGELOG.md +42 -0
- package/LICENSE +8 -0
- package/README.md +199 -0
- package/debug-storybook.log +179 -0
- package/declarations.d.ts +17 -0
- package/dist/standard-view.es.js +9522 -0
- package/dist/standard-view.es.js.map +1 -0
- package/dist/standard-view.umd.js +41 -0
- package/dist/standard-view.umd.js.map +1 -0
- package/fonts/gentilis.bold.typeface.json +1 -0
- package/fonts/gentilis.typeface.json +1 -0
- package/fonts/helvetiker.bold.typeface.json +1 -0
- package/fonts/helvetiker.typeface.json +1 -0
- package/fonts/optimer.bold.typeface.json +1 -0
- package/fonts/optimer.typeface.json +1 -0
- package/images.d.ts +7 -0
- package/index.js +10 -0
- package/lib/controls/OrbitControls.d.ts +9 -0
- package/lib/controls/OrbitControls.js +761 -0
- package/lib/controls/index.d.ts +1 -0
- package/lib/controls/index.js +18 -0
- package/lib/groups/Arrow.d.ts +19 -0
- package/lib/groups/Arrow.js +134 -0
- package/lib/groups/Axis.d.ts +20 -0
- package/lib/groups/Axis.js +147 -0
- package/lib/groups/BoundingBox.d.ts +9 -0
- package/lib/groups/BoundingBox.js +143 -0
- package/lib/groups/Camera.d.ts +32 -0
- package/lib/groups/Camera.js +477 -0
- package/lib/groups/Capsule.d.ts +9 -0
- package/lib/groups/Capsule.js +112 -0
- package/lib/groups/FBX.d.ts +9 -0
- package/lib/groups/FBX.js +213 -0
- package/lib/groups/GLTF.d.ts +9 -0
- package/lib/groups/GLTF.js +198 -0
- package/lib/groups/Group.d.ts +63 -0
- package/lib/groups/Group.js +426 -0
- package/lib/groups/OBJ.d.ts +11 -0
- package/lib/groups/OBJ.js +252 -0
- package/lib/groups/PCD.d.ts +9 -0
- package/lib/groups/PCD.js +82 -0
- package/lib/groups/Path.d.ts +19 -0
- package/lib/groups/Path.js +160 -0
- package/lib/groups/index.d.ts +11 -0
- package/lib/groups/index.js +91 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +298 -0
- package/lib/lights/AmbientLight.d.ts +8 -0
- package/lib/lights/AmbientLight.js +37 -0
- package/lib/lights/DirectionalLight.d.ts +8 -0
- package/lib/lights/DirectionalLight.js +43 -0
- package/lib/lights/HemisphereLight.d.ts +13 -0
- package/lib/lights/HemisphereLight.js +108 -0
- package/lib/lights/LightWithShadows.d.ts +24 -0
- package/lib/lights/LightWithShadows.js +188 -0
- package/lib/lights/PointLight.d.ts +9 -0
- package/lib/lights/PointLight.js +47 -0
- package/lib/lights/RectAreaLight.d.ts +13 -0
- package/lib/lights/RectAreaLight.js +177 -0
- package/lib/lights/SpotLight.d.ts +10 -0
- package/lib/lights/SpotLight.js +49 -0
- package/lib/lights/index.d.ts +6 -0
- package/lib/lights/index.js +48 -0
- package/lib/primitives/Box.d.ts +6 -0
- package/lib/primitives/Box.js +43 -0
- package/lib/primitives/Circle.d.ts +10 -0
- package/lib/primitives/Circle.js +85 -0
- package/lib/primitives/Cylinder.d.ts +15 -0
- package/lib/primitives/Cylinder.js +180 -0
- package/lib/primitives/Label.d.ts +18 -0
- package/lib/primitives/Label.js +189 -0
- package/lib/primitives/Line.d.ts +19 -0
- package/lib/primitives/Line.js +173 -0
- package/lib/primitives/Mesh.d.ts +72 -0
- package/lib/primitives/Mesh.js +642 -0
- package/lib/primitives/Plane.d.ts +7 -0
- package/lib/primitives/Plane.js +47 -0
- package/lib/primitives/Polygon.d.ts +8 -0
- package/lib/primitives/Polygon.js +75 -0
- package/lib/primitives/Quad.d.ts +9 -0
- package/lib/primitives/Quad.js +110 -0
- package/lib/primitives/Sphere.d.ts +14 -0
- package/lib/primitives/Sphere.js +92 -0
- package/lib/primitives/Text.d.ts +20 -0
- package/lib/primitives/Text.js +285 -0
- package/lib/primitives/Triangle.d.ts +8 -0
- package/lib/primitives/Triangle.js +83 -0
- package/lib/primitives/index.d.ts +12 -0
- package/lib/primitives/index.js +90 -0
- package/lib/shaders/index.d.ts +0 -0
- package/lib/shaders/index.js +2 -0
- package/lib/types/three-jsx.d.js +5 -0
- package/lib/utils/constants.js +181 -0
- package/lib/utils/events.d.ts +22 -0
- package/lib/utils/events.js +98 -0
- package/lib/utils/hooks.d.ts +8 -0
- package/lib/utils/hooks.js +96 -0
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/index.js +110 -0
- package/lib/utils/interfaces.d.ts +9 -0
- package/lib/utils/interfaces.js +5 -0
- package/lib/utils/math.d.ts +12 -0
- package/lib/utils/math.js +31 -0
- package/lib/utils/performance.d.ts +7 -0
- package/lib/utils/performance.js +114 -0
- package/lib/utils/styles.js +10 -0
- package/lib/utils/util.d.ts +76 -0
- package/lib/utils/util.js +290 -0
- package/lib/views/ContextBridge.d.ts +23 -0
- package/lib/views/ContextBridge.js +98 -0
- package/lib/views/SceneCamera.d.ts +7 -0
- package/lib/views/SceneCamera.js +52 -0
- package/lib/views/SetBackground.d.ts +9 -0
- package/lib/views/SetBackground.js +90 -0
- package/lib/views/SetControls.d.ts +19 -0
- package/lib/views/SetControls.js +173 -0
- package/lib/views/SetRenderer.d.ts +25 -0
- package/lib/views/SetRenderer.js +66 -0
- package/lib/views/SetShadows.d.ts +7 -0
- package/lib/views/SetShadows.js +48 -0
- package/lib/views/View3D.d.ts +21 -0
- package/lib/views/View3D.js +289 -0
- package/lib/views/ViewContext.d.ts +23 -0
- package/lib/views/ViewContext.js +55 -0
- package/lib/views/index.d.ts +2 -0
- package/lib/views/index.js +20 -0
- package/netlify.toml +15 -0
- package/package.json +110 -0
- package/tsconfig.json +42 -0
- package/tsconfig.prod.json +3 -0
- package/tsconfig.test.json +6 -0
- package/vite.config.ts +37 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _OBJLoader = require("three/examples/jsm/loaders/OBJLoader");
|
|
10
|
+
var _MTLLoader = require("three/examples/jsm/loaders/MTLLoader");
|
|
11
|
+
var _Label = _interopRequireDefault(require("../primitives/Label"));
|
|
12
|
+
var _Group = _interopRequireDefault(require("./Group"));
|
|
13
|
+
var _hooks = require("../utils/hooks");
|
|
14
|
+
var _excluded = ["color"],
|
|
15
|
+
_excluded2 = ["objPath", "objURL", "mtlPath", "mtlURL", "resourcePath", "view3DEnvMap", "castShadow", "receiveShadow"]; // OBJ.tsx
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
17
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
19
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
20
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
22
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
23
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
24
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
25
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
26
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
27
|
+
var useEffect = React.useEffect,
|
|
28
|
+
useMemo = React.useMemo,
|
|
29
|
+
useRef = React.useRef,
|
|
30
|
+
memo = React.memo;
|
|
31
|
+
function loadOBJ(_ref) {
|
|
32
|
+
var group = _ref.group,
|
|
33
|
+
objPath = _ref.objPath,
|
|
34
|
+
objURL = _ref.objURL,
|
|
35
|
+
castShadow = _ref.castShadow,
|
|
36
|
+
receiveShadow = _ref.receiveShadow;
|
|
37
|
+
var loader = new _OBJLoader.OBJLoader();
|
|
38
|
+
loader.setPath(objPath);
|
|
39
|
+
loader.load(objURL, function (obj) {
|
|
40
|
+
// Remove Loading Label or Previous OBJ
|
|
41
|
+
if (group.current) {
|
|
42
|
+
if (group.current.children) {
|
|
43
|
+
group.current.children.map(function (child) {
|
|
44
|
+
return group.current.remove(child);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Shadows
|
|
49
|
+
obj.traverse(function (mesh) {
|
|
50
|
+
/* eslint-disable no-param-reassign */
|
|
51
|
+
// @ts-ignore:TS2339 isMesh does not exist on Object3D
|
|
52
|
+
if (mesh.isMesh) {
|
|
53
|
+
mesh.castShadow = castShadow;
|
|
54
|
+
mesh.receiveShadow = receiveShadow;
|
|
55
|
+
}
|
|
56
|
+
/* eslint-enable no-param-reassign */
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Add OBJ
|
|
60
|
+
group.current.add(obj);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function loadOBJAndMTL(_ref2) {
|
|
65
|
+
var group = _ref2.group,
|
|
66
|
+
objPath = _ref2.objPath,
|
|
67
|
+
objURL = _ref2.objURL,
|
|
68
|
+
mtlPath = _ref2.mtlPath,
|
|
69
|
+
mtlURL = _ref2.mtlURL,
|
|
70
|
+
envMap = _ref2.envMap,
|
|
71
|
+
resourcePath = _ref2.resourcePath,
|
|
72
|
+
castShadow = _ref2.castShadow,
|
|
73
|
+
receiveShadow = _ref2.receiveShadow,
|
|
74
|
+
materialProps = _ref2.materialProps;
|
|
75
|
+
// No OBJ
|
|
76
|
+
if (objURL == null) {
|
|
77
|
+
/* eslint-disable-next-line no-console */
|
|
78
|
+
console.warn("[OBJ] No objURL");
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// OBJ
|
|
83
|
+
if (mtlPath == null || mtlURL == null) {
|
|
84
|
+
loadOBJ({
|
|
85
|
+
group: group,
|
|
86
|
+
objPath: objPath,
|
|
87
|
+
objURL: objURL,
|
|
88
|
+
castShadow: castShadow,
|
|
89
|
+
receiveShadow: receiveShadow
|
|
90
|
+
});
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// OBJ + MTL
|
|
95
|
+
var mtlLoader = new _MTLLoader.MTLLoader();
|
|
96
|
+
mtlLoader.setPath(mtlPath);
|
|
97
|
+
if (resourcePath) {
|
|
98
|
+
// @ts-ignore:TS2339 property setResourcePath does not exist in MTLLoader
|
|
99
|
+
mtlLoader.setResourcePath(resourcePath);
|
|
100
|
+
}
|
|
101
|
+
mtlLoader.load(mtlURL, function (mtl) {
|
|
102
|
+
mtl.preload();
|
|
103
|
+
var objLoader = new _OBJLoader.OBJLoader();
|
|
104
|
+
objLoader.setMaterials(mtl);
|
|
105
|
+
objLoader.setPath(objPath);
|
|
106
|
+
objLoader.load(objURL, function (obj) {
|
|
107
|
+
if (group.current) {
|
|
108
|
+
// Remove Loading Label or Previous OBJ
|
|
109
|
+
if (group.current.children) {
|
|
110
|
+
group.current.children.map(function (child) {
|
|
111
|
+
return group.current.remove(child);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Material Props
|
|
116
|
+
if (materialProps && obj.children) {
|
|
117
|
+
var color = materialProps.color,
|
|
118
|
+
otherMaterialProps = _objectWithoutProperties(materialProps, _excluded);
|
|
119
|
+
// Set Material Props for Each Mesh in OBJ Group of Meshes
|
|
120
|
+
obj.children.map(function (mesh) {
|
|
121
|
+
// @ts-ignore:TS2339 material does not exist on Object3D
|
|
122
|
+
if (mesh.material) {
|
|
123
|
+
if (color) {
|
|
124
|
+
// @ts-ignore:TS2339 material does not exist on Object3D
|
|
125
|
+
mesh.material.color.set(color);
|
|
126
|
+
}
|
|
127
|
+
Object.entries(otherMaterialProps).map(function (_ref3) {
|
|
128
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
129
|
+
propName = _ref4[0],
|
|
130
|
+
value = _ref4[1];
|
|
131
|
+
/* eslint-disable no-param-reassign */
|
|
132
|
+
// @ts-ignore:TS2339 material does not exist on Object3D
|
|
133
|
+
mesh.material[propName] = value;
|
|
134
|
+
/* eslint-enable no-param-reassign */
|
|
135
|
+
return null;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Env Map + Shadows
|
|
143
|
+
obj.traverse(function (mesh) {
|
|
144
|
+
/* eslint-disable no-param-reassign */
|
|
145
|
+
// @ts-ignore
|
|
146
|
+
if (mesh.isMesh) {
|
|
147
|
+
if (envMap) {
|
|
148
|
+
// @ts-ignore
|
|
149
|
+
mesh.material.envMap = envMap;
|
|
150
|
+
}
|
|
151
|
+
mesh.castShadow = castShadow;
|
|
152
|
+
mesh.receiveShadow = receiveShadow;
|
|
153
|
+
}
|
|
154
|
+
/* eslint-enable no-param-reassign */
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// Add OBJ + MTL
|
|
158
|
+
group.current.add(obj);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* OBJ
|
|
166
|
+
*
|
|
167
|
+
* This component may render a textured mesh from a .obj, .mtl, and corresponding set of
|
|
168
|
+
* image files. If mtlURL is not provided, only an untextured mesh from the .obj file
|
|
169
|
+
* will be rendered.
|
|
170
|
+
*
|
|
171
|
+
* resourcePath allows the texture files to located in a directory different from the
|
|
172
|
+
* mtlPath.
|
|
173
|
+
*/
|
|
174
|
+
var OBJ = function OBJ(_ref5) {
|
|
175
|
+
var _ref5$objPath = _ref5.objPath,
|
|
176
|
+
objPath = _ref5$objPath === void 0 ? "" : _ref5$objPath,
|
|
177
|
+
objURL = _ref5.objURL,
|
|
178
|
+
mtlPath = _ref5.mtlPath,
|
|
179
|
+
mtlURL = _ref5.mtlURL,
|
|
180
|
+
resourcePath = _ref5.resourcePath,
|
|
181
|
+
_ref5$view3DEnvMap = _ref5.view3DEnvMap,
|
|
182
|
+
view3DEnvMap = _ref5$view3DEnvMap === void 0 ? false : _ref5$view3DEnvMap,
|
|
183
|
+
_ref5$castShadow = _ref5.castShadow,
|
|
184
|
+
castShadow = _ref5$castShadow === void 0 ? false : _ref5$castShadow,
|
|
185
|
+
_ref5$receiveShadow = _ref5.receiveShadow,
|
|
186
|
+
receiveShadow = _ref5$receiveShadow === void 0 ? false : _ref5$receiveShadow,
|
|
187
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded2);
|
|
188
|
+
var group = useRef(null);
|
|
189
|
+
var _useViewContext = (0, _hooks.useViewContext)(),
|
|
190
|
+
envMap = _useViewContext.envMap;
|
|
191
|
+
|
|
192
|
+
// Material Props
|
|
193
|
+
var materialProps = useMemo(function updateMaterialProps() {
|
|
194
|
+
// No Material Props
|
|
195
|
+
if (!otherProps || Object.keys(otherProps).length === 0) {
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Acceptable Material Props
|
|
200
|
+
var materialPropsKeys = ["color", "wireframe", "opacity", "transparent", "side", "depthWrite", "depthTest"];
|
|
201
|
+
|
|
202
|
+
// Extract Acceptable Props
|
|
203
|
+
var props = {};
|
|
204
|
+
materialPropsKeys.map(function (propName) {
|
|
205
|
+
if (otherProps[propName]) {
|
|
206
|
+
props[propName] = otherProps[propName];
|
|
207
|
+
}
|
|
208
|
+
return null;
|
|
209
|
+
});
|
|
210
|
+
return Object.keys(props).length > 0 ? props : undefined;
|
|
211
|
+
}, [otherProps]);
|
|
212
|
+
|
|
213
|
+
// Environment Map
|
|
214
|
+
var _envMap = useMemo(function updateEnvMap() {
|
|
215
|
+
if (view3DEnvMap) {
|
|
216
|
+
return envMap;
|
|
217
|
+
}
|
|
218
|
+
return null;
|
|
219
|
+
}, [view3DEnvMap, envMap]);
|
|
220
|
+
|
|
221
|
+
// Loading Text
|
|
222
|
+
var loadingText = useMemo(function updateLoadText() {
|
|
223
|
+
return objURL || "No objURL";
|
|
224
|
+
}, [objURL]);
|
|
225
|
+
|
|
226
|
+
// Load OBJ + MTL
|
|
227
|
+
useEffect(function updateOBJAndMTL() {
|
|
228
|
+
if (group) {
|
|
229
|
+
loadOBJAndMTL({
|
|
230
|
+
group: group,
|
|
231
|
+
objPath: objPath,
|
|
232
|
+
objURL: objURL,
|
|
233
|
+
mtlPath: mtlPath,
|
|
234
|
+
mtlURL: mtlURL,
|
|
235
|
+
envMap: _envMap,
|
|
236
|
+
resourcePath: resourcePath,
|
|
237
|
+
castShadow: castShadow,
|
|
238
|
+
receiveShadow: receiveShadow,
|
|
239
|
+
materialProps: materialProps
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}, [objPath, objURL, mtlPath, mtlURL, resourcePath, _envMap, castShadow, receiveShadow, materialProps]);
|
|
243
|
+
return /*#__PURE__*/React.createElement(_Group["default"], _extends({
|
|
244
|
+
ref: group
|
|
245
|
+
}, otherProps), /*#__PURE__*/React.createElement(_Label["default"], {
|
|
246
|
+
text: loadingText,
|
|
247
|
+
textColor: "red"
|
|
248
|
+
}));
|
|
249
|
+
};
|
|
250
|
+
var OBJMemo = memo(OBJ);
|
|
251
|
+
OBJMemo.displayName = "OBJ";
|
|
252
|
+
var _default = exports["default"] = OBJMemo;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { GroupProps } from "./Group";
|
|
3
|
+
interface PCDProps extends GroupProps {
|
|
4
|
+
pcdPath: string;
|
|
5
|
+
pcdURL: string;
|
|
6
|
+
pointSize: number;
|
|
7
|
+
}
|
|
8
|
+
declare const PCDMemo: React.NamedExoticComponent<PCDProps>;
|
|
9
|
+
export default PCDMemo;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _PCDLoader = require("three/examples/jsm/loaders/PCDLoader");
|
|
10
|
+
var _Label = _interopRequireDefault(require("../primitives/Label"));
|
|
11
|
+
var _Group = _interopRequireDefault(require("./Group"));
|
|
12
|
+
var _excluded = ["pcdPath", "pcdURL", "pointSize"]; // PCD.tsx
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
16
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
17
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
18
|
+
var useRef = React.useRef,
|
|
19
|
+
useEffect = React.useEffect,
|
|
20
|
+
useMemo = React.useMemo,
|
|
21
|
+
memo = React.memo;
|
|
22
|
+
function loadPCD(/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
23
|
+
group, pcdPath, pcdURL, pointSize) {
|
|
24
|
+
// No PCD
|
|
25
|
+
if (pcdURL == null) {
|
|
26
|
+
/* eslint-disable-next-line no-console */
|
|
27
|
+
console.warn("[PCD] No pcdURL");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// PCD
|
|
31
|
+
var pcdLoader = new _PCDLoader.PCDLoader();
|
|
32
|
+
pcdLoader.setPath(pcdPath);
|
|
33
|
+
pcdLoader.load(pcdURL, function (pcd) {
|
|
34
|
+
if (group.current) {
|
|
35
|
+
// Remove Loading Label or Previous PCD
|
|
36
|
+
if (group.current.children) {
|
|
37
|
+
group.current.children.map(function (child) {
|
|
38
|
+
return group.current.remove(child);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Material Props
|
|
43
|
+
if (pcd.material) {
|
|
44
|
+
/* eslint-disable no-param-reassign */
|
|
45
|
+
// @ts-ignore:TS2339 size does not exist
|
|
46
|
+
pcd.material.size = pointSize;
|
|
47
|
+
/* eslint-enable no-param-reassign */
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Add PCD
|
|
51
|
+
group.current.add(pcd);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
var PCD = function PCD(_ref) {
|
|
56
|
+
var _ref$pcdPath = _ref.pcdPath,
|
|
57
|
+
pcdPath = _ref$pcdPath === void 0 ? "" : _ref$pcdPath,
|
|
58
|
+
pcdURL = _ref.pcdURL,
|
|
59
|
+
_ref$pointSize = _ref.pointSize,
|
|
60
|
+
pointSize = _ref$pointSize === void 0 ? 0.01 : _ref$pointSize,
|
|
61
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
62
|
+
var group = useRef(null);
|
|
63
|
+
var loadingText = useMemo(function updateLoadText() {
|
|
64
|
+
return pcdURL || "No pcdURL";
|
|
65
|
+
}, [pcdURL]);
|
|
66
|
+
|
|
67
|
+
// Load PCD
|
|
68
|
+
useEffect(function updatePCD() {
|
|
69
|
+
if (group) {
|
|
70
|
+
loadPCD(group, pcdPath, pcdURL, pointSize);
|
|
71
|
+
}
|
|
72
|
+
}, [group, pcdPath, pcdURL, pointSize]);
|
|
73
|
+
return /*#__PURE__*/React.createElement(_Group["default"], _extends({
|
|
74
|
+
ref: group
|
|
75
|
+
}, otherProps), /*#__PURE__*/React.createElement(_Label["default"], {
|
|
76
|
+
text: loadingText,
|
|
77
|
+
textColor: "red"
|
|
78
|
+
}));
|
|
79
|
+
};
|
|
80
|
+
var PCDMemo = memo(PCD);
|
|
81
|
+
PCDMemo.displayName = "PCD";
|
|
82
|
+
var _default = exports["default"] = PCDMemo;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { GroupProps } from "./Group";
|
|
3
|
+
interface PathProps extends GroupProps {
|
|
4
|
+
points?: Array<Array<number>>;
|
|
5
|
+
frames?: Array<number>;
|
|
6
|
+
thickness?: number;
|
|
7
|
+
lineThickness?: number;
|
|
8
|
+
pointRadius?: number;
|
|
9
|
+
pointColor?: string;
|
|
10
|
+
lineColor?: string;
|
|
11
|
+
frame?: number;
|
|
12
|
+
point?: Array<number>;
|
|
13
|
+
lineProps?: any;
|
|
14
|
+
pointProps?: any;
|
|
15
|
+
textProps?: any;
|
|
16
|
+
enumerate?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const PathMemo: React.NamedExoticComponent<PathProps>;
|
|
19
|
+
export default PathMemo;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _Group = _interopRequireWildcard(require("./Group"));
|
|
10
|
+
var _primitives = require("../primitives");
|
|
11
|
+
var _util = require("../utils/util");
|
|
12
|
+
var _excluded = ["points", "frames", "thickness", "lineThickness", "pointRadius", "pointColor", "lineColor", "frame", "point", "enumerate"],
|
|
13
|
+
_excluded2 = ["color", "hoverColor", "lineProps", "pointProps", "textProps", "children"]; // Path.tsx
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
16
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
17
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
18
|
+
var useRef = React.useRef,
|
|
19
|
+
useMemo = React.useMemo,
|
|
20
|
+
memo = React.memo;
|
|
21
|
+
/**
|
|
22
|
+
* Path
|
|
23
|
+
*
|
|
24
|
+
* In Standard View, Path is a Group comprised of Spheres and Cylinders which
|
|
25
|
+
* update based on the array of points prop. Path will keep a hashset of
|
|
26
|
+
* frames and append a new point if frame and point props are both new and
|
|
27
|
+
* the frame number is greater than the last given frame. The new point will
|
|
28
|
+
* have a Cylinder connecting from the last given point in chronological by
|
|
29
|
+
* frame order, thus creating a chronological 3D path.
|
|
30
|
+
*/
|
|
31
|
+
var Path = function Path(_ref) {
|
|
32
|
+
var points = _ref.points,
|
|
33
|
+
frames = _ref.frames,
|
|
34
|
+
_ref$thickness = _ref.thickness,
|
|
35
|
+
thickness = _ref$thickness === void 0 ? 0.1 : _ref$thickness,
|
|
36
|
+
lineThickness = _ref.lineThickness,
|
|
37
|
+
pointRadius = _ref.pointRadius,
|
|
38
|
+
pointColor = _ref.pointColor,
|
|
39
|
+
lineColor = _ref.lineColor,
|
|
40
|
+
frame = _ref.frame,
|
|
41
|
+
point = _ref.point,
|
|
42
|
+
_ref$enumerate = _ref.enumerate,
|
|
43
|
+
enumerate = _ref$enumerate === void 0 ? false : _ref$enumerate,
|
|
44
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
45
|
+
var _generateGroupProps = (0, _Group.generateGroupProps)(otherProps),
|
|
46
|
+
cleanedProps = _generateGroupProps.cleanedProps,
|
|
47
|
+
groupProps = _generateGroupProps.groupProps;
|
|
48
|
+
var color = cleanedProps.color,
|
|
49
|
+
hoverColor = cleanedProps.hoverColor,
|
|
50
|
+
lineProps = cleanedProps.lineProps,
|
|
51
|
+
pointProps = cleanedProps.pointProps,
|
|
52
|
+
textProps = cleanedProps.textProps,
|
|
53
|
+
children = cleanedProps.children,
|
|
54
|
+
otherCleanedProps = _objectWithoutProperties(cleanedProps, _excluded2);
|
|
55
|
+
var _points = useRef([]);
|
|
56
|
+
useMemo(function updatePoints() {
|
|
57
|
+
// Add point
|
|
58
|
+
if (!points) {
|
|
59
|
+
// No point or frame
|
|
60
|
+
if (!point || !frame) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Only add points for frames that do not already have a point
|
|
65
|
+
if (!_points.current[frame]) {
|
|
66
|
+
_points.current[frame] = point;
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
var _frames = frames || Array.from(Array(points.length).keys());
|
|
71
|
+
// Validate Arrays
|
|
72
|
+
if (!Array.isArray(points) || !Array.isArray(_frames) || points.length !== _frames.length) {
|
|
73
|
+
console.warn("[Path] number of elements in frames must match number of elements in points. points.length (".concat(points && points.length, ") =/= frames.length (").concat(_frames && _frames.length, ")"));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Load _points
|
|
78
|
+
if (points.length <= _points.current.length) {
|
|
79
|
+
_points.current = _points.current.slice(0, points.length);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* eslint-disable-next-line no-shadow */
|
|
83
|
+
_frames.map(function (frame, index) {
|
|
84
|
+
// frames number check
|
|
85
|
+
if (Number.isNaN(frame)) {
|
|
86
|
+
console.warn("[Path] frames must be Array<number>. frame[".concat(index, "] = ").concat(frame));
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// points array check
|
|
91
|
+
if (!Array.isArray(points[index]) || points[index].length !== 3) {
|
|
92
|
+
console.warn("[Path] points must be Array<Array<number>> where each point has 3 number elements. points[".concat(index, "] = ").concat(points[index]));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// diff check
|
|
96
|
+
var prevPoint = _points.current[frame];
|
|
97
|
+
var newPoint = points[index];
|
|
98
|
+
if (!(0, _util.areArraysEqual)(prevPoint, newPoint)) {
|
|
99
|
+
_points.current[frame] = newPoint;
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
});
|
|
103
|
+
}, [points, frames, point, frame]);
|
|
104
|
+
var _pointRadius = useMemo(function updatePointRadius() {
|
|
105
|
+
return pointRadius || thickness;
|
|
106
|
+
}, [pointRadius, thickness]);
|
|
107
|
+
var _pointProps = useMemo(function updatePointProps() {
|
|
108
|
+
return pointProps != null ? pointProps : otherCleanedProps;
|
|
109
|
+
}, [pointProps, otherCleanedProps]);
|
|
110
|
+
var _lineProps = useMemo(function updateLineProps() {
|
|
111
|
+
return lineProps != null ? lineProps : otherCleanedProps;
|
|
112
|
+
}, [lineProps, otherCleanedProps]);
|
|
113
|
+
return /*#__PURE__*/React.createElement(_Group["default"], _extends({
|
|
114
|
+
color: color,
|
|
115
|
+
hoverColor: hoverColor
|
|
116
|
+
}, groupProps), _points.current.filter(function (p) {
|
|
117
|
+
return !!p;
|
|
118
|
+
})
|
|
119
|
+
/* eslint-disable-next-line no-shadow */.map(function (point, index) {
|
|
120
|
+
return /*#__PURE__*/ /* eslint-disable react/no-array-index-key */React.createElement(_primitives.Sphere, _extends({
|
|
121
|
+
key: "Sphere".concat(index),
|
|
122
|
+
track: false,
|
|
123
|
+
position: point,
|
|
124
|
+
radius: _pointRadius,
|
|
125
|
+
color: pointColor
|
|
126
|
+
}, _pointProps), enumerate && /*#__PURE__*/React.createElement(_primitives.Text, _extends({
|
|
127
|
+
text: "".concat(index),
|
|
128
|
+
align: "bottom",
|
|
129
|
+
position: [0, 1.2, 0],
|
|
130
|
+
color: "white"
|
|
131
|
+
}, textProps)))
|
|
132
|
+
/* eslint-enable react/no-array-index-key */;
|
|
133
|
+
}), _points.current.filter(function (p) {
|
|
134
|
+
return !!p;
|
|
135
|
+
})
|
|
136
|
+
/* eslint-disable-next-line no-shadow */.map(function (point, index, points) {
|
|
137
|
+
// No Cylinder for first point
|
|
138
|
+
if (points.length <= 1) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// No invalid points nor collapsed
|
|
143
|
+
var prevPoint = points[index - 1];
|
|
144
|
+
if (!Array.isArray(point) || point.length !== 3 || !Array.isArray(prevPoint) || prevPoint.length !== 3 || (0, _util.areArraysEqual)(point, prevPoint)) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
return /*#__PURE__*/ /* eslint-disable react/no-array-index-key */React.createElement(_primitives.Cylinder, _extends({
|
|
148
|
+
key: "Cylinder".concat(index),
|
|
149
|
+
track: false,
|
|
150
|
+
start: points[index - 1],
|
|
151
|
+
end: point,
|
|
152
|
+
radius: lineThickness || thickness,
|
|
153
|
+
color: lineColor
|
|
154
|
+
}, _lineProps))
|
|
155
|
+
/* eslint-enable react/no-array-index-key */;
|
|
156
|
+
}), children);
|
|
157
|
+
};
|
|
158
|
+
var PathMemo = memo(Path);
|
|
159
|
+
PathMemo.displayName = "Path";
|
|
160
|
+
var _default = exports["default"] = PathMemo;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as Axis } from "./Axis";
|
|
2
|
+
export { default as Arrow } from "./Arrow";
|
|
3
|
+
export { default as Camera } from "./Camera";
|
|
4
|
+
export { default as BoundingBox } from "./BoundingBox";
|
|
5
|
+
export { default as Capsule } from "./Capsule";
|
|
6
|
+
export { default as FBX } from "./FBX";
|
|
7
|
+
export { default as GLTF } from "./GLTF";
|
|
8
|
+
export { default as Group, generateGroupProps } from "./Group";
|
|
9
|
+
export { default as OBJ } from "./OBJ";
|
|
10
|
+
export { default as Path } from "./Path";
|
|
11
|
+
export { default as PCD } from "./PCD";
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "Arrow", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _Arrow["default"];
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "Axis", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _Axis["default"];
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "BoundingBox", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function get() {
|
|
22
|
+
return _BoundingBox["default"];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "Camera", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _Camera["default"];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "Capsule", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function get() {
|
|
34
|
+
return _Capsule["default"];
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "FBX", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function get() {
|
|
40
|
+
return _FBX["default"];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "GLTF", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function get() {
|
|
46
|
+
return _GLTF["default"];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "Group", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function get() {
|
|
52
|
+
return _Group["default"];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, "OBJ", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function get() {
|
|
58
|
+
return _OBJ["default"];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "PCD", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function get() {
|
|
64
|
+
return _PCD["default"];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(exports, "Path", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function get() {
|
|
70
|
+
return _Path["default"];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "generateGroupProps", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function get() {
|
|
76
|
+
return _Group.generateGroupProps;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
var _Axis = _interopRequireDefault(require("./Axis"));
|
|
80
|
+
var _Arrow = _interopRequireDefault(require("./Arrow"));
|
|
81
|
+
var _Camera = _interopRequireDefault(require("./Camera"));
|
|
82
|
+
var _BoundingBox = _interopRequireDefault(require("./BoundingBox"));
|
|
83
|
+
var _Capsule = _interopRequireDefault(require("./Capsule"));
|
|
84
|
+
var _FBX = _interopRequireDefault(require("./FBX"));
|
|
85
|
+
var _GLTF = _interopRequireDefault(require("./GLTF"));
|
|
86
|
+
var _Group = _interopRequireWildcard(require("./Group"));
|
|
87
|
+
var _OBJ = _interopRequireDefault(require("./OBJ"));
|
|
88
|
+
var _Path = _interopRequireDefault(require("./Path"));
|
|
89
|
+
var _PCD = _interopRequireDefault(require("./PCD"));
|
|
90
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
91
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { View3D } from "./views";
|
|
2
|
+
import { Mesh, Box, Plane, Circle, Triangle, Quad, Sphere, Cylinder, Line, Text, Label, Polygon } from "./primitives";
|
|
3
|
+
import { Arrow, Axis, BoundingBox, Camera, Capsule, FBX, GLTF, Group, OBJ, Path, PCD, generateGroupProps } from "./groups";
|
|
4
|
+
import { AmbientLight, DirectionalLight, PointLight, RectAreaLight, HemisphereLight, SpotLight } from "./lights";
|
|
5
|
+
import { FPS, useAnimationFrame, useFrame, useViewContext, billboard, Z_AXIS, Y_AXIS, X_AXIS, DEFAULT_UP_VEC3, DEFAULT_NORMAL_VEC3, DEFAULT_RIGHT_VEC3, DEFAULT_UP, DEFAULT_NORMAL, DEFAULT_RIGHT, SIDE_TYPES, CONTROLS_TYPES, CAMERA_TYPES } from "./utils";
|
|
6
|
+
export { View3D, Group, Arrow, Axis, Capsule, Cylinder, FBX, GLTF, OBJ, PCD, Mesh, Box, Camera, Circle, Path, Plane, Polygon, Quad, Sphere, Triangle, Line, BoundingBox, Label, Text, AmbientLight, DirectionalLight, HemisphereLight, PointLight, RectAreaLight, SpotLight, useAnimationFrame, useFrame, useViewContext, Z_AXIS, Y_AXIS, X_AXIS, DEFAULT_UP_VEC3, DEFAULT_NORMAL_VEC3, DEFAULT_RIGHT_VEC3, DEFAULT_UP, DEFAULT_NORMAL, DEFAULT_RIGHT, SIDE_TYPES, CONTROLS_TYPES, CAMERA_TYPES, FPS, generateGroupProps, billboard };
|