Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8a48db2
testing
Alllex202 Nov 17, 2019
37d82ee
Update Visualization.py
Alllex202 Nov 17, 2019
27c37e7
Update Visualization.py
Alllex202 Nov 17, 2019
9380b4c
Update Visualization.py
Alllex202 Nov 17, 2019
15b694b
Init branch
Sw24sX Nov 18, 2019
37f1a09
Save last version under delited
Sw24sX Nov 19, 2019
f2d8b80
Add tests ad fix octree
Sw24sX Nov 21, 2019
6aca05a
Release Visual_2.0
Alllex202 Nov 21, 2019
30af446
Merge remote-tracking branch 'origin/visual_2.0' into visual_2.0
Alllex202 Nov 21, 2019
bb0d8ee
Add tests for distribute in Node
Sw24sX Nov 21, 2019
940fc06
Minor changes in Visual_2.0. Fixed old version.
Alllex202 Nov 21, 2019
e9bc786
Merge branch 'tets' into visual_2.0
Alllex202 Nov 21, 2019
f4e5d67
Update Visualization.py
Alllex202 Nov 21, 2019
218140e
Merge pull request #4 from Untitled-Courseworks/visual_2.0
Alllex202 Nov 21, 2019
8cb420c
smth
Nov 22, 2019
d818429
smth
Nov 22, 2019
8ffaaa9
Save
Nov 22, 2019
22835b7
Merge
Nov 22, 2019
0fdcf30
Save
Nov 22, 2019
0eb70fa
S
Nov 22, 2019
0fd65b2
Rename Visual_2.0.py to Visual_2_0.py
Alllex202 Nov 22, 2019
97a56ef
Rename Visual_2.0.py to Visual_2_0.py
Alllex202 Nov 22, 2019
061ca1c
Merge remote-tracking branch 'origin/visual_2.0' into visual_2.0
Alllex202 Nov 22, 2019
155248b
Added model centering and auto zoom.
Alllex202 Nov 22, 2019
83725e4
Merge branch 'master' into visual_2.0
Alllex202 Nov 22, 2019
c7adbba
Merge pull request #5 from Untitled-Courseworks/visual_2.0
Alllex202 Nov 22, 2019
5806778
Save
Nov 23, 2019
5dc596e
Merge branch 'master' of https://github.com/Untitled-Courseworks/Voxe…
Nov 23, 2019
2078b95
Fixed model centering
Alllex202 Nov 23, 2019
c1c013a
save
Nov 23, 2019
1b21601
Merge branch 'master' of https://github.com/Untitled-Courseworks/Voxe…
Nov 23, 2019
080e5a4
Merge
Nov 23, 2019
2cec132
End work with OcTreeV2
Nov 23, 2019
288e17d
End change crossing
Nov 23, 2019
5a02e13
End create readObj
Nov 23, 2019
b0dbbe7
Save. Need fixed
Nov 23, 2019
7665762
Fixed zooming and minor changes.
Alllex202 Nov 24, 2019
0bab783
Fixed zooming and minor changes.
Alllex202 Nov 24, 2019
7d5588c
Minor changes.
Alllex202 Nov 24, 2019
ef88afd
Merge branch 'master' into visual_v2
Alllex202 Nov 24, 2019
9631cce
Merge pull request #6 from Untitled-Courseworks/visual_v2
Alllex202 Nov 24, 2019
0949906
Save
Nov 24, 2019
0e7bee1
Merge branch 'master' of https://github.com/Untitled-Courseworks/Voxe…
Nov 24, 2019
5834165
Updated debug mode. Changed colors.
Alllex202 Nov 25, 2019
bed6ede
Minor changes
Alllex202 Nov 25, 2019
3986ad5
add some tests, change method get_child
Nov 27, 2019
fa7d102
fix get_location_point (uncorrect work with negative values)
Nov 27, 2019
36201eb
Fix bugs
Nov 27, 2019
e873397
Need fixed
Nov 27, 2019
4150161
Fixed bug
Alllex202 Nov 28, 2019
459324b
Create ConvertToFile
Dec 8, 2019
182018e
Implemented window interface. (Visualization via OpenGL)
Alllex202 Dec 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/Coursework.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/dictionaries/aleksandr.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions ConvertToFile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from OcTreeV2.NodeOcTreeV2 import Node


def convert(file_name, voxels: [], size_voxel: float):
points = get_all_points(voxels, size_voxel)
with open(file_name, "w") as file:
write_header(file, len(points))
for point in points:
file.write(get_str_from_point(point))


