carputils.mesh
.Gridcarputils.mesh.
Grid
(lowerleft, upperright, resolution=0.1, fibres=(1.0, 0.0), triangulate=False)Generate a two dimensional mesh of a regular grid.
The generated mesh is aligned along the x-y plane, with z set to 0. Nodes are arranged on a regularly spaced grid and connected by quad elements. The mesh is defined by the x,y coordinates of the lower left and upper right corners and the mesh resolution, in mm.
To generate a mesh from 0,0 to 10,10, with 0.1mm spacing:
>>> geom = Grid((0,0), (10,10), 0.1)
>>> geom.generate_carp('mesh/grid')
Constant fibre vectors are set by the fibres optional command line
argument, which defaults to be aligned with the positive x direction. The
mesh may also be triangulated by use of the triangulate
argument.
For more information on defining mesh regions etc., please see the mesh_generation section of the documentation.