basic_proto

This commit is contained in:
bklronin 2024-05-09 22:44:38 +02:00
parent c11f47a2b6
commit 243d2c4385
3 changed files with 26 additions and 1 deletions

View File

@ -22,7 +22,7 @@ class MainWindow(QMainWindow):
def generate_mesh(self):
code_bytes = self.ui.textEdit.toPlainText().encode('utf-8')
code_text = code_bytes.decode('utf-8')
save_string = "\nf.save('out.stl', samples=2**10)"
save_string = "\nf.save('out.stl', samples=2**12)"
code_text += save_string
local_vars = {}

View File

@ -73,6 +73,21 @@ class OpenGLWidget(QOpenGLWidget):
glVertex3fv(vertex)
glEnd()
# Draw edges
glColor3f(0.0, 0.0, 1.0) # Set color to blue
glLineWidth(2.0) # Set line width
glBegin(GL_LINES)
for triangle in vertices:
glVertex3fv(triangle[0])
glVertex3fv(triangle[1])
glVertex3fv(triangle[1])
glVertex3fv(triangle[2])
glVertex3fv(triangle[2])
glVertex3fv(triangle[0])
glEnd()
def mousePressEvent(self, event):
self.lastPos = event.pos()

10
requirements.txt Normal file
View File

@ -0,0 +1,10 @@
matplotlib==3.8.2
numpy==1.26.2
Pillow==10.1.0
Pint==0.22
pygame==2.5.2
PySide6==6.6.1
rich==13.7.0
scikit-image==0.22.0
scipy==1.11.4
vtk==9.3.0