@tscircuit/core 0.0.774 → 0.0.776

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 +69 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -9226,6 +9226,47 @@ import { convertCircuitJsonToBpc } from "circuit-json-to-bpc";
9226
9226
  import { getGraphicsForBpcGraph, layoutSchematicGraphVariants } from "bpc-graph";
9227
9227
  import Debug5 from "debug";
9228
9228
  import { buildSubtree } from "@tscircuit/circuit-json-util";
9229
+
9230
+ // lib/components/primitive-components/Group/utils/updateSchematicPrimitivesForLayoutShift.ts
9231
+ function updateSchematicPrimitivesForLayoutShift({
9232
+ db,
9233
+ schematicComponentId,
9234
+ deltaX,
9235
+ deltaY
9236
+ }) {
9237
+ const rects = db.schematic_rect.list({
9238
+ schematic_component_id: schematicComponentId
9239
+ });
9240
+ for (const rect of rects) {
9241
+ rect.center.x += deltaX;
9242
+ rect.center.y += deltaY;
9243
+ }
9244
+ const lines = db.schematic_line.list({
9245
+ schematic_component_id: schematicComponentId
9246
+ });
9247
+ for (const line of lines) {
9248
+ line.x1 += deltaX;
9249
+ line.y1 += deltaY;
9250
+ line.x2 += deltaX;
9251
+ line.y2 += deltaY;
9252
+ }
9253
+ const circles = db.schematic_circle.list({
9254
+ schematic_component_id: schematicComponentId
9255
+ });
9256
+ for (const circle of circles) {
9257
+ circle.center.x += deltaX;
9258
+ circle.center.y += deltaY;
9259
+ }
9260
+ const arcs = db.schematic_arc.list({
9261
+ schematic_component_id: schematicComponentId
9262
+ });
9263
+ for (const arc of arcs) {
9264
+ arc.center.x += deltaX;
9265
+ arc.center.y += deltaY;
9266
+ }
9267
+ }
9268
+
9269
+ // lib/components/primitive-components/Group/Group_doInitialSchematicLayoutMatchAdapt.ts
9229
9270
  var debug4 = Debug5("Group_doInitialSchematicLayoutMatchAdapt");
9230
9271
  function Group_doInitialSchematicLayoutMatchAdapt(group) {
9231
9272
  const { db } = group.root;
@@ -9313,6 +9354,12 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
9313
9354
  text.position.x += positionDelta.x;
9314
9355
  text.position.y += positionDelta.y;
9315
9356
  }
9357
+ updateSchematicPrimitivesForLayoutShift({
9358
+ db,
9359
+ schematicComponentId: schematic_component2.schematic_component_id,
9360
+ deltaX: positionDelta.x,
9361
+ deltaY: positionDelta.y
9362
+ });
9316
9363
  schematic_component2.center = newCenter;
9317
9364
  continue;
9318
9365
  }
