@tscircuit/core 0.0.2154 → 0.0.2156

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 +20 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4284,18 +4284,24 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
4284
4284
  connectedTo: withNetId([element.pcb_plated_hole_id])
4285
4285
  });
4286
4286
  } else if (element.shape === "oval") {
4287
+ const rotatedRect = {
4288
+ center: { x: element.x, y: element.y },
4289
+ width: element.outer_width,
4290
+ height: element.outer_height,
4291
+ rotation: element.ccw_rotation ?? 0
4292
+ };
4293
+ const axisAlignedRect = getAxisAlignedRectFromRotatedRect(rotatedRect);
4294
+ const rect = axisAlignedRect ?? rotatedRect;
4287
4295
  obstacles.push({
4288
4296
  circuitJsonMetadata: pcbPlatedHoleCircuitJsonMetadata,
4289
4297
  componentId: pcbComponentId,
4290
4298
  // @ts-ignore
4291
4299
  type: "oval",
4292
4300
  layers: everyLayer,
4293
- center: {
4294
- x: element.x,
4295
- y: element.y
4296
- },
4297
- width: element.outer_width,
4298
- height: element.outer_height,
4301
+ center: rect.center,
4302
+ width: rect.width,
4303
+ height: rect.height,
4304
+ ccwRotationDegrees: axisAlignedRect ? void 0 : rotatedRect.rotation,
4299
4305
  connectedTo: withNetId([element.pcb_plated_hole_id])
4300
4306
  });
4301
4307
  } else if (element.shape === "pill") {
@@ -10727,6 +10733,9 @@ var Keepout = class extends PrimitiveComponent2 {
10727
10733
  const subcircuit = this.getSubcircuit();
10728
10734
  const { db: db2 } = this.root;
10729
10735
  const { _parsedProps: props } = this;
10736
+ const pcbComponentId = this.getPrimitiveContainer()?.pcb_component_id ?? void 0;
10737
+ const pcbKeepoutOwnershipProps = pcbComponentId ? { pcb_component_id: pcbComponentId } : {};
10738
+ const pcbGroupId = this.getGroup()?.pcb_group_id ?? void 0;
10730
10739
  const position = this._getGlobalPcbPositionBeforeLayout();
10731
10740
  const decomposedMat = decomposeTSR3(
10732
10741
  this._computePcbGlobalTransformBeforeLayout()
@@ -10746,6 +10755,7 @@ var Keepout = class extends PrimitiveComponent2 {
10746
10755
  pcb_keepout = db2.pcb_keepout.insert({
10747
10756
  layers,
10748
10757
  shape: "circle",
10758
+ ...pcbKeepoutOwnershipProps,
10749
10759
  ...pcbKeepoutExclusionProps,
10750
10760
  ...props.allowTraces !== void 0 ? { allow_traces: props.allowTraces } : {},
10751
10761
  ...props.allowPlacements !== void 0 ? { allow_placements: props.allowPlacements } : {},
@@ -10757,12 +10767,13 @@ var Keepout = class extends PrimitiveComponent2 {
10757
10767
  y: position.y
10758
10768
  },
10759
10769
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
10760
- pcb_group_id: subcircuit?.getGroup()?.pcb_group_id ?? void 0
10770
+ pcb_group_id: pcbGroupId
10761
10771
  });
10762
10772
  } else if (props.shape === "rect") {
10763
10773
  pcb_keepout = db2.pcb_keepout.insert({
10764
10774
  layers,
10765
10775
  shape: "rect",
10776
+ ...pcbKeepoutOwnershipProps,
10766
10777
  ...pcbKeepoutExclusionProps,
10767
10778
  ...props.allowTraces !== void 0 ? { allow_traces: props.allowTraces } : {},
10768
10779
  ...props.allowPlacements !== void 0 ? { allow_placements: props.allowPlacements } : {},
@@ -10774,7 +10785,7 @@ var Keepout = class extends PrimitiveComponent2 {
10774
10785
  y: position.y
10775
10786
  },
10776
10787
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
10777
- pcb_group_id: subcircuit?.getGroup()?.pcb_group_id ?? void 0
10788
+ pcb_group_id: pcbGroupId
10778
10789
  });
10779
10790
  }
10780
10791
  if (pcb_keepout) {
@@ -119162,7 +119173,7 @@ var RoutingPhasePreparationError = class extends Error {
119162
119173
  var package_default = {
119163
119174
  name: "@tscircuit/core",
119164
119175
  type: "module",
119165
- version: "0.0.2153",
119176
+ version: "0.0.2155",
119166
119177
  types: "dist/index.d.ts",
119167
119178
  main: "dist/index.js",
119168
119179
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.2154",
4
+ "version": "0.0.2156",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",