Last active
May 12, 2016 23:51
-
-
Save brett19/f95ee940876b89c736445c458f69ad39 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
negatives := []Triangle | |
positives := []Triangle | |
if (d0 <= 0 && d1 <= 0 && d2 <= 0) { | |
negatives.push(Triangle{v0, v1, v2}) | |
return | |
} | |
if (d0 >= 0 && d1 >= 0 && d2 >= 0) { | |
positives.push(Triangle{v0, v1, v2}) | |
return | |
} | |
if (d0 == 0) { | |
i12 = Interpolate(v1, v2) | |
if (d1 < 0) { | |
negatives.push(Triangle{v0, v1, i12}) | |
positives.push(Triangle{v0, i12, v2}) | |
} else { | |
positives.push(Triangle{v0, v1, i12}) | |
negatives.push(Triangle{v0, i12, v2}) | |
} | |
return | |
} | |
if (d1 == 0) { | |
i02 = Interpolate(v0, v2) | |
if (d1 < 0) { | |
negatives.push(Triangle{v1, v2, i02}) | |
positives.push(Triangle{v1, i02, v0}) | |
} else { | |
positives.push(Triangle{v1, v2, i02}) | |
negatives.push(Triangle{v1, i02, v0}) | |
} | |
return | |
} | |
if (d2 == 0) { | |
i01 = Interpolate(v0, v1) | |
if (d2 < 0) { | |
negatives.push(Triangle{v2, v0, i01}) | |
positives.push(Triangle{v2, i01, v1}) | |
} else { | |
positives.push(Triangle{v2, v0, i01}) | |
negatives.push(Triangle{v2, i01, v1}) | |
} | |
return | |
} | |
if (d0 >= 0 && d1 >= 0 || d0 <= 0 && d1 <= 0) { | |
} | |
if (d1 >= 0 && d2 >= 0 || d1 <= 0 && d2 <= 0) { | |
} | |
if (d2 >= 0 && d0 >= 0 || d2 <= 0 && d0 <= 0) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment