jscad-electronics 0.0.176 → 0.0.178
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 +2 -1
- package/dist/index.js +249 -235
- package/dist/index.js.map +1 -1
- package/dist/vanilla.js +29 -18
- package/dist/vanilla.js.map +1 -1
- package/package.json +1 -1
package/dist/vanilla.js
CHANGED
|
@@ -4082,36 +4082,50 @@ var MicroMELF = ({
|
|
|
4082
4082
|
var MINIMELF = ({
|
|
4083
4083
|
bodyLength: bodyLength10 = 3.5,
|
|
4084
4084
|
bodyDiameter = 1.5,
|
|
4085
|
-
color = "#
|
|
4086
|
-
contactColor = "#c6c6c6"
|
|
4085
|
+
color = "#202020",
|
|
4086
|
+
contactColor = "#c6c6c6",
|
|
4087
|
+
bandColor = "#f2f2f2"
|
|
4087
4088
|
}) => {
|
|
4088
|
-
const
|
|
4089
|
+
const contactLength = 0.4;
|
|
4090
|
+
const glassLength = bodyLength10 - 2 * contactLength + 0.04;
|
|
4091
|
+
const contactOffset = (bodyLength10 - contactLength) / 2;
|
|
4092
|
+
const contactRadius = bodyDiameter / 2 + 0.02;
|
|
4093
|
+
const bandLength = 0.14;
|
|
4094
|
+
const bandOffset = -bodyLength10 / 2 + contactLength + 0.35;
|
|
4089
4095
|
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
4090
4096
|
/* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Rotate, { rotation: [0, "90deg", 0], children: /* @__PURE__ */ jsx(
|
|
4091
4097
|
RoundedCylinder,
|
|
4092
4098
|
{
|
|
4093
|
-
height:
|
|
4099
|
+
height: glassLength,
|
|
4094
4100
|
radius: bodyDiameter / 2,
|
|
4095
|
-
roundRadius: 0.
|
|
4101
|
+
roundRadius: 0.05,
|
|
4096
4102
|
center: [-bodyDiameter / 2, 0, 0]
|
|
4097
4103
|
}
|
|
4098
4104
|
) }) }),
|
|
4105
|
+
/* @__PURE__ */ jsx(Colorize, { color: bandColor, children: /* @__PURE__ */ jsx(Rotate, { rotation: [0, "90deg", 0], children: /* @__PURE__ */ jsx(
|
|
4106
|
+
Cylinder,
|
|
4107
|
+
{
|
|
4108
|
+
height: bandLength,
|
|
4109
|
+
radius: bodyDiameter / 2 + 2e-3,
|
|
4110
|
+
center: [-bodyDiameter / 2, 0, bandOffset]
|
|
4111
|
+
}
|
|
4112
|
+
) }) }),
|
|
4099
4113
|
/* @__PURE__ */ jsx(Colorize, { color: contactColor, children: /* @__PURE__ */ jsx(Rotate, { rotation: [0, "90deg", 0], children: /* @__PURE__ */ jsx(
|
|
4100
4114
|
RoundedCylinder,
|
|
4101
4115
|
{
|
|
4102
|
-
height:
|
|
4103
|
-
radius:
|
|
4104
|
-
roundRadius: 0.
|
|
4105
|
-
center: [-bodyDiameter / 2, 0, -
|
|
4116
|
+
height: contactLength,
|
|
4117
|
+
radius: contactRadius,
|
|
4118
|
+
roundRadius: 0.04,
|
|
4119
|
+
center: [-bodyDiameter / 2, 0, -contactOffset]
|
|
4106
4120
|
}
|
|
4107
4121
|
) }) }),
|
|
4108
4122
|
/* @__PURE__ */ jsx(Colorize, { color: contactColor, children: /* @__PURE__ */ jsx(Rotate, { rotation: [0, "90deg", 0], children: /* @__PURE__ */ jsx(
|
|
4109
4123
|
RoundedCylinder,
|
|
4110
4124
|
{
|
|
4111
|
-
height:
|
|
4112
|
-
radius:
|
|
4113
|
-
roundRadius: 0.
|
|
4114
|
-
center: [-bodyDiameter / 2, 0,
|
|
4125
|
+
height: contactLength,
|
|
4126
|
+
radius: contactRadius,
|
|
4127
|
+
roundRadius: 0.04,
|
|
4128
|
+
center: [-bodyDiameter / 2, 0, contactOffset]
|
|
4115
4129
|
}
|
|
4116
4130
|
) }) })
|
|
4117
4131
|
] });
|
|
@@ -8834,11 +8848,8 @@ function renderNode(node, colorCtx, renderCtx) {
|
|
|
8834
8848
|
}));
|
|
8835
8849
|
}
|
|
8836
8850
|
if (type === Rotate) {
|
|
8837
|
-
const
|
|
8838
|
-
|
|
8839
|
-
degToRad(props.rotation[1]),
|
|
8840
|
-
degToRad(props.rotation[2])
|
|
8841
|
-
] : [
|
|
8851
|
+
const angles = props?.angles ?? props?.rotation;
|
|
8852
|
+
const rot = Array.isArray(angles) ? [degToRad(angles[0]), degToRad(angles[1]), degToRad(angles[2])] : [
|
|
8842
8853
|
degToRad(props?.x ?? 0),
|
|
8843
8854
|
degToRad(props?.y ?? 0),
|
|
8844
8855
|
degToRad(props?.z ?? 0)
|