Skip to content

Instantly share code, notes, and snippets.

@rrika
Created May 27, 2018 20:35
Show Gist options
  • Save rrika/49cc097b3c0a5d2f0c1e277bf1b9ed71 to your computer and use it in GitHub Desktop.
Save rrika/49cc097b3c0a5d2f0c1e277bf1b9ed71 to your computer and use it in GitHub Desktop.
def cone2(v1, v2):
return Cone(direction=normalize(v1+v2), angle_by_point=v1)
def cone3(v1, v2, v3):
return Cone(direction=normalize(cross(v2-v1, v3-v1)), angle_by_point=v1)
def cone4(v1, v2, v3, v4):
c = cone2(v1, v2)
if v3 not in c:
c = cone2(v1, v3)
if v2 not in c:
c = cone2(v2, v3)
if v1 not in c:
c = cone3(v1, v2, v3)
if v4 not in c:
c = cone2(v1, v4)
if v2 not in c:
c = cone2(v2, v4)
if v1 not in c:
c = cone3(v1, v2, v4)
if v3 not in c:
c = cone2(v3, v4)
if v1 not in c:
c = cone3(v1, v3, v4)
if v2 not in c:
c = cone3(v2, v3, v4)
return c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment