replace polyvox with simpler implementation#2026
Merged
ksuprynowicz merged 27 commits intooverte-org:masterfrom Apr 18, 2026
Merged
replace polyvox with simpler implementation#2026ksuprynowicz merged 27 commits intooverte-org:masterfrom
ksuprynowicz merged 27 commits intooverte-org:masterfrom
Conversation
ksuprynowicz
requested changes
Jan 25, 2026
Member
ksuprynowicz
left a comment
There was a problem hiding this comment.
Thank you! Everything looks good :)
I only have minor feedback about some of the formatting changes, let me know what you think about it.
ksuprynowicz
approved these changes
Feb 13, 2026
Member
ksuprynowicz
left a comment
There was a problem hiding this comment.
Thank you! Everything looks good :)
Member
|
I'm getting an assert in Overte_hub: |
Member
|
Backtrace: |
f81956c to
cb49bca
Compare
Member
|
The newest version hits an assert for me here: Index is {21, 21, 21}, valid size is {21, 21, 21} and allocated_size is {21, 21, 21}. |
Member
|
Member
|
Member
Member
|
Member
Member
Member
92bf88d to
4f6beaa
Compare
Collaborator
Author
import itertools
def rotr_edge(a):
assert a in range(12)
if a == 0: return 1
elif a == 1: return 2
elif a == 2: return 3
elif a == 3: return 0
elif a == 4: return 5
elif a == 5: return 6
elif a == 6: return 7
elif a == 7: return 4
elif a == 8: return 9
elif a == 9: return 10
elif a == 10: return 11
elif a == 11: return 8
assert False
def rotr_vert(a):
assert a in range(8), f"{a}"
if a == 0: return 1
elif a == 1: return 2
elif a == 2: return 3
elif a == 3: return 0
elif a == 4: return 5
elif a == 5: return 6
elif a == 6: return 7
elif a == 7: return 4
assert False
def mirroru_edge(a):
assert a in range(12)
if a == 0: return 4
elif a == 1: return 5
elif a == 2: return 6
elif a == 3: return 7
elif a == 4: return 0
elif a == 5: return 1
elif a == 6: return 2
elif a == 7: return 3
elif a == 8: return 8
elif a == 9: return 9
elif a == 10: return 10
elif a == 11: return 11
assert False
def mirroru_vert(a):
assert a in range(8)
if a == 0: return 4
elif a == 1: return 5
elif a == 2: return 6
elif a == 3: return 7
elif a == 4: return 0
elif a == 5: return 1
elif a == 6: return 2
elif a == 7: return 3
assert False
def ltoi(l):
assert all(map(lambda i: i in range(8), l))
r = 0
for i in l:
r = r|(1<<i)
return r
def itol(v):
assert v in range(256)
r = []
for i in range(8):
if v&1 != 0:
r.append(i)
v = v>>1
return r
def list_group(v,rot=4,mirror=True):
out = []
e = []
for _ in range(rot):
out.append(v)
v,e = apply_trans(rotr_vert, rotr_edge, v, e)
if mirror:
v,e = apply_trans(mirroru_vert, mirroru_edge, v, e)
for _ in range(rot):
out.append(v)
v,e = apply_trans(rotr_vert, rotr_edge, v, e)
return out
RESULTS = [None for _ in range(256)]
def add_res(v, e, expect_dup = False):
global RESULTS
assert expect_dup or RESULTS[ltoi(v)] is None
assert all(map(lambda a: a in range(12), e))
RESULTS[ltoi(v)] = e + [-1] * (16 - len(e))
def apply_trans(dv, de, v, e):
return list(map(dv,v)), list(map(de, e))
def repeat_group(v,e,rot=4,mirror=True, expect_dup_mirror=False):
assert len(e) % 3 == 0
for _ in range(rot):
add_res(v,e)
v,e = apply_trans(rotr_vert, rotr_edge, v, e)
if mirror:
v,e = apply_trans(mirroru_vert, mirroru_edge, v, e)
e = list(itertools.chain.from_iterable(map(lambda t: [t[0],t[2],t[1]], [e[i:i+3] for i in range(0, len(e), 3)])))
for _ in range(rot):
add_res(v,e, expect_dup=expect_dup_mirror)
v,e = apply_trans(rotr_vert, rotr_edge, v, e)
#print(itol(min(map(lambda v:ltoi(v), list_group([0,1,4,5,3,6])))))
#exit(0)
add_res([],[])
add_res(itol(255), [])
repeat_group([0], [0,8,3])
repeat_group([0, 1], [3,1,8, 8,1,9])
repeat_group([0, 4], [3,0,4, 3,4,7], mirror=False)
repeat_group([0, 5], [3,4,8, 3,5,4, 3,0,5, 0,9,5])
repeat_group([0, 6], [0,8,3, 5,6,10], expect_dup_mirror=True)
repeat_group([0, 2], [0,8,1, 1,8,10, 3,10,8, 3,2,10], rot=2)
repeat_group([0, 1, 2], [8,10,9, 3,10,8, 3,2,10])
repeat_group([0, 1, 2, 3], [8,10,9, 8,11,10], rot=1)
repeat_group([0, 1, 4], [3,1,7, 7,9,4, 9,7,1])
repeat_group([0, 2, 4], [10,4,7, 2,10,7, 3,2,7, 10,1,4, 1,0,4])
repeat_group([1, 2, 4], [2,10,7, 7,8,2, 8,0,2, 7,10,9, 4,7,9])
repeat_group([0, 1, 2, 4], [2,10,9, 2,9,7, 2,7,3, 7,9,4])
repeat_group([0, 3, 4], [11,4,7, 11,2,4, 2,0,4])
repeat_group([1, 3, 4], [0,3,8, 2,7,11, 1,9,4, 2,1,7, 7,1,4])
repeat_group([0, 1, 3, 4], [2,7,11, 1,9,4, 2,1,7, 7,1,4])
#repeat_group([0, 1, 6], [3,6,8, 3,10,6, 1,10,3, 6,5,8, 8,5,9])
repeat_group([0, 1, 6], [3,6,8, 3,1,6, 1,10,6, 6,9,8, 6,5,9])
repeat_group([0, 1, 2, 6], [3,9,8, 3,2,9, 2,6,9, 9,6,5])
repeat_group([1, 2, 3, 4], [3,8,0, 11,4,7, 11,9,4, 11,10,9])
repeat_group([0, 1, 2, 3, 4], [11,4,7, 11,9,4, 11,10,9])
repeat_group([0, 1, 4, 5], [3,5,7, 3,1,5], mirror=False)
repeat_group([0, 2, 4, 5], [0,9,1, 3,5,7, 3,2,5, 2,10,5])
#repeat_group([1, 2, 4, 5], [0,7,8, 2,10,5, 0,5,7, 5,0,2])
repeat_group([1, 2, 4, 5], [2,10,0, 0,10,8, 8,10,7, 7,10,5])
repeat_group([0, 1, 2, 4, 5], [3,5,7, 3,10,5, 3,2,10])
repeat_group([1, 3, 4, 5], [3,8,0, 7,11,2, 2,1,7, 1,5,7])
repeat_group([0, 1, 3, 4, 5], [1,5,7, 11,2,7, 7,2,1])
repeat_group([2, 3, 4, 5], [7,11,5, 5,11,10, 3,8,1, 1,8,9], mirror=False)
repeat_group([0, 1, 3, 5, 6], [8,11,4, 4,11,6, 1,10,2])
repeat_group([1, 2, 3, 4, 5], [3,8,0, 11,5,7, 11,10,5])
repeat_group([0, 1, 2, 3, 4, 5], [11,5,7, 11,10,5])
repeat_group([0, 2, 4, 6], [3,6,7, 3,2,6, 1,0,4, 1,4,5], rot=2, mirror=False)
repeat_group([0, 1, 2, 4, 6], [9,4,5, 3,6,7, 3,2,6])
repeat_group([1, 3, 4, 6], [3,8,0, 2,1,10, 11,6,7, 9,4,5], rot=2, mirror=False)
repeat_group([0, 1, 3, 4, 6], [1,10,2, 9,4,5, 11,6,7])
repeat_group([0, 1, 2, 3, 4, 6], [11,6,7, 9,4,5], rot=2)
repeat_group([0, 1, 2, 4, 5, 6], [3,6,7, 3,2,6], mirror=False)
#repeat_group([0, 1, 3, 4, 5, 6], [11,1,7, 11,2,1, 7,1,10, 7,10,6])
repeat_group([0, 1, 3, 4, 5, 6], [11,6,7, 1,10,2])
repeat_group([0, 2, 3, 4, 5, 6], [11,6,7, 0,9,1], mirror=False)
repeat_group([0, 1, 2, 3, 4, 5, 6], [11,6,7])
done = all(map(lambda x: x is not None, RESULTS))
if done:
print("{ ", end='')
for el in RESULTS:
print("{ ", end='')
for ii, i in enumerate(el):
if ii > 0:
print(", ", end='')
print(i, end='')
print(" },")
print("}")
else:
print(RESULTS, sum(map(lambda x: int(x is not None), RESULTS)), done)
next_none = next((i for i, x in enumerate(RESULTS) if x is None))
print(next_none, itol(next_none))If there is an interest, here is the script I used to generate the new table (the commented-out |
Member
ksuprynowicz
approved these changes
Apr 18, 2026
Member
ksuprynowicz
left a comment
There was a problem hiding this comment.
Thank you!
There's one typo, but all is good otherwise :)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.











This replaces the functionality of the polyvox library, so we don't have to ship it anymore. :)
This will to introduce a bit of a breaking change, where if borders are filled in, then the faces at the border is not rendered. But considering, that polyvox already did it at some of the sides, I tought it would be better to always not render faces there, so that tiling can be done in the future. This can be changed back if needed