diff --git a/Images/L101.svg b/Images/L101.svg new file mode 100644 index 0000000..cf4ff65 --- /dev/null +++ b/Images/L101.svg @@ -0,0 +1,1138 @@ + + + FreeCAD SVG Export + Drawing page: Page exported from FreeCAD document: L101 + + + + + + + image/svg+xml + + 13/10/2016 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1/4 + + + -- + + + V0.01 + + + 1/1 + + + Longeron L101 (Remorque) + + + Vélo solaire pour tous + + + COPYLEFT + + + DESIGNER : + + + PROJECTION : + + + FORMAT : + + + Aluminium + + + MATERIAL : + + + ASSOCIATION : + + + SCALE : + + + WEIGHT (g) : + + + VERSION : + + + SHEET: + + + CREATION DATE : + + + + + + + + + + + + + + + + INDICE + + + CHANGE DESCRIPTION + + + DATE + + +3 + + + + + + V0.01 + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + Creation + + + - + + + - + + + - + + + - + + + 08/03/2025 + + + --/--/---- + + + --/--/---- + + + --/--/---- + + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + + + + + + + + + + + + + + + + GLOBAL TOLERANCE : + + + + + + + + + + 0,5 + + + C.E. + + + 08/03/2025 + + + A3 + + + + + Avant Remorque + + + <---------- + + + + + + Arrière Remorque + + + -----------> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀8,5 + + + + + + + + + + + + + + + + + + + + + + + + ! + + + 610 + + + + + + + + + + + + 305 + + + + + + + + + + + + 53 + + + + + + + + + + + + 106,07 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + 50 + + + + + + + + + + + + 75 + + + + + + + + + + + + 125 + + + + + + + + + + + + 180 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 25 + + + + + + + + + + + + 25 + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + 75 + + + + + + + + + + + + 12,5 + + + + + + + + + + + + 12,5 + + + + + + + + + + + + 75 + + + + + + + + + + + + + diff --git a/Images/L102.svg b/Images/L102.svg new file mode 100644 index 0000000..38eb5af --- /dev/null +++ b/Images/L102.svg @@ -0,0 +1,997 @@ + + + FreeCAD SVG Export + Drawing page: Page exported from FreeCAD document: L102 + + + + + + + image/svg+xml + + 13/10/2016 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1/4 + + + --- + + + V0.01 + + + 1/1 + + + Remorque PM - Longeron L102 (Timon) + + + Vélo solaire pour tous + + + COPYLEFT + + + DESIGNER : + + + PROJECTION : + + + FORMAT : + + + Aluminium + + + MATERIAL : + + + ASSOCIATION : + + + SCALE : + + + WEIGHT (g) : + + + VERSION : + + + SHEET: + + + CREATION DATE : + + + + + + + + + + + + + + + + INDICE + + + CHANGE DESCRIPTION + + + DATE + + +3 + + + + + + V0.01 + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + Creation + + + - + + + - + + + - + + + - + + + 08/03/2025 + + + --/--/---- + + + --/--/---- + + + --/--/---- + + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + + + + + + + + + + + + + + + + GLOBAL TOLERANCE : + + + + + + + + + + 0,5 + + + CE + + + 08/03/2025 + + + A3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 670 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + 0 + + + + + + + + + + + + 0 + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 25 + + + + + + + + + + + + 25 + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + 75 + + + + + + + + + + + + 12,5 + + + + + + + + + + + + 106,07 + + + + + + + + + + + + + diff --git a/Images/M101.svg b/Images/M101.svg new file mode 100644 index 0000000..66bc707 --- /dev/null +++ b/Images/M101.svg @@ -0,0 +1,883 @@ + + + FreeCAD SVG Export + Drawing page: Page exported from FreeCAD document: M101 + + + + + + + image/svg+xml + + 13/10/2016 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1/1 + + + --- + + + V1.00 + + + 1/1 + + + Remorque PM - Montant M101 + + + Vélo solaire pour tous + + + COPYLEFT + + + DESIGNER : + + + PROJECTION : + + + FORMAT : + + + Aluminium + + + MATERIAL : + + + ASSOCIATION : + + + SCALE : + + + WEIGHT (g) : + + + VERSION : + + + SHEET: + + + CREATION DATE : + + + + + + + + + + + + + + + + INDICE + + + CHANGE DESCRIPTION + + + DATE + + +3 + + + + + + V1.00 + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + Creation + + + - + + + - + + + - + + + - + + + 08/03/2025 + + + --/--/---- + + + --/--/---- + + + --/--/---- + + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + + + + + + + + + + + + + + + + GLOBAL TOLERANCE : + + + + + + + + + + 0,5 + + + C.E. + + + 08/03/2025 + + + A3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 19,5 + + + + + + + + + + + + 22 + + + + + + + + + + + + 75 + + + + + + + + + + + + 145 + + + + + + + + + + + + 53 + + + + + + + + + + + + 125,5 + + + + + + + + + + + + + + + + + + + + + + + + Optionnel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 25 + + + + + + + + + + + + 25 + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 12,5 + + + + + + + + + + + + + diff --git a/Images/T101.svg b/Images/T101.svg new file mode 100644 index 0000000..909f3d1 --- /dev/null +++ b/Images/T101.svg @@ -0,0 +1,1060 @@ + + + FreeCAD SVG Export + Drawing page: Page002 exported from FreeCAD document: T101 + + + + + + + image/svg+xml + + 13/10/2016 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1/2 + + + --- + + + V1.00 + + + 1/1 + + + Remorque PM - Traverse T101 + + + Vélo solaire pour tous + + + COPYLEFT + + + DESIGNER : + + + PROJECTION : + + + FORMAT : + + + Aluminium + + + MATERIAL : + + + ASSOCIATION : + + + SCALE : + + + WEIGHT (g) : + + + VERSION : + + + SHEET: + + + CREATION DATE : + + + + + + + + + + + + + + + + INDICE + + + CHANGE DESCRIPTION + + + DATE + + +3 + + + + + + V1.00 + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + Creation + + + - + + + - + + + - + + + - + + + 08/03/2025 + + + --/--/---- + + + --/--/---- + + + --/--/---- + + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + - + + + --/--/---- + + + + + + + + + + + + + + + + + + + GLOBAL TOLERANCE : + + + + + + + + + + 0,5 + + + C.E. + + + 08/03/2025 + + + A3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 205 + + + + + + + + + + + + 410 + + + + + + + + + + + + 152 + + + + + + + + + + + + 106 + + + + + + + + + + + + 53 + + + + + + + + + + + + 75 + + + + + + + + + + + + 75 + + + + + + + + + + + + 152 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 25 + + + + + + + + + + + + 25 + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 12,5 + + + + + + + + + + + + 62,5 + + + + + + + + + + + + 12,5 + + + + + + + + + + + + 62,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + ⌀6,5 + + + + + + + + + + + + + diff --git a/README.md b/README.md index 310094a..5b4ed58 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,13 @@ sur la base du travail de Macéo --- attention --- fait avec FreeCad v0.21.2, peut-être pas lisible correctement avec les versions antérieures +état au **08/03/2025** - 15h30 + +## itération 0.01 avec schémas techniques en 2D (.SVG) +(pas de changement du design 3D) + état au **05/03/2025** - 08h30 - + suite discussion du 3/5/25 ### Dimensions: diff --git a/tools/export-all-parts.py b/tools/export-all-parts.py new file mode 100644 index 0000000..e0e138b --- /dev/null +++ b/tools/export-all-parts.py @@ -0,0 +1,167 @@ +from pathlib import Path +import os + +import FreeCAD as App +import Import +import ImportGui + +project_folder = os.getcwd() +output_folder = project_folder + '/dist/STEP' +assemblies_output_folder = project_folder + '/dist/FCStd' + +def close_all_docs(): + while len(App.listDocuments().values()) > 0: + App.closeDocument(list(App.listDocuments().values())[0].Name) + +def convert_file(file_name, output_format): + doc = App.open(project_folder + '\\' + file_name) + + root_objects = [] + main_object = None + + #print("document: " + doc.Name) + print("document: " + doc.Name) + for obj in doc.Objects: + if len(obj.Parents) == 0: + #print(obj.Label) + print("Object Label : " + obj.Label) + root_objects.append(obj) + if obj.Label == doc.Name or obj.Label == doc.Name + ' (experimental)': + main_object = obj + + if main_object is None and len(root_objects) == 1: + main_object = root_objects[0] + + if main_object is None: + raise Exception("Can't find main object in file " + file_name + " (found " + str(len(root_objects)) + " root object(s), none named like the document " + doc.Name + ")") + + if 'experimental' in main_object.Label or 'expérimental' in main_object.Label: + print('Document ' + doc.Name + ' is marked as experimental and will be ignored') + close_all_docs() + return + + secondary_objects = [] + code_obj = doc.getObjectsByLabel('Code_Tube_Draft') +# + print("len(code_obj) : " + str(len(code_obj))) + if len(code_obj) == 1: + code_obj = code_obj[0] + #code_obj.Label = 'Code_Tube' + #secondary_objects.append(code_obj) + + # engrave code on tube + #code_pocket = main_object.newObjectAt('PartDesign::Pocket','Pocket', [code_obj]) + code_pocket = main_object.newObject('PartDesign::Pocket','Pocket') + code_pocket.Profile = code_obj + code_pocket.Length = 0.2 + code_pocket.recompute() + main_object.recompute() + + if len(secondary_objects) > 0: + group = doc.addObject('App::Part', 'Groupe') + group.addObject(main_object) + for obj in secondary_objects: + group.addObject(obj) + main_object = group + + output_path = output_folder + '/' + os.path.dirname(file_name) + '/' + Path(file_name).stem + '.' + output_format + output_dir = os.path.dirname(output_path) + if not os.path.exists(output_dir): + os.makedirs(output_dir) + + if output_format.lower() == 'stpz': + import stepZ + stepZ.export([main_object], output_path) + else: + Import.export([main_object], output_path) + + close_all_docs() + +def convert_assembly(file_name, output_format): + print("Exporting assembly " + file_name + "...") + + doc = App.open(project_folder + '/' + file_name) + + root_objects = [] + main_object = None + + # remove all objects that are not visible, or not in the TypeId whitelist, because we don't want to export those + need_check_objects = True + while need_check_objects: + need_check_objects = False + for obj in doc.Objects: + if not obj.Visibility or obj.TypeId not in ['Part::Feature', 'Part::FeaturePython', 'PartDesign::Body', 'Part::Mirroring', 'Part::Cut', 'Part::Part2DObjectPython', 'Part::MultiFuse', 'Part::Loft', 'Part::Torus', 'Part::Cylinder', 'App::DocumentObjectGroup', 'App::Part', 'App::Link']: + #print('removing ' + obj.Name + ' ('+obj.Label+')') + doc.removeObject(obj.Name) + need_check_objects = True + break + + for obj in doc.Objects: + if len(obj.Parents) == 0: + #print(obj.Label) + root_objects.append(obj) + if obj.Label == doc.Name: + main_object = obj + + if main_object is None and len(root_objects) == 1: + main_object = root_objects[0] + + if main_object is None: + raise Exception("Can't find main assembly in file " + file_name + " (found " + str(len(root_objects)) + " root object(s), none named like the document " + doc.Name + ")") + + output_path = output_folder + '/' + os.path.dirname(file_name) + '/' + Path(file_name).stem + '.' + output_format + output_dir = os.path.dirname(output_path) + if not os.path.exists(output_dir): + os.makedirs(output_dir) + + if output_format.lower() == 'stpz': + import stepZ + stepZ.export([main_object], output_path) + else: + ImportGui.export([main_object], output_path) + + close_all_docs() + +def export_configuration(doc, config_name, output_filename): + print('Generating assembly for configuration '+config_name+'...') + + Gui.Selection.clearSelection() + Gui.Selection.addSelection('vheliotech','Model','Configurations.'+doc.getObjectsByLabel(config_name)[0].Name+'.') + Gui.runCommand('Asm4_applyConfiguration') + Gui.Selection.clearSelection() + + doc.saveAs(assemblies_output_folder + '/' + output_filename + '.FCStd') + +try: + folders = [ + #'chaudronnerie', + 'tubes' + ] + + for folder in folders: + files = os.listdir(project_folder + '\\' + folder) + for source_file in files: + if not source_file.endswith('.FCStd'): continue + source_path = folder + '\\' + source_file + print(source_path) + convert_file(source_path, 'step') +# + print ("back from convert") + + # convert_assembly('vheliotech.FCStd', 'step') + + # '''doc = App.open(project_folder + '/vheliotech.FCStd') + # export_configuration(doc, 'Config_Integrale', 'vheliotech-config-integrale') + # export_configuration(doc, 'Config_Solaire', 'vheliotech-config-solaire') + # export_configuration(doc, 'Config_Motorisee', 'vheliotech-config-motorisee') + # export_configuration(doc, 'Config_Basique', 'vheliotech-config-basique') + # close_all_docs()''' + +except Exception as e: + print(e) + +# exit FreeCAD +close_all_docs() +# FreeCADGui.getMainWindow().close() +Gui.runCommand('Std_Quit') + diff --git a/tools/test.bat b/tools/test.bat new file mode 100644 index 0000000..1ab658a --- /dev/null +++ b/tools/test.bat @@ -0,0 +1,24 @@ +:: Set the path to your FreeCAD executable here +set FREECAD=C:\Program Files\FreeCAD 0.21\bin\freecad.exe + +set SCRIPT_DIR=%~dp0 +echo %SCRIPT_DIR% >>%TMP%\toto.txt +cd %script_dir% +echo %cd% >>%TMP%\toto.txt + +cd .. +echo %cd% >>%TMP%\toto.txt +:: rm -rf ./dist + +:: Check script syntax before starting freecad +:: python3 -m py_compile tools/export-all-parts.py + +:: Export all versioned files +:: mkdir -p dist/FCStd +:: git archive HEAD . | tar -x -C dist/FCStd + +:: Start freecad to run the script. We must start freecad with GUI (otherwise we can't export colors). We start it hidden in a virtual framebuffer (xvfb) so that it can run cleanly in the background. +:: xvfb-run $FREECAD tools/export-all-parts.py +:: %freecad%/freecad.exe tools/export-all-parts.py +echo %freecad% +start "" "%freecad%" tools/export-all-parts.py \ No newline at end of file diff --git a/tubes/L101.FCStd b/tubes/L101.FCStd index a4a9107..f6c41a3 100644 Binary files a/tubes/L101.FCStd and b/tubes/L101.FCStd differ diff --git a/tubes/L102.FCStd b/tubes/L102.FCStd index 6917e1c..125f6cb 100644 Binary files a/tubes/L102.FCStd and b/tubes/L102.FCStd differ diff --git a/tubes/M101.FCStd b/tubes/M101.FCStd index 13ba986..d10b576 100644 Binary files a/tubes/M101.FCStd and b/tubes/M101.FCStd differ diff --git a/tubes/T101.FCStd b/tubes/T101.FCStd index 2917ce1..1031542 100644 Binary files a/tubes/T101.FCStd and b/tubes/T101.FCStd differ