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 sklearn.cluster import KMeans # /path/to/blender's/python -m pip install scikit-learn | |
import networkx as nx # /path/to/blender's/python -m pip install scipy networkx | |
obj = bpy.data.objects['Armadillo'] | |
mesh = obj.data | |
edges = [(e.vertices[0], e.vertices[1]) for e in mesh.edges] | |
G = nx.Graph(edges) | |
S = [G.subgraph(c).copy() for c in nx.connected_components(G)] | |
G = S[0] |
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 networkx as nx # /path/to/blender's/python -m pip install scipy networkx | |
obj = bpy.data.objects['Armadillo'] | |
mesh = obj.data | |
edges = [(e.vertices[0], e.vertices[1]) for e in mesh.edges] | |
G = nx.Graph(edges) | |
S = [G.subgraph(c).copy() for c in nx.connected_components(G)] | |
fiedler_vector = nx.fiedler_vector(S[0]) | |
minV = min(fiedler_vector) |
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 open3d as o3d | |
import numpy as np | |
import networkx as nx | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
# %% | |
mesh = o3d.io.read_triangle_mesh("bun_zipper.ply") | |
coordinates = mesh.vertices | |
edges = [] |
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 tempfile | |
import scipy.interpolate as scipl | |
import networkx as nx | |
import graphviz | |
import numpy as np | |
import matplotlib.pyplot as plt | |
es0 = [ | |
[1, 4], |
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 java.util.List; | |
import java.util.stream.Collectors; | |
import java.util.Arrays; | |
import java.util.Collections; | |
class a { | |
public static void main(String[] args) { | |
Integer[] array= new Integer[] {1, 2, 3, 4, 5}; | |
List<Integer> list= Arrays.asList(array); | |
System.err.println("sum:"+list.stream().mapToInt(Integer::intValue).sum()); |
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 scipy.interpolate as scipl | |
import networkx as nx | |
import graphviz | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
es0 = [ | |
[1, 4], | |
[4, 3], |
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
BEGIN:VCALENDAR | |
VERSION:2.0 | |
PRODID:p_g_ | |
X-WR-CALNAME:七十二候 | |
BEGIN:VEVENT | |
DTSTART;TZID=Asia/Tokyo;VALUE=DATE:20240101 | |
DTEND;TZID=Asia/Tokyo;VALUE=DATE:20240101 | |
SUMMARY:雪下出麦(ゆきわたりてむぎのびる) - 冬至 | |
URL;VALUE=URI:https://ja.wikipedia.org/wiki/%E5%86%AC%E8%87%B3%23%E4%B8%83%E5%8D%81%E4%BA%8C%E5%80%99 | |
BEGIN:VALARM |
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
BEGIN:VCALENDAR | |
VERSION:2.0 | |
PRODID:p_g_ | |
X-WR-CALNAME:二十四節気 | |
BEGIN:VEVENT | |
DTSTART;TZID=Asia/Tokyo;VALUE=DATE:20240106 | |
DTEND;TZID=Asia/Tokyo;VALUE=DATE:20240106 | |
SUMMARY:小寒 | |
URL;VALUE=URI:https://ja.wikipedia.org/wiki/%E5%B0%8F%E5%AF%92 | |
BEGIN:VALARM |
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 glob | |
import shutil | |
import os | |
iDir = '/Users/Work/Downloads' | |
oDir = '/Users/Work/Desktop/out' | |
if not os.path.isdir(oDir): | |
os.makedirs(oDir) | |
for idx, f in enumerate(sorted(glob.glob(iDir + '/*.png'))): | |
print(f) |
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
#emptyを追加 | |
#emptyのparentを目的物にする | |
bpy.data.objects["Empty"].matrix_world | |
bpy.data.objects["Empty"].matrix_world.to_euler('XYZ') |
NewerOlder