@tscircuit/checks 0.0.155 → 0.0.156
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.
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -573,10 +573,6 @@ var getPcbBoard = (circuitJson) => circuitJson.find((el) => el.type === "pcb_boa
|
|
|
573
573
|
var getBoardDrcValue = (board, key) => board?.[key];
|
|
574
574
|
|
|
575
575
|
// lib/check-pad-clearance/common.ts
|
|
576
|
-
var formatMm = (value) => {
|
|
577
|
-
const rounded = Math.round(value * 1e3) / 1e3;
|
|
578
|
-
return `${Number(rounded.toFixed(3))}mm`;
|
|
579
|
-
};
|
|
580
576
|
var getPadBounds = (pad) => getBoundsOfPcbElements2([pad]);
|
|
581
577
|
var getPadCenter = (pad) => {
|
|
582
578
|
const bounds = getPadBounds(pad);
|
|
@@ -2600,6 +2596,7 @@ import {
|
|
|
2600
2596
|
getPrimaryId as getPrimaryId3,
|
|
2601
2597
|
getReadableNameForElement as getReadableNameForElement6
|
|
2602
2598
|
} from "@tscircuit/circuit-json-util";
|
|
2599
|
+
import { formatMm } from "format-si-unit";
|
|
2603
2600
|
import {
|
|
2604
2601
|
getFullConnectivityMapFromCircuitJson as getFullConnectivityMapFromCircuitJson8
|
|
2605
2602
|
} from "circuit-json-to-connectivity-map";
|
|
@@ -2664,6 +2661,7 @@ import {
|
|
|
2664
2661
|
getPrimaryId as getPrimaryId4,
|
|
2665
2662
|
getReadableNameForElement as getReadableNameForElement7
|
|
2666
2663
|
} from "@tscircuit/circuit-json-util";
|
|
2664
|
+
import { formatMm as formatMm2 } from "format-si-unit";
|
|
2667
2665
|
import {
|
|
2668
2666
|
getFullConnectivityMapFromCircuitJson as getFullConnectivityMapFromCircuitJson9
|
|
2669
2667
|
} from "circuit-json-to-connectivity-map";
|
|
@@ -2706,7 +2704,7 @@ function checkPadTraceClearance(circuitJson, {
|
|
|
2706
2704
|
type: "pcb_pad_trace_clearance_error",
|
|
2707
2705
|
pcb_pad_trace_clearance_error_id: `pad_trace_clearance_${pairId}`,
|
|
2708
2706
|
error_type: "pcb_pad_trace_clearance_error",
|
|
2709
|
-
message: `Pad ${getReadableNameForElement7(circuitJson, padId)} and trace ${getReadableNameForElement7(circuitJson, segment.pcb_trace_id)} are too close (clearance: ${
|
|
2707
|
+
message: `Pad ${getReadableNameForElement7(circuitJson, padId)} and trace ${getReadableNameForElement7(circuitJson, segment.pcb_trace_id)} are too close (clearance: ${formatMm2(gap)}, minimum: ${formatMm2(minClearance)})`,
|
|
2710
2708
|
pcb_pad_id: padId,
|
|
2711
2709
|
pcb_trace_id: segment.pcb_trace_id,
|
|
2712
2710
|
minimum_clearance: minClearance,
|
|
@@ -2724,6 +2722,7 @@ function checkPadTraceClearance(circuitJson, {
|
|
|
2724
2722
|
|
|
2725
2723
|
// lib/check-via-trace-clearance.ts
|
|
2726
2724
|
import { getReadableNameForElement as getReadableNameForElement8 } from "@tscircuit/circuit-json-util";
|
|
2725
|
+
import { formatMm as formatMm3 } from "format-si-unit";
|
|
2727
2726
|
import {
|
|
2728
2727
|
getFullConnectivityMapFromCircuitJson as getFullConnectivityMapFromCircuitJson10
|
|
2729
2728
|
} from "circuit-json-to-connectivity-map";
|
|
@@ -2757,7 +2756,7 @@ function checkViaTraceClearance(circuitJson, {
|
|
|
2757
2756
|
type: "pcb_via_trace_clearance_error",
|
|
2758
2757
|
pcb_via_trace_clearance_error_id: `via_trace_clearance_${pairId}`,
|
|
2759
2758
|
error_type: "pcb_via_trace_clearance_error",
|
|
2760
|
-
message: `Via ${getReadableNameForElement8(circuitJson, via.pcb_via_id)} and trace ${getReadableNameForElement8(circuitJson, segment.pcb_trace_id)} are too close (clearance: ${
|
|
2759
|
+
message: `Via ${getReadableNameForElement8(circuitJson, via.pcb_via_id)} and trace ${getReadableNameForElement8(circuitJson, segment.pcb_trace_id)} are too close (clearance: ${formatMm3(gap)}, minimum: ${formatMm3(minClearance)})`,
|
|
2761
2760
|
pcb_via_id: via.pcb_via_id,
|
|
2762
2761
|
pcb_trace_id: segment.pcb_trace_id,
|
|
2763
2762
|
minimum_clearance: minClearance,
|
|
@@ -2778,6 +2777,7 @@ import {
|
|
|
2778
2777
|
getPrimaryId as getPrimaryId5,
|
|
2779
2778
|
getReadableNameForElement as getReadableNameForElement9
|
|
2780
2779
|
} from "@tscircuit/circuit-json-util";
|
|
2780
|
+
import { formatMm as formatMm4 } from "format-si-unit";
|
|
2781
2781
|
import {
|
|
2782
2782
|
getFullConnectivityMapFromCircuitJson as getFullConnectivityMapFromCircuitJson11
|
|
2783
2783
|
} from "circuit-json-to-connectivity-map";
|
|
@@ -2820,7 +2820,7 @@ function checkViaPadClearance(circuitJson, {
|
|
|
2820
2820
|
type: "pcb_pad_pad_clearance_error",
|
|
2821
2821
|
pcb_pad_pad_clearance_error_id: `via_pad_clearance_${via.pcb_via_id}_${padId}`,
|
|
2822
2822
|
error_type: "pcb_pad_pad_clearance_error",
|
|
2823
|
-
message: `Via ${getReadableNameForElement9(circuitJson, via.pcb_via_id)} and pad ${getReadableNameForElement9(circuitJson, padId)} are too close (clearance: ${
|
|
2823
|
+
message: `Via ${getReadableNameForElement9(circuitJson, via.pcb_via_id)} and pad ${getReadableNameForElement9(circuitJson, padId)} are too close (clearance: ${formatMm4(gap)}, minimum: ${formatMm4(requiredClearance)})`,
|
|
2824
2824
|
pcb_pad_ids: [via.pcb_via_id, padId],
|
|
2825
2825
|
minimum_clearance: requiredClearance,
|
|
2826
2826
|
actual_clearance: gap,
|