loopspace / spath3

TikZ/PGF package for manipulating soft paths, includes the knots and calligraphy TikZ libraries.
16 stars 2 forks source link

Check for closed paths with intersection routines (spath3 & knot) #10

Closed loopspace closed 3 years ago

loopspace commented 3 years ago

There are a few issues pertaining to working with intersections and closed curves.

  1. In the spath3 routines, when splitting a closed curve at an intersection point then the result should be a single open curve. However, this will interact weirdly with when splitting at multiple points so it's not just as simple as cycling round the segments and applying a spot weld. The cycling will have to be done after all the splittings so it will be necessary to remember where the closed path joined up to.
  2. In the knots package then ignore endpoint intersections=true doesn't ignore the intersection between the last point and first point.
loopspace commented 3 years ago

I'm thinking that the simplest way to deal with these is to make the splitting routines work component-by-component. That way, we don't have to keep track of where a particular closepath points to - within a well-defined component then it will point back to the start of the path. So after doing all the splitting, we just have to remember that if the original path was closed then we now cycle the new components round to join the last one to the first. This seems much simpler than the alternative which would be to keep track of which component a closepath was pointing to in a multi-component path.

loopspace commented 3 years ago

Implemented in: bfd3c7fe88bff4ad9a463602f38013fa67d82108