@objectifthunes/three-book 0.5.1 → 0.5.3

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.d.ts CHANGED
@@ -27,6 +27,6 @@ export { TextOverlayContent } from './TextOverlayContent';
27
27
  export type { TextOverlayContentOptions } from './TextOverlayContent';
28
28
  export { SpreadContent, getSpreadPairs } from './SpreadContent';
29
29
  export type { SpreadContentOptions } from './SpreadContent';
30
- export { drawImageWithFit, createPageTexture, loadImage, PX_PER_UNIT } from './textureUtils';
31
- export type { ImageFitMode, LoadedImage } from './textureUtils';
30
+ export { drawImageWithFit, createPageTexture, computeDefaultImageRect, loadImage, PX_PER_UNIT } from './textureUtils';
31
+ export type { ImageFitMode, ImageRect, LoadedImage } from './textureUtils';
32
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE1E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,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YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE3F,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACtH,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as c from "three";
2
- class Pt {
2
+ class wt {
3
3
  constructor() {
4
4
  this.m_PositionX = 0, this.m_PositionZ = 0, this.m_DirectionX = 0, this.m_DirectionZ = 0, this.m_EulerY = 0, this.m_Radius = 0, this._positionOut = new c.Vector3(), this._scratchRP1 = new c.Vector3(), this._scratchRP2 = new c.Vector3(), this._scratchRollClosest = new c.Vector3(), this._scratchRollEuler = new c.Vector3(), this._scratchOffsetRoll = new c.Vector3();
5
5
  }
@@ -78,7 +78,7 @@ class Pt {
78
78
  }
79
79
  // ── Value-type clone ──────────────────────────────────────────────────
80
80
  clone() {
81
- const t = new Pt();
81
+ const t = new wt();
82
82
  return t.m_PositionX = this.m_PositionX, t.m_PositionZ = this.m_PositionZ, t.m_DirectionX = this.m_DirectionX, t.m_DirectionZ = this.m_DirectionZ, t.m_EulerY = this.m_EulerY, t.m_Radius = this.m_Radius, t;
83
83
  }
84
84
  }
@@ -173,8 +173,8 @@ function ne(r, t, e, s, i) {
173
173
  if (T.rootCount === 1)
174
174
  return i.set(T.root0, g * T.root0 + p);
175
175
  if (T.rootCount === 2) {
176
- let w = T.root0, C = T.root1;
177
- return a < u && ([w, C] = [C, w]), i.set(C, g * C + p);
176
+ let P = T.root0, C = T.root1;
177
+ return a < u && ([P, C] = [C, P]), i.set(C, g * C + p);
178
178
  }
179
179
  }
180
180
  return i.copy(r);
@@ -216,7 +216,7 @@ function Vt(r, t, e) {
216
216
  class oe {
217
217
  // ---- Constructor ----
218
218
  constructor(t, e, s, i) {
219
- this.m_UseBackContentForSides = !1, this.m_Prev = null, this.m_Next = null, this.m_NoHole = !1, this.m_Size = new c.Vector2(), this.m_Thickness = 0, this.m_Stiffness = 0, this.m_Margin = 0, this.m_MeshDataType = 1, this.m_Cylinder = new Pt(), this.m_IsRolling = !1, this.m_IsAutoTurning = !1, this.m_WorldPlane = new c.Plane(), this.m_StartHandle = new c.Vector3(), this.m_CurrentHandle = new c.Vector3(), this.m_EndHandle = new c.Vector3(), this.m_PrevHandle = new c.Vector3(), this.m_HandleOffset = new c.Vector3(), this.m_HandleVelocity = new c.Vector3(), this.m_HandleVelocities = [], this.m_SubMeshCount = -1, this.m_MinTurningRadius = 0, this.m_TurningRadius = 0, this.m_FallDuration = 0, this.m_FallTime = 0.2, this.m_XTime = 0, this.m_ZTime = 0, this.m_IsTurning = !1, this.m_IsFalling = !1, this.m_IsFallingLeft = !1, this.m_isMeshChanged = !1, this.sizeXOffset = 0, this._ucStartHandle = new c.Vector3(), this._ucCurrentHandle = new c.Vector3(), this._ucHandleDir = new c.Vector3(), this._ucA = new c.Vector3(), this._ucB = new c.Vector3(), this._ucMid = new c.Vector3(), this._ucRollResult = new c.Vector3(), this._ucCylDir = new c.Vector3(), this._utV1 = new c.Vector3(), this._utV2 = new c.Vector3(), this._utV3 = new c.Vector3(), this._utV4 = new c.Vector3(), this._chP = new c.Vector3(), this._chA = new c.Vector3(), this._chC = new c.Vector3(), this._chEllipseCenter1 = new c.Vector2(), this._chEllipseCenter2 = new c.Vector2(), this._chEllipseSize1 = new c.Vector2(), this._chEllipseSize2 = new c.Vector2(), this._chP2 = new c.Vector2(), this._dirResult = new c.Vector3(), this._gdA = new c.Vector3(), this._gdB = new c.Vector3(), this._rlMatrix = new c.Matrix4(), this._rlPlane = new c.Plane(new c.Vector3(0, 1, 0), 0), this._rlTarget = new c.Vector3(), this._rlNormal = new c.Vector3(), this._utTarget = new c.Vector3(), this._ufSmoothTime = new c.Vector3(), this._umFrontST = new c.Vector4(), this._umBackST = new c.Vector4(), this._h2uResult = new c.Vector2(), this.m_IsCover = t, this.m_Book = s, this.m_Index = e, this.m_Renderer = i, this.m_Transform = i.transform;
219
+ this.m_UseBackContentForSides = !1, this.m_Prev = null, this.m_Next = null, this.m_NoHole = !1, this.m_Size = new c.Vector2(), this.m_Thickness = 0, this.m_Stiffness = 0, this.m_Margin = 0, this.m_MeshDataType = 1, this.m_Cylinder = new wt(), this.m_IsRolling = !1, this.m_IsAutoTurning = !1, this.m_WorldPlane = new c.Plane(), this.m_StartHandle = new c.Vector3(), this.m_CurrentHandle = new c.Vector3(), this.m_EndHandle = new c.Vector3(), this.m_PrevHandle = new c.Vector3(), this.m_HandleOffset = new c.Vector3(), this.m_HandleVelocity = new c.Vector3(), this.m_HandleVelocities = [], this.m_SubMeshCount = -1, this.m_MinTurningRadius = 0, this.m_TurningRadius = 0, this.m_FallDuration = 0, this.m_FallTime = 0.2, this.m_XTime = 0, this.m_ZTime = 0, this.m_IsTurning = !1, this.m_IsFalling = !1, this.m_IsFallingLeft = !1, this.m_isMeshChanged = !1, this.sizeXOffset = 0, this._ucStartHandle = new c.Vector3(), this._ucCurrentHandle = new c.Vector3(), this._ucHandleDir = new c.Vector3(), this._ucA = new c.Vector3(), this._ucB = new c.Vector3(), this._ucMid = new c.Vector3(), this._ucRollResult = new c.Vector3(), this._ucCylDir = new c.Vector3(), this._utV1 = new c.Vector3(), this._utV2 = new c.Vector3(), this._utV3 = new c.Vector3(), this._utV4 = new c.Vector3(), this._chP = new c.Vector3(), this._chA = new c.Vector3(), this._chC = new c.Vector3(), this._chEllipseCenter1 = new c.Vector2(), this._chEllipseCenter2 = new c.Vector2(), this._chEllipseSize1 = new c.Vector2(), this._chEllipseSize2 = new c.Vector2(), this._chP2 = new c.Vector2(), this._dirResult = new c.Vector3(), this._gdA = new c.Vector3(), this._gdB = new c.Vector3(), this._rlMatrix = new c.Matrix4(), this._rlPlane = new c.Plane(new c.Vector3(0, 1, 0), 0), this._rlTarget = new c.Vector3(), this._rlNormal = new c.Vector3(), this._utTarget = new c.Vector3(), this._ufSmoothTime = new c.Vector3(), this._umFrontST = new c.Vector4(), this._umBackST = new c.Vector4(), this._h2uResult = new c.Vector2(), this.m_IsCover = t, this.m_Book = s, this.m_Index = e, this.m_Renderer = i, this.m_Transform = i.transform;
220
220
  }
221
221
  // ---- Properties (mirrors C#) ----
222
222
  get isMeshChanged() {
@@ -849,12 +849,12 @@ class ht {
849
849
  t.push(this.hole), this.next !== null && this.next._getHolesRecursive(t);
850
850
  }
851
851
  }
852
- class wt {
852
+ class Pt {
853
853
  constructor(t, e, s, i) {
854
854
  this.active = !0, this.prevIndex = t, this.index = e, this.nextIndex = s, this.time = i;
855
855
  }
856
856
  clone() {
857
- const t = new wt(this.prevIndex, this.index, this.nextIndex, this.time);
857
+ const t = new Pt(this.prevIndex, this.index, this.nextIndex, this.time);
858
858
  return t.active = this.active, t;
859
859
  }
860
860
  }
@@ -884,7 +884,7 @@ class le {
884
884
  }
885
885
  function pt(r, t) {
886
886
  for (const e of r) {
887
- const s = e.prevNoneSeam, i = e.nextNoneSeam, n = Q(s.value, i.value, e.value), h = new wt(s.index, e.index, i.index, n);
887
+ const s = e.prevNoneSeam, i = e.nextNoneSeam, n = Q(s.value, i.value, e.value), h = new Pt(s.index, e.index, i.index, n);
888
888
  t.push(h);
889
889
  }
890
890
  }
@@ -989,7 +989,7 @@ function Ft(r, t, e, s, i, n) {
989
989
  function Qt(r, t, e, s, i, n, h) {
990
990
  mt(r, e, s, i, n), e += h, s += h, i += h, n += h, _t(t, e, s, i, n);
991
991
  }
992
- function $t(r, t, e, s, i, n) {
992
+ function Yt(r, t, e, s, i, n) {
993
993
  const h = i.left * s.x, a = (1 - i.right) * s.x, o = i.down * s.y, u = (1 - i.up) * s.y, l = t.length, m = e.length;
994
994
  if (n > 1)
995
995
  for (let d = 0; d < m; d++)
@@ -1017,7 +1017,7 @@ const Fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1017
1017
  __proto__: null,
1018
1018
  addBorders: jt,
1019
1019
  addFrontAndBackFaces: Qt,
1020
- addFrontAndBackTexcoords: $t,
1020
+ addFrontAndBackTexcoords: Yt,
1021
1021
  seamNodesToSeams: pt,
1022
1022
  updateBorders: qt,
1023
1023
  updateXSeams: xt,
@@ -1103,8 +1103,8 @@ class Ot {
1103
1103
  for (let _ = 0; _ < h - 1; _++) {
1104
1104
  const g = _ + 1;
1105
1105
  for (let p = 0; p < n - 1; p++) {
1106
- const M = p + 1, T = _ * n + p, w = _ * n + M, C = g * n + p, k = g * n + M, I = t[T], U = t[w], E = t[C], z = t[k];
1107
- At(I, E, U, o), At(z, U, E, u), l.addVectors(o, u), s[T].add(l), s[w].add(l), s[C].add(l), s[k].add(l);
1106
+ const M = p + 1, T = _ * n + p, P = _ * n + M, C = g * n + p, k = g * n + M, I = t[T], U = t[P], E = t[C], z = t[k];
1107
+ At(I, E, U, o), At(z, U, E, u), l.addVectors(o, u), s[T].add(l), s[P].add(l), s[C].add(l), s[k].add(l);
1108
1108
  }
1109
1109
  }
1110
1110
  for (let _ = 0; _ < a; _++)
@@ -1862,8 +1862,8 @@ const W = class W extends c.Group {
1862
1862
  var B;
1863
1863
  if (this.clear(), this.m_Content === null || this.m_Content.isEmpty || this.m_Binding === null) return;
1864
1864
  if (this.m_MeshFactory === null && (this.m_MeshFactory = new ce()), this.m_RendererFactory === null) {
1865
- const P = new c.Object3D();
1866
- P.name = "Root", this.add(P), this.m_Root = P, this.m_RendererFactory = new ue(this.m_Root);
1865
+ const w = new c.Object3D();
1866
+ w.name = "Root", this.add(w), this.m_Root = w, this.m_RendererFactory = new ue(this.m_Root);
1867
1867
  }
1868
1868
  this.m_Direction = this.m_Content.direction;
1869
1869
  const t = this.m_Direction > 1 ? Math.PI / 2 : 0;
@@ -1875,9 +1875,9 @@ const W = class W extends c.Group {
1875
1875
  const a = this.m_CoverPaperCount + this.m_PagePaperCount, o = Math.floor(i.length / 4);
1876
1876
  let u = 0, l = 0, m = 0;
1877
1877
  this.m_Papers = new Array(a);
1878
- for (let P = 0; P < a; P++) {
1879
- const v = this.m_HasCover && (P < o || P >= a - o), N = this.m_RendererFactory.get("Paper"), R = this.m_Papers[P] = new oe(v, P, this, N);
1880
- R.renderer.castShadows = this.m_CastShadows, P < Math.round(c.MathUtils.lerp(0, a, h)) && (R.transform.scale.set(-1, 1, 1), R.setTime(1)), v ? (R.setContentData(i[l++], i[l++], P > o), R.setMaterialData(e), R.setPaperSetup(this.m_CoverPaperSetup)) : (R.setContentData(n[u++], n[u++]), R.setMaterialData(s), R.setPaperSetup(this.m_PagePaperSetup)), m += R.thickness;
1878
+ for (let w = 0; w < a; w++) {
1879
+ const v = this.m_HasCover && (w < o || w >= a - o), N = this.m_RendererFactory.get("Paper"), R = this.m_Papers[w] = new oe(v, w, this, N);
1880
+ R.renderer.castShadows = this.m_CastShadows, w < Math.round(c.MathUtils.lerp(0, a, h)) && (R.transform.scale.set(-1, 1, 1), R.setTime(1)), v ? (R.setContentData(i[l++], i[l++], w > o), R.setMaterialData(e), R.setPaperSetup(this.m_CoverPaperSetup)) : (R.setContentData(n[u++], n[u++]), R.setMaterialData(s), R.setPaperSetup(this.m_PagePaperSetup)), m += R.thickness;
1881
1881
  }
1882
1882
  this.m_TotalThickness = m;
1883
1883
  const f = this.m_Papers[0].thickness, d = this.m_Papers[Math.floor(a / 2)].thickness;
@@ -1891,10 +1891,10 @@ const W = class W extends c.Group {
1891
1891
  this.m_RendererFactory,
1892
1892
  this.m_MeshFactory
1893
1893
  ), this.m_Bound.binderRenderer.setVisibility(!this.m_HideBinder);
1894
- const T = this.m_ReduceOverdraw && n.length > 0, w = this.m_ReduceSubMeshes, C = this.createPaperMeshDataPool(this.m_PagePaperSetup, !0, w), k = T ? this.createPaperMeshDataPool(this.m_PagePaperSetup, !0, w, !0) : null, I = this.createPaperMeshDataPool(this.m_PagePaperSetup, !1), U = this.createPaperMeshDataPool(this.m_CoverPaperSetup, !0), E = this.createPaperMeshDataPool(this.m_CoverPaperSetup, !1), z = Math.floor(a / 2) - 1, L = z + 1, A = ((B = this.m_Bound) == null ? void 0 : B.bindingType) === "staple";
1895
- for (let P = 0; P < a; P++) {
1896
- const v = this.m_Papers[P];
1897
- P !== 0 && (v.prev = this.m_Papers[P - 1]), P !== a - 1 && (v.next = this.m_Papers[P + 1]), v.noHole = A && (P === z || P === L), v.isCover ? v.setMeshData(U.get(), null, E) : v.setMeshData(
1894
+ const T = this.m_ReduceOverdraw && n.length > 0, P = this.m_ReduceSubMeshes, C = this.createPaperMeshDataPool(this.m_PagePaperSetup, !0, P), k = T ? this.createPaperMeshDataPool(this.m_PagePaperSetup, !0, P, !0) : null, I = this.createPaperMeshDataPool(this.m_PagePaperSetup, !1), U = this.createPaperMeshDataPool(this.m_CoverPaperSetup, !0), E = this.createPaperMeshDataPool(this.m_CoverPaperSetup, !1), z = Math.floor(a / 2) - 1, L = z + 1, A = ((B = this.m_Bound) == null ? void 0 : B.bindingType) === "staple";
1895
+ for (let w = 0; w < a; w++) {
1896
+ const v = this.m_Papers[w];
1897
+ w !== 0 && (v.prev = this.m_Papers[w - 1]), w !== a - 1 && (v.next = this.m_Papers[w + 1]), v.noHole = A && (w === z || w === L), v.isCover ? v.setMeshData(U.get(), null, E) : v.setMeshData(
1898
1898
  C.get(),
1899
1899
  (k == null ? void 0 : k.get()) ?? null,
1900
1900
  I
@@ -2021,7 +2021,7 @@ class Me {
2021
2021
  this.baseXArray = [], this.baseZArray = [], this.baseXOffset = 0, this.baseVertexCount = 0, this.xSeams = [], this.zSeams = [], this.xNoneSeamIndexes = [], this.borders = [], this.texcoords = [], this.weights = [], this.triangles = [], this.frontTriangles = [], this.backTriangles = [], this.borderTriangles = [], this.vertexCount = 0, this.subMeshCount = 0, this.size = new c.Vector2(), this.thickness = 0;
2022
2022
  }
2023
2023
  }
2024
- const Yt = Object.freeze(new c.Vector4(1, 1, 0, 0));
2024
+ const $t = Object.freeze(new c.Vector4(1, 1, 0, 0));
2025
2025
  class Oe {
2026
2026
  constructor() {
2027
2027
  this.m_BookContent = null, this.m_IsActive = !1, this.onActiveChangedCallback = null;
@@ -2033,7 +2033,7 @@ class Oe {
2033
2033
  return this.m_IsActive;
2034
2034
  }
2035
2035
  get textureST() {
2036
- return Yt;
2036
+ return $t;
2037
2037
  }
2038
2038
  get isShareable() {
2039
2039
  return !0;
@@ -2065,7 +2065,7 @@ class Et {
2065
2065
  return this.m_Texture;
2066
2066
  }
2067
2067
  get textureST() {
2068
- return this.m_Texture ? this.m_TextureST : Yt;
2068
+ return this.m_Texture ? this.m_TextureST : $t;
2069
2069
  }
2070
2070
  isPointOverUI(t) {
2071
2071
  return !1;
@@ -2230,10 +2230,10 @@ function Lt(r, t, e, s) {
2230
2230
  function Nt(r, t) {
2231
2231
  return r++, r === t ? 0 : r;
2232
2232
  }
2233
- function Pe(r, t) {
2233
+ function we(r, t) {
2234
2234
  return r === 0 ? t - 1 : r - 1;
2235
2235
  }
2236
- const we = 0.01, Te = 0.1, Se = 0.04, ve = 0.4, ke = 2, Be = 10, Re = 0, be = 5;
2236
+ const Pe = 0.01, Te = 0.1, Se = 0.04, ve = 0.4, ke = 2, Be = 10, Re = 0, be = 5;
2237
2237
  function De(r, t) {
2238
2238
  const e = r.clone().normalize();
2239
2239
  if (e.lengthSq() === 0) return new c.Quaternion();
@@ -2266,7 +2266,7 @@ class Ie {
2266
2266
  return this._thickness;
2267
2267
  }
2268
2268
  set thickness(t) {
2269
- this._thickness = H(t, we, Te);
2269
+ this._thickness = H(t, Pe, Te);
2270
2270
  }
2271
2271
  get margin() {
2272
2272
  return this._margin;
@@ -2340,7 +2340,7 @@ class Ve extends Ce {
2340
2340
  M = Math.max(M, p * 2);
2341
2341
  let T = 0;
2342
2342
  T += this.m_Book.totalThickness / 2, T += d;
2343
- const w = -(this.m_Book.papers[0].thickness / 2 + d), C = [];
2343
+ const P = -(this.m_Book.papers[0].thickness / 2 + d), C = [];
2344
2344
  {
2345
2345
  for (let V = 0; V < m; V++) {
2346
2346
  const G = V / (m - 1), K = F(-90, -180, G) * J, y = new c.Vector3(
@@ -2348,12 +2348,12 @@ class Ve extends Ce {
2348
2348
  0,
2349
2349
  p * Math.cos(K)
2350
2350
  );
2351
- y.x += p, y.z += p, y.x += w, C.push(y);
2351
+ y.x += p, y.z += p, y.x += P, C.push(y);
2352
2352
  }
2353
2353
  const x = new c.Vector3(T, 0, 0), Z = new c.Vector3(T + _ * 0.75, 0, 0), S = new c.Vector3(T - d * 0.5, 0, M);
2354
2354
  for (let V = 0; V < f; V++) {
2355
- const G = V / (f - 1), Y = Lt(x, Z, S, G);
2356
- Y.x += w, C.push(Y);
2355
+ const G = V / (f - 1), $ = Lt(x, Z, S, G);
2356
+ $.x += P, C.push($);
2357
2357
  }
2358
2358
  C.reverse();
2359
2359
  }
@@ -2369,7 +2369,7 @@ class Ve extends Ce {
2369
2369
  E[x] = new c.Vector3(), z[x] = new c.Vector3();
2370
2370
  let A = 0;
2371
2371
  for (let x = 0; x < I; x++) {
2372
- const Z = C[Pe(x, I)], S = C[x], V = C[Nt(x, I)];
2372
+ const Z = C[we(x, I)], S = C[x], V = C[Nt(x, I)];
2373
2373
  let G;
2374
2374
  if (x === 0)
2375
2375
  G = new c.Vector3(1, 0, -2).normalize();
@@ -2379,7 +2379,7 @@ class Ve extends Ce {
2379
2379
  const it = S.clone().sub(Z).normalize(), nt = V.clone().sub(S).normalize();
2380
2380
  G = it.add(nt).multiplyScalar(0.5);
2381
2381
  }
2382
- const Y = new c.Vector3(0, 1, 0), K = De(G, Y), y = A;
2382
+ const $ = new c.Vector3(0, 1, 0), K = De(G, $), y = A;
2383
2383
  let b = Q(0, f / 4, x);
2384
2384
  b = F(0.1, 1, b), b = Math.sqrt(b);
2385
2385
  for (let it = 0; it < l; it++) {
@@ -2392,22 +2392,22 @@ class Ve extends Ce {
2392
2392
  }
2393
2393
  }
2394
2394
  let B = 0;
2395
- const P = C.length * 2;
2396
- for (let x = 0; x < P - 1; x++) {
2395
+ const w = C.length * 2;
2396
+ for (let x = 0; x < w - 1; x++) {
2397
2397
  const Z = x * l, S = (x + 1) * l;
2398
2398
  for (let V = 0; V < l; V++) {
2399
- const G = Nt(V, l), Y = Z + V, K = Z + G, y = S + G, b = S + V;
2400
- L[B++] = Y, L[B++] = b, L[B++] = K, L[B++] = K, L[B++] = b, L[B++] = y;
2399
+ const G = Nt(V, l), $ = Z + V, K = Z + G, y = S + G, b = S + V;
2400
+ L[B++] = $, L[B++] = b, L[B++] = K, L[B++] = K, L[B++] = b, L[B++] = y;
2401
2401
  }
2402
2402
  }
2403
- const v = [...E], N = [...z], R = [...L], $ = E.map((x) => x.clone()), tt = [...L];
2403
+ const v = [...E], N = [...z], R = [...L], Y = E.map((x) => x.clone()), tt = [...L];
2404
2404
  for (let x = 0; x < a - 1; x++) {
2405
- const Z = $.length;
2405
+ const Z = Y.length;
2406
2406
  for (let S = 0; S < tt.length; S++)
2407
2407
  tt[S] += Z;
2408
- for (let S = 0; S < $.length; S++)
2409
- $[S].z += o + s;
2410
- v.push(...$.map((S) => S.clone())), N.push(...z.map((S) => S.clone())), R.push(...tt);
2408
+ for (let S = 0; S < Y.length; S++)
2409
+ Y[S].z += o + s;
2410
+ v.push(...Y.map((S) => S.clone())), N.push(...z.map((S) => S.clone())), R.push(...tt);
2411
2411
  }
2412
2412
  const q = new Float32Array(v.length * 3), O = new Float32Array(N.length * 3);
2413
2413
  for (let x = 0; x < v.length; x++)
@@ -2435,12 +2435,12 @@ class Ve extends Ce {
2435
2435
  const p = new ht(0);
2436
2436
  let M = p;
2437
2437
  const T = o / u;
2438
- let w = 0;
2438
+ let P = 0;
2439
2439
  for (let y = 1; y < u + 1; y++)
2440
- M = M.createNext(w), w += T;
2440
+ M = M.createNext(P), P += T;
2441
2441
  const C = (e.x - o) / (f + 1);
2442
2442
  for (let y = u + 1; y < _; y++)
2443
- M = M.createNext(w), w += C;
2443
+ M = M.createNext(P), P += C;
2444
2444
  const k = new ht(0);
2445
2445
  let I = k;
2446
2446
  const U = e.y / (g - 1);
@@ -2456,9 +2456,9 @@ class Ve extends Ce {
2456
2456
  }
2457
2457
  const B = new le(a, A, !1);
2458
2458
  B.insert(p, k, z, L), p.updateIndex(0), k.updateIndex(0), pt(z, a.xSeams), pt(L, a.zSeams);
2459
- const P = this.m_BindingVertexCount + 2, v = new Array(P);
2459
+ const w = this.m_BindingVertexCount + 2, v = new Array(w);
2460
2460
  a.xNoneSeamIndexes = v, M = p;
2461
- for (let y = 0; y < P; y++) {
2461
+ for (let y = 0; y < w; y++) {
2462
2462
  v[y] = M.index;
2463
2463
  do
2464
2464
  M = M.next;
@@ -2466,8 +2466,8 @@ class Ve extends Ce {
2466
2466
  }
2467
2467
  const N = p.getValues(), R = k.getValues();
2468
2468
  _ = N.length, g = R.length;
2469
- const $ = _ * g, tt = [], q = new Array($).fill(0), O = [], x = [], Z = [], S = [];
2470
- $t(
2469
+ const Y = _ * g, tt = [], q = new Array(Y).fill(0), O = [], x = [], Z = [], S = [];
2470
+ Yt(
2471
2471
  tt,
2472
2472
  N,
2473
2473
  R,
@@ -2476,11 +2476,11 @@ class Ve extends Ce {
2476
2476
  this.m_Book.direction
2477
2477
  );
2478
2478
  const V = B.leftNode.index, G = B.downNode.index;
2479
- let Y = B.rightNode.index, K = B.upNode.index;
2480
- Y === 0 && (Y = _ - 1), K === 0 && (K = g - 1);
2479
+ let $ = B.rightNode.index, K = B.upNode.index;
2480
+ $ === 0 && ($ = _ - 1), K === 0 && (K = g - 1);
2481
2481
  for (let y = 0; y < g - 1; y++)
2482
2482
  for (let b = 0; b < _ - 1; b++) {
2483
- if (n && y >= G && y < K && b >= V && b < Y)
2483
+ if (n && y >= G && y < K && b >= V && b < $)
2484
2484
  continue;
2485
2485
  const it = y * _ + b, nt = y * _ + (b + 1), ct = (y + 1) * _ + b, ot = (y + 1) * _ + (b + 1);
2486
2486
  q[it] += 2, q[nt] += 2, q[ct] += 2, q[ot] += 2, Qt(
@@ -2490,10 +2490,10 @@ class Ve extends Ce {
2490
2490
  nt,
2491
2491
  ct,
2492
2492
  ot,
2493
- $
2493
+ Y
2494
2494
  );
2495
2495
  }
2496
- if (S.push(new Tt(0, 0, _ - 1, g - 1, !1, !1)), jt(S, Z, tt, _, g), a.baseXArray = N, a.baseZArray = R, a.baseVertexCount = $, a.vertexCount = tt.length, a.texcoords = tt, a.weights = q, h) {
2496
+ if (S.push(new Tt(0, 0, _ - 1, g - 1, !1, !1)), jt(S, Z, tt, _, g), a.baseXArray = N, a.baseZArray = R, a.baseVertexCount = Y, a.vertexCount = tt.length, a.texcoords = tt, a.weights = q, h) {
2497
2497
  a.subMeshCount = 1;
2498
2498
  const y = [];
2499
2499
  y.push(...O), y.push(...Z), y.push(...x), a.triangles = y;
@@ -2512,11 +2512,11 @@ class Ve extends Ce {
2512
2512
  const e = this.m_Book.papers, s = e.length;
2513
2513
  let i = 0;
2514
2514
  const n = e.length / 2 - 1, h = e.length / 2;
2515
- for (let w = 0; w < s; w++) {
2516
- const C = e[w];
2515
+ for (let P = 0; P < s; P++) {
2516
+ const C = e[P];
2517
2517
  C.updateTime();
2518
2518
  const k = C.zTime, I = C.thickness;
2519
- i += k * I, w === n && (i += k * this.m_BindingMidSpace / 2), w === h && (i += k * this.m_BindingMidSpace / 2);
2519
+ i += k * I, P === n && (i += k * this.m_BindingMidSpace / 2), P === h && (i += k * this.m_BindingMidSpace / 2);
2520
2520
  }
2521
2521
  let a = this.getStackHeight(t.index) - t.thickness / 2;
2522
2522
  const o = this.getStackZ(a), u = 180 + o;
@@ -2529,21 +2529,21 @@ class Ve extends Ce {
2529
2529
  d.z = t.margin;
2530
2530
  let _ = e[Math.floor(s / 2)].size.x, g = this.m_BindingMidSpace, p = Math.sqrt(_ * _ - g * g), M = Math.asin(p / _) * et - 90;
2531
2531
  if (t.index < Math.floor(s / 2)) {
2532
- let w = 0;
2532
+ let P = 0;
2533
2533
  if (this.m_Book.alignToGround) {
2534
2534
  _ = e[0].size.x;
2535
2535
  const C = this.m_StackHeight / 2;
2536
- g = H(i, 0, C) - C, p = Math.sqrt(_ * _ - g * g), w = (Math.asin(p / _) * et - 90) * 2;
2536
+ g = H(i, 0, C) - C, p = Math.sqrt(_ * _ - g * g), P = (Math.asin(p / _) * et - 90) * 2;
2537
2537
  }
2538
- m = F(M, -w, l);
2538
+ m = F(M, -P, l);
2539
2539
  } else {
2540
- let w = 0;
2540
+ let P = 0;
2541
2541
  if (this.m_Book.alignToGround) {
2542
2542
  _ = e[0].size.x;
2543
2543
  const C = this.m_StackHeight / 2;
2544
- g = C - H(i, C, C * 2), p = Math.sqrt(_ * _ - g * g), w = (Math.asin(p / _) * et - 90) * 2;
2544
+ g = C - H(i, C, C * 2), p = Math.sqrt(_ * _ - g * g), P = (Math.asin(p / _) * et - 90) * 2;
2545
2545
  }
2546
- m = F(w, -M, l);
2546
+ m = F(P, -M, l);
2547
2547
  }
2548
2548
  t.transform.position.copy(d), t.transform.quaternion.setFromEuler(
2549
2549
  new c.Euler(0, 0, m * J)
@@ -2632,13 +2632,13 @@ class Ve extends Ce {
2632
2632
  let e = new c.Vector3(0, 0, 0), s = new c.Vector3(0, 0, 0), i = this.m_BindingRadius * 0.6;
2633
2633
  const n = this.m_StapleThickness * 0.5, h = t[0].thickness, a = this.m_Root.matrixWorld.clone(), o = t.length;
2634
2634
  for (let u = 0; u < o; u++) {
2635
- const l = t[u], m = l.transform, f = l.meshData.pattern, d = l.meshData.baseVertices, _ = f.baseXArray, g = f.baseZArray, p = _.length, M = g.length, T = this.m_BindingVertexCount + 1, w = l.thickness, C = f.xNoneSeamIndexes, k = m.position.clone();
2635
+ const l = t[u], m = l.transform, f = l.meshData.pattern, d = l.meshData.baseVertices, _ = f.baseXArray, g = f.baseZArray, p = _.length, M = g.length, T = this.m_BindingVertexCount + 1, P = l.thickness, C = f.xNoneSeamIndexes, k = m.position.clone();
2636
2636
  let I = u, U = n;
2637
2637
  u >= Math.floor(o / 2) && (I = o - u - 1, U *= -1);
2638
- const E = (h + w) * 0.5 + w * (I - 1), z = m.matrixWorld.clone().invert().multiply(a), L = I / (o / 2);
2638
+ const E = (h + P) * 0.5 + P * (I - 1), z = m.matrixWorld.clone().invert().multiply(a), L = I / (o / 2);
2639
2639
  i = this.m_BindingRadius * F(0.45, 0.65, 1 - L);
2640
2640
  for (let A = 0; A < M; A++) {
2641
- const B = g[A], P = new c.Vector3(0, 0, k.z + B), v = k.clone();
2641
+ const B = g[A], w = new c.Vector3(0, 0, k.z + B), v = k.clone();
2642
2642
  v.z += B;
2643
2643
  const N = l.getDirection(B).multiplyScalar(i).add(v.clone());
2644
2644
  if (u === 0 && A === 0) {
@@ -2653,15 +2653,15 @@ class Ve extends Ce {
2653
2653
  const V = Math.atan2(e.y, e.x) * et;
2654
2654
  this.stapleMesh.rotation.set(0, 0, V * J);
2655
2655
  }
2656
- I > 0 && P.add(e.clone().multiplyScalar(E));
2656
+ I > 0 && w.add(e.clone().multiplyScalar(E));
2657
2657
  const R = A * p;
2658
- d[R] = P.clone().applyMatrix4(z), P.add(s.clone().multiplyScalar(U));
2659
- const $ = P.clone().applyMatrix4(z), tt = N.clone().applyMatrix4(z), q = v.clone().applyMatrix4(z);
2660
- d[R + C[1]] = $;
2658
+ d[R] = w.clone().applyMatrix4(z), w.add(s.clone().multiplyScalar(U));
2659
+ const Y = w.clone().applyMatrix4(z), tt = N.clone().applyMatrix4(z), q = v.clone().applyMatrix4(z);
2660
+ d[R + C[1]] = Y;
2661
2661
  for (let O = 2; O < T; O++) {
2662
2662
  const x = Q(1, T, O);
2663
2663
  d[R + C[O]] = Lt(
2664
- $,
2664
+ Y,
2665
2665
  tt,
2666
2666
  q,
2667
2667
  x
@@ -2987,22 +2987,38 @@ function He(r, t, e, s, i, n, h) {
2987
2987
  const u = h === "contain" ? Math.min(i / a, n / o) : Math.max(i / a, n / o), l = a * u, m = o * u;
2988
2988
  r.drawImage(t, e + (i - l) * 0.5, s + (n - m) * 0.5, l, m);
2989
2989
  }
2990
- function We(r, t, e, s, i, n, h) {
2991
- const a = n ? Math.round(n * Wt) : 512, o = h ? Math.round(h * Wt) : 512, u = document.createElement("canvas");
2992
- u.width = a, u.height = o;
2993
- const l = u.getContext("2d");
2994
- if (l.fillStyle = r, l.fillRect(0, 0, a, o), e) {
2995
- const f = i ? 0 : Math.round(Math.min(a, o) * 0.11);
2996
- He(l, e, f, f, a - f * 2, o - f * 2, s);
2997
- } else {
2998
- l.fillStyle = "#333";
2999
- const f = Math.round(Math.min(a, o) * 0.094);
3000
- l.font = `bold ${f}px Arial`, l.textAlign = "center", l.textBaseline = "middle", l.fillText(t, a / 2, o / 2);
2990
+ function We(r, t, e, s, i) {
2991
+ const n = i ? 0 : Math.round(Math.min(t, e) * 0.11), h = n, a = n, o = t - n * 2, u = e - n * 2, l = r.naturalWidth || r.width, m = r.naturalHeight || r.height;
2992
+ if (s === "fill" || l <= 0 || m <= 0)
2993
+ return { x: h, y: a, width: o, height: u };
2994
+ const f = s === "contain" ? Math.min(o / l, u / m) : Math.max(o / l, u / m), d = l * f, _ = m * f;
2995
+ return {
2996
+ x: h + (o - d) * 0.5,
2997
+ y: a + (u - _) * 0.5,
2998
+ width: d,
2999
+ height: _
3000
+ };
3001
+ }
3002
+ function Ge(r, t, e, s, i, n, h, a) {
3003
+ const o = n ? Math.round(n * Wt) : 512, u = h ? Math.round(h * Wt) : 512, l = document.createElement("canvas");
3004
+ l.width = o, l.height = u;
3005
+ const m = l.getContext("2d");
3006
+ if (m.fillStyle = r, m.fillRect(0, 0, o, u), e)
3007
+ if (a)
3008
+ m.drawImage(e, a.x, a.y, a.width, a.height);
3009
+ else {
3010
+ const d = i ? 0 : Math.round(Math.min(o, u) * 0.11);
3011
+ He(m, e, d, d, o - d * 2, u - d * 2, s);
3012
+ }
3013
+ else {
3014
+ m.fillStyle = "#333";
3015
+ const d = Math.round(Math.min(o, u) * 0.094);
3016
+ m.font = `bold ${d}px Arial`, m.textAlign = "center", m.textBaseline = "middle", m.fillText(t, o / 2, u / 2);
3001
3017
  }
3002
- const m = new c.CanvasTexture(u);
3003
- return m.colorSpace = c.SRGBColorSpace, m;
3018
+ const f = new c.CanvasTexture(l);
3019
+ return f.colorSpace = c.SRGBColorSpace, f;
3004
3020
  }
3005
- async function Ge(r) {
3021
+ async function je(r) {
3006
3022
  if (!r) return null;
3007
3023
  const t = URL.createObjectURL(r), e = new Image();
3008
3024
  e.decoding = "async", e.src = t;
@@ -3030,7 +3046,7 @@ export {
3030
3046
  xe as BookHeightException,
3031
3047
  Ue as BookPointerInteraction,
3032
3048
  _e as BookRenderer,
3033
- Pt as Cylinder,
3049
+ wt as Cylinder,
3034
3050
  ce as MeshFactory,
3035
3051
  Wt as PX_PER_UNIT,
3036
3052
  Oe as PageContent,
@@ -3043,7 +3059,7 @@ export {
3043
3059
  ht as PaperNode,
3044
3060
  le as PaperNodeMargin,
3045
3061
  Me as PaperPattern,
3046
- wt as PaperSeam,
3062
+ Pt as PaperSeam,
3047
3063
  rt as PaperSetup,
3048
3064
  gt as PaperUVMargin,
3049
3065
  ue as RendererFactory,
@@ -3054,8 +3070,9 @@ export {
3054
3070
  Ie as StapleSetup,
3055
3071
  Kt as TextBlock,
3056
3072
  Le as TextOverlayContent,
3057
- We as createPageTexture,
3073
+ We as computeDefaultImageRect,
3074
+ Ge as createPageTexture,
3058
3075
  He as drawImageWithFit,
3059
3076
  Ne as getSpreadPairs,
3060
- Ge as loadImage
3077
+ je as loadImage
3061
3078
  };
@@ -11,6 +11,13 @@ export interface LoadedImage {
11
11
  /** Object URL created by URL.createObjectURL — revoke when no longer needed. */
12
12
  objectUrl: string;
13
13
  }
14
+ /** Custom image position and size in canvas pixels. */
15
+ export interface ImageRect {
16
+ x: number;
17
+ y: number;
18
+ width: number;
19
+ height: number;
20
+ }
14
21
  /** Pixels per world unit — used to compute canvas size from page dimensions. */
15
22
  export declare const PX_PER_UNIT = 256;
16
23
  /**
@@ -22,6 +29,12 @@ export declare const PX_PER_UNIT = 256;
22
29
  * - `'cover'` — scales uniformly to fill, cropping the overflow
23
30
  */
24
31
  export declare function drawImageWithFit(ctx: CanvasRenderingContext2D, image: HTMLImageElement, x: number, y: number, width: number, height: number, fit: ImageFitMode): void;
32
+ /**
33
+ * Computes the default image rectangle for a given fit mode and canvas size.
34
+ * Returns the position and dimensions (in canvas pixels) that `drawImageWithFit`
35
+ * would use. Useful for initialising `ImageRect` before the user adjusts it.
36
+ */
37
+ export declare function computeDefaultImageRect(image: HTMLImageElement, canvasWidth: number, canvasHeight: number, fitMode: ImageFitMode, fullBleed: boolean): ImageRect;
25
38
  /**
26
39
  * Creates a `THREE.CanvasTexture` suitable for use as a book page.
27
40
  *
@@ -29,10 +42,11 @@ export declare function drawImageWithFit(ctx: CanvasRenderingContext2D, image: H
29
42
  * aspect ratio (256 px per world unit). Otherwise defaults to 512×512.
30
43
  *
31
44
  * - Fills the background with `color`.
32
- * - If `image` is provided, draws it using `fitMode` and `fullBleed`.
45
+ * - If `image` is provided, draws it using `fitMode` and `fullBleed`,
46
+ * or at the exact `imageRect` position if supplied.
33
47
  * - Otherwise, renders `label` as centred text (useful for debugging).
34
48
  */
35
- export declare function createPageTexture(color: string, label: string, image: HTMLImageElement | null, fitMode: ImageFitMode, fullBleed: boolean, pageWidth?: number, pageHeight?: number): THREE.Texture;
49
+ export declare function createPageTexture(color: string, label: string, image: HTMLImageElement | null, fitMode: ImageFitMode, fullBleed: boolean, pageWidth?: number, pageHeight?: number, imageRect?: ImageRect | null): THREE.Texture;
36
50
  /**
37
51
  * Loads a `File` into an `HTMLImageElement` and returns both the element
38
52
  * and the object URL it was decoded from.
@@ -1 +1 @@
1
- {"version":3,"file":"textureUtils.d.ts","sourceRoot":"","sources":["../src/textureUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,wDAAwD;AACxD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,8DAA8D;AAC9D,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,gFAAgF;AAChF,eAAO,MAAM,WAAW,MAAM,CAAC;AAI/B;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,gBAAgB,EACvB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,YAAY,GAChB,IAAI,CAkBN;AAID;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,gBAAgB,GAAG,IAAI,EAC9B,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,OAAO,EAClB,SAAS,CAAC,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,MAAM,GAClB,KAAK,CAAC,OAAO,CA2Bf;AAID;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAA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UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,GAC3B,KAAK,CAAC,OAAO,CA+Bf;AAID;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAmB1F"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectifthunes/three-book",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",