[Gmsh] How to swith surface normal of a step file and to export this orientation in .mesh format

Christophe Geuzaine cgeuzaine at ulg.ac.be
Fri Apr 5 17:11:19 CEST 2013


On 05 Apr 2013, at 12:45, Christophe Geuzaine <cgeuzaine at ulg.ac.be> wrote:

> 
> On 19 Mar 2013, at 11:14, NENNIG Benoit <benoit.nennig at supmeca.fr> wrote:
> 
>> Dear gmsh team,
>> 
>> I would like to switch orientation of surfaces coming from a part design by FreeCAD and export in step format.
>> - I try to reverse normal orientation in the FreeCAD (MyShape.reverse() ??) but in gmsh nothing change (however I am not sure of how is made the export in step and if step can store inward normal vector....)
>> - I try the "classical" gmsh version :
>>   Physical Surface (1) = {-SufList[]}; 
>> It works for .msh format (native gmsh) but in .mesh (inria format) only the label is change into -label but the orientation remain the same...
>> - flip all mesh normal is not possible because I have other shape in my mesh, not concerned with this problem.
>> 
>> Do you have an idea ?
>> 
> 
> I think we should provide an explicit interface to orient (or just "revert" w.r.t. the natural orientation) the mesh.
> 
> The new MSH3 format will not change the orientation of the elements at "write" time, as this makes the on-disk representation different from the "in-memory" representation. The ".mesh" format is already "correct" in that sense.
> 
> I've filed this as https://geuz.org/trac/gmsh/ticket/191 
> 

This is now fixed in SVN r15204. You can simply use the following commands in your .geo file:

  Reverse Surface { ... };

or

  Reverse Line { ... };

to reverse the mesh orientation (compared to the natural orientation, which matches the orientation of the underlying geometrical entity).



> 
>> Thanks!
>> 
>> Benoit
>> 
>> ps : In .msh format, I observe that if the surface has strong variation close a small inner corner, the element orientation may be random close to the inner corner if there is only one element on the corner thickness. 
>> 
> 
> Hmm... When there is no inner vertex we resort to a simple geometrical test at the barycenter of an element. Could you send a simple example?
> 
> Thanks,
> 
> Christophe
> 
> 
> 
> 
>> 
>> _______________________________________________
>> gmsh mailing list
>> gmsh at geuz.org
>> http://www.geuz.org/mailman/listinfo/gmsh
> 
> -- 
> Prof. Christophe Geuzaine
> University of Liege, Electrical Engineering and Computer Science 
> http://www.montefiore.ulg.ac.be/~geuzaine
> 
> 
> 

-- 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science 
http://www.montefiore.ulg.ac.be/~geuzaine







More information about the gmsh mailing list