From 690b0a3880790f9b1e954f2f6a8ff1ea1d3343de Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 30 Dec 2023 16:55:01 +0100 Subject: [PATCH] init --- 3d_windows.py | 38 ++++++++++++++++++++++++++++++++++++++ fluency.py | 8 ++++++++ 2 files changed, 46 insertions(+) create mode 100644 3d_windows.py create mode 100644 fluency.py diff --git a/3d_windows.py b/3d_windows.py new file mode 100644 index 0000000..45eae5c --- /dev/null +++ b/3d_windows.py @@ -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_()) \ No newline at end of file diff --git a/fluency.py b/fluency.py new file mode 100644 index 0000000..5585b61 --- /dev/null +++ b/fluency.py @@ -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) \ No newline at end of file