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

Re: gEDA-user: gEDA-dev: Arc intersection connectivity bug



On Sun, 2009-11-15 at 19:41 +0000, Ineiev wrote:

> And n2.pcb is a little modest present for those developers who
> are curious about segmentation faults concerned with polygons:
> just a ring, an arc and a tetragon produce segmentation faults
> on loading PCB (24669073abf8a2ebc52d4644e3da4a9d3401d4b5).

Eurrgh...

Looks like it is all going to hell because the clearance arc in the
polygon is thicker than its own radius - thus creating nasty
self-intersection problems with the ArcPolyNoIntersect() contour.

Ironic I named it ArcPolyNoIntersect().. the last time I hit problems
with self-intersecting arcs, it was arcs which reached round ~360
degrees or so, and touched end to end. The solution there was to split
the arc into two - non-touching pieces, then use the polygon routines to
add them together. (Rather than get into the nightmare geometry of how
the caps intersected).

Now we need a special case for this sort of fat-arc geometry:

   __  __
  /  \/  \
 |        |
 |        |
  \      /
    ----

(Being careful to test it still works for the limiting case of arc
radius == arc width.)

My lazy suggestion is to use the polygon routines to do the heavy
lifting - rather than work out the geometry.

Should be one segment - defined by the outer radius of the arc, + 2x
dumpy circles for its caps:

            _          _
 ____      / \        / \
|-..-| +   \_/  +     \_/
 \__/

The bit I've not quite worked out yet is whether you can just draw a
chord across the end of the outer sweep or not. It might need to be a
"V" back to the arc centre. (The "-..-" bit in my diagram).

Since the circle radius is larger than the arc radius, and their full
diameter will be in a line of the "/" segment of the V, the "V" should
be consumed by the caps.



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