mymesh.primitives.Box#

mymesh.primitives.Box(bounds, h, ElemType='quad')[source]#

Generate a surface mesh of a rectangular box.

Parameters:
  • bounds (list) – Six element list of bounds [xmin,xmax,ymin,ymax,zmin,zmax].

  • h (float) – Approximate element size.

  • ElemType (str, optional) – Specify the element type of the grid mesh. This can either be ‘quad’ for a quadrilateral mesh or ‘tri’ for a triangular mesh, by default ‘quad’.

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

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