Changeset View
Changeset View
Standalone View
Standalone View
add_mesh_extra_objects/Blocks.py
| Context not available. | |||||
| points = [] | points = [] | ||||
| faces = [] | faces = [] | ||||
| if Offsets == None: | if Offsets is None: | ||||
| points.append([slices[0],bounds[4],bounds[2]]) | points.append([slices[0],bounds[4],bounds[2]]) | ||||
| points.append([slices[0],bounds[5],bounds[2]]) | points.append([slices[0],bounds[5],bounds[2]]) | ||||
| points.append([slices[0],bounds[5],bounds[3]]) | points.append([slices[0],bounds[5],bounds[3]]) | ||||
| Context not available. | |||||
| elif ht <= self.z-self.h/2-self.cl: | elif ht <= self.z-self.h/2-self.cl: | ||||
| if self.vl > self.w/2: | if self.vl > self.w/2: | ||||
| circVal = circ(ht-self.z+self.h/2,self.rl+self.rtl) | circVal = circ(ht-self.z+self.h/2,self.rl+self.rtl) | ||||
| if circVal == None: | if circVal is None: | ||||
| return None | return None | ||||
| else: return self.x + s*(self.w/2.-self.rl+circVal)/r1 | else: return self.x + s*(self.w/2.-self.rl+circVal)/r1 | ||||
| else: | else: | ||||
| circVal = circ(ht-self.z+self.h/2+self.vl-self.rl,self.rl+self.rtl) | circVal = circ(ht-self.z+self.h/2+self.vl-self.rl,self.rl+self.rtl) | ||||
| if circVal == None: | if circVal is None: | ||||
| return None | return None | ||||
| else: return self.x + s*circVal/r1 | else: return self.x + s*circVal/r1 | ||||
| Context not available. | |||||
| elif ht >= self.z+self.h/2+self.c: | elif ht >= self.z+self.h/2+self.c: | ||||
| if self.v > self.w/2: | if self.v > self.w/2: | ||||
| circVal = circ(ht-self.z-self.h/2,self.r+self.rt) | circVal = circ(ht-self.z-self.h/2,self.r+self.rt) | ||||
| if circVal == None: | if circVal is None: | ||||
| return None | return None | ||||
| else: return self.x + s*(self.w/2.-self.r+circVal)/r1 | else: return self.x + s*(self.w/2.-self.r+circVal)/r1 | ||||
| else: | else: | ||||
| circVal = circ(ht-(self.z+self.h/2+self.v-self.r),self.r+self.rt) | circVal = circ(ht-(self.z+self.h/2+self.v-self.r),self.r+self.rt) | ||||
| if circVal == None: | if circVal is None: | ||||
| return None | return None | ||||
| else: return self.x + s*circVal/r1 | else: return self.x + s*circVal/r1 | ||||
| Context not available. | |||||
| #pointed arch on top | #pointed arch on top | ||||
| elif self.v > self.w/2: | elif self.v > self.w/2: | ||||
| circVal = circ(dist-self.w/2+self.r,self.r+self.rt) | circVal = circ(dist-self.w/2+self.r,self.r+self.rt) | ||||
| if circVal == None: | if circVal is None: | ||||
| return None | return None | ||||
| else: return self.z+self.h/2+circVal | else: return self.z+self.h/2+circVal | ||||
| #domed arch on top | #domed arch on top | ||||
| else: | else: | ||||
| circVal = circ(dist,self.r+self.rt) | circVal = circ(dist,self.r+self.rt) | ||||
| if circVal == None: | if circVal is None: | ||||
| return None | return None | ||||
| else: return self.z+self.h/2+self.v-self.r+circVal | else: return self.z+self.h/2+self.v-self.r+circVal | ||||
| Context not available. | |||||
| #pointed arch on bottom | #pointed arch on bottom | ||||
| elif self.vl > self.w/2: | elif self.vl > self.w/2: | ||||
| circVal = circ(dist-self.w/2+self.rl,self.rl+self.rtl) | circVal = circ(dist-self.w/2+self.rl,self.rl+self.rtl) | ||||
| if circVal == None: | if circVal is None: | ||||
| return None | return None | ||||
| else: return self.z-self.h/2-circVal | else: return self.z-self.h/2-circVal | ||||
| Context not available. | |||||
| #domed arch on bottom | #domed arch on bottom | ||||
| else: | else: | ||||
| circVal = circ(dist,self.rl+self.rtl) # dist-self.w/2+self.rl | circVal = circ(dist,self.rl+self.rtl) # dist-self.w/2+self.rl | ||||
| if circVal == None: | if circVal is None: | ||||
| return None | return None | ||||
| else: return self.z-self.h/2-self.vl+self.rl-circVal | else: return self.z-self.h/2-self.vl+self.rl-circVal | ||||
| Context not available. | |||||
| #edgeV may return "None" - causing TypeError for math op. | #edgeV may return "None" - causing TypeError for math op. | ||||
| #use 0 until wedgeBlocks operation worked out | #use 0 until wedgeBlocks operation worked out | ||||
| edgeVal = opening.edgeV(x-w/2,edgeBinary) | edgeVal = opening.edgeV(x-w/2,edgeBinary) | ||||
| if edgeVal == None: edgeVal = 0.0 | if edgeVal is None: edgeVal = 0.0 | ||||
| LeftVertOffset = -( row.z - (row.h/2)*edgeBinary - edgeVal ) | LeftVertOffset = -( row.z - (row.h/2)*edgeBinary - edgeVal ) | ||||
| #edgeV may return "None" - causing TypeError for math op. | #edgeV may return "None" - causing TypeError for math op. | ||||
| #use 0 until wedgeBlocks operation worked out | #use 0 until wedgeBlocks operation worked out | ||||
| edgeVal = opening.edgeV(x+w/2,edgeBinary) | edgeVal = opening.edgeV(x+w/2,edgeBinary) | ||||
| if edgeVal == None: edgeVal = 0.0 | if edgeVal is None: edgeVal = 0.0 | ||||
| RightVertOffset = -( row.z - (row.h/2)*edgeBinary - edgeVal ) | RightVertOffset = -( row.z - (row.h/2)*edgeBinary - edgeVal ) | ||||
| Context not available. | |||||
| # If one of them missed for some reason, set that value to | # If one of them missed for some reason, set that value to | ||||
| # the middle of the opening. | # the middle of the opening. | ||||
| for i,pos in enumerate(e): | for i,pos in enumerate(e): | ||||
| if pos == None: e[i] = hole.x | if pos is None: e[i] = hole.x | ||||
| # add the intersects to the list of edge points | # add the intersects to the list of edge points | ||||
| edgetop.append([e[0],hole]) | edgetop.append([e[0],hole]) | ||||
| Context not available. | |||||