@tscircuit/core 0.0.410 → 0.0.412
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 +34 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3741,43 +3741,45 @@ var createDownwardNetLabelGroundSymbol = ({
|
|
|
3741
3741
|
source_trace_id
|
|
3742
3742
|
}, { db }) => {
|
|
3743
3743
|
const offsets = calculateOffsets(port);
|
|
3744
|
+
const isLeftOrRight = port.facingDirection === "left" || port.facingDirection === "right";
|
|
3745
|
+
const horizontalEndPos = {
|
|
3746
|
+
x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
|
|
3747
|
+
y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
|
|
3748
|
+
};
|
|
3749
|
+
const groundSymbolPos = isLeftOrRight ? {
|
|
3750
|
+
x: horizontalEndPos.x,
|
|
3751
|
+
y: horizontalEndPos.y - 0.5
|
|
3752
|
+
} : horizontalEndPos;
|
|
3744
3753
|
db.schematic_net_label.insert({
|
|
3745
3754
|
anchor_side: "top",
|
|
3746
|
-
center:
|
|
3747
|
-
x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
|
|
3748
|
-
y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
|
|
3749
|
-
},
|
|
3755
|
+
center: groundSymbolPos,
|
|
3750
3756
|
source_net_id: port.source_port_id,
|
|
3751
3757
|
text: schDisplayLabel,
|
|
3752
|
-
anchor_position:
|
|
3753
|
-
x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
|
|
3754
|
-
y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
|
|
3755
|
-
},
|
|
3758
|
+
anchor_position: groundSymbolPos,
|
|
3756
3759
|
symbol_name: "ground_horz"
|
|
3757
3760
|
});
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
{
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
y: anchorPos.y + offsets.handleUp * offsets.schBoxVertOffset
|
|
3765
|
-
}
|
|
3766
|
-
},
|
|
3767
|
-
{
|
|
3768
|
-
from: { x: anchorPos.x, y: anchorPos.y },
|
|
3769
|
-
to: {
|
|
3770
|
-
x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
|
|
3771
|
-
y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
|
|
3772
|
-
}
|
|
3773
|
-
}
|
|
3774
|
-
],
|
|
3775
|
-
junctions: [
|
|
3776
|
-
{
|
|
3777
|
-
x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
|
|
3778
|
-
y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
|
|
3761
|
+
const edges = [
|
|
3762
|
+
{
|
|
3763
|
+
from: { x: anchorPos.x, y: anchorPos.y },
|
|
3764
|
+
to: {
|
|
3765
|
+
x: anchorPos.x,
|
|
3766
|
+
y: anchorPos.y + offsets.handleUp * offsets.schBoxVertOffset
|
|
3779
3767
|
}
|
|
3780
|
-
|
|
3768
|
+
},
|
|
3769
|
+
{
|
|
3770
|
+
from: { x: anchorPos.x, y: anchorPos.y },
|
|
3771
|
+
to: horizontalEndPos
|
|
3772
|
+
}
|
|
3773
|
+
];
|
|
3774
|
+
if (isLeftOrRight) {
|
|
3775
|
+
edges.push({
|
|
3776
|
+
from: horizontalEndPos,
|
|
3777
|
+
to: groundSymbolPos
|
|
3778
|
+
});
|
|
3779
|
+
}
|
|
3780
|
+
db.schematic_trace.insert({
|
|
3781
|
+
edges,
|
|
3782
|
+
junctions: [],
|
|
3781
3783
|
source_trace_id
|
|
3782
3784
|
});
|
|
3783
3785
|
};
|
|
@@ -5674,7 +5676,7 @@ var NormalComponent = class extends PrimitiveComponent2 {
|
|
|
5674
5676
|
rotation: {
|
|
5675
5677
|
x: rotationOffset.x,
|
|
5676
5678
|
y: (computedLayer === "top" ? 0 : 180) + rotationOffset.y,
|
|
5677
|
-
z: (pcb_component?.rotation ?? 0) +
|
|
5679
|
+
z: computedLayer === "bottom" ? -((pcb_component?.rotation ?? 0) + rotationOffset.z) + 180 : (pcb_component?.rotation ?? 0) + rotationOffset.z
|
|
5678
5680
|
},
|
|
5679
5681
|
pcb_component_id: this.pcb_component_id,
|
|
5680
5682
|
source_component_id: this.source_component_id,
|
|
@@ -8255,7 +8257,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
8255
8257
|
var package_default = {
|
|
8256
8258
|
name: "@tscircuit/core",
|
|
8257
8259
|
type: "module",
|
|
8258
|
-
version: "0.0.
|
|
8260
|
+
version: "0.0.411",
|
|
8259
8261
|
types: "dist/index.d.ts",
|
|
8260
8262
|
main: "dist/index.js",
|
|
8261
8263
|
module: "dist/index.js",
|