https://github.com/flokapi/ecofaber
Python framework to perform 3D economic simulations
https://github.com/flokapi/ecofaber
opengl python qt stl-files
Last synced: 3 months ago
JSON representation
Python framework to perform 3D economic simulations
- Host: GitHub
- URL: https://github.com/flokapi/ecofaber
- Owner: flokapi
- License: agpl-3.0
- Created: 2023-09-07T20:12:06.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-07T22:25:10.000Z (almost 3 years ago)
- Last Synced: 2025-11-27T17:54:53.021Z (7 months ago)
- Topics: opengl, python, qt, stl-files
- Language: Python
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Installation
## Linux
```shell
sudo apt-get install python3-pyqt5.qtopengl freeglut3-dev
pip3 install ecofaber
```
## Windows
```shell
pip3 install ecofaber
```
# Example
Example1.py
```python
import numpy as np
import ecofaber
import ecofaber.basemodel as bm
@bm.register
class Model(bm.ModelElement):
def __init__(self, data=None):
super().__init__(data)
self.angle = 0
def update(self):
self.angle += 0.1
def getView(self):
view = []
view.append({
"name": "b_cube_1",
"pos": [10*np.cos(self.angle),10*np.sin(self.angle),0],
"color": [200,100,0],
})
view.append({
"name": "b_ring_3",
"pos": [0,0,0],
"color": [200,100,0],
})
return view
def getObj(self, pos):
return None
ecofaber.launch(Model)
```
Execute the following code
```shell
git clone git@github.com:flokapi/ecofaber.git
cd ecofaber/example
python3 example1.py
```
This will open the application with the model. You can now start the simulation, control the speed, the view, ...
