diff options
Diffstat (limited to 'archimesh')
-rw-r--r-- | archimesh/achm_gltools.py | 4 | ||||
-rw-r--r-- | archimesh/achm_room_maker.py | 65 |
2 files changed, 31 insertions, 38 deletions
diff --git a/archimesh/achm_gltools.py b/archimesh/achm_gltools.py index aaddbeaf..89e29542 100644 --- a/archimesh/achm_gltools.py +++ b/archimesh/achm_gltools.py @@ -155,7 +155,7 @@ def draw_line(v1, v2): # ------------------------------------------------------------- def draw_room_data(myobj, op, region, rv3d, rgb, rgbw, fsize, wfsize, space, measure, dspname): - verts, activefaces, activenormals = get_wall_points(myobj) + verts, activefaces, activenormals = get_wall_points(myobj, op) # -------------------------- # Get line points and draw @@ -175,7 +175,7 @@ def draw_room_data(myobj, op, region, rv3d, rgb, rgbw, fsize, wfsize, space, mea # Top for e in face: if verts[e][2] != 0: - if verts[a1][0] == verts[e][0] and verts[a1][1] == verts[e][1]: + if round(verts[a1][0], 5) == round(verts[e][0], 5) and round(verts[a1][1], 5) == round(verts[e][1], 5): a2 = e else: b2 = e diff --git a/archimesh/achm_room_maker.py b/archimesh/achm_room_maker.py index e0206d80..92f3c555 100644 --- a/archimesh/achm_room_maker.py +++ b/archimesh/achm_room_maker.py @@ -970,7 +970,7 @@ def get_hight(verts, faces_4, faces_3, face_index, face_num): # ------------------------------------ # Sort list of faces # ------------------------------------ -def sort_facelist(activefaces, activenormals): +def sort_facelist(activefaces, activenormals, merge): totfaces = len(activefaces) newlist = [] newnormal = [] @@ -985,42 +985,33 @@ def sort_facelist(activefaces, activenormals): # ----------------------- # Look for first element # ----------------------- - flag = False - for x in range(1, totfaces): - if flag is False: - idx = 0 - for face in activefaces: - c = 0 - for i in face: - if i == 0 or i == 1: - c += 1 - # avoid close - if i > 3: - c -= 1 - - if c >= 2 and face not in newlist: - newlist.append(face) - newnormal.append(activenormals[idx]) - flag = True - idx += 1 + idx = 0 + for face in activefaces: + c = 0 + for i in face: + if i == 0 or i == 1: + c += 1 + + if c >= 2 and face not in newlist: + newlist.append(face) + newnormal.append(activenormals[idx]) + break + idx += 1 # ----------------------- # Look for second element # ----------------------- - flag = False - for x in range(1, totfaces): - if flag is False: - idx = 0 - for face in activefaces: - c = 0 - for i in face: - if i == 2 or i == 3: - c += 1 - if c >= 2 and face not in newlist: - newlist.append(face) - newnormal.append(activenormals[idx]) - flag = True - idx += 1 + idx = 0 + for face in activefaces: + c = 0 + for i in face: + if i == 2 or i == 3: + c += 1 + if c >= 2 and face not in newlist: + newlist.append(face) + newnormal.append(activenormals[idx]) + break + idx += 1 # ----------------------- # Add next faces @@ -1043,8 +1034,9 @@ def sort_facelist(activefaces, activenormals): # ------------------------------------ # Get points of the walls # selobject: room +# rp: roomproperties # ------------------------------------ -def get_wall_points(selobject): +def get_wall_points(selobject, rp): obverts = selobject.data.vertices obfaces = selobject.data.polygons @@ -1096,7 +1088,8 @@ def get_wall_points(selobject): # ------------------------ # Sort faces # ------------------------ - newlist, newnormal = sort_facelist(activefaces, activenormals) + newlist, newnormal = sort_facelist(activefaces, activenormals, rp.merge) + return verts, newlist, newnormal @@ -1111,7 +1104,7 @@ def add_shell(selobject, objname, rp): myvertex = [] myfaces = [] - verts, activefaces, activenormals = get_wall_points(selobject) + verts, activefaces, activenormals = get_wall_points(selobject, rp) # -------------------------- # Get line points |