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)
| 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. |