robofab.path.intersect
index
/code/projects/robofab/Lib/robofab/path/intersect.py

 
Modules
       
math

 
Functions
       
inbetween((a1, a2), (b1, b2), (c1, c2))
Return True if point b is in between points a and c.
intersect(aGlyph, startPt, endPt, segmentLength=10)
Find the intersections between a glyph and a straight line.
intersectGlyphs(glyphA, glyphB, segmentLength=10)
Approximate the intersection points between two glyphs by
flattening both glyphs and checking each tiny segment for
intersections. Slow, but perhaps more realistic then 
solving the equasions.
 
Seems to work for basic curves and straights, but untested
for edges cases, alsmost hits, near hits, double points, crap like that.
makeTestGlyph()
normalise(a1, a2)
Normalise this vector to length 1
sectlines((a1, a2), (p1, p2), (b1, b2), (q1, q2))
Calculate the intersection point of two straight lines. Result in floats.