MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / create_from_data

Method create_from_data

python/pymesh/wires/WireNetwork.py:62–82  ·  view source on GitHub ↗

Handy factory method to create wire network from ``vertices`` and ``edges``. Example: >>> vertices = np.array([ ... [0.0, 0.0, 0.0], ... [1.0, 0.0, 0.0], ... [1.0, 1.0, 0.0], ... ]) >>> edges =

(cls, vertices, edges)

Source from the content-addressed store, hash-verified

60
61 @classmethod
62 def create_from_data(cls, vertices, edges):
63 """ Handy factory method to create wire network from ``vertices`` and
64 ``edges``.
65
66 Example:
67
68 >>> vertices = np.array([
69 ... [0.0, 0.0, 0.0],
70 ... [1.0, 0.0, 0.0],
71 ... [1.0, 1.0, 0.0],
72 ... ])
73 >>> edges = np.array([
74 ... [0, 1],
75 ... [0, 2],
76 ... [1, 2],
77 ... ])
78 >>> wires = WireNetwork.create_from_data(vertices, edges)
79 """
80 wire_network = cls()
81 wire_network.load(vertices, edges)
82 return wire_network
83
84 def __init__(self):
85 """ Create empty a wire network.

Callers 10

wire_networkMethod · 0.80
form_wiresFunction · 0.80
get_brick5Method · 0.80
get_star_3DMethod · 0.80
get_star_2DMethod · 0.80
get_cross_3DMethod · 0.80
get_pattern1065Method · 0.80
mainFunction · 0.80
bevelFunction · 0.80
mainFunction · 0.80

Calls 1

loadMethod · 0.80

Tested by 5

get_brick5Method · 0.64
get_star_3DMethod · 0.64
get_star_2DMethod · 0.64
get_cross_3DMethod · 0.64
get_pattern1065Method · 0.64