update jupyter-notebook for the construction of the teeth-flanks of a worm gear

This commit is contained in:
looooo
2025-01-04 22:02:47 +01:00
parent 7034963050
commit e65f2e8924

View File

@@ -206,8 +206,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"PATH_TO_FREECAD_LIBDIR not specified, using default FreeCAD version in /home/lo/projects/freecad/freecad.gears/.pixi/envs/default/lib\n",
"Assembly4 workbench (v0.12.5) loaded\n",
"PATH_TO_FREECAD_LIBDIR not specified, using default FreeCAD version in /Users/lo/projects/freecad/freecad.gears/.pixi/envs/default/lib\n",
"t_start_1: -3.111447653720825\n",
"t_start_0: 3.8893095671510314\n",
"t0: 3.918003320200202, min: 0.36578136487102625\n",
@@ -316,7 +315,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 3,
"id": "08796217-5c32-4970-9c2e-486855bfe01a",
"metadata": {},
"outputs": [],
@@ -364,12 +363,21 @@
" x1 = np.sqrt(r1**2 - y**2)\n",
" return d_distance_pw_dx(x1, y, t)\n",
"\n",
" def min_head_1(y, t):\n",
" r1 = xw - module * (1 + head)\n",
" x1 = np.sqrt(r1**2 - y**2)\n",
" r2 = xw + rw - x1\n",
" # x2 = np.sqrt(r2**2 - z(x2, y, t)) # x2 is function of x2!!!\n",
" x2 = sp.optimize.root(lambda x2: x2 - np.sqrt(r2**2 - z(x2, y, t)), x1).x[0]\n",
" xt = rw + xw - x2\n",
" return d_distance_pw_dx(xt, y, t)\n",
"\n",
" def create_points(): \n",
" xyz = []\n",
" t_start_0 = module * (1 + head) * (np.tan(alpha) + 1. / np.tan(alpha))\n",
" t_start_1 = - module * (1 + clearence) * (np.tan(alpha) + 1. / np.tan(alpha))\n",
" for y in np.linspace(- height / 2, height / 2, 5):\n",
" t0 = sp.optimize.root(lambda t: min_head(y, t)**2, t_start_0).x[0]\n",
" t0 = sp.optimize.root(lambda t: min_head_1(y, t)**2, t_start_0).x[0]\n",
" t1 = sp.optimize.root(lambda t: min_root(y, t)**2, t_start_1).x[0]\n",
" xyz_section = []\n",
" for t in np.linspace(t0, t1, 10):\n",
@@ -377,9 +385,6 @@
" # phi = x_p * np.tan(alpha) / r_w\n",
" # phi += - np.sign(alpha) * module * np.pi / 4. / r_w\n",
" phi = t / rw\n",
" # T_0 = numeric_transformation(phi, np.array([0., 1., 0.]))\n",
" # T_1 = numeric_transformation(np.pi / 2, np.array([1., 0., 0.]))\n",
" # T_2 = numeric_transformation(0., np.array([1., 0., 0]), np.array([xw + rw, 0., 0.]))\n",
" T_0 = numeric_transformation(0, np.array([1., 0., 0.]), np.array([-rw - xw, 0, 0]))\n",
" T_1 = numeric_transformation(phi, np.array([0., 1., 0.]))\n",
" T_2 = numeric_transformation(np.pi/2, np.array([1., 0., 0.]))\n",
@@ -429,7 +434,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.8"
"version": "3.13.1"
}
},
"nbformat": 4,