@@ -9789,7 +9836,7 @@ function Group_doInitialSchematicLayoutMatchPack(group) {
9789
9836
  if (!treeNode) {
9790
9837
  debug5(`Warning: No tree node found for chip: ${chipId}`);
9791
9838
  debug5(
9792
- `Available tree nodes:`,
9839
+ "Available tree nodes:",
9793
9840
  tree.childNodes.map((child, idx) => ({
9794
9841
  type: child.nodeType,
9795
9842
  name: child.nodeType === "component" ? child.sourceComponent?.name : child.sourceGroup?.name,
@@ -9826,6 +9873,12 @@ function Group_doInitialSchematicLayoutMatchPack(group) {
9826
9873
  text.position.x += positionDelta.x;
9827
9874
  text.position.y += positionDelta.y;
9828
9875
  }
9876
+ updateSchematicPrimitivesForLayoutShift({
9877
+ db,
9878
+ schematicComponentId: schematicComponent.schematic_component_id,
9879
+ deltaX: positionDelta.x,
9880
+ deltaY: positionDelta.y
9881
+ });
9829
9882
  schematicComponent.center = newCenter;
9830
9883
  if (placement.ccwRotationDegrees !== 0) {
9831
9884
  debug5(
@@ -10120,6 +10173,12 @@ function Group_doInitialSchematicLayoutGrid(group) {
10120
10173
  }
10121
10174
  });
10122
10175
  }
10176
+ updateSchematicPrimitivesForLayoutShift({
10177
+ db,
10178
+ schematicComponentId: child.schematic_component_id,
10179
+ deltaX,
10180
+ deltaY
10181
+ });
10123
10182
  }
10124
10183
  }
10125
10184
  if (group.schematic_group_id) {
@@ -12856,7 +12915,8 @@ import {
12856
12915
  checkPcbComponentsOutOfBoard,
12857
12916
  checkPcbTracesOutOfBoard,
12858
12917
  checkDifferentNetViaSpacing,
12859
- checkSameNetViaSpacing
12918
+ checkSameNetViaSpacing,
12919
+ checkPcbComponentOverlap
12860
12920
  } from "@tscircuit/checks";
12861
12921
  var getRoundedRectOutline = (width, height, radius) => {
12862
12922
  const r = Math.min(radius, width / 2, height / 2);
@@ -13142,6 +13202,10 @@ var Board = class extends Group6 {
13142
13202
  for (const error of sameNetViaErrors) {
13143
13203
  db.pcb_via_clearance_error.insert(error);
13144
13204
  }
13205
+ const pcbComponentOverlapErrors = checkPcbComponentOverlap(db.toArray());
13206
+ for (const error of pcbComponentOverlapErrors) {
13207
+ db.pcb_footprint_overlap_error.insert(error);
13208
+ }
13145
13209
  }
13146
13210
  _emitRenderLifecycleEvent(phase, startOrEnd) {
13147
13211
  super._emitRenderLifecycleEvent(phase, startOrEnd);
@@ -16131,7 +16195,7 @@ import { identity as identity6 } from "transformation-matrix";
16131
16195
  var package_default = {
16132
16196
  name: "@tscircuit/core",
16133
16197
  type: "module",
16134
- version: "0.0.773",
16198
+ version: "0.0.775",
16135
16199
  types: "dist/index.d.ts",
16136
16200
  main: "dist/index.js",
16137
16201
  module: "dist/index.js",
@@ -16161,7 +16225,7 @@ var package_default = {
16161
16225
  devDependencies: {
16162
16226
  "@biomejs/biome": "^1.8.3",
16163
16227
  "@tscircuit/capacity-autorouter": "^0.0.131",
16164
- "@tscircuit/checks": "^0.0.84",
16228
+ "@tscircuit/checks": "^0.0.85",
16165
16229
  "@tscircuit/circuit-json-util": "^0.0.67",
16166
16230
  "@tscircuit/common": "^0.0.9",
16167
16231
  "@tscircuit/footprinter": "^0.0.236",
@@ -16190,7 +16254,7 @@ var package_default = {
16190
16254
  "circuit-json-to-gltf": "^0.0.7",
16191
16255
  "circuit-json-to-simple-3d": "^0.0.9",
16192
16256
  "circuit-json-to-spice": "^0.0.13",
16193
- "circuit-to-svg": "^0.0.228",
16257
+ "circuit-to-svg": "^0.0.230",
16194
16258
  concurrently: "^9.1.2",
16195
16259
  "connectivity-map": "^1.0.0",
16196
16260
  debug: "^4.3.6",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.774",
4
+ "version": "0.0.776",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -31,7 +31,7 @@
31
31
  "devDependencies": {
32
32
  "@biomejs/biome": "^1.8.3",
33
33
  "@tscircuit/capacity-autorouter": "^0.0.131",
34
- "@tscircuit/checks": "^0.0.84",
34
+ "@tscircuit/checks": "^0.0.85",
35
35
  "@tscircuit/circuit-json-util": "^0.0.67",
36
36
  "@tscircuit/common": "^0.0.9",
37
37
  "@tscircuit/footprinter": "^0.0.236",
@@ -60,7 +60,7 @@
60
60
  "circuit-json-to-gltf": "^0.0.7",
61
61
  "circuit-json-to-simple-3d": "^0.0.9",
62
62
  "circuit-json-to-spice": "^0.0.13",
63
- "circuit-to-svg": "^0.0.228",
63
+ "circuit-to-svg": "^0.0.230",
64
64
  "concurrently": "^9.1.2",
65
65
  "connectivity-map": "^1.0.0",
66
66
  "debug": "^4.3.6",