jscad-electronics 0.0.90 → 0.0.92

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
@@ -2910,6 +2910,212 @@ var MS012 = ({
2910
2910
  ] });
2911
2911
  };
2912
2912
 
2913
+ // lib/TO220.tsx
2914
+ var TO220 = () => {
2915
+ const fullLength10 = 20;
2916
+ const bodyLength10 = 9.9;
2917
+ const bodyHeight = 4.5;
2918
+ const zOffset = 1;
2919
+ const padWidth = 9.9;
2920
+ const padLength = 6.5;
2921
+ const padThickness = 1.3;
2922
+ const padHoleDiameter = 3;
2923
+ const prongWidth = 0.81;
2924
+ const prongLength = 16;
2925
+ const prongHeight = 0.5;
2926
+ const prongPitch = 2.7;
2927
+ const bodyWidth = padWidth;
2928
+ const bodyFrontX = fullLength10 - bodyLength10 / 2;
2929
+ const bodyBackX = fullLength10 + bodyLength10 / 2;
2930
+ const prongCenterX = bodyFrontX - prongLength / 2;
2931
+ const padCenterX = bodyBackX + padLength / 2;
2932
+ return /* @__PURE__ */ jsx(Translate, { center: [0, 0, zOffset], children: /* @__PURE__ */ jsxs(Fragment2, { children: [
2933
+ /* @__PURE__ */ jsxs(Rotate, { rotation: [0, 55, -55], children: [
2934
+ /* @__PURE__ */ jsxs(Subtract, { children: [
2935
+ /* @__PURE__ */ jsx(
2936
+ Cuboid,
2937
+ {
2938
+ color: "#ccc",
2939
+ size: [padLength + 0.1, padWidth, padThickness],
2940
+ center: [padCenterX, 0, padThickness - 2]
2941
+ }
2942
+ ),
2943
+ /* @__PURE__ */ jsx(
2944
+ Cylinder,
2945
+ {
2946
+ color: "black",
2947
+ center: [padCenterX, 0, padThickness - 2],
2948
+ radius: padHoleDiameter / 2,
2949
+ height: padThickness * 1.2
2950
+ }
2951
+ )
2952
+ ] }),
2953
+ /* @__PURE__ */ jsx(Colorize, { color: "#222", children: /* @__PURE__ */ jsx(
2954
+ ChipBody,
2955
+ {
2956
+ width: bodyWidth,
2957
+ length: bodyLength10,
2958
+ height: bodyHeight,
2959
+ center: { x: fullLength10, y: 0, z: -2.4 },
2960
+ includeNotch: false,
2961
+ straightHeightRatio: 0.3,
2962
+ taperRatio: 0.04,
2963
+ heightAboveSurface: 1
2964
+ }
2965
+ ) })
2966
+ ] }),
2967
+ /* @__PURE__ */ jsx(Rotate, { rotation: [0, 55, 55], children: Array.from({ length: 3 }).map((_, i) => {
2968
+ const x = prongCenterX;
2969
+ const y = (i - 1) * prongPitch;
2970
+ const z = -prongHeight - 0.6;
2971
+ return /* @__PURE__ */ jsxs(Colorize, { color: "gold", children: [
2972
+ /* @__PURE__ */ jsxs(Hull, { children: [
2973
+ /* @__PURE__ */ jsx(Translate, { center: [bodyFrontX - bodyHeight / 2 + 0.1, y, z], children: /* @__PURE__ */ jsx(Cuboid, { size: [bodyHeight, prongWidth + 1, prongHeight] }) }),
2974
+ /* @__PURE__ */ jsx(
2975
+ Translate,
2976
+ {
2977
+ center: [bodyFrontX - bodyHeight / 2 - 1 + 0.1, y, z],
2978
+ children: /* @__PURE__ */ jsx(Cuboid, { size: [bodyHeight, prongWidth, prongHeight] })
2979
+ }
2980
+ )
2981
+ ] }),
2982
+ /* @__PURE__ */ jsx(Translate, { center: [x, y, z], children: /* @__PURE__ */ jsx(Cuboid, { size: [prongLength + 0.1, prongWidth, prongHeight] }) })
2983
+ ] }, `prong-${i}`);
2984
+ }) })
2985
+ ] }) });
2986
+ };
2987
+
2988
+ // lib/SOT-363.tsx
2989
+ var SOT363 = () => {
2990
+ const fullWidth = 2;
2991
+ const bodyWidth = 1.25;
2992
+ const bodyLength10 = 2;
2993
+ const bodyHeight = 1.1;
2994
+ const leadWidth = 0.25;
2995
+ const leadThickness = 0.15;
2996
+ const leadHeight = 0.85;
2997
+ const padContactLength = 0.3;
2998
+ const extendedBodyDistance = fullWidth - bodyWidth;
2999
+ return /* @__PURE__ */ jsxs(Fragment2, { children: [
3000
+ /* @__PURE__ */ jsx(
3001
+ SmdChipLead,
3002
+ {
3003
+ rotation: Math.PI,
3004
+ position: {
3005
+ x: fullWidth / 2 + extendedBodyDistance / 4,
3006
+ y: -0.65,
3007
+ z: leadThickness / 2
3008
+ },
3009
+ width: leadWidth,
3010
+ thickness: leadThickness,
3011
+ padContactLength,
3012
+ bodyDistance: extendedBodyDistance,
3013
+ height: leadHeight
3014
+ },
3015
+ 1
3016
+ ),
3017
+ /* @__PURE__ */ jsx(
3018
+ SmdChipLead,
3019
+ {
3020
+ rotation: Math.PI,
3021
+ position: {
3022
+ x: fullWidth / 2 + extendedBodyDistance / 4,
3023
+ y: 0,
3024
+ z: leadThickness / 2
3025
+ },
3026
+ width: leadWidth,
3027
+ thickness: leadThickness,
3028
+ padContactLength,
3029
+ bodyDistance: extendedBodyDistance,
3030
+ height: leadHeight
3031
+ },
3032
+ 2
3033
+ ),
3034
+ /* @__PURE__ */ jsx(
3035
+ SmdChipLead,
3036
+ {
3037
+ rotation: Math.PI,
3038
+ position: {
3039
+ x: fullWidth / 2 + extendedBodyDistance / 4,
3040
+ y: 0.65,
3041
+ z: leadThickness / 2
3042
+ },
3043
+ width: leadWidth,
3044
+ thickness: leadThickness,
3045
+ padContactLength,
3046
+ bodyDistance: extendedBodyDistance,
3047
+ height: leadHeight
3048
+ },
3049
+ 3
3050
+ ),
3051
+ /* @__PURE__ */ jsx(
3052
+ SmdChipLead,
3053
+ {
3054
+ position: {
3055
+ x: -fullWidth / 2 - extendedBodyDistance / 4,
3056
+ y: 0,
3057
+ z: leadThickness / 2
3058
+ },
3059
+ width: leadWidth,
3060
+ thickness: leadThickness,
3061
+ padContactLength,
3062
+ bodyDistance: extendedBodyDistance,
3063
+ height: leadHeight
3064
+ },
3065
+ 3
3066
+ ),
3067
+ /* @__PURE__ */ jsx(
3068
+ SmdChipLead,
3069
+ {
3070
+ position: {
3071
+ x: -fullWidth / 2 - extendedBodyDistance / 4,
3072
+ y: -0.65,
3073
+ z: leadThickness / 2
3074
+ },
3075
+ width: leadWidth,
3076
+ thickness: leadThickness,
3077
+ padContactLength,
3078
+ bodyDistance: extendedBodyDistance,
3079
+ height: leadHeight
3080
+ },
3081
+ 1
3082
+ ),
3083
+ /* @__PURE__ */ jsx(
3084
+ SmdChipLead,
3085
+ {
3086
+ position: {
3087
+ x: -fullWidth / 2 - extendedBodyDistance / 4,
3088
+ y: 0.65,
3089
+ z: leadThickness / 2
3090
+ },
3091
+ width: leadWidth,
3092
+ thickness: leadThickness,
3093
+ padContactLength,
3094
+ bodyDistance: extendedBodyDistance,
3095
+ height: leadHeight
3096
+ },
3097
+ 2
3098
+ ),
3099
+ /* @__PURE__ */ jsx(
3100
+ ChipBody,
3101
+ {
3102
+ center: { x: 0, y: 0, z: 0 },
3103
+ width: bodyWidth,
3104
+ length: bodyLength10,
3105
+ height: bodyHeight,
3106
+ straightHeightRatio: 0.6,
3107
+ notchPosition: {
3108
+ x: bodyWidth / 2 - 0.25,
3109
+ y: bodyHeight / 2 + 0.2,
3110
+ z: bodyHeight
3111
+ },
3112
+ heightAboveSurface: 0.1
3113
+ }
3114
+ )
3115
+ ] });
3116
+ };
3117
+ var SOT_363_default = SOT363;
3118
+
2913
3119
  // lib/Footprinter3d.tsx
