poly-extrude 0.13.0 → 0.14.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 (68) hide show
  1. package/dist/cylinder.d.ts +11 -0
  2. package/{src → dist}/cylinder.js +108 -111
  3. package/dist/cylinder.js.map +1 -0
  4. package/dist/index.d.ts +7 -0
  5. package/dist/index.js +8 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/math/Curve.d.ts +41 -0
  8. package/dist/math/Curve.js +142 -0
  9. package/dist/math/Curve.js.map +1 -0
  10. package/dist/math/Interpolations.d.ts +8 -0
  11. package/dist/math/Interpolations.js +48 -0
  12. package/dist/math/Interpolations.js.map +1 -0
  13. package/dist/math/Matrix4.d.ts +8 -0
  14. package/dist/math/Matrix4.js +582 -0
  15. package/dist/math/Matrix4.js.map +1 -0
  16. package/dist/math/QuadraticBezierCurve3.d.ts +10 -0
  17. package/dist/math/QuadraticBezierCurve3.js +22 -0
  18. package/dist/math/QuadraticBezierCurve3.js.map +1 -0
  19. package/dist/math/Quaternion.d.ts +46 -0
  20. package/dist/math/Quaternion.js +415 -0
  21. package/dist/math/Quaternion.js.map +1 -0
  22. package/dist/math/Vector3.d.ts +42 -0
  23. package/dist/math/Vector3.js +403 -0
  24. package/dist/math/Vector3.js.map +1 -0
  25. package/dist/path/PathPoint.d.ts +15 -0
  26. package/dist/path/PathPoint.js +35 -0
  27. package/dist/path/PathPoint.js.map +1 -0
  28. package/dist/path/PathPointList.d.ts +27 -0
  29. package/dist/path/PathPointList.js +212 -0
  30. package/dist/path/PathPointList.js.map +1 -0
  31. package/dist/path.d.ts +11 -0
  32. package/{src → dist}/path.js +334 -360
  33. package/dist/path.js.map +1 -0
  34. package/dist/plane.d.ts +2 -0
  35. package/{src → dist}/plane.js +57 -58
  36. package/dist/plane.js.map +1 -0
  37. package/dist/poly-extrude.js +1286 -1581
  38. package/dist/poly-extrude.js.map +1 -1
  39. package/dist/poly-extrude.min.js +2 -2
  40. package/dist/poly-extrude.mjs +1286 -1581
  41. package/dist/poly-extrude.mjs.map +1 -0
  42. package/dist/polygon.d.ts +9 -0
  43. package/{src → dist}/polygon.js +163 -179
  44. package/dist/polygon.js.map +1 -0
  45. package/dist/polyline.d.ts +24 -0
  46. package/{src → dist}/polyline.js +420 -456
  47. package/dist/polyline.js.map +1 -0
  48. package/dist/tube.d.ts +12 -0
  49. package/{src → dist}/tube.js +124 -142
  50. package/dist/tube.js.map +1 -0
  51. package/dist/type.d.ts +9 -0
  52. package/dist/type.js +2 -0
  53. package/dist/type.js.map +1 -0
  54. package/dist/util.d.ts +20 -0
  55. package/dist/util.js +217 -0
  56. package/dist/util.js.map +1 -0
  57. package/package.json +53 -48
  58. package/readme.md +12 -2
  59. package/src/cylinder.ts +124 -0
  60. package/src/index.ts +7 -0
  61. package/src/path.ts +385 -0
  62. package/src/plane.ts +60 -0
  63. package/src/polygon.ts +189 -0
  64. package/src/polyline.ts +473 -0
  65. package/src/tube.ts +155 -0
  66. package/src/type.ts +9 -0
  67. package/src/{util.js → util.ts} +1 -1
  68. package/index.js +0 -7
