@immugio/three-math-extensions 0.2.18 → 0.2.20

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/CHANGELOG.md CHANGED
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
9
9
 
10
- ## [0.2.18](https://github.com/Immugio/three-math-extensions/compare/16.15.10...0.2.18)
10
+ ## [0.2.20](https://github.com/Immugio/three-math-extensions/compare/16.15.10...0.2.20)
11
11
 
12
12
  ### Commits
13
13
 
@@ -36,6 +36,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
36
36
  - Add functionality for incrementing x, y, z coordinates [`b292dcc`](https://github.com/Immugio/three-math-extensions/commit/b292dcc4e8f7f0f2a63e1810c482d96ca6bebebe)
37
37
  - Add Line3D.index [`7ed13d2`](https://github.com/Immugio/three-math-extensions/commit/7ed13d213748056c9dafd86288c3bcec9a28d1ba)
38
38
  - Polygon from bounding size [`eae6701`](https://github.com/Immugio/three-math-extensions/commit/eae67012f57f426f8b5259b765000447ce06d608)
39
+ - Add Vec3.fromPoints [`62684d7`](https://github.com/Immugio/three-math-extensions/commit/62684d7f6dc1318d345ed74288bb6afd5394e1d3)
39
40
  - Line2D and Line3D to return this instead of specific type [`761ef6a`](https://github.com/Immugio/three-math-extensions/commit/761ef6a9d8cc4e35120b666576794e521aa3b991)
40
41
  - Line2D.in3DSpace added [`a6ce0ec`](https://github.com/Immugio/three-math-extensions/commit/a6ce0ecb67f5c7b2a75fcc283c28af626153a4af)
41
42
  - Line3D.connectsTo added [`6d2cfa0`](https://github.com/Immugio/three-math-extensions/commit/6d2cfa0f5335c665f325a694a32c57b574ec326d)
@@ -46,11 +47,24 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
46
47
  - Add Polygon to exports [`ed66775`](https://github.com/Immugio/three-math-extensions/commit/ed66775c33e961835b23843222b822cfd9c16b1d)
47
48
  - Vec2.fromPoint and Vec3.fromPoint should accept null [`4b871af`](https://github.com/Immugio/three-math-extensions/commit/4b871af297bdcbe8584f1e2b99d602247b77687c)
48
49
  - Add HalfPI [`7a6614c`](https://github.com/Immugio/three-math-extensions/commit/7a6614c3d6f59ac216e58986927112f94207a755)
50
+ - Dependencies update [`e8def7e`](https://github.com/Immugio/three-math-extensions/commit/e8def7e94575720cc25296681f844c4e53a9fc5c)
49
51
  - Use double quotes [`c1f19db`](https://github.com/Immugio/three-math-extensions/commit/c1f19db2d0886a6ff5555bdbf353dfca20a70f0a)
50
52
  - Documentation update [`d5c7a07`](https://github.com/Immugio/three-math-extensions/commit/d5c7a0765f6097f5d3a3be01967d4059f19682fb)
51
53
  - Excluded files from build [`ec70614`](https://github.com/Immugio/three-math-extensions/commit/ec70614bc7df7a98f854c7a6693365118e04faf7)
52
54
 
53
- ## [16.15.10](https://github.com/Immugio/three-math-extensions/compare/0.2.17...16.15.10) - 2023-01-02
55
+ ## [16.15.10](https://github.com/Immugio/three-math-extensions/compare/0.2.19...16.15.10) - 2023-01-02
56
+
57
+ ## [0.2.19](https://github.com/Immugio/three-math-extensions/compare/0.2.18...0.2.19) - 2024-04-02
58
+
59
+ ### Commits
60
+
61
+ - Add Vec3.fromPoints [`62684d7`](https://github.com/Immugio/three-math-extensions/commit/62684d7f6dc1318d345ed74288bb6afd5394e1d3)
62
+
63
+ ## [0.2.18](https://github.com/Immugio/three-math-extensions/compare/0.2.17...0.2.18) - 2024-02-08
64
+
65
+ ### Commits
66
+
67
+ - Add parallelism check to Line2D [`18064ee`](https://github.com/Immugio/three-math-extensions/commit/18064ee35a28e2c4d656f3dfb543b545044167dd)
54
68
 
55
69
  ## [0.2.17](https://github.com/Immugio/three-math-extensions/compare/0.2.16...0.2.17) - 2023-12-26
56
70
 
package/cjs/Vec3.js CHANGED
@@ -16,6 +16,13 @@ class Vec3 extends three_1.Vector3 {
16
16
  static fromPoint(point) {
17
17
  return new Vec3(point?.x, point?.y, point?.z);
18
18
  }
19
+ /**
20
+ * Creates a new Vec3[] array from arguments of {x, y, z} objects.
21
+ * @param points - The ...{x, y, z} instances.
22
+ */
23
+ static fromPoints(...points) {
24
+ return points?.map(p => Vec3.fromPoint(p)) ?? [];
25
+ }
19
26
  /**
20
27
  * Moves this Vec3 instance towards the target Vec3 by the given amount.
21
28
  * @param target - The target Vec3.
package/esm/Vec3.js CHANGED
@@ -13,6 +13,13 @@ export class Vec3 extends Vector3 {
13
13
  static fromPoint(point) {
14
14
  return new Vec3(point?.x, point?.y, point?.z);
15
15
  }
16
+ /**
17
+ * Creates a new Vec3[] array from arguments of {x, y, z} objects.
18
+ * @param points - The ...{x, y, z} instances.
19
+ */
20
+ static fromPoints(...points) {
21
+ return points?.map(p => Vec3.fromPoint(p)) ?? [];
22
+ }
16
23
  /**
17
24
  * Moves this Vec3 instance towards the target Vec3 by the given amount.
18
25
  * @param target - The target Vec3.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immugio/three-math-extensions",
3
- "version": "0.2.18",
3
+ "version": "0.2.20",
4
4
  "description": "Set of utilities for 2d and 3d line math built on top of three.js",
5
5
  "author": "Jan Mikeska <janmikeska@gmail.com>",
6
6
  "license": "ISC",
@@ -47,7 +47,7 @@
47
47
  "eslint": "^8.56.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "three": "0.160.0"
50
+ "three": ">=0.160.0"
51
51
  },
52
52
  "repository": {
53
53
  "type": "git",
package/src/Vec3.ts CHANGED
@@ -18,6 +18,14 @@ export class Vec3 extends Vector3 {
18
18
  return new Vec3(point?.x, point?.y, point?.z);
19
19
  }
20
20
 
21
+ /**
22
+ * Creates a new Vec3[] array from arguments of {x, y, z} objects.
23
+ * @param points - The ...{x, y, z} instances.
24
+ */
25
+ public static fromPoints(...points: Point3[]): Vec3[] {
26
+ return points?.map(p => Vec3.fromPoint(p)) ?? [];
27
+ }
28
+
21
29
  /**
22
30
  * Moves this Vec3 instance towards the target Vec3 by the given amount.
23
31
  * @param target - The target Vec3.
package/types/Vec3.d.ts CHANGED
@@ -12,6 +12,11 @@ export declare class Vec3 extends Vector3 {
12
12
  * @returns A new Vec3 instance.
13
13
  */
14
14
  static fromPoint(point: Point3): Vec3;
15
+ /**
16
+ * Creates a new Vec3[] array from arguments of {x, y, z} objects.
17
+ * @param points - The ...{x, y, z} instances.
18
+ */
19
+ static fromPoints(...points: Point3[]): Vec3[];
15
20
  /**
16
21
  * Moves this Vec3 instance towards the target Vec3 by the given amount.
17
22
  * @param target - The target Vec3.