- Sketch projection and extrude in place working
This commit is contained in:
19
main.py
19
main.py
@@ -1,6 +1,6 @@
|
||||
import uuid
|
||||
import names
|
||||
from PySide6.QtCore import Qt, QPoint
|
||||
from PySide6.QtCore import Qt, QPoint, Signal
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QSizePolicy, QInputDialog, QDialog, QVBoxLayout, QHBoxLayout, QLabel, QDoubleSpinBox, QCheckBox, QPushButton
|
||||
from Gui import Ui_fluencyCAD # Import the generated GUI module
|
||||
from drawing_modules.vtk_widget import VTKWidget
|
||||
@@ -10,7 +10,6 @@ from sdf import *
|
||||
from python_solvespace import SolverSystem, ResultFlag
|
||||
from mesh_modules import simple_mesh, vesta_mesh, interactor_mesh
|
||||
|
||||
|
||||
# main, draw_widget, gl_widget
|
||||
|
||||
class ExtrudeDialog(QDialog):
|
||||
@@ -52,6 +51,8 @@ class ExtrudeDialog(QDialog):
|
||||
return self.length_input.value(), self.symmetric_checkbox.isChecked()
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
send_command = Signal(str)
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
@@ -90,6 +91,8 @@ class MainWindow(QMainWindow):
|
||||
self.ui.pb_del_sketch.pressed.connect(self.del_sketch)
|
||||
self.ui.pb_edt_sktch.pressed.connect(self.edit_sketch)
|
||||
|
||||
self.ui.pb_flip_face.pressed.connect(self.on_flip_face)
|
||||
|
||||
###Modes
|
||||
self.ui.pb_linetool.pressed.connect(self.act_line_mode)
|
||||
self.ui.pb_con_ptpt.pressed.connect(self.act_constrain_pt_pt_mode)
|
||||
@@ -105,6 +108,12 @@ class MainWindow(QMainWindow):
|
||||
self.ui.pb_del_body.pressed.connect(self.del_body)
|
||||
|
||||
self.sketchWidget.constrain_done.connect(self.draw_op_complete)
|
||||
self.setFocusPolicy(Qt.StrongFocus)
|
||||
|
||||
self.send_command.connect(self.custom_3D_Widget.on_receive_command)
|
||||
|
||||
def on_flip_face(self):
|
||||
self.send_command.emit("flip")
|
||||
|
||||
def add_new_sketch_origin(self):
|
||||
self.sketchWidget.clear_sketch()
|
||||
@@ -119,6 +128,10 @@ class MainWindow(QMainWindow):
|
||||
self.sketchWidget.create_workplane_projected()
|
||||
self.sketchWidget.create_proj_lines(edges)
|
||||
|
||||
# CLear all selections after it has been projected
|
||||
self.custom_3D_Widget.clear_edge_select()
|
||||
self.custom_3D_Widget.clear_actors_projection()
|
||||
|
||||
#self.sketchWidget.create_workplane_space(edges, normal)
|
||||
|
||||
def act_line_mode(self):
|
||||
@@ -476,4 +489,4 @@ if __name__ == "__main__":
|
||||
window.show()
|
||||
app.exec()
|
||||
|
||||
#pyside6-uic gui.ui > Gui.py -g python
|
||||
|
||||
|
||||
Reference in New Issue
Block a user