def write_header(file, count_points: int):
file.write("# .PCD v.7 - Point Cloud Data file format\n")
file.write("VERSION .7\n")
file.write("FIELDS x y z\n")
file.write("SIZE 4 4 4 4\n")
file.write("TYPE F F F F\n")
file.write("COUNT 1 1 1 1\n")
file.write("WIDTH 213\n")
file.write("HEIGHT 1\n")
file.write("VIEWPOINT 0 0 0 1 0 0 0\n")
file.write("POINTS " + str(count_points))
file.write("DATA ascii")


def get_all_points(voxels: [], size: int):
res = []
for i in voxels:
[res.append(j) for j in Node.get_all_voxels_vertex(i, size)]
return res


def get_str_from_point(point: []):
return str(point[0]) + " " + str(point[1]) + " " + str(point[2])
3 changes: 1 addition & 2 deletions Crossing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import matplotlib.path as mpltPath


def crossing(mesh: [], voxel: [], size_voxel: float):
"""
Проверка, что у меша и вокселя есть общие точки
Expand Down Expand Up @@ -89,7 +88,7 @@ def _points_in_figure(figure: [], points: []):

def _get_all_vertex_voxel(voxel: [], size: float):
if size < 0:
raise Exception("size can't be less than zero")
raise Exception("size_voxel can't be less than zero")
res = []
for x in range(2):
for y in range(2):
Expand Down
2 changes: 1 addition & 1 deletion Experiments/OcTree1.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def find_and_get_child(self, pos_point: []): # Протестированно

def _get_all_voxels_vertex(self, voxel: [], size: float): # Протестированно
if size < 0:
raise Exception("size can't be less than zero")
raise Exception("size_voxel can't be less than zero")
for x in range(2):
for y in range(2):
for z in range(2):
Expand Down
6 changes: 3 additions & 3 deletions Experiments/OcTreeTests1.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,20 @@ class TestsGetAllVoxelsVertex():

def test_simple(self):
node = get_empty_node_with_empty_children()
res = [i for i in node._get_all_voxels_vertex([0, 0, 0], 1)]
res = [i for i in node.get_all_voxels_vertex([0, 0, 0], 1)]
answ = [[0, 0, 0], [0, 0, 1], [0, 1, 0], [0, 1, 1], [1, 0, 0], [1, 0, 1], [1, 1, 0], [1, 1, 1]]
self.assertEqual(res, answ)

def test_voxel_on_negative_side(self):
node = get_empty_node_with_empty_children()
res = [i for i in node._get_all_voxels_vertex([-4, -4, -4], 2)]
res = [i for i in node.get_all_voxels_vertex([-4, -4, -4], 2)]
answ = [[-4, -4, -4], [-4, -4, -2], [-4, -2, -4], [-4, -2, -2], [-2, -4, -4], [-2, -4, -2], [-2, -2, -4],
[-2, -2, -2]]
self.assertEqual(res, answ)

def test_voxel_on_positive_side(self):
node = get_empty_node_with_empty_children()
res = [i for i in node._get_all_voxels_vertex([1, 1, 1], 1)]
res = [i for i in node.get_all_voxels_vertex([1, 1, 1], 1)]
answ = [[1, 1, 1], [1, 1, 2], [1, 2, 1], [1, 2, 2], [2, 1, 1], [2, 1, 2], [2, 2, 1], [2, 2, 2]]
self.assertEqual(res, answ)

Expand Down
44 changes: 44 additions & 0 deletions Experiments/cube.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
####
#
# OBJ File Generated by Meshlab
#
####
# Object cube.obj
#
# Vertices: 8
# Faces: 12
#
####
vn 0.577350 0.577350 0.577350
v 0.500000 0.500000 0.500000
vn -0.333333 0.666667 0.666667
v -0.500000 0.500000 0.500000
vn 0.666667 -0.333333 0.666667
v 0.500000 -0.500000 0.500000
vn -0.666667 -0.666667 0.333333
v -0.500000 -0.500000 0.500000
vn 0.666667 0.666667 -0.333333
v 0.500000 0.500000 -0.500000
vn -0.666667 0.333333 -0.666667
v -0.500000 0.500000 -0.500000
vn 0.333333 -0.666667 -0.666667
v 0.500000 -0.500000 -0.500000
vn -0.577350 -0.577350 -0.577350
v -0.500000 -0.500000 -0.500000
# 8 vertices, 0 vertices normals

f 1//1 2//2 3//3
f 4//4 3//3 2//2
f 1//1 3//3 5//5
f 7//7 5//5 3//3
f 1//1 5//5 2//2
f 6//6 2//2 5//5
f 8//8 6//6 7//7
f 5//5 7//7 6//6
f 8//8 7//7 4//4
f 3//3 4//4 7//7
f 8//8 4//4 6//6
f 2//2 6//6 4//4
# 12 faces, 0 coords texture

# End of File
2 changes: 1 addition & 1 deletion Experiments/deer.obj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WaveFront *.obj file (generated by CINEMA 4D)


g grp1 grp1_2
usemtl Mat
Expand Down
92 changes: 92 additions & 0 deletions Experiments/dode.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
####
#
# OBJ File Generated by Meshlab
#
####
# Object Dode.obj
#
# Vertices: 32
# Faces: 12
#
####
vn 0.934172 -0.000000 0.356822
v 4.236068 0.000000 1.618034
vn 0.577350 0.577350 0.577350
v 2.618034 2.618034 2.618034
vn -0.000000 0.356822 0.934172
v 0.000000 1.618034 4.236068
vn -0.000000 -0.356822 0.934172
v 0.000000 -1.618034 4.236068
vn 0.577350 -0.577350 0.577350
v 2.618034 -2.618034 2.618034
vn 0.525731 0.000000 0.850651
v 1.894427 0.000000 3.065248
vn -0.577350 0.577350 0.577350
v -2.618034 2.618034 2.618034
vn -0.934172 -0.000000 0.356822
v -4.236068 0.000000 1.618034
vn -0.577350 -0.577350 0.577350
v -2.618034 -2.618034 2.618034
vn -0.525731 0.000000 0.850651
v -1.894427 0.000000 3.065248
vn 0.356822 0.934172 0.000000
v 1.618034 4.236068 0.000000
vn -0.356822 0.934172 0.000000
v -1.618034 4.236068 0.000000
vn 0.000000 0.850651 0.525731
v 0.000000 3.065248 1.894427
vn -0.356822 -0.934172 -0.000000
v -1.618034 -4.236068 0.000000
vn 0.356822 -0.934172 -0.000000
v 1.618034 -4.236068 0.000000
vn 0.000000 -0.850651 0.525731
v -0.000000 -3.065248 1.894427
vn 0.934172 -0.000000 -0.356822
v 4.236068 0.000000 -1.618034
vn 0.577350 0.577350 -0.577350
v 2.618034 2.618034 -2.618034
vn 0.850651 0.525731 0.000000
v 3.065248 1.894427 0.000000
vn -0.577350 0.577350 -0.577350
v -2.618034 2.618034 -2.618034
vn -0.934172 -0.000000 -0.356822
v -4.236068 0.000000 -1.618034
vn -0.850651 0.525731 0.000000
v -3.065248 1.894427 0.000000
vn -0.577350 -0.577350 -0.577350
v -2.618034 -2.618034 -2.618034
vn -0.850651 -0.525731 0.000000
v -3.065248 -1.894427 0.000000
vn 0.577350 -0.577350 -0.577350
v 2.618034 -2.618034 -2.618034
vn 0.850651 -0.525731 0.000000
v 3.065248 -1.894427 0.000000
vn -0.000000 0.356822 -0.934172
v 0.000000 1.618034 -4.236068
vn 0.000000 0.850651 -0.525731
v 0.000000 3.065248 -1.894427
vn -0.000000 -0.356822 -0.934172
v 0.000000 -1.618034 -4.236068
vn 0.000000 -0.850651 -0.525731
v 0.000000 -3.065248 -1.894427
vn 0.525731 0.000000 -0.850651
v 1.894427 0.000000 -3.065248
vn -0.525731 0.000000 -0.850651
v -1.894427 0.000000 -3.065248
# 32 vertices, 0 vertices normals

f 2//2 3//3 4//4 5//5 1//1
f 8//8 9//9 4//4 3//3 7//7
f 3//3 2//2 11//11 12//12 7//7
f 14//14 15//15 5//5 4//4 9//9
f 1//1 17//17 18//18 11//11 2//2
f 12//12 20//20 21//21 8//8 7//7
f 8//8 21//21 23//23 14//14 9//9
f 5//5 15//15 25//25 17//17 1//1
f 11//11 18//18 27//27 20//20 12//12
f 29//29 25//25 15//15 14//14 23//23
f 17//17 25//25 29//29 27//27 18//18
f 21//21 20//20 27//27 29//29 23//23
# 12 faces, 0 coords texture

# End of File
5 changes: 0 additions & 5 deletions Experiments/experiment.py
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
import PyMesh.python.pymesh as py


mesh = py.load_mesh("test.obj", None, True)
print(1)
Loading