Created
June 6, 2019 16:25
-
-
Save taikomatsu/220229e8e0705a5c266dca244ee5afb9 to your computer and use it in GitHub Desktop.
carve each curves
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
// carveする値。ここにバラバラの値を入れればバラバラにcarveも可能。 | |
float carve = fit(f@Frame, 1, 24, 1, 0); | |
int pts[] = primpoints(0, i@primnum); | |
// carve後のcurveのポイントを保持する配列 | |
int newpts[] = {}; | |
foreach (int pt; pts) { | |
float u = point(0, "curveu", pt); | |
// carveの向きはここの条件やcarveの変化を変えればOK | |
if (u<carve) | |
removepoint(0, pt); | |
else | |
append(newpts, pt); | |
} | |
// 新しくcurveを作成する。 | |
int pr = addprim(0, "polyline", pts); | |
// もしコピーしたいprim attrなどがある場合はこの辺でこんな感じで処理。 | |
// setprimattrib(0, "myattr", pr, f@myattr); | |
// 元々のcurveは消しておく | |
removeprim(0, i@primnum, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment