@tscircuit/circuit-json-util 0.0.87 → 0.0.89
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/README.md +2 -1
- package/dist/index.d.ts +597 -133
- package/dist/index.js +21 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -953,7 +953,7 @@ var transformPCBElement = (elm, matrix) => {
|
|
|
953
953
|
elm.center = applyToPoint(matrix, elm.center);
|
|
954
954
|
} else if (elm.type === "pcb_silkscreen_text" || elm.type === "pcb_fabrication_note_text" || elm.type === "pcb_note_text") {
|
|
955
955
|
elm.anchor_position = applyToPoint(matrix, elm.anchor_position);
|
|
956
|
-
} else if (elm.type === "pcb_silkscreen_circle" || elm.type === "pcb_silkscreen_rect" || elm.type === "pcb_note_rect") {
|
|
956
|
+
} else if (elm.type === "pcb_silkscreen_circle" || elm.type === "pcb_silkscreen_rect" || elm.type === "pcb_note_rect" || elm.type === "pcb_courtyard_rect" || elm.type === "pcb_courtyard_circle") {
|
|
957
957
|
elm.center = applyToPoint(matrix, elm.center);
|
|
958
958
|
} else if (elm.type === "pcb_component") {
|
|
959
959
|
elm.center = applyToPoint(matrix, elm.center);
|
|
@@ -963,6 +963,20 @@ var transformPCBElement = (elm, matrix) => {
|
|
|
963
963
|
;
|
|
964
964
|
[elm.width, elm.height] = [elm.height, elm.width];
|
|
965
965
|
}
|
|
966
|
+
} else if (elm.type === "pcb_courtyard_outline") {
|
|
967
|
+
elm.outline = elm.outline.map((p) => {
|
|
968
|
+
const tp = applyToPoint(matrix, p);
|
|
969
|
+
p.x = tp.x;
|
|
970
|
+
p.y = tp.y;
|
|
971
|
+
return p;
|
|
972
|
+
});
|
|
973
|
+
} else if (elm.type === "pcb_courtyard_polygon") {
|
|
974
|
+
elm.points = elm.points.map((p) => {
|
|
975
|
+
const tp = applyToPoint(matrix, p);
|
|
976
|
+
p.x = tp.x;
|
|
977
|
+
p.y = tp.y;
|
|
978
|
+
return p;
|
|
979
|
+
});
|
|
966
980
|
} else if (elm.type === "pcb_silkscreen_path" || elm.type === "pcb_trace" || elm.type === "pcb_fabrication_note_path" || elm.type === "pcb_note_path") {
|
|
967
981
|
elm.route = elm.route.map((rp) => {
|
|
968
982
|
const tp = applyToPoint(matrix, rp);
|
|
@@ -2348,6 +2362,11 @@ var computeClearanceBetweenElements = (elm1, elm2) => {
|
|
|
2348
2362
|
|
|
2349
2363
|
// lib/categorize-error-or-warning.ts
|
|
2350
2364
|
var NETLIST_TYPES = /* @__PURE__ */ new Set(["source_pin_must_be_connected_error"]);
|
|
2365
|
+
var PIN_SPECIFICATION_TYPES = /* @__PURE__ */ new Set([
|
|
2366
|
+
"source_component_pins_underspecified_warning",
|
|
2367
|
+
"source_no_power_pin_defined_warning",
|
|
2368
|
+
"source_no_ground_pin_defined_warning"
|
|
2369
|
+
]);
|
|
2351
2370
|
var PLACEMENT_TYPES = /* @__PURE__ */ new Set([
|
|
2352
2371
|
"pcb_placement_error",
|
|
2353
2372
|
"pcb_component_outside_board_error",
|
|
@@ -2364,6 +2383,7 @@ var categorizeErrorOrWarning = (value) => {
|
|
|
2364
2383
|
const drcType = typeof value === "string" ? value : value.error_type ?? value.warning_type ?? value.type;
|
|
2365
2384
|
if (!drcType) return "unknown";
|
|
2366
2385
|
if (NETLIST_TYPES.has(drcType)) return "netlist";
|
|
2386
|
+
if (PIN_SPECIFICATION_TYPES.has(drcType)) return "pin_specification";
|
|
2367
2387
|
if (PLACEMENT_TYPES.has(drcType)) return "placement";
|
|
2368
2388
|
if (ROUTING_TYPES.has(drcType)) return "routing";
|
|
2369
2389
|
return "unknown";
|