@@ -0,0 +1,11 @@
1
+ import { ResultType } from './type';
2
+ type CylinderOptions = {
3
+ radius?: number;
4
+ height?: number;
5
+ radialSegments?: number;
6
+ };
7
+ type CylinderResult = ResultType & {
8
+ points: Float32Array;
9
+ };
10
+ export declare function cylinder(point: [number, number], options?: CylinderOptions): CylinderResult;
11
+ export {};
@@ -1,111 +1,108 @@
1
- import { generateNormal } from './util';
2
-
3
- export function cylinder(point, options = {}) {
4
- options = Object.assign({}, { radius: 1, height: 2, radialSegments: 6 }, options);
5
- const radialSegments = Math.round(Math.max(4, options.radialSegments));
6
- const { radius, height } = options;
7
- const aRad = 360 / radialSegments / 360 * Math.PI * 2;
8
- const circlePointsLen = (radialSegments + 1);
9
- const points = new Float32Array(circlePointsLen * 3 * 2);
10
- const [centerx, centery] = point;
11
- let idx = 0, uIdx = 0;
12
- const offset = circlePointsLen * 3, uOffset = circlePointsLen * 2;
13
- const indices = [], uv = [];
14
- let iIndex = indices.length - 1;
15
- for (let i = -1; i < radialSegments; i++) {
16
- const rad = aRad * i;
17
- const x = Math.cos(rad) * radius + centerx, y = Math.sin(rad) * radius + centery;
18
- // bottom vertices
19
- points[idx] = x;
20
- points[idx + 1] = y;
21
- points[idx + 2] = 0;
22
-
23
- // top vertices
24
- points[idx + offset] = x;
25
- points[idx + 1 + offset] = y;
26
- points[idx + 2 + offset] = height;
27
-
28
- let u = 0, v = 0;
29
- u = 0.5 + x / radius / 2;
30
- v = 0.5 + y / radius / 2;
31
- uv[uIdx] = u;
32
- uv[uIdx + 1] = v;
33
- uv[uIdx + uOffset] = u;
34
- uv[uIdx + 1 + uOffset] = v;
35
-
36
- idx += 3;
37
- uIdx += 2;
38
- if (i > 1) {
39
- // bottom indices
40
- // indices.push(0, i - 1, i);
41
- indices[++iIndex] = 0;
42
- indices[++iIndex] = i - 1;
43
- indices[++iIndex] = i;
44
- }
45
- }
46
- idx -= 3;
47
- points[idx] = points[0];
48
- points[idx + 1] = points[1];
49
- points[idx + 2] = points[2];
50
- const pointsLen = points.length;
51
- points[pointsLen - 3] = points[0];
52
- points[pointsLen - 2] = points[1];
53
- points[pointsLen - 1] = height;
54
-
55
- const indicesLen = indices.length;
56
- // top indices
57
- iIndex = indices.length - 1;
58
- for (let i = 0; i < indicesLen; i++) {
59
- const index = indices[i];
60
- indices[++iIndex] = index + circlePointsLen;
61
- // indices.push(index + circlePointsLen);
62
- }
63
-
64
- const sidePoints = new Float32Array((circlePointsLen * 3 * 2 - 6) * 2);
65
- let pIndex = -1;
66
- idx = circlePointsLen * 2;
67
- uIdx = 0;
68
- iIndex = indices.length - 1;
69
- let uvIndex = uv.length - 1;
70
- for (let i = 0, len = points.length / 2; i < len - 3; i += 3) {
71
- const x1 = points[i], y1 = points[i + 1], x2 = points[i + 3], y2 = points[i + 4];
72
- sidePoints[++pIndex] = x1;
73
- sidePoints[++pIndex] = y1;
74
- sidePoints[++pIndex] = height;
75
- sidePoints[++pIndex] = x2;
76
- sidePoints[++pIndex] = y2;
77
- sidePoints[++pIndex] = height;
78
- sidePoints[++pIndex] = x1;
79
- sidePoints[++pIndex] = y1;
80
- sidePoints[++pIndex] = 0;
81
- sidePoints[++pIndex] = x2;
82
- sidePoints[++pIndex] = y2;
83
- sidePoints[++pIndex] = 0;
84
- const a = idx + 2, b = idx + 3, c = idx, d = idx + 1;
85
- // indices.push(a, c, b, c, d, b);
86
- indices[++iIndex] = c;
87
- indices[++iIndex] = a;
88
- indices[++iIndex] = d;
89
- indices[++iIndex] = a;
90
- indices[++iIndex] = b;
91
- indices[++iIndex] = d;
92
- // indices.push(c, a, d, a, b, d);
93
- idx += 4;
94
- const u1 = uIdx / circlePointsLen, u2 = (uIdx + 1) / circlePointsLen;
95
- uv[++uvIndex] = u1;
96
- uv[++uvIndex] = height / radius / 2;
97
- uv[++uvIndex] = u2;
98
- uv[++uvIndex] = height / radius / 2;
99
- uv[++uvIndex] = u1;
100
- uv[++uvIndex] = 0;
101
- uv[++uvIndex] = u2;
102
- uv[++uvIndex] = 0;
103
- // uvs.push(u1, height / radius / 2, u2, height / radius / 2, u1, 0, u2, 0);
104
- uIdx++;
105
- }
106
- const position = new Float32Array(points.length + sidePoints.length);
107
- position.set(points, 0);
108
- position.set(sidePoints, points.length);
109
- const normal = generateNormal(indices, position);
110
- return { points, indices: new Uint32Array(indices), position, normal, uv: new Float32Array(uv) };
111
- }
1
+ import { generateNormal } from './util';
2
+ export function cylinder(point, options) {
3
+ options = Object.assign({}, { radius: 1, height: 2, radialSegments: 6 }, options);
4
+ const radialSegments = Math.round(Math.max(4, options.radialSegments));
5
+ let { radius, height } = options;
6
+ radius = radius;
7
+ height = height;
8
+ const aRad = 360 / radialSegments / 360 * Math.PI * 2;
9
+ const circlePointsLen = (radialSegments + 1);
10
+ const points = new Float32Array(circlePointsLen * 3 * 2);
11
+ const [centerx, centery] = point;
12
+ let idx = 0, uIdx = 0;
13
+ const offset = circlePointsLen * 3, uOffset = circlePointsLen * 2;
14
+ const indices = [], uv = [];
15
+ let iIndex = indices.length - 1;
16
+ for (let i = -1; i < radialSegments; i++) {
17
+ const rad = aRad * i;
18
+ const x = Math.cos(rad) * radius + centerx, y = Math.sin(rad) * radius + centery;
19
+ // bottom vertices
20
+ points[idx] = x;
21
+ points[idx + 1] = y;
22
+ points[idx + 2] = 0;
23
+ // top vertices
24
+ points[idx + offset] = x;
25
+ points[idx + 1 + offset] = y;
26
+ points[idx + 2 + offset] = height;
27
+ let u = 0, v = 0;
28
+ u = 0.5 + x / radius / 2;
29
+ v = 0.5 + y / radius / 2;
30
+ uv[uIdx] = u;
31
+ uv[uIdx + 1] = v;
32
+ uv[uIdx + uOffset] = u;
33
+ uv[uIdx + 1 + uOffset] = v;
34
+ idx += 3;
35
+ uIdx += 2;
36
+ if (i > 1) {
37
+ // bottom indices
38
+ // indices.push(0, i - 1, i);
39
+ indices[++iIndex] = 0;
40
+ indices[++iIndex] = i - 1;
41
+ indices[++iIndex] = i;
42
+ }
43
+ }
44
+ idx -= 3;
45
+ points[idx] = points[0];
46
+ points[idx + 1] = points[1];
47
+ points[idx + 2] = points[2];
48
+ const pointsLen = points.length;
49
+ points[pointsLen - 3] = points[0];
50
+ points[pointsLen - 2] = points[1];
51
+ points[pointsLen - 1] = height;
52
+ const indicesLen = indices.length;
53
+ // top indices
54
+ iIndex = indices.length - 1;
55
+ for (let i = 0; i < indicesLen; i++) {
56
+ const index = indices[i];
57
+ indices[++iIndex] = index + circlePointsLen;
58
+ // indices.push(index + circlePointsLen);
59
+ }
60
+ const sidePoints = new Float32Array((circlePointsLen * 3 * 2 - 6) * 2);
61
+ let pIndex = -1;
62
+ idx = circlePointsLen * 2;
63
+ uIdx = 0;
64
+ iIndex = indices.length - 1;
65
+ let uvIndex = uv.length - 1;
66
+ for (let i = 0, len = points.length / 2; i < len - 3; i += 3) {
67
+ const x1 = points[i], y1 = points[i + 1], x2 = points[i + 3], y2 = points[i + 4];
68
+ sidePoints[++pIndex] = x1;
69
+ sidePoints[++pIndex] = y1;
70
+ sidePoints[++pIndex] = height;
71
+ sidePoints[++pIndex] = x2;
72
+ sidePoints[++pIndex] = y2;
73
+ sidePoints[++pIndex] = height;
74
+ sidePoints[++pIndex] = x1;
75
+ sidePoints[++pIndex] = y1;
76
+ sidePoints[++pIndex] = 0;
77
+ sidePoints[++pIndex] = x2;
78
+ sidePoints[++pIndex] = y2;
79
+ sidePoints[++pIndex] = 0;
80
+ const a = idx + 2, b = idx + 3, c = idx, d = idx + 1;
81
+ // indices.push(a, c, b, c, d, b);
82
+ indices[++iIndex] = c;
83
+ indices[++iIndex] = a;
84
+ indices[++iIndex] = d;
85
+ indices[++iIndex] = a;
86
+ indices[++iIndex] = b;
87
+ indices[++iIndex] = d;
88
+ // indices.push(c, a, d, a, b, d);
89
+ idx += 4;
90
+ const u1 = uIdx / circlePointsLen, u2 = (uIdx + 1) / circlePointsLen;
91
+ uv[++uvIndex] = u1;
92
+ uv[++uvIndex] = height / radius / 2;
93
+ uv[++uvIndex] = u2;
94
+ uv[++uvIndex] = height / radius / 2;
95
+ uv[++uvIndex] = u1;
96
+ uv[++uvIndex] = 0;
97
+ uv[++uvIndex] = u2;
98
+ uv[++uvIndex] = 0;
99
+ // uvs.push(u1, height / radius / 2, u2, height / radius / 2, u1, 0, u2, 0);
100
+ uIdx++;
101
+ }
102
+ const position = new Float32Array(points.length + sidePoints.length);
103
+ position.set(points, 0);
104
+ position.set(sidePoints, points.length);
105
+ const normal = generateNormal(indices, position);
106
+ return { points, indices: new Uint32Array(indices), position, normal, uv: new Float32Array(uv) };
107
+ }
108
+ //# sourceMappingURL=cylinder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cylinder.js","sourceRoot":"","sources":["../src/cylinder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAYxC,MAAM,UAAU,QAAQ,CAAC,KAAuB,EAAE,OAA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CAAC,CAAC;IACjD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;AACrG,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { extrudePolygons } from './polygon';
2
+ import { extrudePolylines, expandLine, leftOnLine, extrudeSlopes } from './polyline';
3
+ import { cylinder } from './cylinder';
4
+ import { expandPaths } from './path';
5
+ import { expandTubes } from './tube';
6
+ import { plane } from './plane';
7
+ export { extrudePolygons, extrudePolylines, extrudeSlopes, expandLine, leftOnLine, cylinder, expandPaths, expandTubes, plane };
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ import { extrudePolygons } from './polygon';
2
+ import { extrudePolylines, expandLine, leftOnLine, extrudeSlopes } from './polyline';
3
+ import { cylinder } from './cylinder';
4
+ import { expandPaths } from './path';
5
+ import { expandTubes } from './tube';
6
+ import { plane } from './plane';
7
+ export { extrudePolygons, extrudePolylines, extrudeSlopes, expandLine, leftOnLine, cylinder, expandPaths, expandTubes, plane };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Extensible curve object.
3
+ *
4
+ * Some common of curve methods:
5
+ * .getPoint( t, optionalTarget ), .getTangent( t, optionalTarget )
6
+ * .getPointAt( u, optionalTarget ), .getTangentAt( u, optionalTarget )
7
+ * .getPoints(), .getSpacedPoints()
8
+ * .getLength()
9
+ * .updateArcLengths()
10
+ *
11
+ * This following curves inherit from THREE.Curve:
12
+ *
13
+ * -- 2D curves --
14
+ * THREE.ArcCurve
15
+ * THREE.CubicBezierCurve
16
+ * THREE.EllipseCurve
17
+ * THREE.LineCurve
18
+ * THREE.QuadraticBezierCurve
19
+ * THREE.SplineCurve
20
+ *
21
+ * -- 3D curves --
22
+ * THREE.CatmullRomCurve3
23
+ * THREE.CubicBezierCurve3
24
+ * THREE.LineCurve3
25
+ * THREE.QuadraticBezierCurve3
26
+ *
27
+ * A series of curves can be represented as a THREE.CurvePath.
28
+ *
29
+ **/
30
+ export class Curve {
31
+ type: string;
32
+ arcLengthDivisions: number;
33
+ getPoint(): any;
34
+ getPointAt(u: any, optionalTarget: any): any;
35
+ getPoints(divisions?: number): any[];
36
+ getLength(): number;
37
+ getLengths(divisions?: number): number[];
38
+ needsUpdate: boolean;
39
+ cacheArcLengths: number[];
40
+ getUtoTmapping(u: any, distance: any): number;
41
+ }
@@ -0,0 +1,142 @@
1
+ // code copy from https://github.com/mrdoob/three.js/blob/dev/src/extras/core/Curve.js
2
+ // import * as MathUtils from '../../math/MathUtils.js';
3
+ // import { Vector2 } from '../../math/Vector2.js';
4
+ // import { Vector3 } from '../../math/Vector3.js';
5
+ // import { Matrix4 } from '../../math/Matrix4.js';
6
+ /**
7
+ * Extensible curve object.
8
+ *
9
+ * Some common of curve methods:
10
+ * .getPoint( t, optionalTarget ), .getTangent( t, optionalTarget )
11
+ * .getPointAt( u, optionalTarget ), .getTangentAt( u, optionalTarget )
12
+ * .getPoints(), .getSpacedPoints()
13
+ * .getLength()
14
+ * .updateArcLengths()
15
+ *
16
+ * This following curves inherit from THREE.Curve:
17
+ *
18
+ * -- 2D curves --
19
+ * THREE.ArcCurve
20
+ * THREE.CubicBezierCurve
21
+ * THREE.EllipseCurve
22
+ * THREE.LineCurve
23
+ * THREE.QuadraticBezierCurve
24
+ * THREE.SplineCurve
25
+ *
26
+ * -- 3D curves --
27
+ * THREE.CatmullRomCurve3
28
+ * THREE.CubicBezierCurve3
29
+ * THREE.LineCurve3
30
+ * THREE.QuadraticBezierCurve3
31
+ *
32
+ * A series of curves can be represented as a THREE.CurvePath.
33
+ *
34
+ **/
35
+ class Curve {
36
+ constructor() {
37
+ this.type = 'Curve';
38
+ this.arcLengthDivisions = 200;
39
+ }
40
+ // Virtual base class method to overwrite and implement in subclasses
41
+ getPoint() {
42
+ console.warn('THREE.Curve: .getPoint() not implemented.');
43
+ return null;
44
+ }
45
+ // Get point at relative position in curve according to arc length
46
+ // - u [0 .. 1]
47
+ getPointAt(u, optionalTarget) {
48
+ const t = this.getUtoTmapping(u);
49
+ return this.getPoint(t, optionalTarget);
50
+ }
51
+ // Get sequence of points using getPoint( t )
52
+ getPoints(divisions = 5) {
53
+ const points = [];
54
+ for (let d = 0; d <= divisions; d++) {
55
+ points.push(this.getPoint(d / divisions));
56
+ }
57
+ return points;
58
+ }
59
+ // // Get sequence of points using getPointAt( u )
60
+ // getSpacedPoints(divisions = 5) {
61
+ // const points = [];
62
+ // for (let d = 0; d <= divisions; d++) {
63
+ // points.push(this.getPointAt(d / divisions));
64
+ // }
65
+ // return points;
66
+ // }
67
+ // Get total curve arc length
68
+ getLength() {
69
+ const lengths = this.getLengths();
70
+ return lengths[lengths.length - 1];
71
+ }
72
+ // Get list of cumulative segment lengths
73
+ getLengths(divisions = this.arcLengthDivisions) {
74
+ if (this.cacheArcLengths &&
75
+ (this.cacheArcLengths.length === divisions + 1) &&
76
+ !this.needsUpdate) {
77
+ return this.cacheArcLengths;
78
+ }
79
+ this.needsUpdate = false;
80
+ const cache = [];
81
+ let current, last = this.getPoint(0);
82
+ let sum = 0;
83
+ cache.push(0);
84
+ for (let p = 1; p <= divisions; p++) {
85
+ current = this.getPoint(p / divisions);
86
+ sum += current.distanceTo(last);
87
+ cache.push(sum);
88
+ last = current;
89
+ }
90
+ this.cacheArcLengths = cache;
91
+ return cache; // { sums: cache, sum: sum }; Sum is in the last element.
92
+ }
93
+ // updateArcLengths() {
94
+ // this.needsUpdate = true;
95
+ // this.getLengths();
96
+ // }
97
+ // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant
98
+ getUtoTmapping(u, distance) {
99
+ const arcLengths = this.getLengths();
100
+ let i = 0;
101
+ const il = arcLengths.length;
102
+ let targetArcLength; // The targeted u distance value to get
103
+ if (distance) {
104
+ targetArcLength = distance;
105
+ }
106
+ else {
107
+ targetArcLength = u * arcLengths[il - 1];
108
+ }
109
+ // binary search for the index with largest value smaller than target u distance
110
+ let low = 0, high = il - 1, comparison;
111
+ while (low <= high) {
112
+ i = Math.floor(low + (high - low) / 2); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats
113
+ comparison = arcLengths[i] - targetArcLength;
114
+ if (comparison < 0) {
115
+ low = i + 1;
116
+ }
117
+ else if (comparison > 0) {
118
+ high = i - 1;
119
+ }
120
+ else {
121
+ high = i;
122
+ break;
123
+ // DONE
124
+ }
125
+ }
126
+ i = high;
127
+ if (arcLengths[i] === targetArcLength) {
128
+ return i / (il - 1);
129
+ }
130
+ // we could get finer grain at lengths, or use simple interpolation between two points
131
+ const lengthBefore = arcLengths[i];
132
+ const lengthAfter = arcLengths[i + 1];
133
+ const segmentLength = lengthAfter - lengthBefore;
134
+ // determine where we are between the 'before' and 'after' points
135
+ const segmentFraction = (targetArcLength - lengthBefore) / segmentLength;
136
+ // add that fractional amount to t
137
+ const t = (i + segmentFraction) / (il - 1);
138
+ return t;
139
+ }
140
+ }
141
+ export { Curve };
142
+ //# sourceMappingURL=Curve.js.map
@@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QAElC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QAE3C,OAAO,CAAC,CAAC;IAEb,CAAC;CA4LJ;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * // code copy from https://github.com/mrdoob/three.js/blob/dev/src/extras/core/Interpolations.js
3
+ * Bezier Curves formulas obtained from
4
+ * https://en.wikipedia.org/wiki/B%C3%A9zier_curve
5
+ */
6
+ export function CatmullRom(t: any, p0: any, p1: any, p2: any, p3: any): any;
7
+ export function QuadraticBezier(t: any, p0: any, p1: any, p2: any): number;
8
+ export function CubicBezier(t: any, p0: any, p1: any, p2: any, p3: any): number;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * // code copy from https://github.com/mrdoob/three.js/blob/dev/src/extras/core/Interpolations.js
3
+ * Bezier Curves formulas obtained from
4
+ * https://en.wikipedia.org/wiki/B%C3%A9zier_curve
5
+ */
6
+ function CatmullRom(t, p0, p1, p2, p3) {
7
+ const v0 = (p2 - p0) * 0.5;
8
+ const v1 = (p3 - p1) * 0.5;
9
+ const t2 = t * t;
10
+ const t3 = t * t2;
11
+ return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;
12
+ }
13
+ //
14
+ function QuadraticBezierP0(t, p) {
15
+ const k = 1 - t;
16
+ return k * k * p;
17
+ }
18
+ function QuadraticBezierP1(t, p) {
19
+ return 2 * (1 - t) * t * p;
20
+ }
21
+ function QuadraticBezierP2(t, p) {
22
+ return t * t * p;
23
+ }
24
+ function QuadraticBezier(t, p0, p1, p2) {
25
+ return QuadraticBezierP0(t, p0) + QuadraticBezierP1(t, p1) +
26
+ QuadraticBezierP2(t, p2);
27
+ }
28
+ //
29
+ function CubicBezierP0(t, p) {
30
+ const k = 1 - t;
31
+ return k * k * k * p;
32
+ }
33
+ function CubicBezierP1(t, p) {
34
+ const k = 1 - t;
35
+ return 3 * k * k * t * p;
36
+ }
37
+ function CubicBezierP2(t, p) {
38
+ return 3 * (1 - t) * t * t * p;
39
+ }
40
+ function CubicBezierP3(t, p) {
41
+ return t * t * t * p;
42
+ }
43
+ function CubicBezier(t, p0, p1, p2, p3) {
44
+ return CubicBezierP0(t, p0) + CubicBezierP1(t, p1) + CubicBezierP2(t, p2) +
45
+ CubicBezierP3(t, p3);
46
+ }
47
+ export { CatmullRom, QuadraticBezier, CubicBezier };
48
+ //# sourceMappingURL=Interpolations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Interpolations.js","sourceRoot":"","sources":["../../src/math/Interpolations.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,SAAS,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAEjC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;IAC3B,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;IAC3B,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACjB,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;IAClB,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;AAElG,CAAC;AAED,EAAE;AAEF,SAAS,iBAAiB,CAAC,CAAC,EAAE,CAAC;IAE3B,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAErB,CAAC;AAED,SAAS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E,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC;QACrE,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAE7B,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ export class Matrix4 {
2
+ constructor(n11: any, n12: any, n13: any, n14: any, n21: any, n22: any, n23: any, n24: any, n31: any, n32: any, n33: any, n34: any, n41: any, n42: any, n43: any, n44: any);
3
+ elements: number[];
4
+ set(n11: any, n12: any, n13: any, n14: any, n21: any, n22: any, n23: any, n24: any, n31: any, n32: any, n33: any, n34: any, n41: any, n42: any, n43: any, n44: any): this;
5
+ multiply(m: any): any;
6
+ makeRotationAxis(axis: any, angle: any): this;
7
+ equals(matrix: any): boolean;
8
+ }