MCPcopy Create free account
hub / github.com/ActiveState/code / dart

Class dart

recipes/Python/577405_Penrose_Tiler/recipe-577405.py:193–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191 return subs
192
193class dart(shape):
194 def GetPoints(self, cColour = 'darkgreen'):
195 self.points = [[0,0]
196 ,[nSelfX,nSelfY]
197 ,[0,nScale]
198 ,[-nSelfX,nSelfY]]
199 self.angles = [72,36,216,36]
200 self.type = 'dart'
201 self.viable = [[[dart, 0],[kite, 1]]
202 ,[[kite, 2]]
203 ,[[kite, 3]]
204 ,[[dart, 1],[kite, 0]]]
205 self.colour = cColour
206 def redArc(self):
207 nR = nRatioSmall
208 p0 = self.vertices[0]
209 p1 = Scalar(self.vertices[3][0],self.vertices[3][1], nR, p0[0],p0[1])
210 p5 = Scalar(self.vertices[1][0],self.vertices[1][1], nR, p0[0],p0[1])
211 p3 = MidArc(p1,p5,p0,nR)
212 p2 = MidArc(p1,p3,p0,nR)
213 p4 = MidArc(p3,p5,p0,nR)
214 aR = Perimeter([p1,p2,p3,p4,p5])
215 canvas.create_line(aR, fill = 'darkgrey', tag = self.tag, width = 1)
216 def blueArc(self):
217 nR = 1 / nFib / (1 / nFib + 1) * nScale
218 p0 = self.vertices[2]
219 p1 = Scalar(self.vertices[3][0],self.vertices[3][1], nR, p0[0],p0[1])
220 p9 = Scalar(self.vertices[1][0],self.vertices[1][1], nR, p0[0],p0[1])
221 p5 = MidArc(p1,p9,p0,nR)
222 p5[0] = 2 * p0[0] - p5[0] # great arc
223 p5[1] = 2 * p0[1] - p5[1] # great arc
224 p3 = MidArc(p1,p5,p0,nR)
225 p7 = MidArc(p5,p9,p0,nR)
226 p2 = MidArc(p1,p3,p0,nR)
227 p4 = MidArc(p3,p5,p0,nR)
228 p6 = MidArc(p5,p7,p0,nR)
229 p8 = MidArc(p7,p9,p0,nR)
230 aR = Perimeter([p1,p2,p3,p4,p5,p6,p7,p8,p9])
231 canvas.create_line(aR, fill = 'cyan', tag = self.tag, width = 1)
232 def subShapes(self):
233 subs = []
234 p0 = list(self.vertices[0])
235 p1 = list(self.vertices[1])
236 p2 = list(self.vertices[2])
237 p3 = list(self.vertices[3])
238 p4 = Scalar(p3[0],p3[1], nRatioBig, p0[0],p0[1])
239 p5 = Scalar(p1[0],p1[1], nRatioBig, p0[0],p0[1])
240 subs.append(SubKiteRight(p0,p2,p4))
241 subs.append(SubKiteLeft(p0,p2,p5))
242 subs.append(SubDartRight(p2,p3,p4))
243 subs.append(SubDartLeft(p2,p1,p5))
244 return subs
245
246def AlterBorder(aBorder, temp, nNook, nAligned, nDel, nIns):
247 cnr1 = nNook

Callers 1

recipe-577405.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected