Skip to main content
Solved

How to get slope attribute from dwg polygons


clowncutie
Contributor
Forum|alt.badge.img+7

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

 

 

Best answer by daveatsafe

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).

View original
Did this help you find an answer to your question?

7 replies

Forum|alt.badge.img+2
  • October 15, 2019

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


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • Best Answer
  • October 15, 2019

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).


clowncutie
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • October 16, 2019
markatsafe wrote:

@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


clowncutie
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • October 16, 2019
daveatsafe wrote:

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


clowncutie
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • October 16, 2019
daveatsafe wrote:

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


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • October 16, 2019
clowncutie wrote:

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


clowncutie
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • October 16, 2019
daveatsafe wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings