TexGen
MeshDomainPlane.h
Go to the documentation of this file.
1/*=============================================================================
2TexGen: Geometric textile modeller.
3Copyright (C) 2019 Louise Brown
4
5This program is free software; you can redistribute it and/or
6modify it under the terms of the GNU General Public License
7as published by the Free Software Foundation; either version 2
8of the License, or (at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18=============================================================================*/
19
20#pragma once
21
22#include "Mesh.h"
23#include "tetgen.h"
24
25namespace TexGen
26{
31 using namespace std;
32
34 struct PLANEPARAMS {
39 };
40
42 {
43 public:
44 CMeshDomainPlane(double Seed, bool bFillEnds=true);
45 virtual ~CMeshDomainPlane(void);
46
47 void MeshDomainPlanes(bool bPeriodic);
48
49 protected:
51 bool Triangulate(vector< vector<XY> > &PolygonPoints, vector<XY> &HolePoints, CMesh& OutputMesh, PLANEPARAMS& ConvertRef);
52
54 bool ConvertDomainPointsTo2D(const list<int> &Indices, CMesh& DomainMesh, int numNodes, vector<XY>& Points2D, PLANEPARAMS& ConvertRef);
55
57 void Convert2DTo3DCoordinates(vector<XY>& Points2D, vector<XYZ>& Points3D, PLANEPARAMS& ConvertRef);
59 void Convert3DTo2DCoordinates(vector<XYZ>& Points3D, PLANEPARAMS& ConvertRef, vector<XY>& Points2D);
61 void SeedSides(vector<XY>& Points);
63 void OffsetMeshPoints(CMesh& Mesh, XYZ& Normal, double dDist);
64
66 vector<CMesh> m_DomainMeshes;
68 vector<CMesh> m_TriangulatedMeshes;
70 double m_Seed;
72 vector<vector<int> > m_PolygonNumVertices;
75 };
76}; // namespace TexGen
#define CLASS_DECLSPEC
Definition: Misc.h:35
double m_Seed
Seed used for calculating boundary edge points.
vector< vector< int > > m_PolygonNumVertices
Number of polygon vertices on each face. Number of outer vector members = number of faces.
bool m_bFillEnds
True if yarn areas are to be removed from domain.
vector< CMesh > m_DomainMeshes
Vector of meshes used to store domain plane meshes.
vector< CMesh > m_TriangulatedMeshes
Vector of triangulated domain plane meshes.
Defines the nodes and elements of a surface or volume mesh.
Definition: Mesh.h:58
Namespace containing a series of customised math operations not found in the standard c++ library.
Structure which contains information for transformation from 3D to 2D plane.
Struct for representing points in 3D space.
Definition: mymath.h:56