This commit is contained in:
Thomas 2023-12-30 16:55:01 +01:00
commit 690b0a3880
2 changed files with 46 additions and 0 deletions

38
3d_windows.py Normal file
View File

@ -0,0 +1,38 @@
from PySide6 import QtGui
from PySide6.Qt3DCore import Qt3DCore
from PySide6.Qt3DExtras import Qt3DExtras
from PySide6.QtWidgets import QApplication, QMainWindow
import sys
class My3DWindow(QMainWindow):
def __init__(self):
super(My3DWindow, self).__init__()
# Create the 3D scene
scene = Qt3DCore.QEntity()
# Create a 3D view container
view = Qt3DExtras.Qt3DWindow()
view.defaultFrameGraph().setClearColor(QtGui.QColor(0, 0, 0, 0))
# Set root entity for the scene
view.setRootEntity(scene)
# Create a 3D transform
transform = Qt3DCore.QTransform()
transform.setScale3D(QtGui.QVector3D(1.0, 1.0, 1.0))
# Set components for the mesh entity
mesh_entity.addComponent(material)
mesh_entity.addComponent(transform)
# Add the mesh entity to the scene
scene.addComponent(mesh_entity)
self.setCentralWidget(view)
if __name__ == "__main__":
app = QApplication(sys.argv)
window = My3DWindow()
window.show()
sys.exit(app.exec_())

8
fluency.py Normal file
View File

@ -0,0 +1,8 @@
from sdf import *
f = sphere(1) & box(0.9)
c = cylinder(0.3)
f -= c.orient(X) | c.orient(Y) | c.orient(Z)
f.save('out.stl', step=0.001)