Skip to content

Instantly share code, notes, and snippets.

@capitalaslash
Last active June 1, 2017 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capitalaslash/47c04578b8d34f42df5ff892b577b5be to your computer and use it in GitHub Desktop.
Save capitalaslash/47c04578b8d34f42df5ff892b577b5be to your computer and use it in GitHub Desktop.
gmsh ruled plain creation with wrong orientation
--- 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);
#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