Skip to content

Instantly share code, notes, and snippets.

@taikomatsu
Created November 28, 2016 05:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taikomatsu/8c384492ccc0efbc4da8d23420b9b560 to your computer and use it in GitHub Desktop.
Save taikomatsu/8c384492ccc0efbc4da8d23420b9b560 to your computer and use it in GitHub Desktop.
extend curve (vex)
// curveの先端を接線(というか隣のポイントとの差分)を使って伸ばす
vector p0 = point(0, "P", 0);
vector p1 = point(0, "P", 1);
vector np0 = point(0, "P", i@numpt-1);
vector np1 = point(0, "P", i@numpt-2);
vector tan_in = normalize(p0-p1);
vector tan_out = normalize(np0 - np1);
float ext = ch("ext");
addpoint(0, p0+tan_in*ext);
addpoint(0, np0+tan_out*ext);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment