jscad-electronics 0.0.110 → 0.0.112

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
@@ -679,7 +679,9 @@ var PinRow = ({
679
679
  longSidePinLength = 6,
680
680
  invert,
681
681
  faceup,
682
- rows = 1
682
+ rows = 1,
683
+ smd,
684
+ rightangle
683
685
  }) => {
684
686
  const pinThickness = 0.63;
685
687
  const bodyHeight = 2;
@@ -692,21 +694,37 @@ var PinRow = ({
692
694
  const bodyCenterY = rows > 1 ? -((rows - 1) * rowSpacing) / 2 : 0;
693
695
  const flipZ = (z) => invert || faceup ? -z + bodyHeight : z;
694
696
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
695
- /* @__PURE__ */ jsx(
697
+ /* @__PURE__ */ jsx(Translate, { y: rightangle ? -3 : 0, children: /* @__PURE__ */ jsx(
696
698
  Cuboid,
697
699
  {
698
700
  color: "#222",
699
701
  size: [bodyWidth, bodyDepth, bodyHeight],
700
702
  center: [0, bodyCenterY, flipZ(bodyHeight / 2)]
701
703
  }
702
- ),
704
+ ) }),
703
705
  Array.from({ length: numberOfPins }, (_, i) => {
704
706
  const row = Math.floor(i / pinsPerRow);
705
707
  const col = i % pinsPerRow;
706
708
  const x = xoff + col * pitch;
707
709
  const y = -row * rowSpacing;
708
710
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
709
- !faceup && /* @__PURE__ */ jsx(Colorize, { color: "gold", children: /* @__PURE__ */ jsxs(Hull, { children: [
711
+ !faceup && /* @__PURE__ */ jsx(Colorize, { color: "gold", children: smd ? /* @__PURE__ */ jsx(
712
+ SmdChipLead,
713
+ {
714
+ rotation: -Math.PI / 2,
715
+ position: {
716
+ x,
717
+ y: y + 1,
718
+ z: pinThickness / 2
719
+ },
720
+ thickness: pinThickness,
721
+ width: pinThickness,
722
+ height: pinThickness,
723
+ padContactLength: 2,
724
+ bodyDistance: 3
725
+ },
726
+ `short-smd-${i}`
727
+ ) : /* @__PURE__ */ jsxs(Hull, { children: [
710
728
  /* @__PURE__ */ jsx(
711
729
  Cuboid,
712
730
  {
@@ -732,28 +750,39 @@ var PinRow = ({
732
750
  }
733
751
  )
734
752
  ] }) }, `short-${i}`),
735
- /* @__PURE__ */ jsx(Colorize, { color: "gold", children: /* @__PURE__ */ jsxs(Hull, { children: [
736
- /* @__PURE__ */ jsx(
737
- Cuboid,
738
- {
739
- color: "gold",
740
- size: [pinThickness, pinThickness, longSidePinLength * 0.9],
741
- center: [x, y, flipZ(-longSidePinLength / 2 * 0.9)]
742
- }
743
- ),
744
- /* @__PURE__ */ jsx(
745
- Cuboid,
746
- {
747
- color: "gold",
748
- size: [
749
- pinThickness / 1.8,
750
- pinThickness / 1.8,
751
- longSidePinLength
752
- ],
753
- center: [x, y, flipZ(-longSidePinLength / 2)]
754
- }
755
- )
756
- ] }) }, `long-${i}`)
753
+ /* @__PURE__ */ jsx(Colorize, { color: "gold", children: /* @__PURE__ */ jsx(Translate, { y: rightangle ? -3.9 : 0, z: rightangle ? 1 : 0, children: /* @__PURE__ */ jsx(
754
+ Rotate,
755
+ {
756
+ rotation: rightangle ? [-Math.PI / 2, 0, 0] : [0, 0, 0],
757
+ children: /* @__PURE__ */ jsxs(Hull, { children: [
758
+ /* @__PURE__ */ jsx(
759
+ Cuboid,
760
+ {
761
+ color: "gold",
762
+ size: [
763
+ pinThickness,
764
+ pinThickness,
765
+ longSidePinLength * 0.9
766
+ ],
767
+ center: [x, y, flipZ(-longSidePinLength / 2 * 0.9)]
768
+ }
769
+ ),
770
+ /* @__PURE__ */ jsx(
771
+ Cuboid,
772
+ {
773
+ color: "gold",
774
+ size: [
775
+ pinThickness / 1.8,
776
+ pinThickness / 1.8,
777
+ longSidePinLength
778
+ ],
779
+ center: [x, y, flipZ(-longSidePinLength / 2)]
780
+ }
781
+ )
782
+ ] })
783
+ },
784
+ `rotate-${i}`
785
+ ) }) }, `long-${i}`)
757
786
  ] });
758
787
  })
759
788
  ] });
@@ -3904,12 +3933,49 @@ var SOD323FL = () => {
3904
3933
  ] });
3905
3934
  };
3906
3935
 
3936
+ // lib/AxialCapacitor.tsx
3937
+ var AxialCapacitor = ({ pitch = 10 }) => {
3938
+ const heightToCenterOfCapacitor = 0.5 + 4 / 2;
3939
+ return /* @__PURE__ */ jsxs(Fragment2, { children: [
3940
+ /* @__PURE__ */ jsx(Cylinder, { height: 4, radius: 0.5, center: [-pitch / 2, 0, 0.5] }),
3941
+ /* @__PURE__ */ jsx(
3942
+ Sphere,
3943
+ {
3944
+ radius: 0.5,
3945
+ center: [-pitch / 2, 0, heightToCenterOfCapacitor]
3946
+ }
3947
+ ),
3948
+ /* @__PURE__ */ jsx(Translate, { x: -2.5, y: 0, z: heightToCenterOfCapacitor, children: /* @__PURE__ */ jsxs(Rotate, { rotation: [0, Math.PI / 2, 0], children: [
3949
+ /* @__PURE__ */ jsx(
3950
+ Cylinder,
3951
+ {
3952
+ height: pitch,
3953
+ radius: 0.5,
3954
+ center: [0, 0, heightToCenterOfCapacitor]
3955
+ }
3956
+ ),
3957
+ /* @__PURE__ */ jsx(Colorize, { color: "#d2b48c", children: /* @__PURE__ */ jsx(
3958
+ Cylinder,
3959
+ {
3960
+ height: 5,
3961
+ radius: 1.3,
3962
+ center: [0, 0, heightToCenterOfCapacitor]
3963
+ }
3964
+ ) })
3965
+ ] }) }),
3966
+ /* @__PURE__ */ jsx(Cylinder, { height: 4, radius: 0.5, center: [pitch / 2, 0, 0.5] }),
3967
+ /* @__PURE__ */ jsx(Sphere, { radius: 0.5, center: [pitch / 2, 0, heightToCenterOfCapacitor] })
3968
+ ] });
3969
+ };
3970
+
3907
3971
  // lib/Footprinter3d.tsx
3908
3972
  var Footprinter3d = ({ footprint }) => {
3909
3973
  const fpJson = fp.string(footprint).json();
3910
3974
  switch (fpJson.fn) {
3911
3975
  case "dip":
3912
3976
  return /* @__PURE__ */ jsx(Dip, { numPins: fpJson.num_pins, pitch: fpJson.p, bodyWidth: fpJson.w });
3977
+ case "axial":
3978
+ return /* @__PURE__ */ jsx(AxialCapacitor, { pitch: fpJson.p });
3913
3979
  case "tssop":
3914
3980
  return /* @__PURE__ */ jsx(
3915
3981
  Tssop,
@@ -4006,7 +4072,9 @@ var Footprinter3d = ({ footprint }) => {
4006
4072
  pitch: fpJson.p,
4007
4073
  invert: fpJson.invert,
4008
4074
  faceup: fpJson.faceup,
4009
- rows
4075
+ rows,
4076
+ smd: fpJson.smd || fpJson.surface_mount,
4077
+ rightangle: fpJson.rightangle
4010
4078
  }
4011
4079
  );
4012
4080
  if (fpJson.female)