Reimplemented in dielectric_trapezoid. Definition at line 649 of file general_optics.py. 00649 : 00650 "return a polygonal boundary for the object. By default it is just the bounding box" 00651 try: 00652 00653 face_centered=hasattr(self,"face_centered") 00654 00655 if hasattr(self,"justify"): 00656 justify=self.justify 00657 else: 00658 justify="center" 00659 00660 if justify=="left": 00661 left=0 00662 right=-self.width 00663 elif justify=="right": 00664 left=self.width 00665 right=0 00666 else: 00667 try: 00668 # a fraction of 1 top justifies, 0 center justifies, and -1 bottom justifies 00669 fraction=(float(justify)+1)*0.5 00670 left=self.width*(1-fraction) 00671 right=-self.width*fraction 00672 except: 00673 left=self.width/2.0 00674 right=-left 00675 00676 if hasattr(self,"height"): 00677 height=self.height 00678 else: 00679 height=self.width 00680 00681 top=height/2.0 00682 bottom=-height/2.0 00683 00684 if(face_centered): 00685 front=0 00686 back=self.thickness 00687 else: 00688 front=-self.thickness/2.0 00689 back=-front 00690 00691 baserect=Numeric.array(( 00692 (left, right, right, left, left, left, right, right, left, left, right, right), 00693 (top, top, bottom, bottom, top, top, top, bottom, bottom, top, bottom, bottom), 00694 (front, front, front, front, front, back, back, back, back, back, back, front))) 00695 return Numeric.transpose(Numeric.dot(self.matrix_to_global, baserect))+self.center 00696 00697 except: 00698 return None 00699 def polygon_list(self):
|