@tscircuit/core 0.0.168 → 0.0.169

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 +10 -6
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2905,7 +2905,6 @@ var NormalComponent = class extends PrimitiveComponent {
2905
2905
  });
2906
2906
  }
2907
2907
  doInitialPartsEngineRender() {
2908
- console.log("doInitialPartsEngineRender", this);
2909
2908
  const { partsEngine } = this.getSubcircuit()._parsedProps;
2910
2909
  if (!partsEngine) return;
2911
2910
  const { db } = this.root;
@@ -2933,7 +2932,6 @@ var NormalComponent = class extends PrimitiveComponent {
2933
2932
  }
2934
2933
  updatePartsEngineRender() {
2935
2934
  const { db } = this.root;
2936
- console.log("updatePartsEngineRender", this);
2937
2935
  const source_component = db.source_component.get(this.source_component_id);
2938
2936
  if (!source_component) return;
2939
2937
  if (source_component.supplier_part_numbers) return;
@@ -3581,6 +3579,7 @@ var pushEdgesOfSchematicTraceToPreventOverlap = ({
3581
3579
 
3582
3580
  // lib/components/primitive-components/Trace/create-schematic-trace-crossing-segments.ts
3583
3581
  import { doesLineIntersectLine as doesLineIntersectLine2 } from "@tscircuit/math-utils";
3582
+ import { getUnitVectorFromPointAToB } from "@tscircuit/math-utils";
3584
3583
  var createSchematicTraceCrossingSegments = ({
3585
3584
  edges,
3586
3585
  db,
@@ -3606,14 +3605,19 @@ var createSchematicTraceCrossingSegments = ({
3606
3605
  const intersectX = edgeOrientation === "vertical" ? edge.from.x : otherEdge.from.x;
3607
3606
  const intersectY = edgeOrientation === "vertical" ? otherEdge.from.y : edge.from.y;
3608
3607
  const crossingSegmentLength = 0.1;
3608
+ const lastDrawnPoint = edge.from;
3609
3609
  const crossingPoint = { x: intersectX, y: intersectY };
3610
+ const crossingUnitVec = getUnitVectorFromPointAToB(
3611
+ lastDrawnPoint,
3612
+ crossingPoint
3613
+ );
3610
3614
  const beforeCrossing = {
3611
- x: edgeOrientation === "vertical" ? crossingPoint.x : crossingPoint.x - crossingSegmentLength / 2,
3612
- y: edgeOrientation === "vertical" ? crossingPoint.y - crossingSegmentLength / 2 : crossingPoint.y
3615
+ x: crossingPoint.x - crossingUnitVec.x * crossingSegmentLength / 2,
3616
+ y: crossingPoint.y - crossingUnitVec.y * crossingSegmentLength / 2
3613
3617
  };
3614
3618
  const afterCrossing = {
3615
- x: edgeOrientation === "vertical" ? crossingPoint.x : crossingPoint.x + crossingSegmentLength / 2,
3616
- y: edgeOrientation === "vertical" ? crossingPoint.y + crossingSegmentLength / 2 : crossingPoint.y
3619
+ x: crossingPoint.x + crossingUnitVec.x * crossingSegmentLength / 2,
3620
+ y: crossingPoint.y + crossingUnitVec.y * crossingSegmentLength / 2
3617
3621
  };
3618
3622
  const newEdges = [
3619
3623
  { from: edge.from, to: beforeCrossing },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.168",
4
+ "version": "0.0.169",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -39,7 +39,7 @@
39
39
  "@lume/kiwi": "^0.4.3",
40
40
  "@tscircuit/footprinter": "^0.0.77",
41
41
  "@tscircuit/infgrid-ijump-astar": "^0.0.24",
42
- "@tscircuit/math-utils": "^0.0.4",
42
+ "@tscircuit/math-utils": "^0.0.5",
43
43
  "@tscircuit/props": "^0.0.93",
44
44
  "@tscircuit/schematic-autolayout": "^0.0.6",
45
45
  "@tscircuit/soup-util": "^0.0.40",