react-three-nurbs 0.1.0 → 0.2.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/dist/index.js +308 -306
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Vector3 as
|
|
1
|
+
import Ye, { useMemo as ge, useState as mr, useEffect as hr, isValidElement as Ee, Children as br } from "react";
|
|
2
|
+
import { Vector3 as yr, BufferGeometry as gr, Float32BufferAttribute as $e, MeshPhongMaterial as Er, DoubleSide as Le, Color as _r, Mesh as Rr } from "three";
|
|
3
3
|
import ue from "verb-nurbs";
|
|
4
4
|
import { Line as Sr } from "@react-three/drei";
|
|
5
5
|
import { useThree as Cr } from "@react-three/fiber";
|
|
6
|
-
var
|
|
6
|
+
var _e = { exports: {} }, ee = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
9
9
|
* react-jsx-runtime.production.min.js
|
|
@@ -13,19 +13,19 @@ var ge = { exports: {} }, ee = {};
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
16
|
+
var Me;
|
|
17
17
|
function Tr() {
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
var T =
|
|
21
|
-
function
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
for (
|
|
25
|
-
if (
|
|
26
|
-
return { $$typeof:
|
|
18
|
+
if (Me) return ee;
|
|
19
|
+
Me = 1;
|
|
20
|
+
var T = Ye, S = Symbol.for("react.element"), d = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, k = T.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, A = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
21
|
+
function E(P, s, _) {
|
|
22
|
+
var f, u = {}, R = null, F = null;
|
|
23
|
+
_ !== void 0 && (R = "" + _), s.key !== void 0 && (R = "" + s.key), s.ref !== void 0 && (F = s.ref);
|
|
24
|
+
for (f in s) h.call(s, f) && !A.hasOwnProperty(f) && (u[f] = s[f]);
|
|
25
|
+
if (P && P.defaultProps) for (f in s = P.defaultProps, s) u[f] === void 0 && (u[f] = s[f]);
|
|
26
|
+
return { $$typeof: S, type: P, key: R, ref: F, props: u, _owner: k.current };
|
|
27
27
|
}
|
|
28
|
-
return ee.Fragment =
|
|
28
|
+
return ee.Fragment = d, ee.jsx = E, ee.jsxs = E, ee;
|
|
29
29
|
}
|
|
30
30
|
var re = {};
|
|
31
31
|
/**
|
|
@@ -37,18 +37,18 @@ var re = {};
|
|
|
37
37
|
* This source code is licensed under the MIT license found in the
|
|
38
38
|
* LICENSE file in the root directory of this source tree.
|
|
39
39
|
*/
|
|
40
|
-
var
|
|
40
|
+
var Ne;
|
|
41
41
|
function wr() {
|
|
42
|
-
return
|
|
43
|
-
var T =
|
|
44
|
-
function
|
|
42
|
+
return Ne || (Ne = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
+
var T = Ye, S = Symbol.for("react.element"), d = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), k = Symbol.for("react.strict_mode"), A = Symbol.for("react.profiler"), E = Symbol.for("react.provider"), P = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), F = Symbol.for("react.offscreen"), C = Symbol.iterator, b = "@@iterator";
|
|
44
|
+
function g(e) {
|
|
45
45
|
if (e === null || typeof e != "object")
|
|
46
46
|
return null;
|
|
47
|
-
var r =
|
|
47
|
+
var r = C && e[C] || e[b];
|
|
48
48
|
return typeof r == "function" ? r : null;
|
|
49
49
|
}
|
|
50
|
-
var
|
|
51
|
-
function
|
|
50
|
+
var p = T.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
+
function c(e) {
|
|
52
52
|
{
|
|
53
53
|
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
54
54
|
t[n - 1] = arguments[n];
|
|
@@ -57,24 +57,24 @@ function wr() {
|
|
|
57
57
|
}
|
|
58
58
|
function W(e, r, t) {
|
|
59
59
|
{
|
|
60
|
-
var n =
|
|
60
|
+
var n = p.ReactDebugCurrentFrame, i = n.getStackAddendum();
|
|
61
61
|
i !== "" && (r += "%s", t = t.concat([i]));
|
|
62
|
-
var
|
|
62
|
+
var l = t.map(function(o) {
|
|
63
63
|
return String(o);
|
|
64
64
|
});
|
|
65
|
-
|
|
65
|
+
l.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, l);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
var H = !1, U = !1, ce = !1,
|
|
69
|
-
|
|
68
|
+
var H = !1, U = !1, ce = !1, le = !1, w = !1, v;
|
|
69
|
+
v = Symbol.for("react.module.reference");
|
|
70
70
|
function $(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === h || e === A || w || e === k || e === _ || e === f || le || e === F || H || U || ce || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === u || e.$$typeof === E || e.$$typeof === P || e.$$typeof === s || // This needs to include all possible module reference object
|
|
72
72
|
// types supported by any Flight configuration anywhere since
|
|
73
73
|
// we don't know which Flight build this will end up being used
|
|
74
74
|
// with.
|
|
75
|
-
e.$$typeof ===
|
|
75
|
+
e.$$typeof === v || e.getModuleId !== void 0));
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function M(e, r, t) {
|
|
78
78
|
var n = e.displayName;
|
|
79
79
|
if (n)
|
|
80
80
|
return n;
|
|
@@ -87,41 +87,41 @@ function wr() {
|
|
|
87
87
|
function j(e) {
|
|
88
88
|
if (e == null)
|
|
89
89
|
return null;
|
|
90
|
-
if (typeof e.tag == "number" &&
|
|
90
|
+
if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
91
|
return e.displayName || e.name || null;
|
|
92
92
|
if (typeof e == "string")
|
|
93
93
|
return e;
|
|
94
94
|
switch (e) {
|
|
95
|
-
case
|
|
95
|
+
case h:
|
|
96
96
|
return "Fragment";
|
|
97
|
-
case
|
|
97
|
+
case d:
|
|
98
98
|
return "Portal";
|
|
99
|
-
case
|
|
99
|
+
case A:
|
|
100
100
|
return "Profiler";
|
|
101
101
|
case k:
|
|
102
102
|
return "StrictMode";
|
|
103
|
-
case
|
|
103
|
+
case _:
|
|
104
104
|
return "Suspense";
|
|
105
|
-
case
|
|
105
|
+
case f:
|
|
106
106
|
return "SuspenseList";
|
|
107
107
|
}
|
|
108
108
|
if (typeof e == "object")
|
|
109
109
|
switch (e.$$typeof) {
|
|
110
|
-
case
|
|
110
|
+
case P:
|
|
111
111
|
var r = e;
|
|
112
112
|
return B(r) + ".Consumer";
|
|
113
|
-
case
|
|
113
|
+
case E:
|
|
114
114
|
var t = e;
|
|
115
115
|
return B(t._context) + ".Provider";
|
|
116
|
-
case
|
|
117
|
-
return
|
|
118
|
-
case
|
|
116
|
+
case s:
|
|
117
|
+
return M(e, e.render, "ForwardRef");
|
|
118
|
+
case u:
|
|
119
119
|
var n = e.displayName || null;
|
|
120
120
|
return n !== null ? n : j(e.type) || "Memo";
|
|
121
121
|
case R: {
|
|
122
|
-
var i = e,
|
|
122
|
+
var i = e, l = i._payload, o = i._init;
|
|
123
123
|
try {
|
|
124
|
-
return j(o(
|
|
124
|
+
return j(o(l));
|
|
125
125
|
} catch {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
@@ -129,11 +129,11 @@ function wr() {
|
|
|
129
129
|
}
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
132
|
+
var N = Object.assign, z = 0, Z, Y, L, I, te, ne, q;
|
|
133
133
|
function J() {
|
|
134
134
|
}
|
|
135
135
|
J.__reactDisabledLog = !0;
|
|
136
|
-
function
|
|
136
|
+
function Ke() {
|
|
137
137
|
{
|
|
138
138
|
if (z === 0) {
|
|
139
139
|
Z = console.log, Y = console.info, L = console.warn, I = console.error, te = console.group, ne = console.groupCollapsed, q = console.groupEnd;
|
|
@@ -156,7 +156,7 @@ function wr() {
|
|
|
156
156
|
z++;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Be() {
|
|
160
160
|
{
|
|
161
161
|
if (z--, z === 0) {
|
|
162
162
|
var e = {
|
|
@@ -165,33 +165,33 @@ function wr() {
|
|
|
165
165
|
writable: !0
|
|
166
166
|
};
|
|
167
167
|
Object.defineProperties(console, {
|
|
168
|
-
log:
|
|
168
|
+
log: N({}, e, {
|
|
169
169
|
value: Z
|
|
170
170
|
}),
|
|
171
|
-
info:
|
|
171
|
+
info: N({}, e, {
|
|
172
172
|
value: Y
|
|
173
173
|
}),
|
|
174
|
-
warn:
|
|
174
|
+
warn: N({}, e, {
|
|
175
175
|
value: L
|
|
176
176
|
}),
|
|
177
|
-
error:
|
|
177
|
+
error: N({}, e, {
|
|
178
178
|
value: I
|
|
179
179
|
}),
|
|
180
|
-
group:
|
|
180
|
+
group: N({}, e, {
|
|
181
181
|
value: te
|
|
182
182
|
}),
|
|
183
|
-
groupCollapsed:
|
|
183
|
+
groupCollapsed: N({}, e, {
|
|
184
184
|
value: ne
|
|
185
185
|
}),
|
|
186
|
-
groupEnd:
|
|
186
|
+
groupEnd: N({}, e, {
|
|
187
187
|
value: q
|
|
188
188
|
})
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
z < 0 &&
|
|
191
|
+
z < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
var
|
|
194
|
+
var fe = p.ReactCurrentDispatcher, ve;
|
|
195
195
|
function ae(e, r, t) {
|
|
196
196
|
{
|
|
197
197
|
if (ve === void 0)
|
|
@@ -207,10 +207,10 @@ function wr() {
|
|
|
207
207
|
}
|
|
208
208
|
var de = !1, oe;
|
|
209
209
|
{
|
|
210
|
-
var
|
|
211
|
-
oe = new
|
|
210
|
+
var qe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
+
oe = new qe();
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Re(e, r) {
|
|
214
214
|
if (!e || de)
|
|
215
215
|
return "";
|
|
216
216
|
{
|
|
@@ -222,8 +222,8 @@ function wr() {
|
|
|
222
222
|
de = !0;
|
|
223
223
|
var i = Error.prepareStackTrace;
|
|
224
224
|
Error.prepareStackTrace = void 0;
|
|
225
|
-
var
|
|
226
|
-
|
|
225
|
+
var l;
|
|
226
|
+
l = fe.current, fe.current = null, Ke();
|
|
227
227
|
try {
|
|
228
228
|
if (r) {
|
|
229
229
|
var o = function() {
|
|
@@ -236,55 +236,55 @@ function wr() {
|
|
|
236
236
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
237
|
try {
|
|
238
238
|
Reflect.construct(o, []);
|
|
239
|
-
} catch (
|
|
240
|
-
n =
|
|
239
|
+
} catch (x) {
|
|
240
|
+
n = x;
|
|
241
241
|
}
|
|
242
242
|
Reflect.construct(e, [], o);
|
|
243
243
|
} else {
|
|
244
244
|
try {
|
|
245
245
|
o.call();
|
|
246
|
-
} catch (
|
|
247
|
-
n =
|
|
246
|
+
} catch (x) {
|
|
247
|
+
n = x;
|
|
248
248
|
}
|
|
249
249
|
e.call(o.prototype);
|
|
250
250
|
}
|
|
251
251
|
} else {
|
|
252
252
|
try {
|
|
253
253
|
throw Error();
|
|
254
|
-
} catch (
|
|
255
|
-
n =
|
|
254
|
+
} catch (x) {
|
|
255
|
+
n = x;
|
|
256
256
|
}
|
|
257
257
|
e();
|
|
258
258
|
}
|
|
259
|
-
} catch (
|
|
260
|
-
if (
|
|
261
|
-
for (var a =
|
|
259
|
+
} catch (x) {
|
|
260
|
+
if (x && n && typeof x.stack == "string") {
|
|
261
|
+
for (var a = x.stack.split(`
|
|
262
262
|
`), O = n.stack.split(`
|
|
263
|
-
`),
|
|
264
|
-
|
|
265
|
-
for (;
|
|
266
|
-
if (a[
|
|
267
|
-
if (
|
|
263
|
+
`), m = a.length - 1, y = O.length - 1; m >= 1 && y >= 0 && a[m] !== O[y]; )
|
|
264
|
+
y--;
|
|
265
|
+
for (; m >= 1 && y >= 0; m--, y--)
|
|
266
|
+
if (a[m] !== O[y]) {
|
|
267
|
+
if (m !== 1 || y !== 1)
|
|
268
268
|
do
|
|
269
|
-
if (
|
|
270
|
-
var
|
|
271
|
-
` + a[
|
|
272
|
-
return e.displayName &&
|
|
269
|
+
if (m--, y--, y < 0 || a[m] !== O[y]) {
|
|
270
|
+
var D = `
|
|
271
|
+
` + a[m].replace(" at new ", " at ");
|
|
272
|
+
return e.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", e.displayName)), typeof e == "function" && oe.set(e, D), D;
|
|
273
273
|
}
|
|
274
|
-
while (
|
|
274
|
+
while (m >= 1 && y >= 0);
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
} finally {
|
|
279
|
-
de = !1,
|
|
279
|
+
de = !1, fe.current = l, Be(), Error.prepareStackTrace = i;
|
|
280
280
|
}
|
|
281
281
|
var X = e ? e.displayName || e.name : "", G = X ? ae(X) : "";
|
|
282
282
|
return typeof e == "function" && oe.set(e, G), G;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
284
|
+
function Ue(e, r, t) {
|
|
285
|
+
return Re(e, !1);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function ze(e) {
|
|
288
288
|
var r = e.prototype;
|
|
289
289
|
return !!(r && r.isReactComponent);
|
|
290
290
|
}
|
|
@@ -292,44 +292,44 @@ function wr() {
|
|
|
292
292
|
if (e == null)
|
|
293
293
|
return "";
|
|
294
294
|
if (typeof e == "function")
|
|
295
|
-
return
|
|
295
|
+
return Re(e, ze(e));
|
|
296
296
|
if (typeof e == "string")
|
|
297
297
|
return ae(e);
|
|
298
298
|
switch (e) {
|
|
299
|
-
case
|
|
299
|
+
case _:
|
|
300
300
|
return ae("Suspense");
|
|
301
|
-
case
|
|
301
|
+
case f:
|
|
302
302
|
return ae("SuspenseList");
|
|
303
303
|
}
|
|
304
304
|
if (typeof e == "object")
|
|
305
305
|
switch (e.$$typeof) {
|
|
306
|
-
case
|
|
307
|
-
return
|
|
308
|
-
case
|
|
306
|
+
case s:
|
|
307
|
+
return Ue(e.render);
|
|
308
|
+
case u:
|
|
309
309
|
return ie(e.type, r, t);
|
|
310
310
|
case R: {
|
|
311
|
-
var n = e, i = n._payload,
|
|
311
|
+
var n = e, i = n._payload, l = n._init;
|
|
312
312
|
try {
|
|
313
|
-
return ie(
|
|
313
|
+
return ie(l(i), r, t);
|
|
314
314
|
} catch {
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
return "";
|
|
319
319
|
}
|
|
320
|
-
var Q = Object.prototype.hasOwnProperty,
|
|
320
|
+
var Q = Object.prototype.hasOwnProperty, Se = {}, Ce = p.ReactDebugCurrentFrame;
|
|
321
321
|
function se(e) {
|
|
322
322
|
if (e) {
|
|
323
323
|
var r = e._owner, t = ie(e.type, e._source, r ? r.type : null);
|
|
324
|
-
|
|
324
|
+
Ce.setExtraStackFrame(t);
|
|
325
325
|
} else
|
|
326
|
-
|
|
326
|
+
Ce.setExtraStackFrame(null);
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function Ge(e, r, t, n, i) {
|
|
329
329
|
{
|
|
330
|
-
var
|
|
330
|
+
var l = Function.call.bind(Q);
|
|
331
331
|
for (var o in e)
|
|
332
|
-
if (
|
|
332
|
+
if (l(e, o)) {
|
|
333
333
|
var a = void 0;
|
|
334
334
|
try {
|
|
335
335
|
if (typeof e[o] != "function") {
|
|
@@ -337,44 +337,44 @@ function wr() {
|
|
|
337
337
|
throw O.name = "Invariant Violation", O;
|
|
338
338
|
}
|
|
339
339
|
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
-
} catch (
|
|
341
|
-
a =
|
|
340
|
+
} catch (m) {
|
|
341
|
+
a = m;
|
|
342
342
|
}
|
|
343
|
-
a && !(a instanceof Error) && (se(i),
|
|
343
|
+
a && !(a instanceof Error) && (se(i), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), se(null)), a instanceof Error && !(a.message in Se) && (Se[a.message] = !0, se(i), c("Failed %s type: %s", t, a.message), se(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
|
-
var
|
|
347
|
+
var Je = Array.isArray;
|
|
348
348
|
function pe(e) {
|
|
349
|
-
return
|
|
349
|
+
return Je(e);
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function Ve(e) {
|
|
352
352
|
{
|
|
353
353
|
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
354
354
|
return t;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function Xe(e) {
|
|
358
358
|
try {
|
|
359
|
-
return
|
|
359
|
+
return Te(e), !1;
|
|
360
360
|
} catch {
|
|
361
361
|
return !0;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function Te(e) {
|
|
365
365
|
return "" + e;
|
|
366
366
|
}
|
|
367
|
-
function
|
|
368
|
-
if (
|
|
369
|
-
return
|
|
367
|
+
function we(e) {
|
|
368
|
+
if (Xe(e))
|
|
369
|
+
return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ve(e)), Te(e);
|
|
370
370
|
}
|
|
371
|
-
var
|
|
371
|
+
var je = p.ReactCurrentOwner, He = {
|
|
372
372
|
key: !0,
|
|
373
373
|
ref: !0,
|
|
374
374
|
__self: !0,
|
|
375
375
|
__source: !0
|
|
376
|
-
},
|
|
377
|
-
function
|
|
376
|
+
}, Oe, Pe;
|
|
377
|
+
function Ze(e) {
|
|
378
378
|
if (Q.call(e, "ref")) {
|
|
379
379
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
380
380
|
if (r && r.isReactWarning)
|
|
@@ -382,7 +382,7 @@ function wr() {
|
|
|
382
382
|
}
|
|
383
383
|
return e.ref !== void 0;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function Qe(e) {
|
|
386
386
|
if (Q.call(e, "key")) {
|
|
387
387
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
388
388
|
if (r && r.isReactWarning)
|
|
@@ -390,13 +390,13 @@ function wr() {
|
|
|
390
390
|
}
|
|
391
391
|
return e.key !== void 0;
|
|
392
392
|
}
|
|
393
|
-
function Qe(e, r) {
|
|
394
|
-
typeof e.ref == "string" && Te.current;
|
|
395
|
-
}
|
|
396
393
|
function er(e, r) {
|
|
394
|
+
typeof e.ref == "string" && je.current;
|
|
395
|
+
}
|
|
396
|
+
function rr(e, r) {
|
|
397
397
|
{
|
|
398
398
|
var t = function() {
|
|
399
|
-
|
|
399
|
+
Oe || (Oe = !0, c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
400
400
|
};
|
|
401
401
|
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
402
402
|
get: t,
|
|
@@ -404,10 +404,10 @@ function wr() {
|
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function tr(e, r) {
|
|
408
408
|
{
|
|
409
409
|
var t = function() {
|
|
410
|
-
|
|
410
|
+
Pe || (Pe = !0, c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
411
411
|
};
|
|
412
412
|
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
413
413
|
get: t,
|
|
@@ -415,17 +415,17 @@ function wr() {
|
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
var
|
|
418
|
+
var nr = function(e, r, t, n, i, l, o) {
|
|
419
419
|
var a = {
|
|
420
420
|
// This tag allows us to uniquely identify this as a React Element
|
|
421
|
-
$$typeof:
|
|
421
|
+
$$typeof: S,
|
|
422
422
|
// Built-in properties that belong on the element
|
|
423
423
|
type: e,
|
|
424
424
|
key: r,
|
|
425
425
|
ref: t,
|
|
426
426
|
props: o,
|
|
427
427
|
// Record the component responsible for creating this element.
|
|
428
|
-
_owner:
|
|
428
|
+
_owner: l
|
|
429
429
|
};
|
|
430
430
|
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
431
431
|
configurable: !1,
|
|
@@ -444,38 +444,38 @@ function wr() {
|
|
|
444
444
|
value: i
|
|
445
445
|
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
446
446
|
};
|
|
447
|
-
function
|
|
447
|
+
function ar(e, r, t, n, i) {
|
|
448
448
|
{
|
|
449
|
-
var
|
|
450
|
-
t !== void 0 && (
|
|
451
|
-
for (
|
|
452
|
-
Q.call(r,
|
|
449
|
+
var l, o = {}, a = null, O = null;
|
|
450
|
+
t !== void 0 && (we(t), a = "" + t), Qe(r) && (we(r.key), a = "" + r.key), Ze(r) && (O = r.ref, er(r, i));
|
|
451
|
+
for (l in r)
|
|
452
|
+
Q.call(r, l) && !He.hasOwnProperty(l) && (o[l] = r[l]);
|
|
453
453
|
if (e && e.defaultProps) {
|
|
454
|
-
var
|
|
455
|
-
for (
|
|
456
|
-
o[
|
|
454
|
+
var m = e.defaultProps;
|
|
455
|
+
for (l in m)
|
|
456
|
+
o[l] === void 0 && (o[l] = m[l]);
|
|
457
457
|
}
|
|
458
458
|
if (a || O) {
|
|
459
|
-
var
|
|
460
|
-
a &&
|
|
459
|
+
var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
460
|
+
a && rr(o, y), O && tr(o, y);
|
|
461
461
|
}
|
|
462
|
-
return
|
|
462
|
+
return nr(e, a, O, i, n, je.current, o);
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
|
-
var me =
|
|
465
|
+
var me = p.ReactCurrentOwner, xe = p.ReactDebugCurrentFrame;
|
|
466
466
|
function V(e) {
|
|
467
467
|
if (e) {
|
|
468
468
|
var r = e._owner, t = ie(e.type, e._source, r ? r.type : null);
|
|
469
|
-
|
|
469
|
+
xe.setExtraStackFrame(t);
|
|
470
470
|
} else
|
|
471
|
-
|
|
471
|
+
xe.setExtraStackFrame(null);
|
|
472
472
|
}
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
function
|
|
476
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
473
|
+
var he;
|
|
474
|
+
he = !1;
|
|
475
|
+
function be(e) {
|
|
476
|
+
return typeof e == "object" && e !== null && e.$$typeof === S;
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function ke() {
|
|
479
479
|
{
|
|
480
480
|
if (me.current) {
|
|
481
481
|
var e = j(me.current.type);
|
|
@@ -487,13 +487,13 @@ Check the render method of \`` + e + "`.";
|
|
|
487
487
|
return "";
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function or(e) {
|
|
491
491
|
return "";
|
|
492
492
|
}
|
|
493
|
-
var
|
|
494
|
-
function
|
|
493
|
+
var Ae = {};
|
|
494
|
+
function ir(e) {
|
|
495
495
|
{
|
|
496
|
-
var r =
|
|
496
|
+
var r = ke();
|
|
497
497
|
if (!r) {
|
|
498
498
|
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
499
499
|
t && (r = `
|
|
@@ -503,39 +503,39 @@ Check the top-level render call using <` + t + ">.");
|
|
|
503
503
|
return r;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Fe(e, r) {
|
|
507
507
|
{
|
|
508
508
|
if (!e._store || e._store.validated || e.key != null)
|
|
509
509
|
return;
|
|
510
510
|
e._store.validated = !0;
|
|
511
|
-
var t =
|
|
512
|
-
if (
|
|
511
|
+
var t = ir(r);
|
|
512
|
+
if (Ae[t])
|
|
513
513
|
return;
|
|
514
|
-
|
|
514
|
+
Ae[t] = !0;
|
|
515
515
|
var n = "";
|
|
516
|
-
e && e._owner && e._owner !== me.current && (n = " It was passed a child from " + j(e._owner.type) + "."), V(e),
|
|
516
|
+
e && e._owner && e._owner !== me.current && (n = " It was passed a child from " + j(e._owner.type) + "."), V(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), V(null);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function De(e, r) {
|
|
520
520
|
{
|
|
521
521
|
if (typeof e != "object")
|
|
522
522
|
return;
|
|
523
523
|
if (pe(e))
|
|
524
524
|
for (var t = 0; t < e.length; t++) {
|
|
525
525
|
var n = e[t];
|
|
526
|
-
|
|
526
|
+
be(n) && Fe(n, r);
|
|
527
527
|
}
|
|
528
|
-
else if (
|
|
528
|
+
else if (be(e))
|
|
529
529
|
e._store && (e._store.validated = !0);
|
|
530
530
|
else if (e) {
|
|
531
|
-
var i =
|
|
531
|
+
var i = g(e);
|
|
532
532
|
if (typeof i == "function" && i !== e.entries)
|
|
533
|
-
for (var
|
|
534
|
-
|
|
533
|
+
for (var l = i.call(e), o; !(o = l.next()).done; )
|
|
534
|
+
be(o.value) && Fe(o.value, r);
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function sr(e) {
|
|
539
539
|
{
|
|
540
540
|
var r = e.type;
|
|
541
541
|
if (r == null || typeof r == "string")
|
|
@@ -543,252 +543,254 @@ Check the top-level render call using <` + t + ">.");
|
|
|
543
543
|
var t;
|
|
544
544
|
if (typeof r == "function")
|
|
545
545
|
t = r.propTypes;
|
|
546
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
546
|
+
else if (typeof r == "object" && (r.$$typeof === s || // Note: Memo only checks outer props here.
|
|
547
547
|
// Inner props are checked in the reconciler.
|
|
548
|
-
r.$$typeof ===
|
|
548
|
+
r.$$typeof === u))
|
|
549
549
|
t = r.propTypes;
|
|
550
550
|
else
|
|
551
551
|
return;
|
|
552
552
|
if (t) {
|
|
553
553
|
var n = j(r);
|
|
554
|
-
|
|
555
|
-
} else if (r.PropTypes !== void 0 && !
|
|
556
|
-
|
|
554
|
+
Ge(t, e.props, "prop", n, e);
|
|
555
|
+
} else if (r.PropTypes !== void 0 && !he) {
|
|
556
|
+
he = !0;
|
|
557
557
|
var i = j(r);
|
|
558
|
-
|
|
558
|
+
c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
|
|
559
559
|
}
|
|
560
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
560
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function ur(e) {
|
|
564
564
|
{
|
|
565
565
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
566
566
|
var n = r[t];
|
|
567
567
|
if (n !== "children" && n !== "key") {
|
|
568
|
-
V(e),
|
|
568
|
+
V(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), V(null);
|
|
569
569
|
break;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
e.ref !== null && (V(e),
|
|
572
|
+
e.ref !== null && (V(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
-
var
|
|
576
|
-
function
|
|
575
|
+
var Ie = {};
|
|
576
|
+
function We(e, r, t, n, i, l) {
|
|
577
577
|
{
|
|
578
578
|
var o = $(e);
|
|
579
579
|
if (!o) {
|
|
580
580
|
var a = "";
|
|
581
581
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
582
|
-
var O =
|
|
583
|
-
O ? a += O : a +=
|
|
584
|
-
var
|
|
585
|
-
e === null ?
|
|
582
|
+
var O = or();
|
|
583
|
+
O ? a += O : a += ke();
|
|
584
|
+
var m;
|
|
585
|
+
e === null ? m = "null" : pe(e) ? m = "array" : e !== void 0 && e.$$typeof === S ? (m = "<" + (j(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : m = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", m, a);
|
|
586
586
|
}
|
|
587
|
-
var
|
|
588
|
-
if (
|
|
589
|
-
return
|
|
587
|
+
var y = ar(e, r, t, i, l);
|
|
588
|
+
if (y == null)
|
|
589
|
+
return y;
|
|
590
590
|
if (o) {
|
|
591
|
-
var
|
|
592
|
-
if (
|
|
591
|
+
var D = r.children;
|
|
592
|
+
if (D !== void 0)
|
|
593
593
|
if (n)
|
|
594
|
-
if (pe(
|
|
595
|
-
for (var X = 0; X <
|
|
596
|
-
|
|
597
|
-
Object.freeze && Object.freeze(
|
|
594
|
+
if (pe(D)) {
|
|
595
|
+
for (var X = 0; X < D.length; X++)
|
|
596
|
+
De(D[X], e);
|
|
597
|
+
Object.freeze && Object.freeze(D);
|
|
598
598
|
} else
|
|
599
|
-
|
|
599
|
+
c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
600
600
|
else
|
|
601
|
-
|
|
601
|
+
De(D, e);
|
|
602
602
|
}
|
|
603
603
|
if (Q.call(r, "key")) {
|
|
604
|
-
var G = j(e),
|
|
605
|
-
return
|
|
606
|
-
}), ye =
|
|
607
|
-
if (!
|
|
608
|
-
var
|
|
609
|
-
|
|
604
|
+
var G = j(e), x = Object.keys(r).filter(function(pr) {
|
|
605
|
+
return pr !== "key";
|
|
606
|
+
}), ye = x.length > 0 ? "{key: someKey, " + x.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
607
|
+
if (!Ie[G + ye]) {
|
|
608
|
+
var dr = x.length > 0 ? "{" + x.join(": ..., ") + ": ...}" : "{}";
|
|
609
|
+
c(`A props object containing a "key" prop is being spread into JSX:
|
|
610
610
|
let props = %s;
|
|
611
611
|
<%s {...props} />
|
|
612
612
|
React keys must be passed directly to JSX without using spread:
|
|
613
613
|
let props = %s;
|
|
614
|
-
<%s key={someKey} {...props} />`, ye, G,
|
|
614
|
+
<%s key={someKey} {...props} />`, ye, G, dr, G), Ie[G + ye] = !0;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
return e ===
|
|
617
|
+
return e === h ? ur(y) : sr(y), y;
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
|
-
function ur(e, r, t) {
|
|
621
|
-
return De(e, r, t, !0);
|
|
622
|
-
}
|
|
623
620
|
function cr(e, r, t) {
|
|
624
|
-
return
|
|
621
|
+
return We(e, r, t, !0);
|
|
622
|
+
}
|
|
623
|
+
function lr(e, r, t) {
|
|
624
|
+
return We(e, r, t, !1);
|
|
625
625
|
}
|
|
626
|
-
var fr =
|
|
627
|
-
re.Fragment =
|
|
626
|
+
var fr = lr, vr = cr;
|
|
627
|
+
re.Fragment = h, re.jsx = fr, re.jsxs = vr;
|
|
628
628
|
}()), re;
|
|
629
629
|
}
|
|
630
|
-
process.env.NODE_ENV === "production" ?
|
|
631
|
-
var K =
|
|
630
|
+
process.env.NODE_ENV === "production" ? _e.exports = Tr() : _e.exports = wr();
|
|
631
|
+
var K = _e.exports;
|
|
632
632
|
const jr = ({
|
|
633
633
|
points: T,
|
|
634
|
-
degree:
|
|
635
|
-
weights:
|
|
636
|
-
knots:
|
|
637
|
-
|
|
638
|
-
color:
|
|
639
|
-
segments:
|
|
640
|
-
dashed:
|
|
641
|
-
vertexColors:
|
|
642
|
-
...
|
|
634
|
+
degree: S = 3,
|
|
635
|
+
weights: d,
|
|
636
|
+
knots: h,
|
|
637
|
+
resolution: k = 50,
|
|
638
|
+
color: A = "black",
|
|
639
|
+
segments: E,
|
|
640
|
+
dashed: P = !1,
|
|
641
|
+
vertexColors: s,
|
|
642
|
+
..._
|
|
643
643
|
}) => {
|
|
644
|
-
const
|
|
645
|
-
if (!
|
|
644
|
+
const f = ge(() => {
|
|
645
|
+
if (!h)
|
|
646
646
|
return console.error("NurbsCurve requires knots to be provided"), [];
|
|
647
647
|
try {
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
|
|
648
|
+
const u = Array(T.length).fill(1), R = ue.geom.NurbsCurve.byKnotsControlPointsWeights(
|
|
649
|
+
S,
|
|
650
|
+
h,
|
|
651
651
|
T,
|
|
652
|
-
|
|
653
|
-
);
|
|
654
|
-
return Array.from({ length:
|
|
655
|
-
const
|
|
656
|
-
return new
|
|
652
|
+
d ?? u
|
|
653
|
+
), F = k;
|
|
654
|
+
return Array.from({ length: F + 1 }, (C, b) => {
|
|
655
|
+
const g = b / F, p = R.point(g);
|
|
656
|
+
return new yr(p[0], p[1], p[2]);
|
|
657
657
|
});
|
|
658
|
-
} catch (
|
|
659
|
-
return console.error("Error creating NURBS curve:",
|
|
658
|
+
} catch (u) {
|
|
659
|
+
return console.error("Error creating NURBS curve:", u), [];
|
|
660
660
|
}
|
|
661
|
-
}, [T,
|
|
662
|
-
return
|
|
661
|
+
}, [T, S, d, h, k]);
|
|
662
|
+
return f.length === 0 ? null : /* @__PURE__ */ K.jsx(
|
|
663
663
|
Sr,
|
|
664
664
|
{
|
|
665
|
-
points:
|
|
666
|
-
color:
|
|
667
|
-
segments:
|
|
668
|
-
dashed:
|
|
669
|
-
vertexColors:
|
|
670
|
-
...
|
|
665
|
+
points: f,
|
|
666
|
+
color: A,
|
|
667
|
+
segments: E,
|
|
668
|
+
dashed: P,
|
|
669
|
+
vertexColors: s,
|
|
670
|
+
..._
|
|
671
671
|
}
|
|
672
672
|
);
|
|
673
673
|
};
|
|
674
674
|
function Fr({
|
|
675
675
|
controlPoints: T,
|
|
676
|
-
weights:
|
|
677
|
-
degreeU:
|
|
678
|
-
degreeV:
|
|
676
|
+
weights: S,
|
|
677
|
+
degreeU: d,
|
|
678
|
+
degreeV: h,
|
|
679
679
|
color: k = "#ffffff",
|
|
680
|
-
wireframe:
|
|
681
|
-
children:
|
|
682
|
-
...
|
|
680
|
+
wireframe: A = !1,
|
|
681
|
+
children: E,
|
|
682
|
+
...P
|
|
683
683
|
}) {
|
|
684
|
-
const { scene:
|
|
685
|
-
return
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
684
|
+
const { scene: s } = Cr(), [_, f] = mr(null);
|
|
685
|
+
return hr(() => {
|
|
686
|
+
const u = T.length + d + 1, R = T[0].length + h + 1, F = Array(u).fill(0).map((w, v) => v < d + 1 ? 0 : v >= u - d - 1 ? 1 : (v - d) / (u - 2 * d - 1)), C = Array(R).fill(0).map((w, v) => v < h + 1 ? 0 : v >= R - h - 1 ? 1 : (v - h) / (R - 2 * h - 1)), b = ue.geom.NurbsSurface.byKnotsControlPointsWeights(
|
|
687
|
+
d,
|
|
688
|
+
h,
|
|
689
|
+
F,
|
|
690
|
+
C,
|
|
691
691
|
T,
|
|
692
|
-
|
|
693
|
-
),
|
|
692
|
+
S
|
|
693
|
+
), g = new gr(), p = [], c = [], W = [], H = 20, U = 20, ce = 1 / H, le = 1 / U;
|
|
694
694
|
for (let w = 0; w <= H; w++)
|
|
695
|
-
for (let
|
|
696
|
-
const $ = w * ce,
|
|
695
|
+
for (let v = 0; v <= U; v++) {
|
|
696
|
+
const $ = w * ce, M = v * le, B = b.point($, M), j = 1e-4, N = b.point($ + j, M), z = b.point($, M + j), Z = b.point($, M), Y = N.map((q, J) => (q - Z[J]) / j), L = z.map((q, J) => (q - Z[J]) / j), I = [
|
|
697
697
|
Y[1] * L[2] - Y[2] * L[1],
|
|
698
698
|
Y[2] * L[0] - Y[0] * L[2],
|
|
699
699
|
Y[0] * L[1] - Y[1] * L[0]
|
|
700
700
|
], te = Math.sqrt(
|
|
701
701
|
I[0] * I[0] + I[1] * I[1] + I[2] * I[2]
|
|
702
702
|
), ne = I.map((q) => q / te);
|
|
703
|
-
|
|
703
|
+
p.push(...B), c.push(...ne);
|
|
704
704
|
}
|
|
705
705
|
for (let w = 0; w < H; w++)
|
|
706
|
-
for (let
|
|
707
|
-
const $ = w * (U + 1) +
|
|
708
|
-
W.push($,
|
|
706
|
+
for (let v = 0; v < U; v++) {
|
|
707
|
+
const $ = w * (U + 1) + v, M = $ + 1, B = (w + 1) * (U + 1) + v, j = B + 1;
|
|
708
|
+
W.push($, M, B), W.push(M, j, B);
|
|
709
709
|
}
|
|
710
|
-
if (
|
|
711
|
-
const w = new
|
|
710
|
+
if (g.setAttribute("position", new $e(p, 3)), g.setAttribute("normal", new $e(c, 3)), g.setIndex(W), f(g), !E) {
|
|
711
|
+
const w = new Er({
|
|
712
712
|
color: new _r(k),
|
|
713
|
-
side:
|
|
714
|
-
wireframe:
|
|
715
|
-
}),
|
|
716
|
-
return
|
|
717
|
-
|
|
713
|
+
side: Le,
|
|
714
|
+
wireframe: A
|
|
715
|
+
}), v = new Rr(g, w);
|
|
716
|
+
return s.add(v), () => {
|
|
717
|
+
s.remove(v), g.dispose(), w.dispose();
|
|
718
718
|
};
|
|
719
719
|
}
|
|
720
720
|
return () => {
|
|
721
|
-
|
|
721
|
+
g.dispose();
|
|
722
722
|
};
|
|
723
723
|
}, [
|
|
724
724
|
T,
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
725
|
+
S,
|
|
726
|
+
d,
|
|
727
|
+
h,
|
|
728
728
|
k,
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
]),
|
|
733
|
-
/* @__PURE__ */ K.jsx("primitive", { object:
|
|
734
|
-
|
|
729
|
+
A,
|
|
730
|
+
s,
|
|
731
|
+
E
|
|
732
|
+
]), _ && E ? !Ee(E) || !E.type.toString().includes("Material") ? (console.warn("NurbsSurface children must be a material component"), null) : /* @__PURE__ */ K.jsxs("mesh", { ...P, children: [
|
|
733
|
+
/* @__PURE__ */ K.jsx("primitive", { object: _, attach: "geometry" }),
|
|
734
|
+
E
|
|
735
735
|
] }) : null;
|
|
736
736
|
}
|
|
737
737
|
const Dr = ({
|
|
738
738
|
degreeV: T = 3,
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
children: _
|
|
739
|
+
resolutionU: S = 20,
|
|
740
|
+
resolutionV: d = 20,
|
|
741
|
+
color: h = "#ff0000",
|
|
742
|
+
wireframe: k = !1,
|
|
743
|
+
children: A
|
|
745
744
|
}) => {
|
|
746
|
-
const
|
|
747
|
-
const
|
|
748
|
-
|
|
749
|
-
)
|
|
750
|
-
|
|
745
|
+
const { curveChildren: E, materialChild: P } = ge(() => {
|
|
746
|
+
const _ = [];
|
|
747
|
+
let f = null;
|
|
748
|
+
return br.forEach(A, (u) => {
|
|
749
|
+
Ee(u) && u.type === jr ? _.push(u) : Ee(u) && u.type && u.type.prototype && "isMaterial" in u.type.prototype && (f = u);
|
|
750
|
+
}), { curveChildren: _, materialChild: f };
|
|
751
|
+
}, [A]), s = ge(() => {
|
|
752
|
+
if (E.length < 2)
|
|
751
753
|
return console.error("LoftedSurface requires at least 2 NurbsCurve children"), null;
|
|
752
754
|
try {
|
|
753
|
-
const
|
|
754
|
-
const { points: b, degree:
|
|
755
|
+
const _ = E.map((C) => {
|
|
756
|
+
const { points: b, degree: g = 3, weights: p, knots: c } = C.props, W = Array(b.length).fill(1);
|
|
755
757
|
return ue.geom.NurbsCurve.byKnotsControlPointsWeights(
|
|
756
|
-
|
|
757
|
-
|
|
758
|
+
g,
|
|
759
|
+
c,
|
|
758
760
|
b,
|
|
759
|
-
|
|
761
|
+
p ?? W
|
|
760
762
|
);
|
|
761
|
-
}),
|
|
762
|
-
|
|
763
|
+
}), f = ue.geom.NurbsSurface.byLoftingCurves(
|
|
764
|
+
_,
|
|
763
765
|
T
|
|
764
|
-
),
|
|
765
|
-
for (let
|
|
766
|
-
for (let b = 0; b <=
|
|
767
|
-
const
|
|
768
|
-
|
|
766
|
+
), u = [], R = [], F = [];
|
|
767
|
+
for (let C = 0; C <= S; C++)
|
|
768
|
+
for (let b = 0; b <= d; b++) {
|
|
769
|
+
const g = C / S, p = b / d, c = f.point(g, p);
|
|
770
|
+
u.push(c[0], c[1], c[2]), F.push(g, p);
|
|
769
771
|
}
|
|
770
|
-
for (let
|
|
771
|
-
for (let b = 0; b <
|
|
772
|
-
const
|
|
773
|
-
R.push(
|
|
772
|
+
for (let C = 0; C < S; C++)
|
|
773
|
+
for (let b = 0; b < d; b++) {
|
|
774
|
+
const g = C * (d + 1) + b, p = g + 1, c = (C + 1) * (d + 1) + b, W = c + 1;
|
|
775
|
+
R.push(g, p, c), R.push(p, W, c);
|
|
774
776
|
}
|
|
775
777
|
return {
|
|
776
|
-
vertices:
|
|
778
|
+
vertices: u,
|
|
777
779
|
indices: R,
|
|
778
|
-
uvs:
|
|
780
|
+
uvs: F
|
|
779
781
|
};
|
|
780
|
-
} catch (
|
|
781
|
-
return console.error("Error creating lofted surface:",
|
|
782
|
+
} catch (_) {
|
|
783
|
+
return console.error("Error creating lofted surface:", _), null;
|
|
782
784
|
}
|
|
783
|
-
}, [
|
|
784
|
-
return
|
|
785
|
+
}, [E, T, S, d]);
|
|
786
|
+
return s ? /* @__PURE__ */ K.jsxs("mesh", { children: [
|
|
785
787
|
/* @__PURE__ */ K.jsxs("bufferGeometry", { children: [
|
|
786
788
|
/* @__PURE__ */ K.jsx(
|
|
787
789
|
"bufferAttribute",
|
|
788
790
|
{
|
|
789
791
|
attach: "attributes-position",
|
|
790
|
-
count:
|
|
791
|
-
array: new Float32Array(
|
|
792
|
+
count: s.vertices.length / 3,
|
|
793
|
+
array: new Float32Array(s.vertices),
|
|
792
794
|
itemSize: 3
|
|
793
795
|
}
|
|
794
796
|
),
|
|
@@ -796,8 +798,8 @@ const Dr = ({
|
|
|
796
798
|
"bufferAttribute",
|
|
797
799
|
{
|
|
798
800
|
attach: "attributes-uv",
|
|
799
|
-
count:
|
|
800
|
-
array: new Float32Array(
|
|
801
|
+
count: s.uvs.length / 2,
|
|
802
|
+
array: new Float32Array(s.uvs),
|
|
801
803
|
itemSize: 2
|
|
802
804
|
}
|
|
803
805
|
),
|
|
@@ -805,13 +807,13 @@ const Dr = ({
|
|
|
805
807
|
"bufferAttribute",
|
|
806
808
|
{
|
|
807
809
|
attach: "index",
|
|
808
|
-
count:
|
|
809
|
-
array: new Uint32Array(
|
|
810
|
+
count: s.indices.length,
|
|
811
|
+
array: new Uint32Array(s.indices),
|
|
810
812
|
itemSize: 1
|
|
811
813
|
}
|
|
812
814
|
)
|
|
813
815
|
] }),
|
|
814
|
-
/* @__PURE__ */ K.jsx("meshStandardMaterial", { color:
|
|
816
|
+
P || /* @__PURE__ */ K.jsx("meshStandardMaterial", { color: h, wireframe: k, side: Le })
|
|
815
817
|
] }) : null;
|
|
816
818
|
};
|
|
817
819
|
export {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-three-nurbs",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@react-three/drei": "^9.99.0",
|
|
52
52
|
"@react-three/fiber": "^8.15.16",
|
|
53
|
+
"earcut": "^3.0.1",
|
|
53
54
|
"react": "^18.2.0",
|
|
54
55
|
"react-dom": "^18.2.0",
|
|
55
56
|
"three": "^0.161.0",
|
|
56
|
-
"verb": "^0.8.10",
|
|
57
57
|
"verb-nurbs": "^3.0.3"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|