@tscircuit/checks 0.0.172 → 0.0.173
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 +10 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1967,6 +1967,11 @@ function checkCopperToBoardEdgeClearance(circuitJson) {
|
|
|
1967
1967
|
if (!boardPolygon) return [];
|
|
1968
1968
|
const requiredClearance = getBoardDrcValue(board, "min_board_edge_clearance") ?? jlcMinTolerances.min_board_edge_clearance;
|
|
1969
1969
|
if (requiredClearance === void 0) return [];
|
|
1970
|
+
const allowedOffBoardComponentIds = new Set(
|
|
1971
|
+
circuitJson.filter(
|
|
1972
|
+
(element) => element.type === "pcb_component"
|
|
1973
|
+
).filter((component) => component.is_allowed_to_be_off_board).map((component) => toPcbComponentId(component.pcb_component_id))
|
|
1974
|
+
);
|
|
1970
1975
|
const copperElements = circuitJson.filter(
|
|
1971
1976
|
(element) => element.type === "pcb_via" || element.type === "pcb_smtpad" || element.type === "pcb_plated_hole" || element.type === "pcb_copper_pour"
|
|
1972
1977
|
);
|
|
@@ -1980,6 +1985,11 @@ function checkCopperToBoardEdgeClearance(circuitJson) {
|
|
|
1980
1985
|
);
|
|
1981
1986
|
const errors = [];
|
|
1982
1987
|
for (const element of copperElements) {
|
|
1988
|
+
if ((element.type === "pcb_smtpad" || element.type === "pcb_plated_hole") && element.pcb_component_id && allowedOffBoardComponentIds.has(
|
|
1989
|
+
toPcbComponentId(element.pcb_component_id)
|
|
1990
|
+
)) {
|
|
1991
|
+
continue;
|
|
1992
|
+
}
|
|
1983
1993
|
const geometry = getCopperGeometry(element, componentCcwRotationsById);
|
|
1984
1994
|
if (!geometry) continue;
|
|
1985
1995
|
const { isInside, clearance } = measureClearance(boardPolygon, geometry);
|