jscad-electronics 0.0.124 → 0.0.126

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/vanilla.js CHANGED
@@ -4165,7 +4165,7 @@ var StampBoard = ({
4165
4165
  }
4166
4166
  }
4167
4167
  }
4168
- const boardBody = /* @__PURE__ */ jsx(Colorize, { color: "#008080", children: /* @__PURE__ */ jsxs(Subtract, { children: [
4168
+ const boardBody = /* @__PURE__ */ jsx(Colorize, { color: "#051a0a", children: /* @__PURE__ */ jsxs(Subtract, { children: [
4169
4169
  /* @__PURE__ */ jsx(
4170
4170
  Cuboid,
4171
4171
  {
@@ -4520,9 +4520,153 @@ var SOD723 = () => {
4520
4520
  };
4521
4521
  var SOD723_default = SOD723;
4522
4522
 
4523
+ // lib/JSTZH1_5mm.tsx
4524
+ var JSTZH1_5mm = ({
4525
+ numPins = 7,
4526
+ showPins = true,
4527
+ showFootprint = true,
4528
+ bodyColor = "#f5f5f5",
4529
+ pinColor = "#635959"
4530
+ }) => {
4531
+ const pitch = 1.5;
4532
+ const bodyHeight = 6;
4533
+ const bodyDepth = 3.5;
4534
+ const wallThickness = 0.5;
4535
+ const hollowHeight = bodyHeight * 0.6;
4536
+ const pinLength = 6;
4537
+ const bodyWidth = (numPins - 1) * pitch + 4;
4538
+ const startX = -((numPins - 1) * pitch) / 2;
4539
+ return /* @__PURE__ */ jsxs(Fragment2, { children: [
4540
+ /* @__PURE__ */ jsx(Translate, { offset: [0, 0, bodyHeight], children: /* @__PURE__ */ jsx(Rotate, { angles: [Math.PI, 0, 0], children: /* @__PURE__ */ jsx(Colorize, { color: bodyColor, children: /* @__PURE__ */ jsxs(Subtract, { children: [
4541
+ /* @__PURE__ */ jsx(
4542
+ Cuboid,
4543
+ {
4544
+ size: [bodyWidth, bodyDepth, bodyHeight],
4545
+ center: [0, 0, bodyHeight / 2]
4546
+ }
4547
+ ),
4548
+ /* @__PURE__ */ jsx(
4549
+ Cuboid,
4550
+ {
4551
+ size: [
4552
+ bodyWidth - wallThickness * 2,
4553
+ bodyDepth - wallThickness * 2,
4554
+ hollowHeight
4555
+ ],
4556
+ center: [0, 0, hollowHeight / 2]
4557
+ }
4558
+ ),
4559
+ /* @__PURE__ */ jsx(
4560
+ Cuboid,
4561
+ {
4562
+ size: [bodyWidth, bodyDepth / 3, hollowHeight],
4563
+ center: [0, 0, hollowHeight / 6]
4564
+ }
4565
+ ),
4566
+ /* @__PURE__ */ jsx(
4567
+ Cuboid,
4568
+ {
4569
+ size: [
4570
+ bodyWidth - wallThickness * 2,
4571
+ wallThickness / 2,
4572
+ hollowHeight
4573
+ ],
4574
+ center: [
4575
+ 0,
4576
+ bodyDepth / 2 - wallThickness / 4,
4577
+ hollowHeight / 2
4578
+ ]
4579
+ }
4580
+ ),
4581
+ /* @__PURE__ */ jsx(
4582
+ Cuboid,
4583
+ {
4584
+ size: [
4585
+ bodyWidth - wallThickness * 2,
4586
+ wallThickness / 2,
4587
+ hollowHeight
4588
+ ],
4589
+ center: [
4590
+ 0,
4591
+ -bodyDepth / 2 + wallThickness / 4,
4592
+ hollowHeight / 2
4593
+ ]
4594
+ }
4595
+ ),
4596
+ /* @__PURE__ */ jsx(
4597
+ Cuboid,
4598
+ {
4599
+ size: [1, wallThickness + 2, 1],
4600
+ center: [-bodyWidth / 4, bodyDepth / 2, bodyHeight / 2]
4601
+ }
4602
+ ),
4603
+ /* @__PURE__ */ jsx(
4604
+ Cuboid,
4605
+ {
4606
+ size: [1, wallThickness + 3, 1],
4607
+ center: [bodyWidth / 4, bodyDepth / 2, bodyHeight / 2]
4608
+ }
4609
+ ),
4610
+ /* @__PURE__ */ jsx(
4611
+ Cuboid,
4612
+ {
4613
+ size: [1, wallThickness + 2, 1],
4614
+ center: [-bodyWidth / 4, -bodyDepth / 2, bodyHeight / 2]
4615
+ }
4616
+ ),
4617
+ /* @__PURE__ */ jsx(
4618
+ Cuboid,
4619
+ {
4620
+ size: [1, wallThickness + 3, 1],
4621
+ center: [bodyWidth / 4, -bodyDepth / 2, bodyHeight / 2]
4622
+ }
4623
+ )
4624
+ ] }) }) }) }),
4625
+ showPins && Array.from({ length: numPins }).map((_, i) => /* @__PURE__ */ jsx(Colorize, { color: pinColor, children: /* @__PURE__ */ jsx(
4626
+ Cylinder,
4627
+ {
4628
+ height: pinLength,
4629
+ radius: 0.35,
4630
+ center: [startX + i * pitch, 0, 2.5]
4631
+ }
4632
+ ) }, i)),
4633
+ showFootprint && Array.from({ length: numPins }).map((_, i) => {
4634
+ const hole = {
4635
+ type: "pcb_plated_hole",
4636
+ pcb_plated_hole_id: `jstzh_${i}`,
4637
+ shape: "circular_hole_with_rect_pad",
4638
+ x: startX + i * pitch,
4639
+ y: 0,
4640
+ hole_diameter: 0.73,
4641
+ hole_shape: "circle",
4642
+ pad_shape: "rect",
4643
+ rect_pad_width: 1.03,
4644
+ rect_pad_height: 1.73,
4645
+ layers: ["top", "bottom"],
4646
+ port_hints: [`${i + 1}`]
4647
+ };
4648
+ const isPin1 = i === 0;
4649
+ return /* @__PURE__ */ jsx(
4650
+ FootprintPlatedHole,
4651
+ {
4652
+ hole,
4653
+ isPin1
4654
+ },
4655
+ `footprint_${i}`
4656
+ );
4657
+ })
4658
+ ] });
4659
+ };
4660
+
4523
4661
  // lib/Footprinter3d.tsx
4524
4662
  var Footprinter3d = ({ footprint }) => {
4525
- const fpJson = fp2.string(footprint).json();
4663
+ let normalizedFootprint = footprint;
4664
+ if (footprint.startsWith("jstzh1_5mm")) {
4665
+ const pinMatch = footprint.match(/jstzh1_5mm(\d+)?/);
4666
+ const numPins = pinMatch && pinMatch[1] ? pinMatch[1] : "7";
4667
+ normalizedFootprint = `zh${numPins}`;
4668
+ }
4669
+ const fpJson = fp2.string(normalizedFootprint).json();
4526
4670
  switch (fpJson.fn) {
4527
4671
  case "dip":
4528
4672
  return /* @__PURE__ */ jsx(Dip, { numPins: fpJson.num_pins, pitch: fpJson.p, bodyWidth: fpJson.w });
@@ -4690,6 +4834,11 @@ var Footprinter3d = ({ footprint }) => {
4690
4834
  innerDiameter: fpJson.id
4691
4835
  }
4692
4836
  );
4837
+ case "jst":
4838
+ if (fpJson.zh) {
4839
+ return /* @__PURE__ */ jsx(JSTZH1_5mm, { numPins: fpJson.num_pins });
4840
+ }
4841
+ break;
4693
4842
  case "soic":
4694
4843
  return /* @__PURE__ */ jsx(
4695
4844
  SOIC,