-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeshFactory.h
More file actions
20 lines (18 loc) · 893 Bytes
/
meshFactory.h
File metadata and controls
20 lines (18 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once
#include "mesh.h"
#include "point3.h"
#include "vector3.h"
#include "size2.h"
#include "size3.h"
#include "plane.h"
namespace libMesh {
class MeshFactory {
public:
static Mesh *box(Point3 center, Size2 size, Vector3 xAxis, Vector3 yAxis, float length);
static Mesh *cylinder(Point3 center, float diameter, Vector3 xAxis, Vector3 yAxis, float length, unsigned int numFaces = 40);
private:
static void makeFaceFromRectangle(std::vector<Vertex> &vertices, std::vector<Index3> &indices, Plane &plane, Size2 size);
static void makeFaceFromParallelCurves(std::vector<Vertex> &vertices, std::vector<Index3> &indices, Point3 *left, Point3 *right, size_t size);
static void makeFaceAroundCenter(std::vector<Vertex> &vertices, std::vector<Index3> &indices, Point3 center, Point3 *edge, size_t size);
};
}