<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dear all,<div class=""><br class=""></div><div class="">I just started using gmsh, and I am finding difficulties. My situation is easy right now: write a code that meshes a cracked domain.</div><div class=""><br class=""></div><div class="">As far as I’ve read, I can use a C++ code to create and mesh a domain. However, it seems that gmsh is way faster than my code, even if compiled in release. So, let’s say I have this .geo file (modified from t1.geo):</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">lc = 1;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Point(1) = { 0.0, 0.0, 0.0, lc } ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Point(2) = { 10.0, 0.0, 0.0, lc } ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Point(3) = { 10.0, 20.0, 0.0, lc } ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Point(4) = { 0.0, 20.0, 0.0, lc } ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Point(5) = { 0.0, 11.1, 0.0, lc } ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Point(6) = { 5.0, 10.0, 0.0, lc } ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Point(7) = { 0.0, 8.9, 0.0, lc } ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Line(1) = {1, 2} ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Line(2) = {2, 3} ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Line(3) = {3, 4} ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Line(4) = {4, 5} ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Line(5) = {5, 6} ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Line(6) = {6, 7} ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Line(7) = {7, 1} ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Line Loop(5) = { 1, 2, 3, 4, 5, 6, 7 } ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Plane Surface(6) = { 5 } ;</div></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><br class=""></div><div class="">The gmsh tool outputs a very nice mesh that I can visualize in paraview. Cool, it also takes very few seconds:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Running 'gmsh -2 a.geo -format vtk' [Gmsh 2.9.2, 1 node, max. 1 thread]</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Started on Thu Apr 23 15:26:57 2015</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Reading 'a.geo'...</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Done reading 'a.geo'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Meshing 1D...</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Meshing curve 1 (Line)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Meshing curve 2 (Line)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Meshing curve 3 (Line)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Meshing curve 4 (Line)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Meshing curve 5 (Line)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Meshing curve 6 (Line)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Meshing curve 7 (Line)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Done meshing 1D (0.001055 s)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Meshing 2D...</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Meshing surface 6 (Plane, Delaunay)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Done meshing 2D (0.022495 s)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : 300 vertices 605 elements</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Writing 'a.vtk'...</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Done writing 'a.vtk'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Info : Stopped on Thu Apr 23 15:26:58 2015</div></div><div class=""><br class=""></div><div class=""><br class=""><div class="">Ok, now I’ve developed my code, with two domains. The non-compiled one as you can see is a square, and it works like a charm. On the other hand, my cracked domain is a complete failure. So, here’s my test code:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">auto</span> t = <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">time</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">nullptr</span>);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">auto</span> tm = *<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">localtime</span>(&t);</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(82, 51, 147);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>GmshInitialize<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">();</span></div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">cout</span> << <span style="font-variant-ligatures: no-common-ligatures; color: #4f97ff" class="">"start @ "</span> << <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">put_time</span>(&tm, <span style="font-variant-ligatures: no-common-ligatures; color: #4f97ff" class="">"%d-%m-%Y %H-%M-%S"</span>) << <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">endl</span>;</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GModel</span> *m = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GModel</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #4f97ff" class="">"plate"</span>);</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(148, 82, 42);" class="">#if <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0</span></div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Add vertices</div><div style="margin: 0px;" class=""> vertex* v0 = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> vertex(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>);</div><div style="margin: 0px;" class=""> vertex* v1 = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> vertex(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>);</div><div style="margin: 0px;" class=""> vertex* v2 = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> vertex(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">2</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>);</div><div style="margin: 0px;" class=""> vertex* v3 = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> vertex(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">3</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>);</div><div style="margin: 0px;" class=""> m->add(v0);</div><div style="margin: 0px;" class=""> m->add(v1);</div><div style="margin: 0px;" class=""> m->add(v2);</div><div style="margin: 0px;" class=""> m->add(v3);</div><div style="margin: 0px; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Add edges counterclockwise</div><div style="margin: 0px;" class=""> edge* e0 = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> edge(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0</span>, v0, v1);</div><div style="margin: 0px;" class=""> edge* e1 = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> edge(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1</span>, v1, v2);</div><div style="margin: 0px;" class=""> edge* e2 = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> edge(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">2</span>, v2, v3);</div><div style="margin: 0px;" class=""> edge* e3 = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> edge(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">3</span>, v3, v0);</div><div style="margin: 0px;" class=""> m->add(e0);</div><div style="margin: 0px;" class=""> m->add(e1);</div><div style="margin: 0px;" class=""> m->add(e2);</div><div style="margin: 0px;" class=""> m->add(e3);</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Create a list of edges</div><div style="margin: 0px;" class=""> std::list<GEdge*> e { e0, e1, e2, e3 };</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Create the only face</div><div style="margin: 0px;" class=""> face* f = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> face(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0</span>, e);</div><div style="margin: 0px;" class=""> m->add(f);</div><div style="margin: 0px; color: rgb(148, 82, 42);" class="">#else</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">list</span><<span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">base</span>*> vertices;</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">list</span><<span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">base</span>*> edges;</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">list</span><<span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">face</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">base</span>*> faces;</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>* bl = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>* br = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">10.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>* tr = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">2</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">10.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">20.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>* tl = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">3</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">20.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>* cu = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">4</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">11.1</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>* ct = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">5</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">5.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">10.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>* cd = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">6</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">8.9</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>);</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// All vertices</div><div style="margin: 0px;" class=""> vertices.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(bl);</div><div style="margin: 0px;" class=""> vertices.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(br);</div><div style="margin: 0px;" class=""> vertices.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(tr);</div><div style="margin: 0px;" class=""> vertices.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(tl);</div><div style="margin: 0px;" class=""> vertices.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(cu);</div><div style="margin: 0px;" class=""> vertices.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(ct);</div><div style="margin: 0px;" class=""> vertices.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(cd);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">for</span> (<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">auto</span> &p : vertices) m-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">add</span>(p);</div><div style="margin: 0px; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>* be = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0</span>, bl, br);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>* re = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1</span>, br, tr);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>* te = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">2</span>, tr, tl);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>* l1 = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">3</span>, tl, cu);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>* eu = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">4</span>, cu, ct);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>* ed = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">5</span>, ct, cd);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>* l2 = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">6</span>, cd, bl);</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// All edges</div><div style="margin: 0px;" class=""> edges.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(be);</div><div style="margin: 0px;" class=""> edges.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(re);</div><div style="margin: 0px;" class=""> edges.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(te);</div><div style="margin: 0px;" class=""> edges.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(l1);</div><div style="margin: 0px;" class=""> edges.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(eu);</div><div style="margin: 0px;" class=""> edges.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(ed);</div><div style="margin: 0px;" class=""> edges.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(l2);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">for</span> (<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">auto</span> &p : edges) m-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">add</span>(p);</div><div style="margin: 0px; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">face</span>* f = <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">new</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">face</span>(m, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0</span>, edges);</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Add the only face</div><div style="margin: 0px;" class=""> faces.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(f);</div><div style="margin: 0px;" class=""> m-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">add</span>(f);</div><div style="margin: 0px; color: rgb(148, 82, 42);" class="">#endif</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px;" class=""> t = <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">time</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">nullptr</span>);</div><div style="margin: 0px;" class=""> tm = *<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">localtime</span>(&t);</div><div style="margin: 0px; color: rgb(79, 151, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">::</span><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">cout</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> << </span>"meshing @ "<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> << </span><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">::</span><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">put_time</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(&tm, </span>"%d-%m-%Y %H-%M-%S"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">) << </span><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">::</span><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">endl</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">;</span></div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Dimension is 2</div><div style="margin: 0px;" class=""> m-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">mesh</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">2</span>);</div><div style="margin: 0px; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px;" class=""> t = <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">time</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">nullptr</span>);</div><div style="margin: 0px;" class=""> tm = *<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">localtime</span>(&t);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">cout</span> << <span style="font-variant-ligatures: no-common-ligatures; color: #4f97ff" class="">"vtk @ "</span> << <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">put_time</span>(&tm, <span style="font-variant-ligatures: no-common-ligatures; color: #4f97ff" class="">"%d-%m-%Y %H-%M-%S"</span>) << <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">endl</span>;</div><div style="margin: 0px; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Write a VTK file to test</div><div style="margin: 0px; color: rgb(79, 151, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> m-></span><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">writeVTK</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span>"/Users/sensei/Desktop/a.vtk"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">);</span></div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Deallocate or else gmsh fails miserably</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">delete</span> m;</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(82, 51, 147);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>GmshFinalize<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">();</span></div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px;" class=""> t = <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">time</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">nullptr</span>);</div><div style="margin: 0px;" class=""> tm = *<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">localtime</span>(&t);</div><div style="margin: 0px;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">cout</span> << <span style="font-variant-ligatures: no-common-ligatures; color: #4f97ff" class="">"end @ "</span> << <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">put_time</span>(&tm, <span style="font-variant-ligatures: no-common-ligatures; color: #4f97ff" class="">"%d-%m-%Y %H-%M-%S"</span>) << <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">endl</span>;</div></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">In release mode, it takes about five minutes! </div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><b class="">start @ 23-04-2015 15-44-57</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><b class="">meshing @ 23-04-2015 15-44-57</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><b class="">vtk @ 23-04-2015 15-49-49</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><b class="">end @ 23-04-2015 15-49-49</b></div></div><div class=""><b class=""><br class=""></b></div><div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><span style="orphans: auto; widows: auto;" class="">I must me doing something VERY wrong with my code, so I am resorting to you. Being a newbie with gmsh, I expect I am doing something very stupid! </span></div><div class=""><span style="orphans: auto; widows: auto;" class=""><br class=""></span></div><div class=""><span style="orphans: auto; widows: auto;" class="">Moreover, when I open the output vtk in paraview, it seems it has NO FACES at all. </span></div><div class=""><span style="orphans: auto; widows: auto;" class=""><br class=""></span></div><div class=""><span style="orphans: auto; widows: auto;" class="">At the end of the mail you will find my custom classes for vertices, edges, and faces.</span></div><div class=""><span style="orphans: auto; widows: auto;" class=""><br class=""></span></div><div class=""><span style="orphans: auto; widows: auto;" class="">Thanks for any hints you can give me!</span></div><div class=""><span style="orphans: auto; widows: auto;" class=""><br class=""></span></div><div class=""><span style="orphans: auto; widows: auto;" class="">Cheers & Thanks!</span></div><div class=""><span style="orphans: auto; widows: auto;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Franco</span></div><div class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>/fm</div><div class=""><div apple-content-edited="true" style="orphans: auto; widows: auto;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; orphans: 2; widows: 2; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class="">-- </div><div class="">Franco Milicchio <<a href="mailto:fmilicchio@me.com" class="">fmilicchio@me.com</a>></div><div class=""><br class=""></div><div class="">DIA - Dept. of Engineering</div><div class="">University Roma Tre</div></div><a href="http://plm.dia.uniroma3.it/milicchio/" class="">http://plm.dia.uniroma3.it/milicchio/</a></div><div class=""><br class=""></div></span></div></span></div></span></div></div></div></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 151, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #94522a" class="">#include </span>"GVertex.h"</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(148, 82, 42);" class="">#include <span style="font-variant-ligatures: no-common-ligatures; color: #4f97ff" class="">"GEdge.h"</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(148, 82, 42);" class="">#include <span style="font-variant-ligatures: no-common-ligatures; color: #4f97ff" class="">"GFace.h"</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class="">// Forward class definition</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">class</span> GModel;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class="">// Vertex class</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">class</span> vertex : <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">public</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GVertex</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">{</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GPoint</span> p_;</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(4, 51, 255);" class="">public<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">:</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Base class (useful)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">typedef</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GVertex</span> base;</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Constructor</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> vertex(<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GModel</span> *m, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">int</span> idx, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> x, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> y, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> z, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> length = <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">10e-1</span>) : <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GVertex</span>(m, idx, length), <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">p_</span>(x, y, z)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #929292" class="">// NOP</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Destructor</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">virtual</span> ~vertex()</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #929292" class="">// NOP</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Return the vertex coordinates</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">virtual</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GPoint</span> point() <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">const</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">p_</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Return the vertex X coordinate</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(4, 51, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>virtual<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>double<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> x() </span>const</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">p_</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">x</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Return the vertex Y coordinate</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(4, 51, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>virtual<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>double<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> y() </span>const</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">p_</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">y</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Return the vertex Z coordinate</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(4, 51, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>virtual<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>double<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> z() </span>const</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">p_</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">z</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Set the position of the vertex</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">virtual</span> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">void</span> setPosition(<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GPoint</span> &p)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">p_</span> = p;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">};</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class="">// Vertex class</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(4, 51, 255);" class="">class<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> edge : </span>public<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GEdge</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">{</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(4, 51, 255);" class="">public<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">:</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Base class (useful)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">typedef</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GEdge</span> base;</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Constructor</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> edge(<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GModel</span> *m, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">int</span> idx, <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">base</span> *v0, <span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">vertex</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">base</span> *v1) : <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GEdge</span>(m, idx, v0, v1)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #929292" class="">// NOP</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Destructor</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">virtual</span> ~edge()</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #929292" class="">// NOP</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Parametric bounds (?)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">virtual</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">Range</span><<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span>> parBounds(<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">int</span> i) <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">const</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">Range</span><<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span>>(<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Return the parametric point, with 0 <= p <= 1</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(4, 51, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>virtual<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GPoint</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> point(</span>double<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> p) </span>const</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> x = (<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1</span> - p) * <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">v0</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">x</span>() + p * <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">v1</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">x</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> y = (<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1</span> - p) * <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">v0</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">y</span>() + p * <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">v1</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">y</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> z = (<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1</span> - p) * <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">v0</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">z</span>() + p * <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">v1</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">z</span>();</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GPoint</span>(x, y, z, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">this</span>, p);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Return the first derivative on the edge (parametrized with 0 <= p <= 1)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">virtual</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SVector3</span> firstDer(<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> p) <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">const</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> x = - <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">v0</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">x</span>() + <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">v1</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">x</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> y = - <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">v0</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">y</span>() + <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">v1</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">y</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> z = - <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">v0</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">z</span>() + <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">v1</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">z</span>();</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SVector3</span>(x, y, z);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">};</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class="">// Face class</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(4, 51, 255);" class="">class<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> face : </span>public<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GFace</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">{</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(4, 51, 255);" class="">public<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">:</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Base class (useful)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">typedef</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GFace</span> base;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Constructor</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> face(<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GModel</span> *m, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">int</span> idx, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">const</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">std</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">list</span><<span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">edge</span>::<span style="font-variant-ligatures: no-common-ligatures; color: #4f9192" class="">base</span>*> &edges) : <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GFace</span>(m, idx)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(82, 51, 147);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>edgeLoops<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">.</span>push_back<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span>GEdgeLoop<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(edges));</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">for</span> (<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">auto</span> it = edges.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">begin</span>(); it != edges.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">end</span>(); ++it)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GEdge</span> *e = *it;</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">l_edges</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(e);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> e-><span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">addFace</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">this</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">l_dirs</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">push_back</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(82, 51, 147);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>computeMeanPlane<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">();</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Destructor</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">virtual</span> ~face()</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #929292" class="">// NOP</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Return the parametric bounds (?)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">Range</span><<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span>> parBounds(<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">int</span> i) <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">const</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">Range</span><<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span>>(<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1.0</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Return the parametric point, with 0 <= p_i <= 1</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">virtual</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GPoint</span> point(<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> p_0, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> p_1) <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">const</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> pp[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">2</span>] = { p_0, p_1 };</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> x, y, z, VX[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">3</span>], VY[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">3</span>];</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">getMeanPlaneData</span>(VX, VY, x, y, z);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GPoint</span>(x + VX[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0</span>] * p_0 + VY[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0</span>] * p_1,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> y + VX[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1</span>] * p_0 + VY[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1</span>] * p_1,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> z + VX[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">2</span>] * p_0 + VY[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">2</span>] * p_1, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">this</span>, pp);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Return the first derivative on the edge (parametrized with 0 <= p_i <= 1)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(82, 51, 147);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">virtual</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>Pair<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><</span>SVector3<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">,</span>SVector3<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">> firstDer(</span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">const</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>SPoint2<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> &p) </span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">const</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">double</span> x, y, z, VX[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">3</span>], VY[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">3</span>];</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">getMeanPlaneData</span>(VX, VY, x, y, z);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">Pair</span><<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SVector3</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SVector3</span>>(<span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SVector3</span>(VX[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0</span>], VX[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1</span>], VX[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">2</span>]),</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SVector3</span>(VY[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0</span>], VY[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">1</span>], VY[<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">2</span>]));</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Return the second derivative on the face (parametrized with 0 <= p_i <= 1)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">virtual</span> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">void</span> secondDer(<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">const</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SPoint2</span> ¶m, <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SVector3</span> *dudu, <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SVector3</span> *dvdv, <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SVector3</span> *dudv) <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">const</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// No derivative: this is a PLANAR FACE, no curvature</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> *dudu = <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SVector3</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> *dvdv = <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SVector3</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> *dudv = <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">SVector3</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0.0</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// Return the geometric type of the face, i.e., a plane face</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">virtual</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">GeomType</span> geomType() <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">const</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #523393" class="">Plane</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">};</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div></div></div></div></span></div></span></div></span></div></div></div><br class=""></div></body></html>