mymesh.primitives.Box#

mymesh.primitives.Box(vertices, n, ElemType='hex', Type='vol')[source]#

Generate a mesh of box.

Parameters:
  • vertices (list) – Array of box vertices (shape = (8,3)).

  • n (int, tuple) – Number of elements along each edge of the box.

  • ElemType (str, optional) – Specify the element type of the grid mesh.

  • Type (str, optional) – Mesh type of the final mesh. This could be ‘surf’ for a surface mesh or ‘vol’ the full volumetric grid, by default ‘vol’.

Returns:

  • box (mymesh.mesh) – Mesh object containing the box mesh.

  • .. note:: – Due to the ability to unpack the mesh object to NodeCoords and NodeConn, the NodeCoords and NodeConn array can be returned directly (instead of the mesh object) by running: NodeCoords, NodeConn = primitives.Box(...)

Examples

vertices = [[0,0,0],
            [1,0,0],
            [1,1,0],
            [0,1,0],
            [0,0,1],
            [1,0,1],
            [1,1,1],
            [0,1,1]
            ]
box = primitives.Box(vertices, 10, ElemType='tet')
box.plot(bgcolor='w', show_edges=True)
../../_images/mymesh-primitives-Box-1.png