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

Method inflate

python/pymesh/wires/Inflator.py:63–90  ·  view source on GitHub ↗
(self, thickness, per_vertex_thickness=True,
            allow_self_intersection=False)

Source from the content-addressed store, hash-verified

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

Callers 10

test_simpleMethod · 0.95
test_tiledMethod · 0.95
test_profileMethod · 0.95
inflate_supportsFunction · 0.95
tile_with_guide_boxFunction · 0.95
tile_with_guide_meshFunction · 0.95
tile_with_mixed_patternsFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
inflate_periodicMethod · 0.45

Calls 10

__setup_subdivisionMethod · 0.95
__setup_profileMethod · 0.95
createMethod · 0.45
set_thickness_typeMethod · 0.45
set_thicknessMethod · 0.45
get_verticesMethod · 0.45
get_facesMethod · 0.45
get_face_sourcesMethod · 0.45

Tested by 3

test_simpleMethod · 0.76
test_tiledMethod · 0.76
test_profileMethod · 0.76