Illustrator用プラグインからzxpを作成する例
ディレクトリ構造(プラグイン名:anchorGrabber.aip の場合)
- anchorGrabber
- anchorGrabber.mxi
- mac
- anchorGrabber.aip
zxp生成コマンドはHTML拡張からzxpを作成する場合と同じ
Illustrator用プラグインからzxpを作成する例
ディレクトリ構造(プラグイン名:anchorGrabber.aip の場合)
zxp生成コマンドはHTML拡張からzxpを作成する場合と同じ
#target illustrator | |
// 選択されているテキストオブジェクトの内容を正規表現で検索して、 | |
// 一致した箇所に指定した文字スタイルを割り当てます。 | |
(function(){ | |
const SCRIPTNAME = "正規表現で文字スタイル割り当て"; | |
var _opt = { | |
ignore_case : true, |
#!/usr/bin/env python | |
# coding:utf-8 | |
from __future__ import print_function | |
import os | |
import math | |
import numpy as np | |
import scipy.spatial | |
import matplotlib.pyplot as plt | |
from random import random |
インストールに成功したIllustrator用ハイブリッドzxpのmxiファイル。
ディレクトリ構造はこんなだ。comboMoverUI.zxpはHTMLエクステンション部分単体で作成したzxp。
Schwarz-Christoffel mapping という変換手法を使って、Illustrator でこんな図を作成してみました。
以下の頁を参考にさせて頂きました。
http://squircular.blogspot.jp/2015/09/schwarz-christoffel-mapping.html
ただし、大きさや向きを変更するための計算は省いています。
計算方法などの詳しい説明は、上記頁からリンクしている PDF ファイルにあります。
中心になる式だけを書くと、変換後の座標を得る式はそれぞれ以下のようになります。
// cylinder tool for pen tool https://s.baku89.com/pentool/ | |
// 使い方:リンク先の画面左の(+)をクリックしてから、右側のエディタに以下の内容を張り付け、 | |
// 右上の「Update」を押して反映させるとツールが使えるようになります。 | |
// キャンバス上でドラッグまたはクリックすると描画できます。 | |
// コードの最初の opt { ... } の中身の数字を変えて Update すると、 | |
// それ以降に描画する円柱の形や間隔などを変更できます。 | |
// 描いたものは左下の歯車メニューからSVG形式で書き出せます。 | |
const BLACK = '#282a2e' | |
//const GUIDE = '#3e999f' | |
const WHITE = '#f9faf9' |
#target "illustrator" | |
// 選択オブジェクトの各中心点を母点として | |
// ドロネー分割した三角形を描画します。 | |
// 以下のページを参考にさせて頂きました。 | |
// http://tercel-sakuragaoka.blogspot.jp/2011/06/processingdelaunay.html | |
// ここから delaunay 関連 | |
// ------------------------------------------------ |
;; grid specification | |
(def interval 40) | |
(def nlines 10) | |
(transform [1 0 0 1 | |
(* nlines interval -0.5) | |
(* nlines interval -0.5)] | |
;; circles as controller | |
(def cs [ |
;; grid specification | |
(def interval 40) | |
(def nlines 10) | |
(transform [1 0 0 1 | |
(* nlines interval -0.5) | |
(* nlines interval -0.5)] | |
;; circles as controller | |
(def cs [ |