@thi.ng/geom 8.3.7 → 8.3.9

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/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 210 standalone projects, maintained as part
10
+ > This is one of 211 standalone projects, maintained as part
11
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
12
12
  > and anti-framework.
13
13
  >
@@ -45,7 +45,7 @@ class ComplexPolygon {
45
45
  segments.push(["z"]);
46
46
  };
47
47
  $hiccupSegments(this.boundary);
48
- for (let c of this.children) $hiccupSegments(c);
48
+ for (const c of this.children) $hiccupSegments(c);
49
49
  return ["path", this.attribs, segments];
50
50
  }
51
51
  }
package/api/path.js CHANGED
@@ -55,7 +55,7 @@ class Path {
55
55
  return !!this.subPaths.length;
56
56
  }
57
57
  addSegments(...segments) {
58
- for (let s of segments) {
58
+ for (const s of segments) {
59
59
  this.closed && illegalState("path already closed");
60
60
  this.segments.push(s);
61
61
  }
@@ -82,7 +82,7 @@ class Path {
82
82
  if (this.segments.length > 1) {
83
83
  $hiccupSegments(this.segments);
84
84
  }
85
- for (let p of this.subPaths) $hiccupSegments(p);
85
+ for (const p of this.subPaths) $hiccupSegments(p);
86
86
  return ["path", this.attribs || {}, acc];
87
87
  }
88
88
  }
package/api/path3.js CHANGED
@@ -55,7 +55,7 @@ class Path3 {
55
55
  return !!this.subPaths.length;
56
56
  }
57
57
  addSegments(...segments) {
58
- for (let s of segments) {
58
+ for (const s of segments) {
59
59
  this.closed && illegalState("path already closed");
60
60
  this.segments.push(s);
61
61
  }
@@ -82,7 +82,7 @@ class Path3 {
82
82
  if (this.segments.length > 1) {
83
83
  $hiccupSegments(this.segments);
84
84
  }
85
- for (let p of this.subPaths) $hiccupSegments(p);
85
+ for (const p of this.subPaths) $hiccupSegments(p);
86
86
  return ["path3", this.attribs || {}, acc];
87
87
  }
88
88
  }
package/as-path.js CHANGED
@@ -33,7 +33,7 @@ const asPath = defmulti(
33
33
  );
34
34
  }
35
35
  const res = pathFromCubics(asCubic(boundary, opts), attribs);
36
- for (let child of children) {
36
+ for (const child of children) {
37
37
  res.addSubPaths(
38
38
  pathFromCubics(asCubic(child, opts)).segments
39
39
  );
package/clip-convex.js CHANGED
@@ -43,7 +43,7 @@ const clipConvex = defmulti(
43
43
  );
44
44
  if (!clipped.length) return void 0;
45
45
  const res = [new Polygon(clipped)];
46
- for (let child of $.children) {
46
+ for (const child of $.children) {
47
47
  clipped = sutherlandHodgeman(child.points, boundary, c);
48
48
  if (clipped.length) res.push(new Polygon(clipped));
49
49
  }
@@ -59,7 +59,7 @@ const clipConvex = defmulti(
59
59
  group: ({ children, attribs }, boundary) => {
60
60
  boundary = ensureVertices(boundary);
61
61
  const clipped = [];
62
- for (let c of children) {
62
+ for (const c of children) {
63
63
  const res = clipConvex(c, boundary);
64
64
  if (res) clipped.push(...res);
65
65
  }
@@ -90,7 +90,7 @@ const clipConvex = defmulti(
90
90
  [],
91
91
  __copyAttribs($.attribs)
92
92
  );
93
- for (let sub of $.subPaths) {
93
+ for (const sub of $.subPaths) {
94
94
  clipped = __clipVertices(
95
95
  new Path(sub, [], __copyAttribs($.attribs)),
96
96
  boundary
package/closest-point.js CHANGED
@@ -33,7 +33,7 @@ const closestPoint = defmulti(
33
33
  out = closestPointPolyline(p, $.boundary.points, true, out);
34
34
  let minD = distSq2(p, out);
35
35
  let tmp = [];
36
- for (let child of $.children) {
36
+ for (const child of $.children) {
37
37
  closestPointPolyline(p, child.points, true, tmp);
38
38
  const d = distSq2(p, tmp);
39
39
  if (d < minD) {
@@ -55,7 +55,7 @@ const closestPoint = defmulti(
55
55
  path: ($, p, out) => {
56
56
  let minD = Infinity;
57
57
  const $closestPSegment = (segments) => {
58
- for (let s of segments) {
58
+ for (const s of segments) {
59
59
  if (!s.geo) continue;
60
60
  const q = closestPoint(s.geo, p);
61
61
  if (!q) continue;
@@ -67,7 +67,7 @@ const closestPoint = defmulti(
67
67
  }
68
68
  };
69
69
  $closestPSegment($.segments);
70
- for (let sub of $.subPaths) $closestPSegment(sub);
70
+ for (const sub of $.subPaths) $closestPSegment(sub);
71
71
  return out;
72
72
  },
73
73
  plane: ($, p, out) => closestPointPlane(p, $.normal, $.w, out),
package/flip.js CHANGED
@@ -35,7 +35,7 @@ const flip = defmulti(
35
35
  },
36
36
  complexpoly: ($) => {
37
37
  flip($.boundary);
38
- for (let c of $.children) flip(c);
38
+ for (const c of $.children) flip(c);
39
39
  return $;
40
40
  },
41
41
  group: ($) => {
package/intersects.js CHANGED
@@ -66,7 +66,7 @@ const intersects = defmulti(
66
66
  const points = [];
67
67
  const all = opts?.all;
68
68
  let inside = false;
69
- for (let child of children) {
69
+ for (const child of children) {
70
70
  let $res = intersects(ray, child, opts);
71
71
  if ($res.type !== IntersectionType.INTERSECT) continue;
72
72
  if ($res.inside) inside = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/geom",
3
- "version": "8.3.7",
3
+ "version": "8.3.9",
4
4
  "description": "Functional, polymorphic API for 2D geometry types & SVG generation",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -40,33 +40,33 @@
40
40
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@thi.ng/adjacency": "^3.0.62",
44
- "@thi.ng/api": "^8.12.8",
45
- "@thi.ng/arrays": "^2.14.1",
46
- "@thi.ng/checks": "^3.7.24",
47
- "@thi.ng/defmulti": "^3.0.84",
48
- "@thi.ng/equiv": "^2.1.98",
49
- "@thi.ng/errors": "^2.5.48",
50
- "@thi.ng/geom-arc": "^2.1.202",
51
- "@thi.ng/geom-clip-line": "^2.3.159",
52
- "@thi.ng/geom-clip-poly": "^2.1.201",
53
- "@thi.ng/geom-closest-point": "^2.1.197",
54
- "@thi.ng/geom-hull": "^2.1.197",
55
- "@thi.ng/geom-isec": "^4.0.69",
56
- "@thi.ng/geom-poly-utils": "^3.1.6",
57
- "@thi.ng/geom-resample": "^3.0.69",
58
- "@thi.ng/geom-splines": "^2.3.69",
59
- "@thi.ng/geom-subdiv-curve": "^3.0.76",
60
- "@thi.ng/geom-tessellate": "^3.0.76",
61
- "@thi.ng/hiccup": "^5.3.31",
62
- "@thi.ng/hiccup-svg": "^5.5.18",
63
- "@thi.ng/math": "^5.13.5",
64
- "@thi.ng/matrices": "^3.0.28",
65
- "@thi.ng/object-utils": "^1.3.0",
66
- "@thi.ng/random": "^4.1.33",
67
- "@thi.ng/strings": "^3.9.29",
68
- "@thi.ng/transducers": "^9.6.17",
69
- "@thi.ng/vectors": "^8.6.13"
43
+ "@thi.ng/adjacency": "^3.0.64",
44
+ "@thi.ng/api": "^8.12.10",
45
+ "@thi.ng/arrays": "^2.14.3",
46
+ "@thi.ng/checks": "^3.8.0",
47
+ "@thi.ng/defmulti": "^3.0.86",
48
+ "@thi.ng/equiv": "^2.1.100",
49
+ "@thi.ng/errors": "^2.5.50",
50
+ "@thi.ng/geom-arc": "^2.1.204",
51
+ "@thi.ng/geom-clip-line": "^2.3.161",
52
+ "@thi.ng/geom-clip-poly": "^2.1.203",
53
+ "@thi.ng/geom-closest-point": "^2.1.199",
54
+ "@thi.ng/geom-hull": "^2.1.199",
55
+ "@thi.ng/geom-isec": "^4.0.71",
56
+ "@thi.ng/geom-poly-utils": "^3.1.8",
57
+ "@thi.ng/geom-resample": "^3.0.71",
58
+ "@thi.ng/geom-splines": "^2.3.71",
59
+ "@thi.ng/geom-subdiv-curve": "^3.0.78",
60
+ "@thi.ng/geom-tessellate": "^3.0.78",
61
+ "@thi.ng/hiccup": "^5.3.33",
62
+ "@thi.ng/hiccup-svg": "^5.5.20",
63
+ "@thi.ng/math": "^5.14.0",
64
+ "@thi.ng/matrices": "^3.0.30",
65
+ "@thi.ng/object-utils": "^1.3.2",
66
+ "@thi.ng/random": "^4.1.35",
67
+ "@thi.ng/strings": "^3.9.31",
68
+ "@thi.ng/transducers": "^9.6.19",
69
+ "@thi.ng/vectors": "^8.6.15"
70
70
  },
71
71
  "devDependencies": {
72
72
  "esbuild": "^0.27.0",
@@ -533,5 +533,5 @@
533
533
  "tag": "geometry",
534
534
  "year": 2013
535
535
  },
536
- "gitHead": "be6e7657b1e5c54d7d648d1b52888a7297e95a17\n"
536
+ "gitHead": "824bf9047b5a10f777c5c5b4aeecf0c750a22c75\n"
537
537
  }
@@ -18,7 +18,7 @@ const __pathFromCubics = (ctor, cubics, attribs) => {
18
18
  curr = [{ type: "m", point: c.points[0] }];
19
19
  subPaths.push(curr);
20
20
  };
21
- for (let c of cubics) {
21
+ for (const c of cubics) {
22
22
  if (!(lastP && equals(lastP, c.points[0]))) $beginPath(c);
23
23
  curr.push({ type: "c", geo: c });
24
24
  lastP = c.points[3];
package/tessellate.js CHANGED
@@ -46,7 +46,7 @@ const tessellate = defmulti(
46
46
  group: ($, fns, tess) => {
47
47
  fns = ensureArray(fns);
48
48
  tess = tess || new BasicTessellation();
49
- for (let child of $.children) {
49
+ for (const child of $.children) {
50
50
  tess = tessellate(child, fns, tess);
51
51
  }
52
52
  return tess;
package/vertices.js CHANGED
@@ -89,7 +89,7 @@ const vertices = defmulti(
89
89
  },
90
90
  complexpoly: ($, opts) => {
91
91
  const pts = vertices($.boundary, opts);
92
- for (let child of $.children) pts.push(...vertices(child, opts));
92
+ for (const child of $.children) pts.push(...vertices(child, opts));
93
93
  return pts;
94
94
  },
95
95
  cubic: ($, opts) => sampleCubic($.points, __sampleAttribs(opts, $.attribs)),
@@ -135,7 +135,7 @@ const vertices = defmulti(
135
135
  }
136
136
  };
137
137
  $segmentVerts($.segments);
138
- for (let sub of $.subPaths) $segmentVerts(sub);
138
+ for (const sub of $.subPaths) $segmentVerts(sub);
139
139
  return verts;
140
140
  },
141
141
  points: ($) => $.points.slice(),