Illustrator用プラグインからzxpを作成する例
ディレクトリ構造(プラグイン名:anchorGrabber.aip の場合)
- anchorGrabber
- anchorGrabber.mxi
- mac
- anchorGrabber.aip
zxp生成コマンドはHTML拡張からzxpを作成する場合と同じ
Illustrator用プラグインからzxpを作成する例
ディレクトリ構造(プラグイン名:anchorGrabber.aip の場合)
zxp生成コマンドはHTML拡張からzxpを作成する場合と同じ
| ;; 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 [ |
| import bpy | |
| import math | |
| import numpy as np | |
| from time import time | |
| # 参考: | |
| # https://blender.stackexchange.com/questions/190547/mesh-edges-foreach-set-doesnt-update | |
| bpy.app.handlers.frame_change_pre.clear() | |
| bpy.app.handlers.frame_change_post.clear() |
| import bpy | |
| import numpy as np | |
| from scipy.interpolate import Rbf | |
| def getGridEdgeIndices(polys): | |
| """Gets the index of the vertices on the outer edge""" | |
| idxs = [] | |
| for poly in polys: | |
| idxs.extend([x for x in poly.vertices]) | |
| idxs, counts = np.unique(idxs, return_counts=1) |
| import bpy | |
| import numpy as np | |
| from scipy.interpolate import griddata | |
| def func(): | |
| bpy.ops.object.mode_set(mode='OBJECT') | |
| grid = bpy.data.objects['Grid'] | |
| vs = grid.data.vertices | |
| points = [] |
| import bpy | |
| import numpy as np | |
| from scipy.spatial import ConvexHull | |
| MAX_ITERATION = 10 | |
| MAX_ERROR_SQUARED = 1e-4 | |
| NUM_POINTS = 400 | |
| RADIUS = 10 # 球の半径 | |
| points = np.random.randn(3, NUM_POINTS) |
| ; controllers | |
| (def G0 (ngon [1 1.8125] 137 11)) | |
| (def G1 (ngon [3 0.8125] 106 7)) | |
| (def G2 (ngon [9 -4.1875] 74 8)) | |
| (def G3 (ngon [8 -1.1875] 46 5)) | |
| ; coordinates of the nth vertex | |
| (defn fv [s n] (nth s (inc n))) | |
| ; number of vertices | |
| (defn fc [s] (dec (count s))) |
| (def spiral_radius 30) | |
| (def interval 1.2) | |
| (def arc_angle (deg 80)) | |
| (defn prepare [tr t r] | |
| (if (> r spiral_radius) | |
| tr | |
| (let [t1 (+ t (atan2 interval r)) | |
| r1 (+ r (/ interval t1))] | |
| (prepare (conj tr t1 r1) t1 r1)))) |