Last active
June 1, 2017 12:40
-
-
Save capitalaslash/47c04578b8d34f42df5ff892b577b5be to your computer and use it in GitHub Desktop.
gmsh ruled plain creation with wrong orientation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- gmsh-3.0.2-source-orig/Geo/GModelFactory.cpp 2017-06-01 14:00:32.312450002 +0200 | |
+++ gmsh-3.0.2-source/Geo/GModelFactory.cpp 2017-06-01 14:00:52.182585146 +0200 | |
@@ -177,7 +177,7 @@ | |
int numEdge = edges[i][j]->tag(); | |
List_Add(temp, &numEdge); | |
} | |
- SortEdgesInLoop(numl, temp); | |
+ SortEdgesInLoop(numl, temp, true); | |
EdgeLoop *l = CreateEdgeLoop(numl, temp); | |
vecLoops.push_back(l); | |
Tree_Add(gm->getGEOInternals()->EdgeLoops, &l); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Gmsh.h> | |
#include <GModel.h> | |
int main(int argc, char* argv[]) | |
{ | |
GmshInitialize(argc, argv); | |
GModel* m { new GModel() }; | |
m->setFactory("Gmsh"); | |
GVertex* v1 { m->addVertex(0.0, 0.0, 0.0, 0.1) }; | |
GVertex* v2 { m->addVertex(1.0, 0.0, 0.0, 0.1) }; | |
GVertex* v3 { m->addVertex(1.0, 1.0, 0.0, 0.1) }; | |
GVertex* v4 { m->addVertex(0.0, std::cos(M_PI/6.), std::sin(M_PI/6.), 0.1) }; | |
std::vector<GEdge*> edges; | |
edges.push_back(m->addLine(v1, v2)); | |
edges.push_back(m->addLine(v2, v3)); | |
edges.push_back(m->addLine(v4, v3)); | |
edges.push_back(m->addLine(v4, v1)); | |
std::vector<std::vector<GEdge*>> loop; | |
loop.push_back(edges); | |
// GFace* face = m->addPlanarFace(loop); | |
std::vector<GFace*> faces = m->addRuledFaces(loop); | |
// m->mesh(2); | |
m->writeGEO("ruled.geo"); | |
// m->writeMSH("ruled.msh"); | |
// delete m; | |
GmshFinalize(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment