three-cad-viewer 4.3.4 → 4.3.5

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.
@@ -20,6 +20,12 @@ declare class CenteredPlane extends THREE.Plane {
20
20
  * @param value - The centered constant value.
21
21
  */
22
22
  setConstant(value: number): void;
23
+ /**
24
+ * Clone this CenteredPlane.
25
+ * Overrides THREE.Plane.clone() which calls `new this.constructor()` without
26
+ * arguments, causing `center` to be undefined during shadow map generation.
27
+ */
28
+ clone(): CenteredPlane;
23
29
  }
24
30
  /**
25
31
  * A THREE.Group that only contains PlaneMesh children.
@@ -84131,11 +84131,15 @@ class NestedGroup {
84131
84131
  logger.warn(`Unknown builtin preset '${presetName}' referenced by '${tag}' on '${objectPath}'`);
84132
84132
  return null;
84133
84133
  }
84134
- const resolved = { ...preset, ...appearance };
84134
+ // Strip preset color unless the user explicitly provides one,
84135
+ // so the leaf node's CAD color is used as fallback.
84136
+ const { color: presetColor, ...presetRest } = preset;
84137
+ const resolved = "color" in appearance
84138
+ ? { ...preset, ...appearance }
84139
+ : { ...presetRest, ...appearance };
84135
84140
  this.resolvedMaterials.set(tag, resolved);
84136
84141
  return resolved;
84137
84142
  }
84138
- // Should not happen with current type, but guard anyway
84139
84143
  logger.warn(`Unrecognised material entry for tag '${tag}' on '${objectPath}'`);
84140
84144
  return null;
84141
84145
  }
@@ -87474,6 +87478,15 @@ class CenteredPlane extends Plane {
87474
87478
  const z = this.distanceToPoint(new Vector3(0, 0, 0));
87475
87479
  this.constant = z - c + value;
87476
87480
  }
87481
+ /**
87482
+ * Clone this CenteredPlane.
87483
+ * Overrides THREE.Plane.clone() which calls `new this.constructor()` without
87484
+ * arguments, causing `center` to be undefined during shadow map generation.
87485
+ */
87486
+ // @ts-expect-error -- THREE.Plane.clone() returns `this`, but we need a concrete CenteredPlane
87487
+ clone() {
87488
+ return new CenteredPlane(this.normal.clone(), this.centeredConstant, [...this.center]);
87489
+ }
87477
87490
  }
87478
87491
  // ============================================================================
87479
87492
  // PlaneMesh - Visual representation of a clipping plane
@@ -94288,7 +94301,7 @@ class Tools {
94288
94301
  }
94289
94302
  }
94290
94303
 
94291
- const version = "4.3.4";
94304
+ const version = "4.3.5";
94292
94305
 
94293
94306
  /**
94294
94307
  * Clean room environment for Studio mode PMREM generation.