/[escript]/trunk/pycad/py_src/primitives.py
ViewVC logotype

Diff of /trunk/pycad/py_src/primitives.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 916 by gross, Fri Dec 15 08:25:57 2006 UTC revision 917 by gross, Tue Jan 2 02:46:53 2007 UTC
# Line 30  from transformations import _TYPE, Trans Line 30  from transformations import _TYPE, Trans
30    
31    
32  def resetGlobalPrimitiveIdCounter():  def resetGlobalPrimitiveIdCounter():
33       """
34       initializes the global primitive ID counter
35       """
36     global global_primitive_id_counter     global global_primitive_id_counter
37     global_primitive_id_counter=1     global_primitive_id_counter=1
38    
39  def setToleranceForColocation(tol=1.e-11):  def setToleranceForColocation(tol=1.e-11):
40       """
41       set the global tolerance for colocation checks to tol
42       """
43     global global_tolerance_for_colocation     global global_tolerance_for_colocation
44     global_tolerance_for_colocation=tol     global_tolerance_for_colocation=tol
45    
46  def getToleranceForColocation():  def getToleranceForColocation():
47       """
48       returns the global tolerance for colocation checks
49       """
50     return global_tolerance_for_colocation     return global_tolerance_for_colocation
51    
52  resetGlobalPrimitiveIdCounter()  resetGlobalPrimitiveIdCounter()
# Line 422  class Line(Curve): Line 431  class Line(Curve):
431    
432  class Arc(Primitive1D):  class Arc(Primitive1D):
433      """      """
434      defines an arc      defines an arc which is strictly, smaller than Pi
435      """      """
436      def __init__(self,center,start,end):      def __init__(self,center,start,end):
437         """         """
438         creates an arc by the start point, end point and center         creates an arc by the start point, end point and center
439         """         """
440         if isinstance(center,Point): raise TypeError("center needs to be a Point object.")         if not isinstance(center,Point): raise TypeError("center needs to be a Point object.")
441         if isinstance(end,Point): raise TypeError("end needs to be a Point object.")         if not isinstance(end,Point): raise TypeError("end needs to be a Point object.")
442         if isinstance(start,Point): raise TypeError("start needs to be a Point object.")         if not isinstance(start,Point): raise TypeError("start needs to be a Point object.")
443           # TODO: check length of circle.
444         super(Arc, self).__init__()         super(Arc, self).__init__()
445         self.__center=center         self.__center=center
446         self.__start=start         self.__start=start
# Line 456  class Arc(Primitive1D): Line 466  class Arc(Primitive1D):
466    
467      def getPrimitives(self):      def getPrimitives(self):
468         """         """
469         returns C{set} of primitive used to construct the Curve         returns the primitives used to construct the Curve
470         """         """
471         out=set()         out=set()
472         out|=set(self.getStartPoint().getPrimitives())         out|=set(self.getStartPoint().getPrimitives())
# Line 495  class Arc(Primitive1D): Line 505  class Arc(Primitive1D):
505         else:         else:
506            return False            return False
507    
   
508  #=================================================================================================================================  #=================================================================================================================================
509  class CurveLoop(Primitive):  class CurveLoop(Primitive):
510      """      """

Legend:
Removed from v.916  
changed lines
  Added in v.917

  ViewVC Help
Powered by ViewVC 1.1.26