Skip to main content
Question

Normal Vectors

  • 15 July 2024
  • 1 reply
  • 54 views

In the 3D modeled buildings, some normal vectors on the exterior walls are pointing to the right while others are pointing to the left. How can I identify and reverse the vectors that are pointing to the right, so that they all point to the left?

I attached sample buildings.

1 reply

Userlevel 5
Badge +32

I think this is a bit of an unsolved puzzle. A polygon on it’s own has no context - In this dataset for example when each surface is looked at on it’s own there is no way to tell what the correct orientation is. 

In FME the way to try and solve this is to collect the geometry into a CompositeSurface or Solid. Once you have a CompositeSurface or Solid you can then use the GeometryValidator to test for Surface Orientation, Solid Boundaries and Solid Orientation. if an error in orientation is detected then a repair can be attempted. It’s fairly common that FME is unable to fully repair an object

You can read more about the GeometryValidator here.https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Transformers/Transformers/geometryvalidator.htm - It’s important to note that certain tests require that other issues not be present. It can be that you will need to use multiple GeometryValidators in a workflow.

Here is workflow I have used in the past to try and repair surfaces which have been incorrectly oriented. 

  1. Make sure that all your polygons are single areas. You can use a deaggregator to make sure there are no multi polygons.
  2. Make sure all your polygons are planar. You can use the GeometryValidator and check for Non-Planar surfaces
  3. If any come out of the repaired port then FME will have performed a triangulation on the surface. You wlll need to once again Deaggregate the result.
  4. Use a FaceReplacor to convert the polygons to Faces. (all of your polygons should be now planar so none should get rejected).
  5. Now you should have a collection of faces which are planar, Use a GeometryValidator to check for Self intersecting 2D (You may also want to check for Degenerate/Corrupt, nans, and Null geoms at the same time. Make sure that if you do that you but Self Intersecting 2D at the bottom of the list. FME will perform the operations in order.
  6. If any features get Repaired there is a change that FME has modified the goemetry of the face. some feature may now be lines, or points (or null). Use a GeometryFilter to filter these out. 
  7. Another repair option is face is cut and converted into a CompositeSurface. Run any repaired features through a Deaggregator being sure to set Split Composites to true. You will now be back to a collection of Faces which should be both planer and contain no self intersections.
  8. Now we can begin to start building the Solid. Start by running all the features through an Aggregator. Be sure to use the GroupBy option to make sure use an appropriate ID if you have multiple buildings or parts which should be treated as individual solids/Features. Your output here should be just one feature per Building/Part
  9. Verify that your resulting feature(s) have geometry with is a MultiSurface, i.e., not an Aggregate. Ideally we will have a homogeneous collection.
  10. Use a GeometryCoercer to convert these MultiSurface features into a CompositeSurface. Anything that comes out of the Unchanged port should be reviewed for non-multi surface geometries. 
  11. Add another GeometryCoercer to convert these CompositeSurfaces into brep solids. 
  12. Now that we have Solids we should be able to fix the orientation of the surfaces in the solids. Add another GeometryValidator and check for (in this order) Invalid Solid Voids, Invalid Solid Boundaries, Surface Orientation, Solid Orientation.
  13. The output of this is likely to contain a mixture of Passed, Repaired and Failed Features. It’s not uncommon for FME to partially repair features depending on the data.
  14. Make a copy of the GeometryValidator and run the Failed and Repaired features through it again.
  15. Again, it’s quite possible that the features still remain unrepaired, however, an inspection of the geometry might show a pretty decent result.


Let me know how you get on or if you have any other questions about the workflow.
 

Reply