fastpli.model.sandbox.seeds.triangular_grid
- triangular_grid(width, height, spacing, center=False, sort=True, endpoint=True)[source]
Generated 2d triangular grid of seed points inside [0,width]x[0,height].
- Parameters
width, height (float) – length and height of grid [0,width]x[0,height]
spacing (float) – distance between seed points
center (bool, optional) – If false, the seed points will be inside [0,width]x[0,height], beginning at (0,0). If true, the grid will be inside [-width/2,width/2]x[-height/2,height/2] with widths eed point at (0,0).
sort (bool, optional) – If true, the returning seed points are lexsorted along x,y.
endpoint (bool, optional) – If false, [0,width)x[0,height) or [-width/2,width/2)x[-height/2,height/2). If true, [0,width]x[0,height] or [-width/2,width/2]x[-height/2,height/2].
- Returns
res – seed points
- Return type
(nx2)-array