@tscircuit/core 0.0.483 → 0.0.485
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.d.ts +1 -0
- package/dist/index.js +63 -14
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -14161,6 +14161,7 @@ declare class TestPoint extends NormalComponent<typeof testpointProps> {
|
|
|
14161
14161
|
}>;
|
|
14162
14162
|
sourceFtype: "simple_test_point";
|
|
14163
14163
|
};
|
|
14164
|
+
private _getPropsWithDefaults;
|
|
14164
14165
|
_getImpliedFootprintString(): string | null;
|
|
14165
14166
|
doInitialSourceRender(): void;
|
|
14166
14167
|
}
|
package/dist/index.js
CHANGED
|
@@ -9897,6 +9897,11 @@ var Switch = class extends NormalComponent {
|
|
|
9897
9897
|
|
|
9898
9898
|
// lib/components/normal-components/TestPoint.ts
|
|
9899
9899
|
import { testpointProps } from "@tscircuit/props";
|
|
9900
|
+
var TESTPOINT_DEFAULTS = {
|
|
9901
|
+
HOLE_DIAMETER: 0.5,
|
|
9902
|
+
SMT_CIRCLE_DIAMETER: 1.2,
|
|
9903
|
+
SMT_RECT_SIZE: 2
|
|
9904
|
+
};
|
|
9900
9905
|
var TestPoint = class extends NormalComponent {
|
|
9901
9906
|
get config() {
|
|
9902
9907
|
return {
|
|
@@ -9906,12 +9911,11 @@ var TestPoint = class extends NormalComponent {
|
|
|
9906
9911
|
sourceFtype: FTYPE.simple_test_point
|
|
9907
9912
|
};
|
|
9908
9913
|
}
|
|
9909
|
-
|
|
9914
|
+
_getPropsWithDefaults() {
|
|
9910
9915
|
let {
|
|
9911
9916
|
padShape,
|
|
9912
9917
|
holeDiameter,
|
|
9913
9918
|
footprintVariant,
|
|
9914
|
-
// TODO SMTPAD
|
|
9915
9919
|
padDiameter,
|
|
9916
9920
|
width,
|
|
9917
9921
|
height
|
|
@@ -9921,25 +9925,70 @@ var TestPoint = class extends NormalComponent {
|
|
|
9921
9925
|
}
|
|
9922
9926
|
footprintVariant ??= "through_hole";
|
|
9923
9927
|
padShape ??= "circle";
|
|
9928
|
+
if (footprintVariant === "pad") {
|
|
9929
|
+
if (padShape === "circle") {
|
|
9930
|
+
padDiameter ??= TESTPOINT_DEFAULTS.SMT_CIRCLE_DIAMETER;
|
|
9931
|
+
} else if (padShape === "rect") {
|
|
9932
|
+
width ??= TESTPOINT_DEFAULTS.SMT_RECT_SIZE;
|
|
9933
|
+
height ??= width;
|
|
9934
|
+
}
|
|
9935
|
+
} else if (footprintVariant === "through_hole") {
|
|
9936
|
+
holeDiameter ??= TESTPOINT_DEFAULTS.HOLE_DIAMETER;
|
|
9937
|
+
}
|
|
9938
|
+
return {
|
|
9939
|
+
padShape,
|
|
9940
|
+
holeDiameter,
|
|
9941
|
+
footprintVariant,
|
|
9942
|
+
padDiameter,
|
|
9943
|
+
width,
|
|
9944
|
+
height
|
|
9945
|
+
};
|
|
9946
|
+
}
|
|
9947
|
+
_getImpliedFootprintString() {
|
|
9948
|
+
const {
|
|
9949
|
+
padShape,
|
|
9950
|
+
holeDiameter,
|
|
9951
|
+
footprintVariant,
|
|
9952
|
+
padDiameter,
|
|
9953
|
+
width,
|
|
9954
|
+
height
|
|
9955
|
+
} = this._getPropsWithDefaults();
|
|
9924
9956
|
if (footprintVariant === "through_hole") {
|
|
9925
|
-
holeDiameter ??= 0.5;
|
|
9926
9957
|
return `platedhole_d${holeDiameter}`;
|
|
9927
9958
|
}
|
|
9928
|
-
|
|
9959
|
+
if (footprintVariant === "pad") {
|
|
9960
|
+
if (padShape === "circle") {
|
|
9961
|
+
return `smtpad_circle_d${padDiameter}`;
|
|
9962
|
+
}
|
|
9963
|
+
if (padShape === "rect") {
|
|
9964
|
+
return `smtpad_rect_w${width}_h${height}`;
|
|
9965
|
+
}
|
|
9966
|
+
}
|
|
9967
|
+
throw new Error(
|
|
9968
|
+
`Footprint variant "${footprintVariant}" with pad shape "${padShape}" not implemented`
|
|
9969
|
+
);
|
|
9929
9970
|
}
|
|
9930
9971
|
doInitialSourceRender() {
|
|
9931
9972
|
const { db } = this.root;
|
|
9932
9973
|
const { _parsedProps: props } = this;
|
|
9974
|
+
const {
|
|
9975
|
+
padShape,
|
|
9976
|
+
holeDiameter,
|
|
9977
|
+
footprintVariant,
|
|
9978
|
+
padDiameter,
|
|
9979
|
+
width,
|
|
9980
|
+
height
|
|
9981
|
+
} = this._getPropsWithDefaults();
|
|
9933
9982
|
const source_component = db.source_component.insert({
|
|
9934
9983
|
ftype: FTYPE.simple_test_point,
|
|
9935
9984
|
name: props.name,
|
|
9936
9985
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
9937
|
-
footprint_variant:
|
|
9938
|
-
pad_shape:
|
|
9939
|
-
pad_diameter:
|
|
9940
|
-
hole_diameter:
|
|
9941
|
-
width
|
|
9942
|
-
height
|
|
9986
|
+
footprint_variant: footprintVariant,
|
|
9987
|
+
pad_shape: padShape,
|
|
9988
|
+
pad_diameter: padDiameter,
|
|
9989
|
+
hole_diameter: holeDiameter,
|
|
9990
|
+
width,
|
|
9991
|
+
height,
|
|
9943
9992
|
are_pins_interchangeable: true
|
|
9944
9993
|
});
|
|
9945
9994
|
this.source_component_id = source_component.source_component_id;
|
|
@@ -10132,9 +10181,9 @@ var SchematicBox = class extends PrimitiveComponent2 {
|
|
|
10132
10181
|
is_dashed: props.strokeStyle === "dashed"
|
|
10133
10182
|
});
|
|
10134
10183
|
if (props.title) {
|
|
10135
|
-
const isInside = props.titleInside
|
|
10184
|
+
const isInside = props.titleInside;
|
|
10136
10185
|
const TITLE_PADDING = 0.1;
|
|
10137
|
-
const anchor = props.titleAlignment
|
|
10186
|
+
const anchor = props.titleAlignment;
|
|
10138
10187
|
const anchorPos = getTitleAnchorAndPosition({
|
|
10139
10188
|
anchor,
|
|
10140
10189
|
x,
|
|
@@ -10179,7 +10228,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
10179
10228
|
var package_default = {
|
|
10180
10229
|
name: "@tscircuit/core",
|
|
10181
10230
|
type: "module",
|
|
10182
|
-
version: "0.0.
|
|
10231
|
+
version: "0.0.484",
|
|
10183
10232
|
types: "dist/index.d.ts",
|
|
10184
10233
|
main: "dist/index.js",
|
|
10185
10234
|
module: "dist/index.js",
|
|
@@ -10204,8 +10253,8 @@ var package_default = {
|
|
|
10204
10253
|
"@biomejs/biome": "^1.8.3",
|
|
10205
10254
|
"@tscircuit/capacity-autorouter": "^0.0.75",
|
|
10206
10255
|
"@tscircuit/checks": "^0.0.52",
|
|
10256
|
+
"@tscircuit/footprinter": "^0.0.182",
|
|
10207
10257
|
"@tscircuit/circuit-json-util": "^0.0.49",
|
|
10208
|
-
"@tscircuit/footprinter": "^0.0.177",
|
|
10209
10258
|
"@tscircuit/import-snippet": "^0.0.4",
|
|
10210
10259
|
"@tscircuit/infgrid-ijump-astar": "^0.0.33",
|
|
10211
10260
|
"@tscircuit/layout": "^0.0.28",
|
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.485",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@biomejs/biome": "^1.8.3",
|
|
27
27
|
"@tscircuit/capacity-autorouter": "^0.0.75",
|
|
28
28
|
"@tscircuit/checks": "^0.0.52",
|
|
29
|
+
"@tscircuit/footprinter": "^0.0.182",
|
|
29
30
|
"@tscircuit/circuit-json-util": "^0.0.49",
|
|
30
|
-
"@tscircuit/footprinter": "^0.0.177",
|
|
31
31
|
"@tscircuit/import-snippet": "^0.0.4",
|
|
32
32
|
"@tscircuit/infgrid-ijump-astar": "^0.0.33",
|
|
33
33
|
"@tscircuit/layout": "^0.0.28",
|