[Gmsh] How can I classify faces of an imported OPEN CASCADE geometry by color?

Christophe Geuzaine cgeuzaine at uliege.be
Tue Nov 5 16:14:11 CET 2019



> On 5 Nov 2019, at 15:32, Wesley Ranger <metorm at outlook.com> wrote:
> 
> Say we have an uncertain polyhedron, which is built via CAD software. Some of its faces contact with other objects and are thus painted red, and the other faces are painted blue.
> 
> Naturally, I want to *Merge* the shape into Gmsh, and assign the faces into different physical groups by color. I am glad to see that the OpenCASCADE CAD kernel is now able to read "color & label information" from step files. But I haven't managed to find any clue on utilizing such information to set meshing options.
> 
> Can someone please show me an example to do this? Either script or API is OK.
> 

See e.g. https://gitlab.onelab.info/gmsh/gmsh/blob/master/demos/api/step_assembly.py, which shows how to exploit labels. Colors can be accessed in a similar way (using getColor instead of getName).

Christophe




> Best Regards
> 
> Ran Wei
> _______________________________________________
> gmsh mailing list
> gmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh

— 
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