This file contains 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
import bpy | |
import mathutils | |
import math | |
bl_info = { | |
'name': 'Physics and FK Armature', | |
'author': 'p_g_', | |
'version': (0, 2), | |
'blender': (3, 6, 0), | |
'location': 'VIEW 3D > Tool(Sidebar)', |
This file contains 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
# %% | |
import matplotlib.pyplot as plt | |
import random | |
def closestPointOnCurveFromPoint(ps, q, ax): | |
def f(p, i, t): | |
return p[0][i]*(1-t)**3+p[1][i]*3*((1-t)**2)*t+p[2][i]*3*(1-t)*t**2+p[3][i]*t**3 | |
def _d(p, q): |
This file contains 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
# %% | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import numpy.linalg as LA | |
from PIL import Image, ImageDraw, ImageFont | |
fnt = ImageFont.truetype("/System/Library/Fonts/ヒラギノ明朝 ProN.ttc", 40) | |
im = Image.open('untitledBW.png') | |
imAry = np.array(im) | |
# %% |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
import bpy | |
import mathutils | |
import os | |
from os.path import exists | |
def d2r(v): | |
return v / 180.0 * 3.1415926 | |
This file contains 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
import gzip | |
import xml.etree.ElementTree as ET | |
import pathlib | |
def map(distDir, root, ns): | |
ret = root.findall("./g/g[@id='map']", ns) | |
mapSettings = [ | |
['sea', 'path', 'fill', '#DEF'], | |
['fillmap', 'polyline', 'stroke', '#000'], |
This file contains 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
import bpy | |
import mathutils | |
import bmesh | |
def d2r(deg): | |
return deg / 180.0 * 3.1415926 | |
def deleteMesh(name): |
This file contains 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
import bpy | |
from bpy.app.handlers import persistent | |
import subprocess | |
from os.path import exists | |
bl_info = { | |
"name": "Notification", | |
"author": "p_g_", | |
"version": (0, 2), |
This file contains 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
import bpy | |
import mathutils | |
def mkText(str="Text", name="Text_outer", extrude=0.2): | |
name0 = f'{name}' | |
if name0 in bpy.data.meshes: | |
bpy.data.meshes.remove(bpy.data.meshes[name0]) | |
bpy.ops.object.select_all(action='DESELECT') | |
bpy.ops.object.text_add() |