@tscircuit/core 0.0.444 → 0.0.446
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 +2 -116
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3813,77 +3813,6 @@ function getTraceLength(route) {
|
|
|
3813
3813
|
return totalLength;
|
|
3814
3814
|
}
|
|
3815
3815
|
|
|
3816
|
-
// lib/components/primitive-components/Trace/create-downward-net-label-ground-symbol.ts
|
|
3817
|
-
var calculateOffsets = (port) => {
|
|
3818
|
-
const schBoxOffset = {
|
|
3819
|
-
left: { x: -0.5, y: 0 },
|
|
3820
|
-
up: { x: 0.5, y: 0.5 },
|
|
3821
|
-
right: { x: 0.5, y: 0 },
|
|
3822
|
-
down: { x: 0, y: -0.5 }
|
|
3823
|
-
}[port.facingDirection];
|
|
3824
|
-
const schBoxVertOffset = port.parent?.config.shouldRenderAsSchematicBox ? 3 : 1;
|
|
3825
|
-
const schBoxHorzOffset = port.parent?.config.shouldRenderAsSchematicBox && (port.facingDirection === "left" || port.facingDirection === "right") ? 3 : 1;
|
|
3826
|
-
const horzPortDirection = schBoxOffset.x;
|
|
3827
|
-
const vertPortDirectionOffset = schBoxOffset.y;
|
|
3828
|
-
const handleUp = port.facingDirection === "up" ? 0.5 : 0;
|
|
3829
|
-
return {
|
|
3830
|
-
schBoxVertOffset,
|
|
3831
|
-
schBoxHorzOffset,
|
|
3832
|
-
horzPortDirection,
|
|
3833
|
-
vertPortDirectionOffset,
|
|
3834
|
-
handleUp
|
|
3835
|
-
};
|
|
3836
|
-
};
|
|
3837
|
-
var createDownwardNetLabelGroundSymbol = ({
|
|
3838
|
-
port,
|
|
3839
|
-
anchorPos,
|
|
3840
|
-
schDisplayLabel,
|
|
3841
|
-
source_trace_id
|
|
3842
|
-
}, { db }) => {
|
|
3843
|
-
const offsets = calculateOffsets(port);
|
|
3844
|
-
const isLeftOrRight = port.facingDirection === "left" || port.facingDirection === "right";
|
|
3845
|
-
const horizontalEndPos = {
|
|
3846
|
-
x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
|
|
3847
|
-
y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
|
|
3848
|
-
};
|
|
3849
|
-
const groundSymbolPos = isLeftOrRight ? {
|
|
3850
|
-
x: horizontalEndPos.x,
|
|
3851
|
-
y: horizontalEndPos.y - 0.5
|
|
3852
|
-
} : horizontalEndPos;
|
|
3853
|
-
db.schematic_net_label.insert({
|
|
3854
|
-
anchor_side: "top",
|
|
3855
|
-
center: groundSymbolPos,
|
|
3856
|
-
source_net_id: port.source_port_id,
|
|
3857
|
-
text: schDisplayLabel,
|
|
3858
|
-
anchor_position: groundSymbolPos,
|
|
3859
|
-
symbol_name: "ground_horz"
|
|
3860
|
-
});
|
|
3861
|
-
const edges = [
|
|
3862
|
-
{
|
|
3863
|
-
from: { x: anchorPos.x, y: anchorPos.y },
|
|
3864
|
-
to: {
|
|
3865
|
-
x: anchorPos.x,
|
|
3866
|
-
y: anchorPos.y + offsets.handleUp * offsets.schBoxVertOffset
|
|
3867
|
-
}
|
|
3868
|
-
},
|
|
3869
|
-
{
|
|
3870
|
-
from: { x: anchorPos.x, y: anchorPos.y },
|
|
3871
|
-
to: horizontalEndPos
|
|
3872
|
-
}
|
|
3873
|
-
];
|
|
3874
|
-
if (isLeftOrRight) {
|
|
3875
|
-
edges.push({
|
|
3876
|
-
from: horizontalEndPos,
|
|
3877
|
-
to: groundSymbolPos
|
|
3878
|
-
});
|
|
3879
|
-
}
|
|
3880
|
-
db.schematic_trace.insert({
|
|
3881
|
-
edges,
|
|
3882
|
-
junctions: [],
|
|
3883
|
-
source_trace_id
|
|
3884
|
-
});
|
|
3885
|
-
};
|
|
3886
|
-
|
|
3887
3816
|
// lib/components/primitive-components/Trace/create-schematic-trace-crossing-segments.ts
|
|
3888
3817
|
import { distance as distance2, doesLineIntersectLine } from "@tscircuit/math-utils";
|
|
3889
3818
|
|
|
@@ -4833,49 +4762,6 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
|
|
|
4833
4762
|
if (existingToNetLabel && existingToNetLabel?.text !== netLabelText) {
|
|
4834
4763
|
existingToNetLabel.text = `${netLabelText} / ${existingToNetLabel.text}`;
|
|
4835
4764
|
}
|
|
4836
|
-
if (netLabelText?.toLocaleLowerCase().includes("gnd") || netLabelText?.toLocaleLowerCase().includes("ground")) {
|
|
4837
|
-
if (!existingFromNetLabel && !existingToNetLabel) {
|
|
4838
|
-
createDownwardNetLabelGroundSymbol(
|
|
4839
|
-
{
|
|
4840
|
-
port: fromPort,
|
|
4841
|
-
anchorPos: fromAnchorPos,
|
|
4842
|
-
schDisplayLabel: this.props.schDisplayLabel,
|
|
4843
|
-
source_trace_id: this.source_trace_id
|
|
4844
|
-
},
|
|
4845
|
-
{ db }
|
|
4846
|
-
);
|
|
4847
|
-
createDownwardNetLabelGroundSymbol(
|
|
4848
|
-
{
|
|
4849
|
-
port: toPort,
|
|
4850
|
-
anchorPos: toAnchorPos,
|
|
4851
|
-
schDisplayLabel: this.props.schDisplayLabel,
|
|
4852
|
-
source_trace_id: this.source_trace_id
|
|
4853
|
-
},
|
|
4854
|
-
{ db }
|
|
4855
|
-
);
|
|
4856
|
-
} else if (!existingFromNetLabel) {
|
|
4857
|
-
createDownwardNetLabelGroundSymbol(
|
|
4858
|
-
{
|
|
4859
|
-
port: fromPort,
|
|
4860
|
-
anchorPos: fromAnchorPos,
|
|
4861
|
-
schDisplayLabel: this.props.schDisplayLabel,
|
|
4862
|
-
source_trace_id: this.source_trace_id
|
|
4863
|
-
},
|
|
4864
|
-
{ db }
|
|
4865
|
-
);
|
|
4866
|
-
} else if (!existingToNetLabel) {
|
|
4867
|
-
createDownwardNetLabelGroundSymbol(
|
|
4868
|
-
{
|
|
4869
|
-
port: toPort,
|
|
4870
|
-
anchorPos: toAnchorPos,
|
|
4871
|
-
schDisplayLabel: this.props.schDisplayLabel,
|
|
4872
|
-
source_trace_id: this.source_trace_id
|
|
4873
|
-
},
|
|
4874
|
-
{ db }
|
|
4875
|
-
);
|
|
4876
|
-
}
|
|
4877
|
-
return;
|
|
4878
|
-
}
|
|
4879
4765
|
if (!existingToNetLabel) {
|
|
4880
4766
|
db.schematic_net_label.insert({
|
|
4881
4767
|
text: this.props.schDisplayLabel ?? pinFullName,
|
|
@@ -9410,7 +9296,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
9410
9296
|
var package_default = {
|
|
9411
9297
|
name: "@tscircuit/core",
|
|
9412
9298
|
type: "module",
|
|
9413
|
-
version: "0.0.
|
|
9299
|
+
version: "0.0.445",
|
|
9414
9300
|
types: "dist/index.d.ts",
|
|
9415
9301
|
main: "dist/index.js",
|
|
9416
9302
|
module: "dist/index.js",
|
|
@@ -9434,7 +9320,7 @@ var package_default = {
|
|
|
9434
9320
|
devDependencies: {
|
|
9435
9321
|
"@biomejs/biome": "^1.8.3",
|
|
9436
9322
|
"@tscircuit/capacity-autorouter": "^0.0.67",
|
|
9437
|
-
"@tscircuit/checks": "^0.0.
|
|
9323
|
+
"@tscircuit/checks": "^0.0.52",
|
|
9438
9324
|
"@tscircuit/circuit-json-util": "^0.0.47",
|
|
9439
9325
|
"@tscircuit/footprinter": "^0.0.171",
|
|
9440
9326
|
"@tscircuit/import-snippet": "^0.0.4",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.446",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@biomejs/biome": "^1.8.3",
|
|
27
27
|
"@tscircuit/capacity-autorouter": "^0.0.67",
|
|
28
|
-
"@tscircuit/checks": "^0.0.
|
|
28
|
+
"@tscircuit/checks": "^0.0.52",
|
|
29
29
|
"@tscircuit/circuit-json-util": "^0.0.47",
|
|
30
30
|
"@tscircuit/footprinter": "^0.0.171",
|
|
31
31
|
"@tscircuit/import-snippet": "^0.0.4",
|