revision 2376 by jfenwick, Mon Mar 30 02:13:58 2009 UTC revision 2377 by gross, Wed Apr 8 07:57:55 2009 UTC
# Line 43  except: Line 43  except:
43
44  import numarray  import numarray
45  from transformations import _TYPE, Translation, Dilation, Transformation  from transformations import _TYPE, Translation, Dilation, Transformation
46  from math import sqrt  import math
47
48
49  def resetGlobalPrimitiveIdCounter():  def resetGlobalPrimitiveIdCounter():
# Line 845  class Ellipse(EllipseBase, Primitive): Line 845  class Ellipse(EllipseBase, Primitive):
845              p=self.getPointOnMainAxis().getCoordinates()-self_c              p=self.getPointOnMainAxis().getCoordinates()-self_c
846              q=primitive.getPointOnMainAxis().getCoordinates()-self_c              q=primitive.getPointOnMainAxis().getCoordinates()-self_c
847              # are p and q orthogonal or collinear?              # are p and q orthogonal or collinear?
848              len_p=sqrt(p[0]**2+p[1]**2+p[2]**2)              len_p=math.sqrt(p[0]**2+p[1]**2+p[2]**2)
849              len_q=sqrt(q[0]**2+q[1]**2+q[2]**2)              len_q=math.sqrt(q[0]**2+q[1]**2+q[2]**2)
850              p_q= abs(p[0]*q[0]+p[1]*q[1]+p[2]*q[2])              p_q= abs(p[0]*q[0]+p[1]*q[1]+p[2]*q[2])
851              return ((p_q <= getToleranceForColocation() * len_q * p_q) or \              return ((p_q <= getToleranceForColocation() * len_q * p_q) or \
852                      (abs(p_q - len_q * p_q) <= getToleranceForColocation())) and \                      (abs(p_q - len_q * p_q) <= getToleranceForColocation())) and \

Legend:
 Removed from v.2376 changed lines Added in v.2377