title: Questions about the Gmsh Python API
body: <p>I am trying to write a script that will automatically mesh geometries for CFD analysis using the Gmsh Python API. There are a few issues I am running into:</p>
  
  <p>First of all, I would like to be able to write Gmsh script files (<em>.geo</em>) for debugging purposes. I looked through the source code of the Gmsh API and found that the <em>.geo_unrolled</em> extension is supported for the <code>gmsh.write()</code> function, but not just <em>.geo</em>. This extension does the trick mostly, but it seems that any meshing operations (such as marking curves as transfinite) or transformations (such as dilate) are not written to the output file when using <code>gmsh.write('test.geo_unrolled')</code>. I assume this has something to do with the <em>_unrolled</em> part. But is there any way to get the full Gmsh script out of the API?</p>
  
  <p>Secondly, when I try to make a copy of a spline like in this example:</p>
  
  <pre><code>p1 = gmsh.model.geo.addPoint(-1, 0.5, 0, 0.1)
  p2 = gmsh.model.geo.addPoint(0, 1, 0, 0.1)
  p3 = gmsh.model.geo.addPoint(1, 0.5, 0, 0.1)
  s1 = gmsh.model.geo.addSpline([p1, p2, p3])
  s2 = gmsh.model.geo.copy([s1])
  </code></pre>
  
  <p>I get <code>ValueError: ('gmshModelGeoCopy returned non-zero error code: ', 1)</code>. The error code, <code>1</code>, seems to indicate that the tag of the original spline (<code>s1</code>) cannot be found when <code>copy()</code> is called. Am I missing something here? I have tried, for example, to call <code>gmsh.model.geo.synchronize()</code> before attempting to call <code>copy()</code>, but this had no effect.</p>
  
  <p>Finally, when I use the dilate transformation in the Gmsh GUI using <em>Modules - Geometry - Elementary entities - Transform - Scale</em>, checking the <em>Apply scaling on copy</em> option in the dialog, on the example spline from above, I indeed get a scaled version of the curve as expected, including the three points. Assuming I was able to accomplish the same with the API, how do I then refer to the three new points that the scaled spline goes through, for example, if I wanted to draw a line between the start point of the original spline and that of the scaled spline?</p>
  
  <p>In the end, what I want to accomplish is the following: draw a spline through a list of points, create a scaled copy of this spline, draw lines between the start and end points, and create a plane surface bounded by the two splines and lines. Is there a better way to do this than what I am trying to do with the dilation?</p>