[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (dbcbb88e326ae882c51063733ad5e98a5ea48014)



The branch, master has been updated
       via  dbcbb88e326ae882c51063733ad5e98a5ea48014 (commit)
       via  d5d894d977e610308d6ec36a3670cf3c94a8b015 (commit)
      from  64c875b0662e285dc101e7b2a0392a4c743c8700 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/polygon.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)


=================
 Commit Messages
=================

commit dbcbb88e326ae882c51063733ad5e98a5ea48014
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Play with number of line segments in line caps
    
    By changing from 36 lines-segments per circle to 40, we create a symmetry
    at 45 degrees - a common angle for lines on a circuit board to intersect
    at. This avoids building additional complexity in the polygons which are
    cut by these intersections.

:100644 100644 f0b26af... 6c34bc1... M	src/polygon.c

commit d5d894d977e610308d6ec36a3670cf3c94a8b015
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Fixup frac_circle to avoid repeating a vertex the caller will add
    
    Before we were getting self-intersecting polygons in some cases,
    a big no-no. One less vertex should be added than the expected
    (CIRC_SEGS / range), since the caller adds the last vertex.

:100644 100644 0c8c0cb... f0b26af... M	src/polygon.c

=========
 Changes
=========

commit dbcbb88e326ae882c51063733ad5e98a5ea48014
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Play with number of line segments in line caps
    
    By changing from 36 lines-segments per circle to 40, we create a symmetry
    at 45 degrees - a common angle for lines on a circuit board to intersect
    at. This avoids building additional complexity in the polygons which are
    cut by these intersections.

diff --git a/src/polygon.c b/src/polygon.c
index f0b26af..6c34bc1 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -114,10 +114,10 @@ RCSID ("$Id$");
  * local prototypes
  */
 
-#define CIRC_SEGS 36
+#define CIRC_SEGS 40
 static double circleVerticies[] = {
   1.0, 0.0,
-  0.98480775301221, 0.17364817766693,
+  0.98768834059513777, 0.15643446504023087,
 };
 
 static void
@@ -345,7 +345,7 @@ frac_circle (PLINE * c, LocationType X, LocationType Y, Vector v, int range)
 }
 
 #define COARSE_CIRCLE 0
-/* create a 35-vertex circle approximation */
+/* create a circle approximation from lines */
 POLYAREA *
 CirclePoly (LocationType x, LocationType y, BDimension radius)
 {

commit d5d894d977e610308d6ec36a3670cf3c94a8b015
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Fixup frac_circle to avoid repeating a vertex the caller will add
    
    Before we were getting self-intersecting polygons in some cases,
    a big no-no. One less vertex should be added than the expected
    (CIRC_SEGS / range), since the caller adds the last vertex.

diff --git a/src/polygon.c b/src/polygon.c
index 0c8c0cb..f0b26af 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -330,7 +330,8 @@ frac_circle (PLINE * c, LocationType X, LocationType Y, Vector v, int range)
   e1 = v[0] - X;
   e2 = v[1] - Y;
 
-  range = range == 1 ? CIRC_SEGS-1 : (CIRC_SEGS / range);
+  /* NB: the caller adds the last vertex, hence the -1 */
+  range = CIRC_SEGS / range - 1;
   for (i = 0; i < range; i++)
     {
       /* rotate the vector */




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs