@tscircuit/3d-viewer 0.0.558 → 0.0.559
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 +50 -44
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -16094,6 +16094,8 @@ var soic = (raw_params) => {
|
|
|
16094
16094
|
};
|
|
16095
16095
|
var soicWithoutParsing = (parameters) => {
|
|
16096
16096
|
const pads = [];
|
|
16097
|
+
let maxPadExtentX = 0;
|
|
16098
|
+
let maxPadExtentY = 0;
|
|
16097
16099
|
for (let i = 0; i < parameters.num_pins; i++) {
|
|
16098
16100
|
const { x, y } = getCcwSoicCoords({
|
|
16099
16101
|
num_pins: parameters.num_pins,
|
|
@@ -16103,6 +16105,8 @@ var soicWithoutParsing = (parameters) => {
|
|
|
16103
16105
|
pl: parameters.pl,
|
|
16104
16106
|
legsoutside: parameters.legsoutside
|
|
16105
16107
|
});
|
|
16108
|
+
maxPadExtentX = Math.max(maxPadExtentX, Math.abs(x) + parameters.pl / 2);
|
|
16109
|
+
maxPadExtentY = Math.max(maxPadExtentY, Math.abs(y) + parameters.pw / 2);
|
|
16106
16110
|
if (parameters.pillpads) {
|
|
16107
16111
|
pads.push(pillpad(i + 1, x, y, parameters.pl, parameters.pw));
|
|
16108
16112
|
} else {
|
|
@@ -16136,11 +16140,12 @@ var soicWithoutParsing = (parameters) => {
|
|
|
16136
16140
|
{ x: -sw / 2, y: -sh / 2 }
|
|
16137
16141
|
]
|
|
16138
16142
|
};
|
|
16139
|
-
const
|
|
16140
|
-
const
|
|
16141
|
-
const courtyardStepOuterHalfWidth =
|
|
16142
|
-
const courtyardStepInnerHalfHeight =
|
|
16143
|
-
const
|
|
16143
|
+
const bodyHalfWidth = parameters.w / 2;
|
|
16144
|
+
const bodyHalfHeight = sh / 2;
|
|
16145
|
+
const courtyardStepOuterHalfWidth = Math.max(maxPadExtentX, bodyHalfWidth) + 0.25;
|
|
16146
|
+
const courtyardStepInnerHalfHeight = Math.min(maxPadExtentY, bodyHalfHeight) + 0.25;
|
|
16147
|
+
const courtyardStepInnerHalfWidth = Math.min(maxPadExtentX, bodyHalfWidth) + 0.25;
|
|
16148
|
+
const courtyardStepOuterHalfHeight = Math.max(maxPadExtentY, bodyHalfHeight) + 0.25;
|
|
16144
16149
|
const courtyard = {
|
|
16145
16150
|
type: "pcb_courtyard_outline",
|
|
16146
16151
|
pcb_courtyard_outline_id: "",
|
|
@@ -17553,6 +17558,8 @@ var pinrow = (raw_params) => {
|
|
|
17553
17558
|
else if (pinlabeltextalignright) pinlabelTextAlign = "right";
|
|
17554
17559
|
const holes = [];
|
|
17555
17560
|
const numPinsPerRow = Math.ceil(num_pins / rows);
|
|
17561
|
+
const pinRowSpanY = (rows - 1) * p;
|
|
17562
|
+
const yStart = pinRowSpanY / 2;
|
|
17556
17563
|
const ySpacing = -p;
|
|
17557
17564
|
const calculateAnchorPosition = ({
|
|
17558
17565
|
xoff,
|
|
@@ -17693,7 +17700,7 @@ var pinrow = (raw_params) => {
|
|
|
17693
17700
|
for (let row = 0; row < rows && currentPin <= num_pins; row++) {
|
|
17694
17701
|
for (let col = 0; col < numPinsPerRow && currentPin <= num_pins; col++) {
|
|
17695
17702
|
const xoff = xStart + col * p;
|
|
17696
|
-
const yoff = row * ySpacing;
|
|
17703
|
+
const yoff = yStart + row * ySpacing;
|
|
17697
17704
|
const posKey = `${xoff},${yoff}`;
|
|
17698
17705
|
if (usedPositions.has(posKey)) throw new Error(`Overlap at ${posKey}`);
|
|
17699
17706
|
usedPositions.add(posKey);
|
|
@@ -17710,7 +17717,7 @@ var pinrow = (raw_params) => {
|
|
|
17710
17717
|
while (currentPin <= num_pins && top <= bottom && left <= right) {
|
|
17711
17718
|
for (let row = top; row <= bottom && currentPin <= num_pins; row++) {
|
|
17712
17719
|
const xoff = xStart + left * p;
|
|
17713
|
-
const yoff = row * ySpacing;
|
|
17720
|
+
const yoff = yStart + row * ySpacing;
|
|
17714
17721
|
const posKey = `${xoff},${yoff}`;
|
|
17715
17722
|
if (usedPositions.has(posKey)) throw new Error(`Overlap at ${posKey}`);
|
|
17716
17723
|
usedPositions.add(posKey);
|
|
@@ -17719,7 +17726,7 @@ var pinrow = (raw_params) => {
|
|
|
17719
17726
|
left++;
|
|
17720
17727
|
for (let col = left; col <= right && currentPin <= num_pins; col++) {
|
|
17721
17728
|
const xoff = xStart + col * p;
|
|
17722
|
-
const yoff = bottom * ySpacing;
|
|
17729
|
+
const yoff = yStart + bottom * ySpacing;
|
|
17723
17730
|
const posKey = `${xoff},${yoff}`;
|
|
17724
17731
|
if (usedPositions.has(posKey)) throw new Error(`Overlap at ${posKey}`);
|
|
17725
17732
|
usedPositions.add(posKey);
|
|
@@ -17729,7 +17736,7 @@ var pinrow = (raw_params) => {
|
|
|
17729
17736
|
if (left <= right) {
|
|
17730
17737
|
for (let row = bottom; row >= top && currentPin <= num_pins; row--) {
|
|
17731
17738
|
const xoff = xStart + right * p;
|
|
17732
|
-
const yoff = row * ySpacing;
|
|
17739
|
+
const yoff = yStart + row * ySpacing;
|
|
17733
17740
|
const posKey = `${xoff},${yoff}`;
|
|
17734
17741
|
if (usedPositions.has(posKey)) throw new Error(`Overlap at ${posKey}`);
|
|
17735
17742
|
usedPositions.add(posKey);
|
|
@@ -17740,7 +17747,7 @@ var pinrow = (raw_params) => {
|
|
|
17740
17747
|
if (top <= bottom) {
|
|
17741
17748
|
for (let col = right; col >= left && currentPin <= num_pins; col--) {
|
|
17742
17749
|
const xoff = xStart + col * p;
|
|
17743
|
-
const yoff = top * ySpacing;
|
|
17750
|
+
const yoff = yStart + top * ySpacing;
|
|
17744
17751
|
const posKey = `${xoff},${yoff}`;
|
|
17745
17752
|
if (usedPositions.has(posKey)) throw new Error(`Overlap at ${posKey}`);
|
|
17746
17753
|
usedPositions.add(posKey);
|
|
@@ -17755,11 +17762,10 @@ var pinrow = (raw_params) => {
|
|
|
17755
17762
|
);
|
|
17756
17763
|
}
|
|
17757
17764
|
}
|
|
17758
|
-
const refText = silkscreenRef(0, p, 0.5);
|
|
17765
|
+
const refText = silkscreenRef(0, pinRowSpanY / 2 + p, 0.5);
|
|
17759
17766
|
const padHalfWidth = parameters.smd ? parameters.pw / 2 : od / 2;
|
|
17760
17767
|
const padHalfHeight = parameters.smd ? parameters.pl / 2 : od / 2;
|
|
17761
17768
|
const pinRowSpanX = (numPinsPerRow - 1) * p;
|
|
17762
|
-
const pinRowSpanY = (rows - 1) * p;
|
|
17763
17769
|
const padOuterHalfWidth = pinRowSpanX / 2 + padHalfWidth;
|
|
17764
17770
|
const padOuterHalfHeight = pinRowSpanY / 2 + padHalfHeight;
|
|
17765
17771
|
const bodyHalfWidth = pinRowSpanX / 2 + p / 2;
|
|
@@ -17776,7 +17782,7 @@ var pinrow = (raw_params) => {
|
|
|
17776
17782
|
type: "pcb_courtyard_rect",
|
|
17777
17783
|
pcb_courtyard_rect_id: "",
|
|
17778
17784
|
pcb_component_id: "",
|
|
17779
|
-
center: { x: 0, y:
|
|
17785
|
+
center: { x: 0, y: 0 },
|
|
17780
17786
|
width: 2 * courtyardHalfWidth,
|
|
17781
17787
|
height: 2 * courtyardHalfHeight,
|
|
17782
17788
|
layer: "top"
|
|
@@ -19551,9 +19557,9 @@ var sod_def2 = base_def.extend({
|
|
|
19551
19557
|
fn: z36.string(),
|
|
19552
19558
|
num_pins: z36.literal(2).default(2),
|
|
19553
19559
|
w: z36.string().default("2.15mm"),
|
|
19554
|
-
h: z36.string().default("
|
|
19555
|
-
pl: z36.string().default("0.
|
|
19556
|
-
pw: z36.string().default("0.
|
|
19560
|
+
h: z36.string().default("0.7mm"),
|
|
19561
|
+
pl: z36.string().default("0.6mm"),
|
|
19562
|
+
pw: z36.string().default("0.7mm"),
|
|
19557
19563
|
p: z36.string().default("1.4mm")
|
|
19558
19564
|
});
|
|
19559
19565
|
var sod523 = (raw_params) => {
|
|
@@ -19570,19 +19576,19 @@ var sod523 = (raw_params) => {
|
|
|
19570
19576
|
route: [
|
|
19571
19577
|
{
|
|
19572
19578
|
x: length27.parse(parameters.p) / 2,
|
|
19573
|
-
y: length27.parse(parameters.h) / 2
|
|
19579
|
+
y: length27.parse(parameters.h) / 2 + 0.2
|
|
19574
19580
|
},
|
|
19575
19581
|
{
|
|
19576
19582
|
x: -length27.parse(parameters.w) / 2 - 0.2,
|
|
19577
|
-
y: length27.parse(parameters.h) / 2
|
|
19583
|
+
y: length27.parse(parameters.h) / 2 + 0.2
|
|
19578
19584
|
},
|
|
19579
19585
|
{
|
|
19580
19586
|
x: -length27.parse(parameters.w) / 2 - 0.2,
|
|
19581
|
-
y: -length27.parse(parameters.h) / 2
|
|
19587
|
+
y: -length27.parse(parameters.h) / 2 - 0.2
|
|
19582
19588
|
},
|
|
19583
19589
|
{
|
|
19584
19590
|
x: length27.parse(parameters.p) / 2,
|
|
19585
|
-
y: -length27.parse(parameters.h) / 2
|
|
19591
|
+
y: -length27.parse(parameters.h) / 2 - 0.2
|
|
19586
19592
|
}
|
|
19587
19593
|
],
|
|
19588
19594
|
stroke_width: 0.1,
|
|
@@ -19793,10 +19799,10 @@ var sod_def3 = base_def.extend({
|
|
|
19793
19799
|
fn: z38.string(),
|
|
19794
19800
|
num_pins: z38.literal(2).default(2),
|
|
19795
19801
|
w: z38.string().default("4.4mm"),
|
|
19796
|
-
h: z38.string().default("
|
|
19802
|
+
h: z38.string().default("1.7mm"),
|
|
19797
19803
|
pl: z38.string().default("1.2mm"),
|
|
19798
19804
|
pw: z38.string().default("1.2mm"),
|
|
19799
|
-
p: z38.string().default("2.
|
|
19805
|
+
p: z38.string().default("2.8mm")
|
|
19800
19806
|
});
|
|
19801
19807
|
var sod123w = (raw_params) => {
|
|
19802
19808
|
const parameters = sod_def3.parse(raw_params);
|
|
@@ -20167,9 +20173,9 @@ var sod_def7 = base_def.extend({
|
|
|
20167
20173
|
fn: z42.string(),
|
|
20168
20174
|
num_pins: z42.literal(2).default(2),
|
|
20169
20175
|
w: z42.string().default("3.05mm"),
|
|
20170
|
-
h: z42.string().default("1.
|
|
20171
|
-
pl: z42.string().default("0.
|
|
20172
|
-
pw: z42.string().default("0.
|
|
20176
|
+
h: z42.string().default("1.4mm"),
|
|
20177
|
+
pl: z42.string().default("0.5mm"),
|
|
20178
|
+
pw: z42.string().default("0.5mm"),
|
|
20173
20179
|
pad_spacing: z42.string().default("2.2mm")
|
|
20174
20180
|
});
|
|
20175
20181
|
var sod323f = (raw_params) => {
|
|
@@ -24324,9 +24330,9 @@ var platedhole2 = (raw_params) => {
|
|
|
24324
24330
|
var sot_def = base_def.extend({
|
|
24325
24331
|
fn: z77.string(),
|
|
24326
24332
|
num_pins: z77.literal(6).default(6),
|
|
24327
|
-
h: z77.string().default("1.
|
|
24328
|
-
pl: z77.string().default("
|
|
24329
|
-
pw: z77.string().default("0.
|
|
24333
|
+
h: z77.string().default("1.3mm"),
|
|
24334
|
+
pl: z77.string().default("1.325mm"),
|
|
24335
|
+
pw: z77.string().default("0.6mm"),
|
|
24330
24336
|
p: z77.string().default("0.95mm")
|
|
24331
24337
|
});
|
|
24332
24338
|
var sot = (raw_params) => {
|
|
@@ -24339,22 +24345,22 @@ var sot = (raw_params) => {
|
|
|
24339
24345
|
var getCcwSotCoords = (parameters) => {
|
|
24340
24346
|
const { p, h: h2, pn } = parameters;
|
|
24341
24347
|
if (pn === 1) {
|
|
24342
|
-
return { x: -h2 / 2 - 0.
|
|
24348
|
+
return { x: -h2 / 2 - 0.4875, y: p };
|
|
24343
24349
|
}
|
|
24344
24350
|
if (pn === 2) {
|
|
24345
|
-
return { x: -h2 / 2 - 0.
|
|
24351
|
+
return { x: -h2 / 2 - 0.4875, y: 0 };
|
|
24346
24352
|
}
|
|
24347
24353
|
if (pn === 3) {
|
|
24348
|
-
return { x: -h2 / 2 - 0.
|
|
24354
|
+
return { x: -h2 / 2 - 0.4875, y: -p };
|
|
24349
24355
|
}
|
|
24350
24356
|
if (pn === 4) {
|
|
24351
|
-
return { x: h2 / 2 + 0.
|
|
24357
|
+
return { x: h2 / 2 + 0.4875, y: -p };
|
|
24352
24358
|
}
|
|
24353
24359
|
if (pn === 5) {
|
|
24354
|
-
return { x: h2 / 2 + 0.
|
|
24360
|
+
return { x: h2 / 2 + 0.4875, y: 0 };
|
|
24355
24361
|
}
|
|
24356
24362
|
if (pn === 6) {
|
|
24357
|
-
return { x: h2 / 2 + 0.
|
|
24363
|
+
return { x: h2 / 2 + 0.4875, y: p };
|
|
24358
24364
|
}
|
|
24359
24365
|
throw new Error("Invalid pin number");
|
|
24360
24366
|
};
|
|
@@ -24416,7 +24422,7 @@ var sotWithoutParsing = (parameters) => {
|
|
|
24416
24422
|
pcb_silkscreen_path_id: "pin1_indicator",
|
|
24417
24423
|
route: [
|
|
24418
24424
|
{
|
|
24419
|
-
x: pin1Position.x + triangleHeight / 2,
|
|
24425
|
+
x: pin1Position.x + triangleHeight / 2 - 0.2,
|
|
24420
24426
|
y: pin1Position.y
|
|
24421
24427
|
},
|
|
24422
24428
|
{
|
|
@@ -24428,7 +24434,7 @@ var sotWithoutParsing = (parameters) => {
|
|
|
24428
24434
|
y: pin1Position.y - triangleWidth / 2
|
|
24429
24435
|
},
|
|
24430
24436
|
{
|
|
24431
|
-
x: pin1Position.x + triangleHeight / 2,
|
|
24437
|
+
x: pin1Position.x + triangleHeight / 2 - 0.2,
|
|
24432
24438
|
y: pin1Position.y
|
|
24433
24439
|
}
|
|
24434
24440
|
],
|
|
@@ -24438,12 +24444,12 @@ var sotWithoutParsing = (parameters) => {
|
|
|
24438
24444
|
const p_val = Number.parseFloat(parameters.p);
|
|
24439
24445
|
const pl_val = Number.parseFloat(parameters.pl);
|
|
24440
24446
|
const pw_val = Number.parseFloat(parameters.pw);
|
|
24441
|
-
const pinColumnCenterX = h_val / 2 + 0.
|
|
24447
|
+
const pinColumnCenterX = h_val / 2 + 0.4875;
|
|
24442
24448
|
const pinRowSpanY = p_val * 2 + pw_val;
|
|
24443
24449
|
const pinToeHalfSpanX = pinColumnCenterX + pl_val / 2;
|
|
24444
|
-
const courtyardStepInnerHalfWidth = h_val / 2 + 0.
|
|
24450
|
+
const courtyardStepInnerHalfWidth = h_val / 2 + 0.4;
|
|
24445
24451
|
const courtyardStepOuterHalfWidth = pinToeHalfSpanX + 0.25;
|
|
24446
|
-
const courtyardStepInnerHalfHeight = pinRowSpanY / 2 + 0.
|
|
24452
|
+
const courtyardStepInnerHalfHeight = pinRowSpanY / 2 + 0.25;
|
|
24447
24453
|
const courtyardStepOuterHalfHeight = courtyardStepInnerHalfHeight + 0.2;
|
|
24448
24454
|
const courtyard = {
|
|
24449
24455
|
type: "pcb_courtyard_outline",
|
|
@@ -25388,7 +25394,7 @@ function isNotNull(value) {
|
|
|
25388
25394
|
return value !== null && value !== void 0;
|
|
25389
25395
|
}
|
|
25390
25396
|
var normalizeDefinition = (def) => {
|
|
25391
|
-
return def.trim().replace(/^sot23-(\d+)(?=_|$)/i, "sot23_$1").replace(/^sot-223-(\d+)(?=_|$)/i, "sot223_$1").replace(/^to-220f-(\d+)(?=_|$)/i, "to220f_$1").replace(/^jst_(ph|sh|zh)_(\d+)(?=_|$)/i, "jst$2_$1");
|
|
25397
|
+
return def.trim().replace(/^pinheader(?=[\d_]|$)/i, "pinrow").replace(/^sot23-(\d+)(?=_|$)/i, "sot23_$1").replace(/^sot-223-(\d+)(?=_|$)/i, "sot223_$1").replace(/^to-220f-(\d+)(?=_|$)/i, "to220f_$1").replace(/^jst_(ph|sh|zh)_(\d+)(?=_|$)/i, "jst$2_$1");
|
|
25392
25398
|
};
|
|
25393
25399
|
var string2 = (def) => {
|
|
25394
25400
|
let fp2 = footprinter();
|
|
@@ -31985,7 +31991,7 @@ import * as THREE20 from "three";
|
|
|
31985
31991
|
// package.json
|
|
31986
31992
|
var package_default = {
|
|
31987
31993
|
name: "@tscircuit/3d-viewer",
|
|
31988
|
-
version: "0.0.
|
|
31994
|
+
version: "0.0.558",
|
|
31989
31995
|
main: "./dist/index.js",
|
|
31990
31996
|
module: "./dist/index.js",
|
|
31991
31997
|
type: "module",
|
|
@@ -32014,7 +32020,7 @@ var package_default = {
|
|
|
32014
32020
|
dependencies: {
|
|
32015
32021
|
"@jscad/regl-renderer": "^2.6.12",
|
|
32016
32022
|
"@jscad/stl-serializer": "^2.1.20",
|
|
32017
|
-
"circuit-json": "^0.0.
|
|
32023
|
+
"circuit-json": "^0.0.421",
|
|
32018
32024
|
"circuit-to-canvas": "^0.0.102",
|
|
32019
32025
|
"react-hot-toast": "^2.6.0",
|
|
32020
32026
|
three: "^0.165.0",
|
|
@@ -32035,7 +32041,7 @@ var package_default = {
|
|
|
32035
32041
|
"@storybook/blocks": "9.0.0-alpha.17",
|
|
32036
32042
|
"@storybook/react-vite": "^9.1.5",
|
|
32037
32043
|
"@tscircuit/alphabet": "^0.0.25",
|
|
32038
|
-
"@tscircuit/copper-pour-solver": "^0.0.
|
|
32044
|
+
"@tscircuit/copper-pour-solver": "^0.0.29",
|
|
32039
32045
|
"@tscircuit/solver-utils": "^0.0.4",
|
|
32040
32046
|
"@types/jsdom": "^21.1.7",
|
|
32041
32047
|
"@types/react": "19",
|
|
@@ -32053,7 +32059,7 @@ var package_default = {
|
|
|
32053
32059
|
"react-use-gesture": "^9.1.3",
|
|
32054
32060
|
semver: "^7.7.0",
|
|
32055
32061
|
"strip-ansi": "^7.1.0",
|
|
32056
|
-
tscircuit: "^0.0.
|
|
32062
|
+
tscircuit: "^0.0.1704",
|
|
32057
32063
|
tsup: "^8.3.6",
|
|
32058
32064
|
typescript: "^5.7.3",
|
|
32059
32065
|
vite: "^7.1.5",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/3d-viewer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.559",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@jscad/regl-renderer": "^2.6.12",
|
|
31
31
|
"@jscad/stl-serializer": "^2.1.20",
|
|
32
|
-
"circuit-json": "^0.0.
|
|
32
|
+
"circuit-json": "^0.0.421",
|
|
33
33
|
"circuit-to-canvas": "^0.0.102",
|
|
34
34
|
"react-hot-toast": "^2.6.0",
|
|
35
35
|
"three": "^0.165.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@storybook/blocks": "9.0.0-alpha.17",
|
|
51
51
|
"@storybook/react-vite": "^9.1.5",
|
|
52
52
|
"@tscircuit/alphabet": "^0.0.25",
|
|
53
|
-
"@tscircuit/copper-pour-solver": "^0.0.
|
|
53
|
+
"@tscircuit/copper-pour-solver": "^0.0.29",
|
|
54
54
|
"@tscircuit/solver-utils": "^0.0.4",
|
|
55
55
|
"@types/jsdom": "^21.1.7",
|
|
56
56
|
"@types/react": "19",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"react-use-gesture": "^9.1.3",
|
|
69
69
|
"semver": "^7.7.0",
|
|
70
70
|
"strip-ansi": "^7.1.0",
|
|
71
|
-
"tscircuit": "^0.0.
|
|
71
|
+
"tscircuit": "^0.0.1704",
|
|
72
72
|
"tsup": "^8.3.6",
|
|
73
73
|
"typescript": "^5.7.3",
|
|
74
74
|
"vite": "^7.1.5",
|