This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How to Set Face Orientation from Mesh Function (on Surfaces without Interior)?

+1 vote

Dear all,

we have a surface scan from a 3D scanner and want to load this scanner data into FEniCS. Afterwards, we want to create an RT-Function space on this surface.

Creating RT-Function Spaces on surfaces demand a global cell orientation.

As per the documentation, this is done by calling

mesh.init_cell_orientations(EXPRESSION)

However, our geometry is not convex and rather complicated with cavities (but still orientable). IMHO, it's not possible to define a single, global (analytical) expression to orient the faces with.

Is there a possibility to initialize an RT-Space on a surface with e.g. a per facet normal manually provided as a DG0-function or a per-face mesh function?

asked Dec 12, 2016 by sschmidt FEniCS Novice (490 points)

1 Answer

+1 vote

There is no current interface for setting the cell orientations in any other way than via an Expression. This could easily be extended however to other types e.g. a DG0 or a MeshFunction if that is of interest.

But, to clarify, what information do you have available regarding global orientation? Do you know the outward direction of each outer surface?

answered Dec 12, 2016 by Marie E. Rognes FEniCS User (5,380 points)

Many thanks for the quick reply!

The quick answer is:
Yes, we know the outward direction of each face and need an interface within Python FEniCS where we can put this information.

The long answer below:
We are getting the scanner data as Wavefront .obj files.

Those are ascii-files containing vertices, edges (=faces), textures, etc.

The normals are either given explicitly in the .obj file per stored facet or implicitly via a uniform ordering of the vertices per face within the file.

We have written a dolfin-convert-like tool to read the mesh geometry out of the .obj into FEniCS using the mesh editor in parallel and we also wrote a converter to load the accompanying texture of the scanned object into a CG-1 function on the surface.

We are just missing a way to get the normal into FEniCS as they are implicitly or explicitly given inside the .obj file. Having a methodology to load the texture as a CG-1 function on the surface, it would be great if we could provide the normal as e.g. a DG-0 function on the surface or a similar mesh function.

...