three-cad-viewer 4.3.5 → 4.3.7

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 (58) hide show
  1. package/dist/three-cad-viewer.esm.js +8 -5
  2. package/dist/three-cad-viewer.esm.js.map +1 -1
  3. package/dist/three-cad-viewer.esm.min.js +1 -1
  4. package/dist/three-cad-viewer.js +8 -5
  5. package/dist/three-cad-viewer.min.js +1 -1
  6. package/package.json +2 -3
  7. package/src/_version.ts +0 -1
  8. package/src/camera/camera.ts +0 -445
  9. package/src/camera/controls/CADOrbitControls.ts +0 -241
  10. package/src/camera/controls/CADTrackballControls.ts +0 -598
  11. package/src/camera/controls.ts +0 -380
  12. package/src/core/patches.ts +0 -16
  13. package/src/core/studio-manager.ts +0 -652
  14. package/src/core/types.ts +0 -892
  15. package/src/core/viewer-state.ts +0 -784
  16. package/src/core/viewer.ts +0 -4821
  17. package/src/index.ts +0 -151
  18. package/src/rendering/environment.ts +0 -840
  19. package/src/rendering/light-detection.ts +0 -327
  20. package/src/rendering/material-factory.ts +0 -735
  21. package/src/rendering/material-presets.ts +0 -289
  22. package/src/rendering/raycast.ts +0 -291
  23. package/src/rendering/room-environment.ts +0 -192
  24. package/src/rendering/studio-composer.ts +0 -577
  25. package/src/rendering/studio-floor.ts +0 -108
  26. package/src/rendering/texture-cache.ts +0 -324
  27. package/src/rendering/tree-model.ts +0 -542
  28. package/src/rendering/triplanar.ts +0 -329
  29. package/src/scene/animation.ts +0 -343
  30. package/src/scene/axes.ts +0 -108
  31. package/src/scene/bbox.ts +0 -223
  32. package/src/scene/clipping.ts +0 -650
  33. package/src/scene/grid.ts +0 -864
  34. package/src/scene/nestedgroup.ts +0 -1448
  35. package/src/scene/objectgroup.ts +0 -866
  36. package/src/scene/orientation.ts +0 -259
  37. package/src/scene/render-shape.ts +0 -634
  38. package/src/tools/cad_tools/measure.ts +0 -811
  39. package/src/tools/cad_tools/select.ts +0 -100
  40. package/src/tools/cad_tools/tools.ts +0 -231
  41. package/src/tools/cad_tools/ui.ts +0 -454
  42. package/src/tools/cad_tools/zebra.ts +0 -369
  43. package/src/types/html.d.ts +0 -5
  44. package/src/types/n8ao.d.ts +0 -28
  45. package/src/types/three-augmentation.d.ts +0 -60
  46. package/src/ui/display.ts +0 -3295
  47. package/src/ui/index.html +0 -505
  48. package/src/ui/info.ts +0 -177
  49. package/src/ui/slider.ts +0 -206
  50. package/src/ui/toolbar.ts +0 -347
  51. package/src/ui/treeview.ts +0 -945
  52. package/src/utils/decode-instances.ts +0 -233
  53. package/src/utils/font.ts +0 -60
  54. package/src/utils/gpu-tracker.ts +0 -265
  55. package/src/utils/logger.ts +0 -92
  56. package/src/utils/sizeof.ts +0 -116
  57. package/src/utils/timer.ts +0 -69
  58. package/src/utils/utils.ts +0 -446
@@ -83221,9 +83221,11 @@ void main() {
83221
83221
  const roleForCache = colorSpace === SRGBColorSpace
83222
83222
  ? "baseColorTexture"
83223
83223
  : "normalTexture";
83224
- const tex = await textureCache.get(textureRef, roleForCache);
83224
+ let tex = await textureCache.get(textureRef, roleForCache);
83225
83225
  if (tex) {
83226
- if (textureRepeat) {
83226
+ if (textureRepeat && (textureRepeat[0] !== 1 || textureRepeat[1] !== 1)) {
83227
+ // Clone to avoid mutating shared cached texture
83228
+ tex = tex.clone();
83227
83229
  tex.repeat.set(textureRepeat[0], textureRepeat[1]);
83228
83230
  }
83229
83231
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -83912,8 +83914,9 @@ float metalnessFactor = metalness;
83912
83914
  // Uniform values (captured by closure, per-object)
83913
83915
  const offset = bb.min.clone();
83914
83916
  const scale = 1.0 / maxDim;
83915
- // Read texture repeat from the material's map (all textures share same repeat)
83916
- const repeat = material.map?.repeat?.clone() ?? new Vector2(1, 1);
83917
+ // Read texture repeat from the first available texture map
83918
+ const repeat = (material.map ?? material.roughnessMap ?? material.normalMap ??
83919
+ material.metalnessMap ?? material.emissiveMap ?? material.aoMap)?.repeat?.clone() ?? new Vector2(1, 1);
83917
83920
  material.onBeforeCompile = (shader) => {
83918
83921
  // Custom uniforms
83919
83922
  shader.uniforms.triplanarOffset = { value: offset };
@@ -94307,7 +94310,7 @@ float metalnessFactor = metalness;
94307
94310
  }
94308
94311
  }
94309
94312
 
94310
- const version = "4.3.5";
94313
+ const version = "4.3.7";
94311
94314
 
94312
94315
  /**
94313
94316
  * Clean room environment for Studio mode PMREM generation.