-
Notifications
You must be signed in to change notification settings - Fork 44
/
MRRegularGridMesh.h
28 lines (24 loc) · 1.15 KB
/
MRRegularGridMesh.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
#include "MRMeshFwd.h"
#include "MRMesh.h"
#include "MRVector3.h"
#include "MRProgressCallback.h"
#include "MRExpected.h"
#include <functional>
namespace MR
{
// Lambda for validating grid lattice
using RegularGridLatticeValidator = std::function<bool( size_t x, size_t y )>;
// Lambda for getting lattice position
using RegularGridLatticePositioner = std::function<Vector3f( size_t x, size_t y )>;
// Lambda for validating mesh face
using RegularGridMeshFaceValidator =
std::function<bool( size_t x0, size_t y0, size_t x1, size_t y1, size_t x2, size_t y2 )>;
// Creates regular mesh with points in valid grid lattice
MRMESH_API Mesh makeRegularGridMesh( size_t width, size_t height,
const RegularGridLatticeValidator& validator,
const RegularGridLatticePositioner& positioner,
const RegularGridMeshFaceValidator& faceValidator = {} );
// Creates regular mesh from monotone (connects point with closed x, y neighbors) points
MRMESH_API Expected<Mesh, std::string> makeRegularGridMesh( VertCoords pc, ProgressCallback cb = {} );
}