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

Function split_hex_into_tets

python/pymesh/meshutils/generate_box_mesh.py:285–310  ·  view source on GitHub ↗

Convert a hex to 24 tets. Algorithm: Each hex is split into 6 tets. The resulting tet mesh does not symmetric connectivities. Corner ordering: 7 _______ 6 /: /| z 4 /______/ | | | : 5| | | y | :... |.| | /

(corners)

Source from the content-addressed store, hash-verified

283 return subcell_corners
284
285def split_hex_into_tets(corners):
286 """ Convert a hex to 24 tets.
287 Algorithm: Each hex is split into 6 tets. The resulting tet mesh does not
288 symmetric connectivities.
289
290 Corner ordering:
291 7 _______ 6
292 /: /| z
293 4 /______/ | |
294 | : 5| | | y
295 | :... |.| | /
296 | . 3 | /2 |/
297 |_______|/ /-------x
298 0 1
299
300 """
301 vertices = np.array(corners)
302 tets = np.array([
303 [0, 3, 7, 6],
304 [0, 3, 6, 2],
305 [0, 2, 6, 1],
306 [5, 0, 6, 1],
307 [5, 0, 4, 6],
308 [6, 0, 4, 7],
309 ])
310 return vertices, tets
311
312def split_hex_into_tets_symmetrically(corners):
313 """ Convert a hex to 24 tets.

Callers 2

hex_to_tetFunction · 0.85
generate_3D_box_meshFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected