update README + UI

This commit is contained in:
Thomas-Alexandre Moreau 2025-04-14 11:20:16 +02:00
parent eee63985d7
commit a5e4966b82
3 changed files with 29 additions and 53 deletions

View file

@ -67,7 +67,7 @@ class WindowDialog():
FreeCAD.activeDocument().recompute() FreeCAD.activeDocument().recompute()
def _exportSketchCalepinage(self, sketchList, plateLength, plateWidth, spacing, laserSize): def _exportSketchCalepinage(self, sketchList, plateLength, plateWidth, spacing):
copy_sketchList = sketchList[:] copy_sketchList = sketchList[:]
__obj__ = [] __obj__ = []
currentX = 0.0 currentX = 0.0
@ -159,8 +159,9 @@ class WindowDialog():
plateLength = self.form.doubleSpinBoxLength.value() plateLength = self.form.doubleSpinBoxLength.value()
plateWidth = self.form.doubleSpinBoxWidth.value() plateWidth = self.form.doubleSpinBoxWidth.value()
spacing = self.form.doubleSpinBoxSpacing.value() spacing = self.form.doubleSpinBoxSpacing.value()
laserSize = self.form.doubleSpinBoxLaserSize.value() # laserSize = self.form.doubleSpinBoxLaserSize.value()
sketchList = [] sketchList = []
for selectedObject in FreeCADGui.Selection.getSelectionEx(): for selectedObject in FreeCADGui.Selection.getSelectionEx():
if hasattr(selectedObject.Object, 'Dir'): if hasattr(selectedObject.Object, 'Dir'):
sv0 = Draft.make_shape2dview(selectedObject.Object, FreeCAD.Vector(selectedObject.Object.Dir)) sv0 = Draft.make_shape2dview(selectedObject.Object, FreeCAD.Vector(selectedObject.Object.Dir))
@ -179,10 +180,13 @@ class WindowDialog():
FreeCAD.ActiveDocument.removeObject(sv0.Name) FreeCAD.ActiveDocument.removeObject(sv0.Name)
if isCalepinage: if isCalepinage:
self._exportSketchCalepinage(sketchList, plateLength, plateWidth, spacing, laserSize) self._exportSketchCalepinage(sketchList, plateLength, plateWidth, spacing)
else: else:
self._exportSketchBasic(sketchList) self._exportSketchBasic(sketchList)
FreeCADGui.Selection.clearSelection()
self._populate_selector_list()
def exportSTL(self, singleMode): def exportSTL(self, singleMode):
__obj__ = [] __obj__ = []
for selectedObject in FreeCADGui.Selection.getSelectionEx(): for selectedObject in FreeCADGui.Selection.getSelectionEx():
@ -209,9 +213,12 @@ class WindowDialog():
print(f'Export STL de {os.path.basename(self.outputRacine)}.stl') print(f'Export STL de {os.path.basename(self.outputRacine)}.stl')
del __obj__ del __obj__
FreeCADGui.Selection.clearSelection()
self._populate_selector_list()
if __name__ == '__main__': if __name__ == '__main__':
try: try:
d = WindowDialog() WindowDialog()
except Exception as e: except Exception as e:
print(e) print(e)

View file

@ -17,13 +17,13 @@
<string notr="true">Multi Exporting</string> <string notr="true">Multi Exporting</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="10" column="0" colspan="3"> <item row="10" column="0" colspan="3">
<widget class="QListWidget" name="listWidgetSelector"> <widget class="QListWidget" name="listWidgetSelector">
<property name="selectionMode"> <property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum> <enum>QAbstractItemView::MultiSelection</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="16" column="0" colspan="3"> <item row="16" column="0" colspan="3">
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
@ -31,13 +31,13 @@
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
<string notr="true">Export SVG</string> <string notr="true">Exportation SVG</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="locale"> <property name="locale">
<locale language="French" country="France" /> <locale language="French" country="France"/>
</property> </property>
<property name="text"> <property name="text">
<string notr="true">Longueur du plateau (mm) :</string> <string notr="true">Longueur du plateau (mm) :</string>
@ -47,10 +47,10 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxLength"> <widget class="QDoubleSpinBox" name="doubleSpinBoxLength">
<property name="maximum"> <property name="maximum">
<double>999999.000000000000000</double> <double>999999.0</double>
</property> </property>
<property name="value"> <property name="value">
<double>50.000000000000000</double> <double>729.0</double>
</property> </property>
</widget> </widget>
</item> </item>
@ -64,10 +64,10 @@
<item row="1" column="1"> <item row="1" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxWidth"> <widget class="QDoubleSpinBox" name="doubleSpinBoxWidth">
<property name="maximum"> <property name="maximum">
<double>999999.000000000000000</double> <double>999999.0</double>
</property> </property>
<property name="value"> <property name="value">
<double>50.000000000000000</double> <double>430.0</double>
</property> </property>
</widget> </widget>
</item> </item>
@ -81,27 +81,10 @@
<item row="2" column="1"> <item row="2" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxSpacing"> <widget class="QDoubleSpinBox" name="doubleSpinBoxSpacing">
<property name="maximum"> <property name="maximum">
<double>999999.000000000000000</double> <double>999999.0</double>
</property> </property>
<property name="value"> <property name="value">
<double>5.000000000000000</double> <double>5.0</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label4">
<property name="text">
<string notr="true">Epaisseur du laser (mm) :</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxLaserSize">
<property name="maximum">
<double>999999.000000000000000</double>
</property>
<property name="value">
<double>5.000000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>
@ -123,9 +106,6 @@
<property name="text"> <property name="text">
<string>Export en .svg (calepinage)</string> <string>Export en .svg (calepinage)</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignVCenter</set>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
@ -139,9 +119,6 @@
<property name="text"> <property name="text">
<string>Export en .svg (sans calepinage)</string> <string>Export en .svg (sans calepinage)</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignVCenter</set>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
@ -154,7 +131,7 @@
</widget> </widget>
<widget class="QWidget" name="tab_2"> <widget class="QWidget" name="tab_2">
<attribute name="title"> <attribute name="title">
<string notr="true">Export STL</string> <string notr="true">Exportation STL</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0"> <item row="1" column="0">
@ -162,9 +139,6 @@
<property name="text"> <property name="text">
<string>Export en .stl (single)</string> <string>Export en .stl (single)</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignVCenter</set>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
@ -178,9 +152,6 @@
<property name="text"> <property name="text">
<string>Export en .stl (multi)</string> <string>Export en .stl (multi)</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignVCenter</set>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
@ -208,6 +179,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<resources /> <resources/>
<connections /> <connections/>
</ui> </ui>

View file

@ -19,8 +19,6 @@ Vous trouverez dans cet onglet 4 champs à remplir :
- la longueur du plateau de découpe (en millimètre) - la longueur du plateau de découpe (en millimètre)
- la largeur du plateau de découpe (en millimètre) - la largeur du plateau de découpe (en millimètre)
- l'espacement entre chaque schéma de découpe lors de l'exportation (en millimètre) - l'espacement entre chaque schéma de découpe lors de l'exportation (en millimètre)
- (*l'épaisseur du laser (en millimètre)*)
**-- NON FONCTIONNEL --**
Ensuite, vous avez le choix entre 2 algorithmes d'exportation : avec ou sans calepinage. Ensuite, vous avez le choix entre 2 algorithmes d'exportation : avec ou sans calepinage.