Question

How to convert a surface into triangles without using SurfaceModeller transformer?

  • 13 September 2017
  • 11 replies
  • 37 views

Badge

I have a fme_surface and I need to clip it. As long as it is not possible to clip a fme_surface, I have tried to extract triangles from that feature and then clip them. Is it possible to extract triangles from a fme_surface without using the SurfaceModeller?


11 replies

Badge +15

What do you have against the SurfaceModeller? The Triangulator should do the very same job, although I'm not sure if it's just basically a particular instance of the SurfaceModeller

Badge +1

This should work - GeometryCoercer (>composite surface) then Deaggregator (split composites) and finally another GeometryCoercer to polygons, etc depending on what you want to do with the triangles

Userlevel 2
Badge +17

Hi @tono, what is the geometry class (IFME*) of the surface, which is shown in the Feature Information of FME Data Inspector like this?

 

Badge

This should work - GeometryCoercer (>composite surface) then Deaggregator (split composites) and finally another GeometryCoercer to polygons, etc depending on what you want to do with the triangles

I tried GeometryCoercer and then Deaggregator but it did not work
Badge

What do you have against the SurfaceModeller? The Triangulator should do the very same job, although I'm not sure if it's just basically a particular instance of the SurfaceModeller

If the original surface is made of triangles, triangulating it again will build a different surface, and also it means more processing time when i could extract the triangles without creating a new surface

 

 

Badge +15
If the original surface is made of triangles, triangulating it again will build a different surface, and also it means more processing time when i could extract the triangles without creating a new surface

 

 

Sorry, I hadn't understood the original surface was made of triangles. It completely makes sense now

 

Badge

Hi @tono, what is the geometry class (IFME*) of the surface, which is shown in the Feature Information of FME Data Inspector like this?

 

1 Part, but in the inspector I can see it is made of several triangles
Userlevel 2
Badge +17

Hi @tono, what is the geometry class (IFME*) of the surface, which is shown in the Feature Information of FME Data Inspector like this?

 

OK. You can just use the GeometryPartExtractor with this Geometry XQuery setting.Part to TestLeft ValueOperatorRight ValueThis partGeometry Type=IFMEDonutIf you have other IFMECompositeSurface surfaces containing IFMPolygon internally, connect another GeometryPartExtractor to the Untouched port of this one to extract IFMEPolygon geometries (set IFMEPolygon to Right Value).

 

However, it's a bit strange. If the surface was made of triangles as you said, I don't think there should be IFMEDonut part internally.
Badge

1 Part, but in the inspector I can see it is made of several triangles
Hi @tono,

 

Would you like to share (a part of) your surface data with us? Best thing would be to write an FFS file of the surface(s) you want to break apart into individual triangles.

 

Furthermore, like @takashi already pointed out, it's a bit odd that the FMEFace is a donut. Faces do not need to be triangular, but if you say that your surface consists of triangles only, I believe you should check that again. Your surface might be invalid in that case (tip: use a GeometryValidator to find out).
Userlevel 2
Badge +17

Hi @tono, what is the geometry class (IFME*) of the surface, which is shown in the Feature Information of FME Data Inspector like this?

 

If the surface could contain not only IFMEDonut parts but also IFMEPolygon parts, this Geometry XQuery would be better.

 

Part to TestLeft ValueOperatorRight ValueThe parent of this partGeometry Type=IFMEFaceNote: The GeometryPartExtractor with the query extracts every area geometry from the IFMECompositeSurface surface. However, they aren't always triangles since a surface can be constructed with any shaped areas, as @sander mentioned. If it's not guaranteed that the parts of the target surface are always triangles and also if you need to create triangles anyway, the triangulation process would be necessary.

 

 

In addition, just be aware that the View of FME Data Inspector always shows triangle edges within every face, even if the surface consists of non-triangle faces.

 

 

Userlevel 2
Badge +17

If your goal is to clip a surface by an area, I don't think it's required that all the parts of the surface are triangles. However, the parts don't always keep planarity after clipping even if they all were triangles, since some vertices from the clipper could be added to the clippees. I therefore think that you will have to triangulate clipped parts which didn't keep planarity.

This is a possible workflow. Assuming the source feature has IFMECompositeSurface geometry. The MeshBuilder is a custom transformer from FME Hub, which outputs a feature having IFMEMesh geometry, but you can transform it into IFMCompositeSurface with a GeometryCoercer if necessary.

Related Idea: Clipping Operation for Surface

Reply