Index: trunk/tools/geometry_tools.py
===================================================================
--- trunk/tools/geometry_tools.py	(revision 2543)
+++ trunk/tools/geometry_tools.py	(revision 2544)
@@ -16,4 +16,5 @@
 import os
 import generic_tools as gen
+import numpy.ma as ma
 
 errormsg = 'ERROR -- error -- ERROR -- error'
@@ -67,4 +68,5 @@
 # plot_sphere: Function to plot an sphere and determine which standard lines will be 
 #   also drawn
+# [north/east/south/west_buoy1: Function to draw a [North/East/South/West] danger buoy using buoy1
 
 def deg_deci(angle):
@@ -832,5 +834,4 @@
       N: number of points (50, default)
     """
-    import numpy.ma as ma
     function = 'p_doubleArrow'
 
@@ -885,5 +886,5 @@
       N: number of points (100, default)
     """
-    fname = 'p_angle_triange'
+    fname = 'p_angle_triangle'
 
     angle3 = 180. - angle1 - angle2
@@ -1025,5 +1026,4 @@
       lmains: length of main sail (as percentage of legnth, defaul 0.55)
     """
-    import numpy.ma as ma
     fname = 'zsailing_boat'
 
@@ -1156,5 +1156,4 @@
       N: number of points (200, default)
     """
-    import numpy.ma as ma
     fname = 'zisland1'
 
@@ -1261,5 +1260,4 @@
       N: number of points (300, default)
     """
-    import numpy.ma as ma
     fname = 'band_lighthouse'
 
@@ -1404,5 +1402,5 @@
     return lighthouse, lighthousesecs, lighthousedic
 
-def north_buoy1(height=5., width=10., bradii=1.75, bfrac=0.8, hsings=0.2, N=300):
+def north_buoy1(height=5., width=10., bradii=1.75, bfrac=0.8, hsigns=0.7, N=300):
     """ Function to draw a North danger buoy using buoy1
       height: height of the prism (5., default) 
@@ -1410,36 +1408,187 @@
       bradii: radii of the ball (1.75, default)
       bfrac: fraction of the ball above the prism (0.8, default)
