@tscircuit/core 0.0.810 → 0.0.811

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 (2) hide show
  1. package/dist/index.js +8 -9
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -8391,7 +8391,6 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
8391
8391
  if (!cadModel && !footprint) return;
8392
8392
  if (cadModel === null) return;
8393
8393
  const bounds = this._getPcbCircuitJsonBounds();
8394
- const pcb_component = db.pcb_component.get(this.pcb_component_id);
8395
8394
  if (typeof cadModel === "string") {
8396
8395
  throw new Error("String cadModel not yet implemented");
8397
8396
  }
@@ -8413,10 +8412,10 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
8413
8412
  const computedLayer = this.props.layer === "bottom" ? "bottom" : "top";
8414
8413
  const globalTransform = this._computePcbGlobalTransformBeforeLayout();
8415
8414
  const decomposedTransform = decomposeTSR5(globalTransform);
8416
- const accumulatedRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
8417
- const pcbRotation = pcb_component?.rotation ?? 0;
8418
- const rotationWithOffset = pcbRotation + accumulatedRotation + (rotationOffset.z ?? 0);
8419
- const cadRotationZ = computedLayer === "bottom" ? normalizeDegrees(-rotationWithOffset + 180) : normalizeDegrees(rotationWithOffset);
8415
+ const totalRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
8416
+ const isBottomLayer = computedLayer === "bottom";
8417
+ const rotationWithOffset = totalRotation + (rotationOffset.z ?? 0);
8418
+ const cadRotationZ = normalizeDegrees(rotationWithOffset);
8420
8419
  const cad_model = db.cad_component.insert({
8421
8420
  // TODO z maybe depends on layer
8422
8421
  position: {
@@ -8426,8 +8425,8 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
8426
8425
  },
8427
8426
  rotation: {
8428
8427
  x: rotationOffset.x,
8429
- y: (computedLayer === "top" ? 0 : 180) + rotationOffset.y,
8430
- z: cadRotationZ
8428
+ y: rotationOffset.y + (isBottomLayer ? 180 : 0),
8429
+ z: normalizeDegrees(isBottomLayer ? -cadRotationZ : cadRotationZ)
8431
8430
  },
8432
8431
  pcb_component_id: this.pcb_component_id,
8433
8432
  source_component_id: this.source_component_id,
@@ -17220,7 +17219,7 @@ import { identity as identity6 } from "transformation-matrix";
17220
17219
  var package_default = {
17221
17220
  name: "@tscircuit/core",
17222
17221
  type: "module",
17223
- version: "0.0.809",
17222
+ version: "0.0.810",
17224
17223
  types: "dist/index.d.ts",
17225
17224
  main: "dist/index.js",
17226
17225
  module: "dist/index.js",
@@ -17277,7 +17276,7 @@ var package_default = {
17277
17276
  "circuit-json": "^0.0.288",
17278
17277
  "circuit-json-to-bpc": "^0.0.13",
17279
17278
  "circuit-json-to-connectivity-map": "^0.0.22",
17280
- "circuit-json-to-gltf": "^0.0.27",
17279
+ "circuit-json-to-gltf": "^0.0.28",
17281
17280
  "circuit-json-to-simple-3d": "^0.0.9",
17282
17281
  "circuit-json-to-spice": "^0.0.15",
17283
17282
  "circuit-to-svg": "^0.0.250",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.810",
4
+ "version": "0.0.811",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -58,7 +58,7 @@
58
58
  "circuit-json": "^0.0.288",
59
59
  "circuit-json-to-bpc": "^0.0.13",
60
60
  "circuit-json-to-connectivity-map": "^0.0.22",
61
- "circuit-json-to-gltf": "^0.0.27",
61
+ "circuit-json-to-gltf": "^0.0.28",
62
62
  "circuit-json-to-simple-3d": "^0.0.9",
63
63
  "circuit-json-to-spice": "^0.0.15",
64
64
  "circuit-to-svg": "^0.0.250",