Skip to content

Instantly share code, notes, and snippets.

@zeffii
Forked from anonymous/mesh_VTXb.py
Last active August 29, 2015 13:57
Show Gist options
  • Save zeffii/9860924 to your computer and use it in GitHub Desktop.
Save zeffii/9860924 to your computer and use it in GitHub Desktop.
def point_on_edge(p, edge):
'''
> p: vector
> edge: tuple of 2 vectors
< returns: True / False if a point happens to lie on an edge
'''
pt, _percent = PtLineIntersect(p, *edge)
on_line = (pt-p).length < AutoVTX.VTX_PRECISION
return on_line and (0.0 <= _percent <= 1.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment