Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
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 stanza | |
import graphviz as gv | |
# %% | |
# https://qiita.com/ytaki0801/items/b8d7d4c778fe98966ce5 | |
def p_lex(p): | |
for s in '()[]{}",': |
Loading
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 networkx as nx # /path/to/blender's/python -m pip install scipy networkx | |
import numpy as np | |
from scipy.spatial import ConvexHull | |
def obj2GraphAndXyzAndNormFiedler(obj): | |
edges = [(e.vertices[0], e.vertices[1]) for e in obj.data.edges] | |
G = nx.Graph(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 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()); |
NewerOlder