-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
3,046 additions
and
1,967 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
normal_list,axislist,negaxislist,vaxis,uaxis=[],['1 0 0 1','0 1 0 1','0 0 1 1'],['-1 0 0 1','0 -1 0 1','0 0 -1 1'],0,0 | ||
def evaluate(coords): | ||
dist_x,dist_y,dist_z = abs(coords[0]),abs(coords[1]),abs(coords[2]), | ||
if dist_x >= dist_y and dist_x >= dist_z: | ||
return axislist[0] | ||
if dist_y >= dist_z: | ||
return axislist[1] | ||
return axislist[2] | ||
|
||
def get_normal(coord_list): | ||
vector_a = (coord_list[1][0]-coord_list[0][0],coord_list[1][1]-coord_list[0][1],coord_list[1][2]-coord_list[0][2]) | ||
vector_b = (coord_list[2][0]-coord_list[0][0],coord_list[2][1]-coord_list[0][1],coord_list[2][2]-coord_list[0][2]) | ||
|
||
normal = (vector_a[1]*vector_b[2]-vector_a[2]*vector_b[1],vector_a[2]*vector_b[0]-vector_a[0]*vector_b[2],vector_a[0]*vector_b[1]-vector_a[1]*vector_b[0]) | ||
return normal | ||
|
||
for normal_num in range(1,var_count+1,3): | ||
normal_list=[] | ||
for i in range(3): | ||
normal_list.append([]) | ||
for var in ["x", "y", "z"]: | ||
normal_list[i].append(eval(var+str(normal_num+i))) | ||
coords = get_normal(normal_list) | ||
response = evaluate(coords) | ||
if response == axislist[0]: | ||
uaxis = axislist[1] | ||
else: | ||
uaxis = axislist[0] | ||
if response == axislist[2]: | ||
vaxis = negaxislist[1] | ||
else: | ||
vaxis = negaxislist[2] | ||
values = values.replace('AXIS_REPLACE_U',uaxis,1) | ||
values = values.replace('AXIS_REPLACE_V',vaxis,1) |
Oops, something went wrong.