Solved

How to get slope attribute from dwg polygons

  • 14 October 2019
  • 7 replies
  • 12 views

Badge +1

Hi, I have:

 

1. A .dwg file of a single 1 ground surface model that i read in.

2. I use GeometryPartExtractor to extract IFMEMesh and IFMEFaces so I get a trianglor network of the model.

3. I then I use GeometryCoherer to get FME_polygon

 

How do I get the slope (and possibly aspect) for each individual face? I tried SurfaceModeller and it is not working for me since it is creating extra triangles that I do not want.

 

I have created a custom tool that calulates FME color based on all incoming attributes, ex a test where I add a step 4 where I use surfaceModeller to create the surface again just to get the slope value then I use a DWGStyler to set the surface color to my calculated color and that works fine.

 

My problem is that I do not like the surface modeller since I already have my model and the extracted version as it is, and NOW I want to get the slope for each individual Face or Mesh, set the color for each triangle and possible use the aggregator and write to a dwg file again.

 

I have not found a good solution in the community since they all use SurfaceModeller and I want to keep the dwg attributes and extended settings and whatnot.

 

 

We say a low slope is white, medium is green and too high slope is red, in a gradient, I sucessfully tested the color tool but I do not know how to extract the slope

 

From this

 

to this I need the slope

 

 

 

 

 

 

 

 

 

 

for each polygon wihtout loosing or editing the model

 

 

icon

Best answer by daveatsafe 15 October 2019, 20:03

View original

7 replies

Badge +2

@clowncutie Did you try (or find) the SlopeCalculator on FME HUB?

Userlevel 2
Badge +17

Hi @clowncutie,

You can use a couple of couple of transformers to get the slope:

- The PlanarityFilter will calculate the surface normal parameters if Expose Surface Normal is set Yes.

- The slope angle can be calculated from the surface normal Z component using the inverse cosine in an AttributeCreator.

This process works best on individual faces. You can extract the faces from a mesh by using the GeometryCoercer to convert the mesh to fme_composite_surface, then a Deaggregator to break the surface up into faces (with Split Composites set to Yes).

Badge +1

@clowncutie Did you try (or find) the SlopeCalculator on FME HUB?

I did, but it only accepts polylines and I'm not sure if it will be accurate slope if I just take a center line or similar. I looked into alternatives of using the normal vector of the objects

Badge +1

Hi @clowncutie,

You can use a couple of couple of transformers to get the slope:

- The PlanarityFilter will calculate the surface normal parameters if Expose Surface Normal is set Yes.

- The slope angle can be calculated from the surface normal Z component using the inverse cosine in an AttributeCreator.

This process works best on individual faces. You can extract the faces from a mesh by using the GeometryCoercer to convert the mesh to fme_composite_surface, then a Deaggregator to break the surface up into faces (with Split Composites set to Yes).

Any more settings to the deaggregator? Because it dont have any output

Badge +1

Hi @clowncutie,

You can use a couple of couple of transformers to get the slope:

- The PlanarityFilter will calculate the surface normal parameters if Expose Surface Normal is set Yes.

- The slope angle can be calculated from the surface normal Z component using the inverse cosine in an AttributeCreator.

This process works best on individual faces. You can extract the faces from a mesh by using the GeometryCoercer to convert the mesh to fme_composite_surface, then a Deaggregator to break the surface up into faces (with Split Composites set to Yes).

No, the GeoMetry Coherer sont work with composite surface, my geametryPartExtractor is set to

for $geom in //geometry

where $geom/parent::geometry/@fme_geometry_type = 'IFMEMesh'

or $geom/parent::geometry/@fme_geometry_type = 'IFMEFace'

return number($geom/@fme_id)

 

It onyl returns meshes now

Userlevel 1
Badge +10

Any more settings to the deaggregator? Because it dont have any output

It doesn't look like the geometries are getting coerced, so there's nothing coming out of the coerced port to go into the deaggregator

Badge +1

Hi @clowncutie,

You can use a couple of couple of transformers to get the slope:

- The PlanarityFilter will calculate the surface normal parameters if Expose Surface Normal is set Yes.

- The slope angle can be calculated from the surface normal Z component using the inverse cosine in an AttributeCreator.

This process works best on individual faces. You can extract the faces from a mesh by using the GeometryCoercer to convert the mesh to fme_composite_surface, then a Deaggregator to break the surface up into faces (with Split Composites set to Yes).

Thank you I solved it, I added https://knowledge.safe.com/questions/3204/how-to-convert-a-3d-polygon-into-a-surface.html a step where I composite it to multisurface first then use your solution afterwards to thank you!

Reply