Skip to content

Instantly share code, notes, and snippets.

@shspage
shspage / 1_example_mxi_for_aip.md
Last active February 10, 2024 19:34
Illustrator用プラグインからzxpを作成する例

Illustrator用プラグインからzxpを作成する例

ディレクトリ構造(プラグイン名:anchorGrabber.aip の場合)

  • anchorGrabber
    • anchorGrabber.mxi
    • mac
      • anchorGrabber.aip

zxp生成コマンドはHTML拡張からzxpを作成する場合と同じ

@shspage
shspage / 正規表現で文字スタイル割り当て.jsx
Created December 11, 2018 10:55
@jamesw05さんの illustrator-shortcuts/apply_Style_With_RegExp.jsx のUIやメッセージを日本語にしたもの。
#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
@shspage
shspage / 1_example_mxi_file_for_hybrid_zxp.md
Last active September 15, 2022 01:01
Illustrator用ハイブリッドzxpのmxiファイル

インストールに成功したIllustrator用ハイブリッドzxpのmxiファイル。
ディレクトリ構造はこんなだ。comboMoverUI.zxpはHTMLエクステンション部分単体で作成したzxp。

  • comboMover
    • comboMoverUI.mxi
    • comboMoverUI.zxp
    • mac
      • comboMover.aip
    • win64
  • comboMover.aip
@shspage
shspage / ai_schwarz_christoffel_mapping.md
Last active August 7, 2022 19:35
an example of Schwarz-Christoffel mapping with Adobe Illustrator and python

Adobe Illustrator と python を使った Schwarz-Christoffel mapping の一例

Schwarz-Christoffel mapping という変換手法を使って、Illustrator でこんな図を作成してみました。

square_to_circle

以下の頁を参考にさせて頂きました。
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'
@shspage
shspage / delaunay-for-illustrator.jsx
Last active May 10, 2021 15:25
Delaunay triangulation for Illustrator (Commented in Japanese)
#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 [