-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
4,664 additions
and
7,124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
include src/ada/sections/resources/ProfileDB.json | ||
include src/ada/materials/metals/resources/NLMatParams.json | ||
include src/ada/cadit/gxml/write/resources/xml_blank.xml | ||
include src/ada/fem/results/resources/results.sql | ||
include src/ada/fem/results/resources/results.sql | ||
include src/ada/visit/resources/index.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import random | ||
|
||
# mamba install pyside | ||
from PySide6 import QtWidgets | ||
from wgpu.gui.qt import WgpuCanvas | ||
|
||
import pygfx as gfx | ||
|
||
|
||
class Main(QtWidgets.QWidget): | ||
def __init__(self): | ||
super().__init__(None) | ||
self.resize(640, 480) | ||
|
||
# Creat button and hook it up | ||
self._button = QtWidgets.QPushButton("Add a line", self) | ||
self._button.clicked.connect(self._on_button_click) | ||
|
||
# Create canvas, renderer and a scene object | ||
self._canvas = WgpuCanvas(parent=self) | ||
self._renderer = gfx.WgpuRenderer(self._canvas) | ||
self._scene = gfx.Scene() | ||
self._camera = gfx.OrthographicCamera(110, 110) | ||
|
||
# Hook up the animate callback | ||
self._canvas.request_draw(self.animate) | ||
|
||
layout = QtWidgets.QHBoxLayout() | ||
self.setLayout(layout) | ||
layout.addWidget(self._button) | ||
layout.addWidget(self._canvas) | ||
|
||
def _on_button_click(self): | ||
positions = [ | ||
[random.uniform(-50, 50), random.uniform(-50, 50), 0] for i in range(8) | ||
] | ||
line = gfx.Line( | ||
gfx.Geometry(positions=positions), gfx.LineMaterial(thickness=3) | ||
) | ||
self._scene.add(line) | ||
self._canvas.update() | ||
|
||
def animate(self): | ||
self._renderer.render(self._scene, self._camera) | ||
|
||
|
||
app = QtWidgets.QApplication([]) | ||
m = Main() | ||
m.show() | ||
|
||
|
||
if __name__ == "__main__": | ||
app.exec() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# run_example = false | ||
|
||
import pygfx as gfx | ||
|
||
# mamba install wxpython | ||
import wx | ||
from wgpu.gui.wx import WgpuCanvas | ||
|
||
|
||
app = wx.App() | ||
|
||
canvas = WgpuCanvas() | ||
renderer = gfx.renderers.WgpuRenderer(canvas) | ||
scene = gfx.Scene() | ||
|
||
cube = gfx.Mesh( | ||
gfx.box_geometry(200, 200, 200), | ||
gfx.MeshPhongMaterial(color=(0.2, 0.4, 0.6, 1.0)), | ||
) | ||
scene.add(cube) | ||
|
||
scene.add(gfx.AmbientLight()) | ||
scene.add(gfx.DirectionalLight(position=(0, 0, 1))) | ||
|
||
camera = gfx.PerspectiveCamera(70, 16 / 9) | ||
camera.position.z = 400 | ||
|
||
|
||
def animate(): | ||
rot = gfx.linalg.Quaternion().set_from_euler(gfx.linalg.Euler(0.005, 0.01)) | ||
cube.rotation.multiply(rot) | ||
|
||
renderer.render(scene, camera) | ||
canvas.request_draw() | ||
|
||
|
||
if __name__ == "__main__": | ||
canvas.request_draw(animate) | ||
app.MainLoop() |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.