|
|
|
|
@ -6,22 +6,15 @@
|
|
|
|
|
"metadata": { |
|
|
|
|
"collapsed": true, |
|
|
|
|
"ExecuteTime": { |
|
|
|
|
"end_time": "2026-05-16T16:06:57.388758263Z", |
|
|
|
|
"start_time": "2026-05-16T16:06:29.224097165Z" |
|
|
|
|
"end_time": "2026-05-17T23:28:42.138106727Z", |
|
|
|
|
"start_time": "2026-05-17T23:28:27.883466201Z" |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
"source": [ |
|
|
|
|
"from itertools import product\n", |
|
|
|
|
"\n", |
|
|
|
|
"from ocp_vscode import show\n", |
|
|
|
|
"\n", |
|
|
|
|
"\"\"\"\n", |
|
|
|
|
"punch-guide — build123d\n", |
|
|
|
|
"4 pièces : superieure, inferieure, couvercle, (bac)\n", |
|
|
|
|
"Exporte chaque pièce en STEP et STL dans ./exports/\n", |
|
|
|
|
"\"\"\"\n", |
|
|
|
|
"\n", |
|
|
|
|
"from build123d import *\n", |
|
|
|
|
"from ocp_vscode import show\n", |
|
|
|
|
"\n", |
|
|
|
|
"# ─────────────────────────────────────────────────────────────────────────────\n", |
|
|
|
|
"# PARAMÈTRES — modifier ici uniquement\n", |
|
|
|
|
@ -64,7 +57,7 @@
|
|
|
|
|
"ailettes_ecart = 26 # mm\n", |
|
|
|
|
"ailettes_epaisseur = 3 # mm\n", |
|
|
|
|
"ailettes_hauteur = 30 # mm\n", |
|
|
|
|
"ailettes_profondeur = 20 # mm\n", |
|
|
|
|
"ailettes_profondeur = 21 # mm\n", |
|
|
|
|
"\n", |
|
|
|
|
"# Trou d'évacuation (confettis)\n", |
|
|
|
|
"evac_taille = 48.0 # mm — côté du carré (45 + jeu)\n", |
|
|
|
|
@ -117,7 +110,7 @@
|
|
|
|
|
"# léger offset pour centrer la zone à extruder dans l'axe de l'extrudeuse\n", |
|
|
|
|
"fente_y = fente_largeur / 2 - tracte_extrusion_center_y_offset\n", |
|
|
|
|
"fente_z_abs = epaisseur_fond + zone_extrusion_offset_hauteur # hauteur absolue depuis le bas\n", |
|
|
|
|
"fente_profondeur = tract_extrusion_center_x_offset + zone_extrusion_offset_avant + epaisseur_paroi\n", |
|
|
|
|
"fente_profondeur = tract_extrusion_center_x_offset + zone_extrusion_offset_avant + epaisseur_paroi + 3\n", |
|
|
|
|
"\n", |
|
|
|
|
"bloc_extrudeur_int_x = cav_dim_x\n", |
|
|
|
|
"bloc_extrudeur_int_y = max(cav_dim_y, fente_largeur + fente_y)\n", |
|
|
|
|
@ -297,22 +290,29 @@
|
|
|
|
|
" cx = (min_x + max_x) / 2\n", |
|
|
|
|
"\n", |
|
|
|
|
" with BuildSketch(front_plane) as sk:\n", |
|
|
|
|
" add([s.translate((-cx, 0, 0)) for s in logo_shapes])\n", |
|
|
|
|
" scale(by=0.7)\n", |
|
|
|
|
" add([s.translate((-cx, -4, 0)) for s in logo_shapes])\n", |
|
|
|
|
" scale(by=0.6)\n", |
|
|
|
|
"\n", |
|
|
|
|
" extrude(amount=-1, mode=Mode.SUBTRACT) # 1.5 mm de profondeur\n", |
|
|
|
|
"\n", |
|
|
|
|
" # Affichage du nom sur les deux cotés de la boite\n", |
|
|
|
|
" left_face = faces().filter_by(Axis.Y).sort_by(Axis.Y)[0]\n", |
|
|
|
|
" right_face = faces().filter_by(Axis.Y).sort_by(Axis.Y)[-1]\n", |
|
|
|
|
" line_spacing = 17\n", |
|
|
|
|
" for side_face in [left_face, right_face]:\n", |
|
|
|
|
" # side_face = Plane(side_face).rotated((0, 90, 0))\n", |
|
|
|
|
" with BuildSketch(side_face.translate((0, 0, -5))) as sk:\n", |
|
|
|
|
" Text(\"GUI-O-TRACTINE\\n3000\",\n", |
|
|
|
|
" with BuildSketch(side_face.translate((0, 0, 7))) as sk:\n", |
|
|
|
|
" Text(\"DETRACTOR\",\n", |
|
|
|
|
" font_size=20,\n", |
|
|
|
|
" align=Align.CENTER,\n", |
|
|
|
|
" font=\"Tanker\",\n", |
|
|
|
|
" rotation=-90)\n", |
|
|
|
|
" with Locations((-line_spacing,0)):\n", |
|
|
|
|
" Text(\"3000\",\n", |
|
|
|
|
" font_size=20,\n", |
|
|
|
|
" align=Align.CENTER,\n", |
|
|
|
|
" font=\"Tanker\",\n", |
|
|
|
|
" rotation=-90)\n", |
|
|
|
|
" extrude(amount=-1, mode=Mode.SUBTRACT)\n", |
|
|
|
|
"\n", |
|
|
|
|
" # Couper au niveau de la fente\n", |
|
|
|
|
@ -362,6 +362,17 @@
|
|
|
|
|
" top_edges = (edges(Select.LAST).filter_by(Axis.X).sort_by(Axis.Z)[-4:])\n", |
|
|
|
|
" chamfer(top_edges, length=0.5)\n", |
|
|
|
|
"\n", |
|
|
|
|
" # on enlève le bas des ailettes\n", |
|
|
|
|
" points = [\n", |
|
|
|
|
" (0, 0), # Premier sommet\n", |
|
|
|
|
" (0, -ailettes_profondeur), # Deuxième sommet\n", |
|
|
|
|
" (ailettes_profondeur, -ailettes_profondeur) # Troisième sommet\n", |
|
|
|
|
" ]\n", |
|
|
|
|
" with BuildSketch(Plane.XZ):\n", |
|
|
|
|
" with Locations((cav_dim_x / 2, 0)):\n", |
|
|
|
|
" Polygon(points, align=(Align.MAX, Align.CENTER))\n", |
|
|
|
|
" extrude(amount=ailettes_ecart / 2 + ailettes_epaisseur, mode=Mode.SUBTRACT, both=True)\n", |
|
|
|
|
"\n", |
|
|
|
|
" with BuildPart() as p_bottom:\n", |
|
|
|
|
" add(bottom)\n", |
|
|
|
|
" top_face = faces().filter_by(Plane.XY).sort_by(Axis.Z)[-1]\n", |
|
|
|
|
@ -468,8 +479,8 @@
|
|
|
|
|
"\n", |
|
|
|
|
"show(\n", |
|
|
|
|
" make_bloc_extrudeur(),\n", |
|
|
|
|
" make_bac_recup().translate((0, 0, -(bloc_extrudeur_ext_z / 2 + 2 * gap))),\n", |
|
|
|
|
" make_couvercle().translate((0, 0, bloc_extrudeur_ext_z / 2 + gap)),\n", |
|
|
|
|
" make_bac_recup().translate((0, 0, -(bac_hauteur/2 + bloc_extrudeur_ext_z / 2) + emboitement_profondeur)),\n", |
|
|
|
|
" make_couvercle().translate((0, 0, couv_ext_z/2 + bloc_extrudeur_ext_z / 2 - emboitement_profondeur)),\n", |
|
|
|
|
" names=[\"superieure\", \"inferieure\", \"couvercle\"],\n", |
|
|
|
|
" colors=[\"#ff7800\", \"#000000\", \"#000000\"],\n", |
|
|
|
|
")" |
|
|
|
|
@ -483,7 +494,7 @@
|
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
"execution_count": 124 |
|
|
|
|
"execution_count": 157 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"metadata": { |
|
|
|
|
@ -588,8 +599,8 @@
|
|
|
|
|
{ |
|
|
|
|
"metadata": { |
|
|
|
|
"ExecuteTime": { |
|
|
|
|
"end_time": "2026-05-15T13:58:22.949409543Z", |
|
|
|
|
"start_time": "2026-05-15T13:58:10.759490392Z" |
|
|
|
|
"end_time": "2026-05-17T23:37:18.404982125Z", |
|
|
|
|
"start_time": "2026-05-17T23:37:03.924008868Z" |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
"cell_type": "code", |
|
|
|
|
@ -605,12 +616,12 @@
|
|
|
|
|
"True" |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
"execution_count": 121, |
|
|
|
|
"execution_count": 158, |
|
|
|
|
"metadata": {}, |
|
|
|
|
"output_type": "execute_result" |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
"execution_count": 121 |
|
|
|
|
"execution_count": 158 |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
"metadata": { |
|
|
|
|
|