GSOF-3dWireFrame 1.0.0__tar.gz → 1.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gsof_3dwireframe-1.1.1/GSOF_3dWireFrame/Drone_Class.py +64 -0
- gsof_3dwireframe-1.1.1/GSOF_3dWireFrame/Example_Drone.py +156 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Example_F16.py +6 -1
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/F16_Class.py +1 -1
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame.egg-info/PKG-INFO +9 -3
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame.egg-info/SOURCES.txt +2 -1
- gsof_3dwireframe-1.1.1/GSOF_3dWireFrame.egg-info/requires.txt +1 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/PKG-INFO +9 -3
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/README.md +7 -1
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/pyproject.toml +2 -2
- gsof_3dwireframe-1.0.0/GSOF_3dWireFrame/stlToObject.py +0 -32
- gsof_3dwireframe-1.0.0/GSOF_3dWireFrame.egg-info/requires.txt +0 -1
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/AUTHORS +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Example_dynamicWorld.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Example_motionWorld.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Example_staticWorld.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Lib3D/Assembly.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Lib3D/Lib3D.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Lib3D/Object_WireFrame.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Lib3D/Object_base.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Lib3D/Objects.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Lib3D/Utils.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Lib3D/WireFrame_display.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Lib3D/__init__.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Lib3D/stlToObj.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/MathLib/MathLib.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/MathLib/__init__.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/attitudeViewer.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/modules/AttitudeViewer_class.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/modules/Controls.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/modules/__init__.py +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/objects/Axis.json +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/objects/F16.stl +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/objects/LandingGear.json +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/objects/Plume.json +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/objects/Spark.json +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/objects/cube.json +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/objects/cube_flex.json +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/objects/frame.json +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/objects/house.json +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/objects/net.json +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/objects/plane.stl +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/objects/pyramid.json +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame.egg-info/dependency_links.txt +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame.egg-info/top_level.txt +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/LICENSE +0 -0
- {gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/setup.cfg +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/python
|
|
2
|
+
"""
|
|
3
|
+
* F16_Class.py
|
|
4
|
+
* Created on: 6 Jan 2025
|
|
5
|
+
* Improved for: 25 May 2026
|
|
6
|
+
* Author: Tzur Soffer
|
|
7
|
+
* Copyright (C) 2026 Tzur Soffer
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import copy
|
|
11
|
+
try:
|
|
12
|
+
from GSOF_3dWireFrame.Lib3D.Object_WireFrame import Object_wireFrame as Object
|
|
13
|
+
from GSOF_3dWireFrame.Lib3D.Assembly import Assembly
|
|
14
|
+
from GSOF_3dWireFrame.Lib3D.Utils import Colors
|
|
15
|
+
except:
|
|
16
|
+
print("GSOF_Wireframe3D module isn't installed")
|
|
17
|
+
|
|
18
|
+
class View(Assembly):
|
|
19
|
+
"""Constructs the gauges screen"""
|
|
20
|
+
def __init__(self, folder='./'):
|
|
21
|
+
self.time = 0.0
|
|
22
|
+
axis = Object(
|
|
23
|
+
filename="%s/objects/axis.json"%folder, color=Colors.GREEN)\
|
|
24
|
+
.scale(50.0)\
|
|
25
|
+
.translate(0, 0, 150)\
|
|
26
|
+
.setOrigin()
|
|
27
|
+
|
|
28
|
+
self.drone = Object(
|
|
29
|
+
filename="%s/objects/Drone/Body.stl"%folder, color=Colors.BLUE)\
|
|
30
|
+
.setCenter(scale=1.0, method="arithCenter")
|
|
31
|
+
|
|
32
|
+
propellorObj = Object(filename="%s/objects/Drone/Blade.stl"%folder, color=Colors.RED)\
|
|
33
|
+
.translate(0,20,0)\
|
|
34
|
+
.setCenter(scale=1.0, method="arithCenter")\
|
|
35
|
+
.setOrigin()
|
|
36
|
+
|
|
37
|
+
self.propellorA = copy.deepcopy(propellorObj)
|
|
38
|
+
self.propellorB = copy.deepcopy(propellorObj)
|
|
39
|
+
self.propellorC = copy.deepcopy(propellorObj)
|
|
40
|
+
self.propellorD = copy.deepcopy(propellorObj)
|
|
41
|
+
|
|
42
|
+
self.propellorA.color = Colors.RED
|
|
43
|
+
self.propellorB.color = Colors.BLACK
|
|
44
|
+
self.propellorC.color = Colors.GRAY
|
|
45
|
+
self.propellorD.color = Colors.YELLOW
|
|
46
|
+
|
|
47
|
+
super().__init__(objects=(axis, self.drone,
|
|
48
|
+
Assembly(objects=(self.propellorA,)).translate(-95,0,-90).setOrigin(),
|
|
49
|
+
Assembly(objects=(self.propellorB,)).translate(100,0,-90).setOrigin(),
|
|
50
|
+
Assembly(objects=(self.propellorC,)).translate(90,0,100).setOrigin(),
|
|
51
|
+
Assembly(objects=(self.propellorD,)).translate(-85,0,100).setOrigin()
|
|
52
|
+
))
|
|
53
|
+
|
|
54
|
+
def setPropellorRps(self, propellor, rps) -> None:
|
|
55
|
+
propellor.rotate(x=0, y=rps*self.time*6.28, z=0)
|
|
56
|
+
|
|
57
|
+
def setPropellors(self, A, B, C, D) -> None:
|
|
58
|
+
self.setPropellorRps(self.propellorA, A)
|
|
59
|
+
self.setPropellorRps(self.propellorB, B)
|
|
60
|
+
self.setPropellorRps(self.propellorC, C)
|
|
61
|
+
self.setPropellorRps(self.propellorD, D)
|
|
62
|
+
|
|
63
|
+
def tick(self, dt):
|
|
64
|
+
self.time+=dt
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
#!/usr/bin/python
|
|
2
|
+
"""
|
|
3
|
+
* Example_F16.py
|
|
4
|
+
* Created on: 31 May 2026
|
|
5
|
+
* Improved for: 31 May 2026
|
|
6
|
+
* Author: Tzur Soffer
|
|
7
|
+
* Copyright (C) 2026 Tzur Soffer
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
import pymeshlab
|
|
12
|
+
except:
|
|
13
|
+
raise ValueError("could not find pymeshlab. Run ```pip install pymeshlab```")
|
|
14
|
+
|
|
15
|
+
import pygame, math
|
|
16
|
+
from MathLib import MathLib
|
|
17
|
+
from Lib3D.Object_WireFrame import Object_wireFrame
|
|
18
|
+
from Lib3D.Assembly import Assembly
|
|
19
|
+
from Lib3D import Objects
|
|
20
|
+
from Lib3D import WireFrame_display as DISP
|
|
21
|
+
from Lib3D.Utils import Colors
|
|
22
|
+
from Drone_Class import View
|
|
23
|
+
|
|
24
|
+
SCREEN_WIDTH = 800
|
|
25
|
+
SCREEN_HEIGHT = 600
|
|
26
|
+
PI = math.pi
|
|
27
|
+
|
|
28
|
+
def drawWireFrame(screen, obj, color=None) -> None:
|
|
29
|
+
for line in obj.getLines():
|
|
30
|
+
x0, y0, z0 = line.p0
|
|
31
|
+
x1, y1, z1 = line.p1
|
|
32
|
+
lcolor = color
|
|
33
|
+
if lcolor == None:
|
|
34
|
+
lcolor = line.color
|
|
35
|
+
pygame.draw.line( screen, lcolor, (x0, y0), (x1, y1) ) #< Line from P0 to P1
|
|
36
|
+
|
|
37
|
+
def clearScreen(screen, color=(255,255,255)) -> None:
|
|
38
|
+
screen.fill(color)
|
|
39
|
+
|
|
40
|
+
def newScreen(title="New", resX=SCREEN_WIDTH, resY=SCREEN_HEIGHT, color=Colors.WHITE):
|
|
41
|
+
screenSize = (resX, resY)
|
|
42
|
+
screen = pygame.display.set_mode( screenSize )
|
|
43
|
+
clearScreen(screen, color)
|
|
44
|
+
pygame.display.set_caption(title)
|
|
45
|
+
return screen
|
|
46
|
+
|
|
47
|
+
def rotatePR(p, r, yaw):
|
|
48
|
+
R = MathLib.DCM_V2(yaw)
|
|
49
|
+
return MathLib.MxV_2x2(R, [p, r])
|
|
50
|
+
|
|
51
|
+
def quadMix(p, r):
|
|
52
|
+
M = [
|
|
53
|
+
[ 1, -1], # A
|
|
54
|
+
[ 1, 1], # B
|
|
55
|
+
[-1, 1], # C
|
|
56
|
+
[-1, -1], # D
|
|
57
|
+
]
|
|
58
|
+
return MathLib.MxV(M, [p, r])
|
|
59
|
+
|
|
60
|
+
def computePropellers(maxRps, p, r, yaw):
|
|
61
|
+
p2, r2 = rotatePR(p, r, yaw)
|
|
62
|
+
|
|
63
|
+
props = quadMix(p2, r2) # mix WITHOUT maxRps first
|
|
64
|
+
|
|
65
|
+
# Normalize
|
|
66
|
+
maxVal = 0
|
|
67
|
+
for v in props:
|
|
68
|
+
if abs(v) > maxVal:
|
|
69
|
+
maxVal = abs(v)
|
|
70
|
+
|
|
71
|
+
# Scale if needed
|
|
72
|
+
if maxVal > 1.0:
|
|
73
|
+
props = MathLib.scaleV(props, 1.0 / maxVal)
|
|
74
|
+
|
|
75
|
+
# Apply maxRps
|
|
76
|
+
props = MathLib.scaleV(props, maxRps)
|
|
77
|
+
|
|
78
|
+
A = MathLib.clip(props[0], -maxRps, maxRps)
|
|
79
|
+
B = MathLib.clip(props[1], -maxRps, maxRps)
|
|
80
|
+
C = MathLib.clip(props[2], -maxRps, maxRps)
|
|
81
|
+
D = MathLib.clip(props[3], -maxRps, maxRps)
|
|
82
|
+
|
|
83
|
+
return A, B, C, D
|
|
84
|
+
|
|
85
|
+
def sign(val):
|
|
86
|
+
if val >= 0:
|
|
87
|
+
return 1
|
|
88
|
+
return -1
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
if __name__ == "__main__":
|
|
92
|
+
pygame.init()
|
|
93
|
+
ground = Object_wireFrame(
|
|
94
|
+
obj=Objects.net(25,25), color=(0,100,0))\
|
|
95
|
+
.scale(0.2)\
|
|
96
|
+
.rotate(x=math.pi/2, y=0, z=0)\
|
|
97
|
+
.translate(-250, -200, -250)\
|
|
98
|
+
.setOrigin()
|
|
99
|
+
|
|
100
|
+
drone = View()\
|
|
101
|
+
.scale(1.0)\
|
|
102
|
+
.translate(100, 100, -100).setOrigin()
|
|
103
|
+
|
|
104
|
+
world = Assembly(objects=(ground, drone)).translate(0,0,-1000).setOrigin()
|
|
105
|
+
|
|
106
|
+
clock = pygame.time.Clock()
|
|
107
|
+
screen = newScreen("3D Wire Frame Shapes", SCREEN_WIDTH, SCREEN_HEIGHT, Colors.WHITE)
|
|
108
|
+
wireframe = DISP.WireFrame(screen, pygame.draw.line, f=50, scale=20.0)
|
|
109
|
+
|
|
110
|
+
fps = 30
|
|
111
|
+
maxRps = 2
|
|
112
|
+
dt = 1/fps
|
|
113
|
+
t = 0
|
|
114
|
+
useMouse = True
|
|
115
|
+
mPosZ = 0
|
|
116
|
+
run = True
|
|
117
|
+
while run:
|
|
118
|
+
for event in pygame.event.get():
|
|
119
|
+
if event.type == pygame.QUIT:
|
|
120
|
+
run = False
|
|
121
|
+
world.reset()
|
|
122
|
+
clearScreen(screen)
|
|
123
|
+
|
|
124
|
+
keys = pygame.key.get_pressed()
|
|
125
|
+
|
|
126
|
+
if useMouse:
|
|
127
|
+
(mPosX, mPosY) = pygame.mouse.get_pos()
|
|
128
|
+
mPosZ += (keys[pygame.K_z] -keys[pygame.K_x])*2
|
|
129
|
+
x = mPosX/SCREEN_WIDTH -0.5
|
|
130
|
+
y = mPosY/SCREEN_HEIGHT -0.5
|
|
131
|
+
z = mPosZ/360
|
|
132
|
+
else:
|
|
133
|
+
x += 0.5*dt
|
|
134
|
+
y += 1*dt
|
|
135
|
+
z = 0
|
|
136
|
+
camAngX_r = y*PI
|
|
137
|
+
camAngY_r = z*PI
|
|
138
|
+
camAngZ_r = x*PI
|
|
139
|
+
|
|
140
|
+
print(computePropellers(maxRps, camAngX_r, camAngY_r, camAngZ_r))
|
|
141
|
+
A, B, C, D = computePropellers(maxRps/2, camAngX_r, camAngY_r, camAngZ_r)
|
|
142
|
+
A+=maxRps/2*sign(A)
|
|
143
|
+
B+=maxRps/2*sign(B)
|
|
144
|
+
C+=maxRps/2*sign(C)
|
|
145
|
+
D+=maxRps/2*sign(D)
|
|
146
|
+
drone.setPropellors(A, B, C, D)
|
|
147
|
+
drone.rotate(-camAngX_r,-camAngY_r,-camAngZ_r, centerAt=(100, 100, -100))
|
|
148
|
+
drone.tick(dt)
|
|
149
|
+
wireframe.draw(world)
|
|
150
|
+
|
|
151
|
+
t += dt
|
|
152
|
+
clock.tick(30)
|
|
153
|
+
|
|
154
|
+
pygame.display.flip()
|
|
155
|
+
|
|
156
|
+
pygame.quit()
|
|
@@ -6,10 +6,15 @@
|
|
|
6
6
|
* Author: Guy Soffer
|
|
7
7
|
* Copyright (C) 2026 Guy Soffer
|
|
8
8
|
"""
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
import pymeshlab
|
|
12
|
+
except:
|
|
13
|
+
raise ValueError("could not find pymeshlab. Run ```pip install pymeshlab```")
|
|
14
|
+
|
|
9
15
|
import pygame, math
|
|
10
16
|
from Lib3D.Object_WireFrame import Object_wireFrame
|
|
11
17
|
from Lib3D.Assembly import Assembly
|
|
12
|
-
#from Lib3D.Object_base import Object_base
|
|
13
18
|
from Lib3D import Objects
|
|
14
19
|
from Lib3D import WireFrame_display as DISP
|
|
15
20
|
from F16_Class import F16_View, Commands, State
|
|
@@ -73,7 +73,7 @@ class F16_View(Assembly):
|
|
|
73
73
|
filename="%s/objects/f16.stl"%folder, color=BLUE, name="F16")\
|
|
74
74
|
.setCenter(scale=1.0, method="arithCenter")
|
|
75
75
|
|
|
76
|
-
self.plume =
|
|
76
|
+
self.plume = Object(
|
|
77
77
|
filename="%s/objects/Plume.json"%folder, color=RED)\
|
|
78
78
|
.setCenter(scale=30, rotate=(180*degToRad, 0, 0))
|
|
79
79
|
plume = Assembly(objects=(self.plume,))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: GSOF_3dWireFrame
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: A 3D wireframe rendering library built on Pygame
|
|
5
5
|
Author-email: Guy Soffer <gsoffer@yahoo.com>
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -22,10 +22,10 @@ Requires-Python: >=3.9
|
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
License-File: LICENSE
|
|
24
24
|
License-File: AUTHORS
|
|
25
|
-
Requires-Dist: pygame
|
|
25
|
+
Requires-Dist: pygame-ce
|
|
26
26
|
Dynamic: license-file
|
|
27
27
|
|
|
28
|
-
#
|
|
28
|
+
# GSOF_3dWireFrame
|
|
29
29
|
Simple and basic 3D Wire-Frame drawing program.
|
|
30
30
|
- Loads .stl or .json object files.
|
|
31
31
|
- Supports assembly containers to manipulate object in their own frame of reference.
|
|
@@ -36,13 +36,19 @@ Simple and basic 3D Wire-Frame drawing program.
|
|
|
36
36
|
## Running instructions
|
|
37
37
|
## Using pip (recommened)
|
|
38
38
|
- run `pip install GSOF_3dWireFrame`
|
|
39
|
+
- run `pip install pymeshlab` (if you want to use stl files)
|
|
40
|
+
|
|
39
41
|
## Manual install
|
|
40
42
|
- Clone
|
|
41
43
|
- Install requirements `pip install -r requirements.txt`
|
|
42
44
|
- run `pip install .`
|
|
45
|
+
- run `pip install pymeshlab` (if you want to use stl files)
|
|
43
46
|
- Open and run one of the code examples (e.g. `Example_staticWorld.py`)
|
|
44
47
|
|
|
48
|
+

|
|
49
|
+
|
|
45
50
|

|
|
46
51
|
|
|
47
52
|

|
|
48
53
|
|
|
54
|
+
## This project is licensed under MIT LICENSE, see LICENSE file for more info.
|
|
@@ -2,13 +2,14 @@ AUTHORS
|
|
|
2
2
|
LICENSE
|
|
3
3
|
README.md
|
|
4
4
|
pyproject.toml
|
|
5
|
+
GSOF_3dWireFrame/Drone_Class.py
|
|
6
|
+
GSOF_3dWireFrame/Example_Drone.py
|
|
5
7
|
GSOF_3dWireFrame/Example_F16.py
|
|
6
8
|
GSOF_3dWireFrame/Example_dynamicWorld.py
|
|
7
9
|
GSOF_3dWireFrame/Example_motionWorld.py
|
|
8
10
|
GSOF_3dWireFrame/Example_staticWorld.py
|
|
9
11
|
GSOF_3dWireFrame/F16_Class.py
|
|
10
12
|
GSOF_3dWireFrame/attitudeViewer.py
|
|
11
|
-
GSOF_3dWireFrame/stlToObject.py
|
|
12
13
|
GSOF_3dWireFrame.egg-info/PKG-INFO
|
|
13
14
|
GSOF_3dWireFrame.egg-info/SOURCES.txt
|
|
14
15
|
GSOF_3dWireFrame.egg-info/dependency_links.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pygame-ce
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: GSOF_3dWireFrame
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: A 3D wireframe rendering library built on Pygame
|
|
5
5
|
Author-email: Guy Soffer <gsoffer@yahoo.com>
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -22,10 +22,10 @@ Requires-Python: >=3.9
|
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
License-File: LICENSE
|
|
24
24
|
License-File: AUTHORS
|
|
25
|
-
Requires-Dist: pygame
|
|
25
|
+
Requires-Dist: pygame-ce
|
|
26
26
|
Dynamic: license-file
|
|
27
27
|
|
|
28
|
-
#
|
|
28
|
+
# GSOF_3dWireFrame
|
|
29
29
|
Simple and basic 3D Wire-Frame drawing program.
|
|
30
30
|
- Loads .stl or .json object files.
|
|
31
31
|
- Supports assembly containers to manipulate object in their own frame of reference.
|
|
@@ -36,13 +36,19 @@ Simple and basic 3D Wire-Frame drawing program.
|
|
|
36
36
|
## Running instructions
|
|
37
37
|
## Using pip (recommened)
|
|
38
38
|
- run `pip install GSOF_3dWireFrame`
|
|
39
|
+
- run `pip install pymeshlab` (if you want to use stl files)
|
|
40
|
+
|
|
39
41
|
## Manual install
|
|
40
42
|
- Clone
|
|
41
43
|
- Install requirements `pip install -r requirements.txt`
|
|
42
44
|
- run `pip install .`
|
|
45
|
+
- run `pip install pymeshlab` (if you want to use stl files)
|
|
43
46
|
- Open and run one of the code examples (e.g. `Example_staticWorld.py`)
|
|
44
47
|
|
|
48
|
+

|
|
49
|
+
|
|
45
50
|

|
|
46
51
|
|
|
47
52
|

|
|
48
53
|
|
|
54
|
+
## This project is licensed under MIT LICENSE, see LICENSE file for more info.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# GSOF_3dWireFrame
|
|
2
2
|
Simple and basic 3D Wire-Frame drawing program.
|
|
3
3
|
- Loads .stl or .json object files.
|
|
4
4
|
- Supports assembly containers to manipulate object in their own frame of reference.
|
|
@@ -9,13 +9,19 @@ Simple and basic 3D Wire-Frame drawing program.
|
|
|
9
9
|
## Running instructions
|
|
10
10
|
## Using pip (recommened)
|
|
11
11
|
- run `pip install GSOF_3dWireFrame`
|
|
12
|
+
- run `pip install pymeshlab` (if you want to use stl files)
|
|
13
|
+
|
|
12
14
|
## Manual install
|
|
13
15
|
- Clone
|
|
14
16
|
- Install requirements `pip install -r requirements.txt`
|
|
15
17
|
- run `pip install .`
|
|
18
|
+
- run `pip install pymeshlab` (if you want to use stl files)
|
|
16
19
|
- Open and run one of the code examples (e.g. `Example_staticWorld.py`)
|
|
17
20
|
|
|
21
|
+

|
|
22
|
+
|
|
18
23
|

|
|
19
24
|
|
|
20
25
|

|
|
21
26
|
|
|
27
|
+
## This project is licensed under MIT LICENSE, see LICENSE file for more info.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "GSOF_3dWireFrame"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.1.1"
|
|
8
8
|
description = "A 3D wireframe rendering library built on Pygame"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -28,7 +28,7 @@ classifiers = [
|
|
|
28
28
|
"Topic :: Multimedia :: Graphics :: 3D Rendering",
|
|
29
29
|
]
|
|
30
30
|
dependencies = [
|
|
31
|
-
"pygame",
|
|
31
|
+
"pygame-ce",
|
|
32
32
|
]
|
|
33
33
|
|
|
34
34
|
[project.urls]
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
from stl import mesh
|
|
3
|
-
|
|
4
|
-
# Load the STL file
|
|
5
|
-
stl_file = 'objects/plane.stl'
|
|
6
|
-
your_mesh = mesh.Mesh.from_file(stl_file)
|
|
7
|
-
|
|
8
|
-
# Initialize lists for points and lines
|
|
9
|
-
points = []
|
|
10
|
-
lines = []
|
|
11
|
-
|
|
12
|
-
# Iterate over the vectors (triangles) in the mesh
|
|
13
|
-
for i in range(len(your_mesh.vectors)):
|
|
14
|
-
vertexes = your_mesh.vectors[i].tolist()
|
|
15
|
-
# Add the vertices (points) to the list
|
|
16
|
-
for vertex in vertexes:
|
|
17
|
-
points.append(vertex)
|
|
18
|
-
|
|
19
|
-
# Add the edges (lines) to the list
|
|
20
|
-
lines.append([i*3, i*3+1])
|
|
21
|
-
lines.append([i*3+1, i*3+2])
|
|
22
|
-
lines.append([i*3+2, i*3+0])
|
|
23
|
-
|
|
24
|
-
# Now you have a list of points and lines
|
|
25
|
-
objectDict = {"scale": 100.0,
|
|
26
|
-
"points_xyz": points,
|
|
27
|
-
"connections": lines}
|
|
28
|
-
with open("objects/stl.json", "w") as f:
|
|
29
|
-
json.dump(objectDict, f)
|
|
30
|
-
|
|
31
|
-
if __name__ == "__main__":
|
|
32
|
-
exit()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
pygame
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Lib3D/Object_WireFrame.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/Lib3D/WireFrame_display.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame/modules/AttitudeViewer_class.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gsof_3dwireframe-1.0.0 → gsof_3dwireframe-1.1.1}/GSOF_3dWireFrame.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|