[Gmsh] Line / edge / curve direction - how to change it to use Progression properly (transfinite curve)

Christophe Geuzaine cgeuzaine at uliege.be
Fri Jan 24 13:10:20 CET 2020

> On 14 Jan 2020, at 17:57, triimaran <triimaran at gmail.com> wrote:
> Hello everyone,
> is there any way to change all selected lines/curves to have the same direction?
> I want to make a structured mesh for a simple room with a rectangular heater inside and rectangular inlet and outlet on different walls. All geometry lines I have are either parallel or perpendicular. All I need is to choose some parallel lines in one view and set the progression so that the mesh will be finer near a wall. Unfortunately lines from both imported or created geometries tend to have quite random directions. I know that I can change in geo file particular lines in Transfinite Curve function by writing minuses ("-") before chosen curves (e.g. Transfinite Curve {1, -3, -4, 6}), but this solution is ok just for geometries with not too many lines. It is even more troublesome and unreasonably time consuming when imported geometries have a lot (usualy x4) duplicated lines.

Using the API you could iterate over all the curves, check the orientation (using e.g. getDerivative()), and set the meshing constraint based on that.


> And here comes my second, minor problem:
> Coherence function does nothing in this case. When I import STEP file there is even no way to delete any part of the geometry. When importing IGES the Delete option works, but lines are also duplicated and to delete them I would have to delete first all volumes and surfaces, then create them again, which is also too time consuming for a bit more complex geometries. Although, I guess, if all chosen lines could have direction changed as mentioned above, then duplicated lines should not be a problem, because I could use "Coherence Mesh" at the end of meshing (which seems to work properly).
> Edit: when trying it now Delete function does not work also for the .iges imported geometry. I have no idea what has changed.
> Please find attached geometries (I used only .step and .iges because exporting to .brep was always filling it with a lot of triangles). These geometries are just for an example (made in Fusion 360, I was trying hard to use FreeCAD but failed to use slicing functions to make it possible to export). In the .geo file I used the Transfinite Curve for one set of lines to make the problem more clear (mesh 1 and then 2D).
> In the attached pictures there is how my final geometries will look like (made in Gambit - I am trying not to use it further also because of the same problem: no way to change the lines' directions and after one meshing they all become random, so to change something I would have to delete everything and start all over).
> This is my first time writing here so please forgive me in case some of these problems are obvious to solve.
> Best regards
> J.
> <view_gambit2.png>
> <view_gambit1.png>
> <example_structured.iges><example_structured.step><example_structured.geo>_______________________________________________
> gmsh mailing list
> gmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh

Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science 

More information about the gmsh mailing list