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
// plotCurvature.jsx Copyright (c) 2021 koji sakai | |
// 選択したパス上に曲率コームを描画するIllustrator用のExtendScriptです | |
// | |
// * 使いかた * | |
// パスを選択しスクリプトを実行します。パスのもつ曲率によって表示される大きさに差がでますので、拡大率をスライダーで調整してください。 | |
// 選択されたパスの数によってはものすごく重くなりますのでプレビューはデフォルトオフにしています。main()冒頭の conf オブジェクトで設定変更できます。 | |
// 曲率を表示する点の分割数(法線の密度)や、描画色などについても、conf オブジェクト内のパラメータにてお好みに調整してください。 | |
// このスクリプトを用いた結果として生じたいかなる損害・不利益について責任は持てません(いちおう)。 | |
// | |
// --------------------------------------------- |
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
int graphHeight = 300; | |
int graphWidth = 300; | |
int displayMargin = 100; | |
PImage img; | |
float x0 = 0, y0 = 0, x1 = 0, y1 = 0; | |
boolean dragging = false; | |
boolean defined = false; | |
color[] colorArray = new color[0]; | |
void setup() { |
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
/* | |
パスを延長 Copyright (c) koji sakai | |
https://gist.github.com/S4K4K0/62896e92287b40fded0d7f1614082d22 | |
プレビュー部分やUIは以下のサンプルを元にしています | |
https://qiita.com/shspage/items/441ccf61394d9c504beb | |
* HOW TO USE | |
選択して実行するとスライダーが表示され、始端か終端のセグメントに対して指定した比率でBezier曲線のパラメータが延長されます | |
(サイズや長さがそのままk倍になるわけではありません) |