Browse Source

Renfort pour le cadre

master
hadware 1 month ago
parent
commit
e363b8294e
  1. 53
      tractocadre.ipynb

53
tractocadre.ipynb

@ -6,16 +6,16 @@
"metadata": {
"collapsed": true,
"ExecuteTime": {
"end_time": "2026-05-22T01:25:54.666792544Z",
"start_time": "2026-05-22T01:25:54.440667158Z"
"end_time": "2026-05-22T18:32:07.989017130Z",
"start_time": "2026-05-22T18:32:07.752507264Z"
}
},
"source": [
"from build123d import *\n",
"from ocp_vscode import show, set_port\n",
"\n",
"A3_largueur = 105\n",
"A3_hauteur = 148\n",
"A3_largueur = 148\n",
"A3_hauteur = 210\n",
"\n",
"stand_bordure = 5 # de chaque coté\n",
"stand_epaisseur = 5\n",
@ -49,24 +49,24 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Plane(o=(-101.50, 0.00, 0.00), x=(0.00, 0.00, 1.00), z=(-1.00, -0.00, 0.00))\n",
"c\n"
"Plane(o=(-50.00, 0.00, 0.00), x=(0.00, 0.00, 1.00), z=(-1.00, -0.00, 0.00))\n",
"+\n"
]
}
],
"execution_count": 15
"execution_count": 116
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2026-05-22T17:29:08.227823509Z",
"start_time": "2026-05-22T17:29:07.494508009Z"
"end_time": "2026-05-22T18:35:49.426903482Z",
"start_time": "2026-05-22T18:35:48.369326760Z"
}
},
"cell_type": "code",
"source": [
"A3_largueur = 105\n",
"A3_hauteur = 148\n",
"A3_largueur = 148\n",
"A3_hauteur = 210\n",
"\n",
"stand_bordure = 5 # de chaque coté\n",
"stand_epaisseur = 5\n",
@ -98,6 +98,7 @@
" Rectangle(A3_largueur - 10, A3_hauteur - 10)\n",
" extrude(amount=-1.8, mode=Mode.SUBTRACT)\n",
"\n",
" # extrusion du rail\n",
" stand_backface = faces().filter_by(Plane.XY).sort_by(Axis.Z)[-1]\n",
" with BuildSketch(stand_backface):\n",
" with Locations((0, stand_backface.width / 2)):\n",
@ -111,9 +112,17 @@
" align=(Align.CENTER, Align.MAX))\n",
" loft(mode=Mode.SUBTRACT)\n",
"\n",
" # rajout des renforts\n",
" middle_angle_plane = Plane(origin=(stand_bordure + 10, stand_backface.center().Y, 0)).rotated(\n",
" (0, -stand_angle_pied / 2, 0))\n",
" with BuildSketch(middle_angle_plane):\n",
" with GridLocations(0, stand_largueur - stand_bordure, 1, 2):\n",
" Rectangle(10, 5)\n",
" extrude(until=Until.NEXT, both=True)\n",
"\n",
"cadre = cadre.part\n",
"\n",
"clearance = 0.2\n",
"clearance = 0.5\n",
"\n",
"with BuildPart() as rail:\n",
" with BuildSketch(Plane.XY) as sk1:\n",
@ -143,7 +152,7 @@
"rail_joint = LinearJoint(\n",
" label=\"insert\",\n",
" to_part=rail,\n",
" axis=Axis((rail.faces()\n",
" axis=-Axis((rail.faces()\n",
" .filter_by(Plane.YZ)\n",
" .sort_by(Axis.X)[-1]\n",
" .offset(-(A3_hauteur + stand_bordure) / 2))\n",
@ -156,7 +165,7 @@
"cadre_joint.connect_to(rail_joint, position=0)\n",
"\n",
"# Or move to a specific position\n",
"cadre_joint.connect_to(rail_joint, position=0)\n",
"cadre_joint.connect_to(rail_joint, position=60)\n",
"assembly = Compound(children=[cadre, rail])\n",
"cog = assembly.center(CenterOf.MASS)\n",
"cog_marker = Sphere(2).locate(Location(cog))\n",
@ -168,35 +177,35 @@
"name": "stdout",
"output_type": "stream",
"text": [
"cc+\n"
"c++\n"
]
}
],
"execution_count": 92
"execution_count": 126
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2026-05-22T17:26:35.126466252Z",
"start_time": "2026-05-22T17:26:35.071890866Z"
"end_time": "2026-05-22T18:10:39.214716262Z",
"start_time": "2026-05-22T18:10:39.161736598Z"
}
},
"cell_type": "code",
"source": "Compound(children=[cadre, rail]).center(CenterOf.MASS)",
"source": "Plane.XY.rotated()",
"id": "9c05871fcb7d0f44",
"outputs": [
{
"data": {
"text/plain": [
"Vector(54.041693811711, -57.5, 6.2695039269171)"
"Plane(o=(0.00, 0.00, 0.00), x=(1.00, 0.00, 0.00), z=(0.00, 0.00, 1.00))"
]
},
"execution_count": 89,
"execution_count": 96,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 89
"execution_count": 96
},
{
"metadata": {

Loading…
Cancel
Save