-      hisngs: height of the sings [as reg. triangle] as percentage of the height 
-        (0.2, default)
+      hisgns: height of the signs [as reg. triangle] as percentage of the height 
+        (0.7, default)
       N: total number of points of the buoy (300, default)
     """
     fname = 'north_buoy1'
 
-    Nbuoy = np.ones((N,2), dtype=np.float)*gen.fillValueF
+    buoy = np.ones((N,2), dtype=np.float)*gen.fillValueF
 
     # buoy
     N2 = int(N/2)
-    buoy1v = buoy1(height=5., width=10., bradii=1.75, bfrac=0.8, hsings=0.2, N=N2)
-    Nbuoy[0:N2] = buoy1v
+    buoy1v, buoy1vsecs, buoy1vdic = buoy1(height=5., width=10., bradii=1.75, bfrac=0.8, N=N2)
+    buoy[0:N2,:] = buoy1v
 
     # signs
-    N3 = N - N2 - 1
-
+    N3 = N - N2 - 2
+    
+    bottsigns = 2.*bradii+height
     lsign = height*hsigns
-    # First up
-    N32 = N3 / 2
-    N323 = N32 / 3
-
-    # left up arm
-    ix = -lsign/2.
-    iy = height
-    dx = -lsign/(2.*(N323-1))
-    dy = lsign*np.sin(np.pi/3.)/(N323-1)
-    for ip in range(N323):
-        Nbuoy[N2+1:N2+N323+1] = [iy + dy*ip, ix + dx*ip]
-
-    Nbuoy = ma.masked_equal(Nbuoy, gen.fillValueF)
-
-    return Nbuoy, Nbuoysecs, Nbuoydic
+    # up
+    N32 = int(N3/2) 
+    triu = p_angle_triangle(N=N32)
+    trib = triu*lsign + [0.,-lsign/2.] 
+
+    buoy[N2+1:N2+1+N32,:] = trib + [bottsigns+2.1*lsign,0.]
+
+    # up
+    N323 = N - N32 - N2 - 2
+    trid = p_angle_triangle(N=N323)
+    trib = trid*lsign + [0.,-lsign/2.] 
+    buoy[N2+N32+2:N,:] = trib + [bottsigns+1.1*lsign,0.]
+
+    buoy = ma.masked_equal(buoy, gen.fillValueF)
+
+    buoysecs = ['buoy', 'sign1', 'sign2']
+    buoydic = {'buoy': [buoy[0:N2,:],'-','k',1.5],                                   \
+      'sign1': [buoy[N2+1:N2+N32+1,:],'-','k',1.5],                                  \
+      'sign2': [buoy[N2+N32+2:N,:],'-','k',1.5]}
+
+    return buoy, buoysecs, buoydic
+
+def east_buoy1(height=5., width=10., bradii=1.75, bfrac=0.8, hsigns=0.7, N=300):
+    """ Function to draw a East danger buoy using buoy1
+      height: height of the prism (5., default) 
+      width: width of the prism (10., default)
+      bradii: radii of the ball (1.75, default)
+      bfrac: fraction of the ball above the prism (0.8, default)
+      hisgns: height of the signs [as reg. triangle] as percentage of the height 
+        (0.7, default)
+      N: total number of points of the buoy (300, default)
+    """
+    fname = 'east_buoy1'
+
+    buoy = np.ones((N,2), dtype=np.float)*gen.fillValueF
+
+    # buoy
+    N2 = int(N/2)
+    buoy1v, buoy1vsecs, buoy1vdic = buoy1(height=5., width=10., bradii=1.75, bfrac=0.8, N=N2)
+    buoy[0:N2,:] = buoy1v
+
+    # signs
+    N3 = N - N2 - 2
+    
+    bottsigns = 2.*bradii+height
+    lsign = height*hsigns
+    # up
+    N32 = int(N3/2) 
+    triu = p_angle_triangle(N=N32)
+    trib = triu*lsign + [0.,-lsign/2.] 
+
+    buoy[N2+1:N2+1+N32,:] = trib + [bottsigns+2.1*lsign,0.]
+
+    # down
+    N323 = N - N32 - N2 - 2
+
+    trid = p_angle_triangle(N=N323)
+    trid = mirror_polygon(trid, 'x')
+    trib = trid*lsign + [lsign,-lsign/2.] 
+    buoy[N2+N32+2:N,:] = trib + [bottsigns+0.9*lsign,0.]
+
+    buoy = ma.masked_equal(buoy, gen.fillValueF)
+
+    buoysecs = ['buoy', 'sign1', 'sign2']
+    buoydic = {'buoy': [buoy[0:N2,:],'-','k',1.5],                                   \
+      'sign1': [buoy[N2+1:N2+N32+1,:],'-','k',1.5],                                  \
+      'sign2': [buoy[N2+N32+2:N,:],'-','k',1.5]}
+
+    return buoy, buoysecs, buoydic
+
+def south_buoy1(height=5., width=10., bradii=1.75, bfrac=0.8, hsigns=0.7, N=300):
+    """ Function to draw a South danger buoy using buoy1
+      height: height of the prism (5., default) 
+      width: width of the prism (10., default)
+      bradii: radii of the ball (1.75, default)
+      bfrac: fraction of the ball above the prism (0.8, default)
+      hisgns: height of the signs [as reg. triangle] as percentage of the height 
+        (0.7, default)
+      N: total number of points of the buoy (300, default)
+    """
+    fname = 'east_buoy1'
+
+    buoy = np.ones((N,2), dtype=np.float)*gen.fillValueF
+
+    # buoy
+    N2 = int(N/2)
+    buoy1v, buoy1vsecs, buoy1vdic = buoy1(height=5., width=10., bradii=1.75, bfrac=0.8, N=N2)
+    buoy[0:N2,:] = buoy1v
+
+    # signs
+    N3 = N - N2 - 2
+    
+    bottsigns = 2.*bradii+height
+    lsign = height*hsigns
+    # up
+    N32 = int(N3/2) 
+    trid = p_angle_triangle(N=N32)
+    trid = mirror_polygon(trid, 'x')
+    trib = trid*lsign + [0.,-lsign/2.] 
+
+    buoy[N2+1:N2+1+N32,:] = trib + [bottsigns+2.9*lsign,0.]
+
+    # down
+    N323 = N - N32 - N2 - 2
+    trid = p_angle_triangle(N=N323)
+    trid = mirror_polygon(trid, 'x')
+    trib = trid*lsign + [lsign,-lsign/2.] 
+    buoy[N2+N32+2:N,:] = trib + [bottsigns+0.9*lsign,0.]
+
+    buoy = ma.masked_equal(buoy, gen.fillValueF)
+
+    buoysecs = ['buoy', 'sign1', 'sign2']
+    buoydic = {'buoy': [buoy[0:N2,:],'-','k',1.5],                                   \
+      'sign1': [buoy[N2+1:N2+N32+1,:],'-','k',1.5],                                  \
+      'sign2': [buoy[N2+N32+2:N,:],'-','k',1.5]}
+
+    return buoy, buoysecs, buoydic
+
+def west_buoy1(height=5., width=10., bradii=1.75, bfrac=0.8, hsigns=0.7, N=300):
+    """ Function to draw a West danger buoy using buoy1
+      height: height of the prism (5., default) 
+      width: width of the prism (10., default)
+      bradii: radii of the ball (1.75, default)
+      bfrac: fraction of the ball above the prism (0.8, default)
+      hisgns: height of the signs [as reg. triangle] as percentage of the height 
+        (0.7, default)
+      N: total number of points of the buoy (300, default)
+    """
+    fname = 'east_buoy1'
+
+    buoy = np.ones((N,2), dtype=np.float)*gen.fillValueF
+
+    # buoy
+    N2 = int(N/2)
+    buoy1v, buoy1vsecs, buoy1vdic = buoy1(height=5., width=10., bradii=1.75, bfrac=0.8, N=N2)
+    buoy[0:N2,:] = buoy1v
+
+    # signs
+    N3 = N - N2 - 2
+    
+    bottsigns = 2.*bradii+height
+    lsign = height*hsigns
+
+    # down
+    N32 = int(N3/2) 
+    trid = p_angle_triangle(N=N32)
+    trid = mirror_polygon(trid, 'x')
+    trib = trid*lsign + [lsign,-lsign/2.] 
+    buoy[N2+1:N2+1+N32,:] = trib + [bottsigns+1.9*lsign,0.]
+
+    # up
+    N323 = N - N32 - N2 - 2
+    triu = p_angle_triangle(N=N323)
+    trib = triu*lsign + [0.,-lsign/2.] 
+
+    buoy[N2+N323+2:N,:] = trib + [bottsigns+1.*lsign,0.]
+
+    buoy = ma.masked_equal(buoy, gen.fillValueF)
+
+    buoysecs = ['buoy', 'sign1', 'sign2']
+    buoydic = {'buoy': [buoy[0:N2,:],'-','k',1.5],                                   \
+      'sign1': [buoy[N2+1:N2+N32+1,:],'-','k',1.5],                                  \
+      'sign2': [buoy[N2+N32+2:N,:],'-','k',1.5]}
+
+    return buoy, buoysecs, buoydic
 
 ####### ####### ##### #### ### ## #