2914
3120
  var Footprinter3d = ({ footprint }) => {
2915
3121
  const fpJson = fp.string(footprint).json();
@@ -3034,6 +3240,8 @@ var Footprinter3d = ({ footprint }) => {
3034
3240
  return /* @__PURE__ */ jsx(SOT223, {});
3035
3241
  case "sot323":
3036
3242
  return /* @__PURE__ */ jsx(SOT323, {});
3243
+ case "sot363":
3244
+ return /* @__PURE__ */ jsx(SOT_363_default, {});
3037
3245
  case "pushbutton":
3038
3246
  return /* @__PURE__ */ jsx(
3039
3247
  PushButton,
@@ -3092,6 +3300,8 @@ var Footprinter3d = ({ footprint }) => {
3092
3300
  );
3093
3301
  case "sot723":
3094
3302
  return /* @__PURE__ */ jsx(SOT723, {});
3303
+ case "to220":
3304
+ return /* @__PURE__ */ jsx(TO220, {});
3095
3305
  }
3096
3306
  const colorMatch = footprint.match(/_color\(([^)]+)\)/);
3097
3307
  const color = colorMatch ? colorMatch[1] : void 0;
@@ -3157,7 +3367,7 @@ function renderNode(node, colorCtx, renderCtx) {
3157
3367
  }
3158
3368
  if (type === Translate) {
3159
3369
  const off = toVec3(
3160
- props?.offset ?? { x: props?.x, y: props?.y, z: props?.z }
3370
+ props?.offset ?? props?.center ?? { x: props?.x, y: props?.y, z: props?.z }
3161
3371
  );
3162
3372
  const geoms = (children ?? []).flatMap(
3163
3373
  (c) => renderNode(c, colorCtx, renderCtx)