Skip to content

Commit

Permalink
Progress encoding vertices
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron committed May 29, 2020
1 parent 970eaa3 commit 5fc5bb2
Show file tree
Hide file tree
Showing 5 changed files with 665 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 2

# 4 space indentation
[*.py]
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab
Empty file added qmesh/__init__.py
Empty file.
55 changes: 55 additions & 0 deletions qmesh/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
from collections import OrderedDict


HEADER = OrderedDict([
['centerX', 'd'], # 8bytes
['centerY', 'd'],
['centerZ', 'd'],
['minimumHeight', 'f'], # 4bytes
['maximumHeight', 'f'],
['boundingSphereCenterX', 'd'],
['boundingSphereCenterY', 'd'],
['boundingSphereCenterZ', 'd'],
['boundingSphereRadius', 'd'],
['horizonOcclusionPointX', 'd'],
['horizonOcclusionPointY', 'd'],
['horizonOcclusionPointZ', 'd']
])

VERTEX_DATA = OrderedDict([
# 4bytes -> determines the size of the 3 following arrays
['vertexCount', 'I'],
['uVertexCount', 'H'], # 2bytes, unsigned short
['vVertexCount', 'H'],
['heightVertexCount', 'H']
])

INDEX_DATA16 = OrderedDict([
['triangleCount', 'I'],
['indices', 'H']
])
INDEX_DATA32 = OrderedDict([
['triangleCount', 'I'],
['indices', 'I']
])

EDGE_INDICES16 = OrderedDict([
['westVertexCount', 'I'],
['westIndices', 'H'],
['southVertexCount', 'I'],
['southIndices', 'H'],
['eastVertexCount', 'I'],
['eastIndices', 'H'],
['northVertexCount', 'I'],
['northIndices', 'H']
])
EDGE_INDICES32 = OrderedDict([
['westVertexCount', 'I'],
['westIndices', 'I'],
['southVertexCount', 'I'],
['southIndices', 'I'],
['eastVertexCount', 'I'],
['eastIndices', 'I'],
['northVertexCount', 'I'],
['northIndices', 'I']
])
Loading

0 comments on commit 5fc5bb2

Please sign in to comment.