<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div>Thanks Christophe for replying. I have attached a picture after adding the line you suggested. </div><div>In the picture you can also see the API version I am using and built number. The size of triangles does not respond to any value set on ‘lc’.</div><div>Best,</div><div>Alejandro </div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Christophe Geuzaine <<a href="mailto:geuzaine@gmail.com">geuzaine@gmail.com</a>><br><span style="font-weight:bold">Date: </span> Monday, May 21, 2018 at 7:36 AM<br><span style="font-weight:bold">To: </span> Alejandro Pina <<a href="mailto:ajpina@gmail.com">ajpina@gmail.com</a>><br><span style="font-weight:bold">Cc: </span> <<a href="mailto:gmsh@onelab.info">gmsh@onelab.info</a>><br><span style="font-weight:bold">Subject: </span> Re: [Gmsh] Gmsh Python API<br></div><div><br></div><div><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div>It works fine over here: are you sure you are editing/examining the correct input/output files?<div class=""><br class=""></div><div class="">Add</div><div class=""><br class=""></div><div class=""> gmsh.fltk.run()</div><div class=""><br class=""></div><div class="">before gmsh.finalize() - it will launch the GUI so that you can inspect the model interactively.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 20 May 2018, at 21:03, Alejandro Pina <<a href="mailto:ajpina@gmail.com" class="">ajpina@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;" class=""><div class="">Dear List,</div><div class=""><br class=""></div><div class="">I have been trying to use the Python API but my meshing does not respond to the mesh size that I set when adding the points. I reproduced my problem in the following example. So no matter what value I set on ‘lc’, the surface always happens to have only four triangles.</div><div class=""><br class=""></div><div class="">Hope you can help me figure it out and be able to control the meshing. I am also attaching the resulting 'MyTest.msh’ file. </div><div class=""><br class=""></div><div class=""><div class="">import gmsh</div><div class=""><br class=""></div><div class="">gmsh.initialize()</div><div class="">gmsh.option.setNumber("General.Terminal", 1)</div><div class="">gmsh.model.add("MyTest")</div><div class="">lc = 1e-4</div><div class="">gmsh.model.geo.addPoint(0, 0, 0, lc, 1)</div><div class="">gmsh.model.geo.addPoint(.1, 0, 0, lc, 2)</div><div class="">gmsh.model.geo.addPoint(.1, .3, 0, lc, 3)</div><div class="">gmsh.model.geo.addPoint(0, .3, 0, lc, 4)</div><div class="">gmsh.model.geo.addLine(1, 2, 1)</div><div class="">gmsh.model.geo.addLine(3, 2, 2)</div><div class="">gmsh.model.geo.addLine(3, 4, 3)</div><div class="">gmsh.model.geo.addLine(4, 1, 4)</div><div class="">gmsh.model.geo.addCurveLoop([4, 1, -2, 3], 1)</div><div class="">gmsh.model.geo.addPlaneSurface([1], 1)</div><div class="">gmsh.model.addPhysicalGroup(2, [1], 1)</div><div class="">gmsh.model.setPhysicalName(2, 1, "My surface")</div><div class="">gmsh.model.geo.synchronize()</div><div class="">gmsh.model.mesh.generate(2)</div><div class="">gmsh.write("MyTest.msh")</div><div class="">gmsh.finalize()</div></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Alejandro</div><div class=""><br class=""></div><div class=""><br class=""></div></div><span id="cid:9025B45E-9736-4A2E-844D-8A1022026F57@home"><MyTest.msh></span>_______________________________________________<br class="">gmsh mailing list<br class=""><a href="mailto:gmsh@onelab.info" class="">gmsh@onelab.info</a><br class=""><a href="http://onelab.info/mailman/listinfo/gmsh">http://onelab.info/mailman/listinfo/gmsh</a><br class=""></div></blockquote></div><br class=""></div></div></div></span></body></html>