| 61 | self.subdivide_method = method |
| 62 | |
| 63 | def inflate(self, thickness, per_vertex_thickness=True, |
| 64 | allow_self_intersection=False): |
| 65 | wires = self.wire_network.raw_wires |
| 66 | inflator = PyMesh.InflatorEngine.create("simple", wires) |
| 67 | if not allow_self_intersection: |
| 68 | inflator.self_intersection_is_fatal() |
| 69 | |
| 70 | if per_vertex_thickness: |
| 71 | if isinstance(thickness, numbers.Number): |
| 72 | thickness = np.ones(self.wire_network.num_vertices) * thickness |
| 73 | assert(len(thickness) == self.wire_network.num_vertices) |
| 74 | inflator.set_thickness_type(PyMesh.InflatorEngine.PER_VERTEX) |
| 75 | else: |
| 76 | if isinstance(thickness, numbers.Number): |
| 77 | thickness = np.ones(self.wire_network.num_edges) * thickness |
| 78 | assert(len(thickness) == self.wire_network.num_edges) |
| 79 | inflator.set_thickness_type(PyMesh.InflatorEngine.PER_EDGE) |
| 80 | inflator.set_thickness(thickness) |
| 81 | |
| 82 | self.__setup_geometry_correction(inflator) |
| 83 | self.__setup_subdivision(inflator) |
| 84 | self.__setup_profile(inflator) |
| 85 | |
| 86 | inflator.inflate() |
| 87 | |
| 88 | self.mesh_vertices = inflator.get_vertices() |
| 89 | self.mesh_faces = inflator.get_faces() |
| 90 | self.source_wire_id = inflator.get_face_sources() |
| 91 | |
| 92 | def inflate_periodic(self, parameters): |
| 93 | wires = self.wire_network.raw_wires |