Skip to main content
Solved

How are intersections between 2D and 3D solids possible?


javierml
Contributor
Forum|alt.badge.img+1

Hello everyone,

 

I’ve been working with 3D Buildings recently and I’d like to add some info to the walls (e.g. indicating which wall has an entrance door). I could set up this information with the 2D Footprints by using the BoundingBoxReplacer and HorizontalAngleCalculator (I’d have used it with my 3D Buildings themselves, but it only works for 2D lines). But I can’t find the right way to add this information to my 3D walls.

  • If I directly extrude the 2D walls instead of the 2D polygons, I lose the classification of Building_IDs that I want.
  • If I reconvert the 2D walls into 2D polygons with an aggregator, all my info goes away and I’m back at the starting point.
  • I tried converting the walls into points with snipping and then converting them into 3D Features with Offsetter and Bufferer such as other past suggestions, but then I hit a wall (pun unintended) becacuse SpatialRelator and SpatialFilter don’t work for 3D Data (INVALID_GEOMETRY will be written).
    • The only transformer that seems to work for 3D features is SurfaceOnSurfaceOverlyer, but my wall information is just added to the table and I can’t find how to join them with the right wall I want.

Does anyone have an idea how this could be solved? Is there already a transformer or is there something I’m not seeing?

 

For context: This is actually an update from the ticket I posted yesterday. I hope one day I have enough knowledge and time to help others.

Best answer by takashi

Hi ​@javierml ,

I suppose you are trying to convert a 2d polygon to a solid representing a building, extract wall geometries (virtical surfaces) from the solid, and add some required attributes to the wall (vertical) surfaces.

If I understand your requirement correctly, I think the following approach might help you. Assuming you already have an appropriate method to add required attributes to wall footprint geometry (line).

Firstly create a solid representing a building and extract wall surfaces from the solid.

  1. Extruder : Transform 2d polygon to 3d solid (Extrusion).
  2. GeometryCoercer (Geometry Type: brep_solid) : Transform the solid from Exturion to BRepSolid.
  3. GeometryPartExtractor : Decompose the solid into individual boundary surfaces (Face).
    • Geometry XQuery: This part | Geometry Type | = | IFMEFace
  4. PlanarityFilter (Expose Surface Normal: Yes) : Calculate surface normal for each boundary surface.
  5. TestFilter : Classify the boundary surfaces into walls and others based on the surface normal.

You can then apply the following process to the walls. 

  1. Store the wall geometry (Face) as an attribute called e.g. '_geometry' with GeometryExtractor (Geometry Encoding: FME Binary).
  2. Convert each wall geometry (Face) to its footprint geometry (Line) with SurfaceFootprinter.
  3. Add required attributes to the footprint (line) with an appropreate method.
  4. Restore the original wall geometry (Face) from '_geometry' with GeometryReplacer (Geometry Encoding: FME Binary).

I think a pair of GeometryEctractor and GeometryReplacer is very helpful in your case.

Hope this helps.

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

7 replies

evieatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • April 4, 2025

Hi ​@javierml this is an interesting question. Are you able to share a sample of your data, or at least some screenshots? There’s probably a few things you could try each increasing in complexity but really depends on your data. 
for example you could try using the NeighborFinder with a distance of 0, however this transformer will ignore the z values of your 3D geometry. 
you could also use a GeometryExtractor, change everything to 2D and perform your analysis, then add the geometry back with a GeometryReplacer. 
Similarly you could use the SharedItem transformers to save your geometry and add it back later, but this works best for where you want to use the same 3D model for multiple features.  
 

let us know!!


takashi
Supporter
  • Best Answer
  • April 5, 2025

Hi ​@javierml ,

I suppose you are trying to convert a 2d polygon to a solid representing a building, extract wall geometries (virtical surfaces) from the solid, and add some required attributes to the wall (vertical) surfaces.

If I understand your requirement correctly, I think the following approach might help you. Assuming you already have an appropriate method to add required attributes to wall footprint geometry (line).

Firstly create a solid representing a building and extract wall surfaces from the solid.

  1. Extruder : Transform 2d polygon to 3d solid (Extrusion).
  2. GeometryCoercer (Geometry Type: brep_solid) : Transform the solid from Exturion to BRepSolid.
  3. GeometryPartExtractor : Decompose the solid into individual boundary surfaces (Face).
    • Geometry XQuery: This part | Geometry Type | = | IFMEFace
  4. PlanarityFilter (Expose Surface Normal: Yes) : Calculate surface normal for each boundary surface.
  5. TestFilter : Classify the boundary surfaces into walls and others based on the surface normal.

You can then apply the following process to the walls. 

  1. Store the wall geometry (Face) as an attribute called e.g. '_geometry' with GeometryExtractor (Geometry Encoding: FME Binary).
  2. Convert each wall geometry (Face) to its footprint geometry (Line) with SurfaceFootprinter.
  3. Add required attributes to the footprint (line) with an appropreate method.
  4. Restore the original wall geometry (Face) from '_geometry' with GeometryReplacer (Geometry Encoding: FME Binary).

I think a pair of GeometryEctractor and GeometryReplacer is very helpful in your case.

Hope this helps.


javierml
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • April 7, 2025

Thank you ​@evieatsafe and ​@takashi for your answers.

 

I’ve applied your suggestions (mainly ​@takashi’s following ​@evieatsafe’s commentary about GeometryExtractor and GeometryReplacer). The idea has worked and now I can select certain walls and add differentiate the walls with a housedoor with the ones that don’t have it.

 

There’s only one issue: The BoundingBoxReplacer and HorizontalAngleCalculator I used to determine which walls face which direction the walls face doesn’t work as it does directly from the 2D Footprint. Virtually the same angle will be applied on two sides of the wall (instead of every side having a distinct one) I’d like to corect this because doors are facing a exact direction of the street I’m simulating. It’s probably something easy I’m not capable to see with this BBoxReplacer or HorizontalAngleCalculator.

 

I’ve attached a workbench with an example reader (FGDB Format). The first process is my original workflow and the second one is takashi’s workaround. Hope it helps.


javierml
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • April 7, 2025
javierml wrote:

Thank you ​@evieatsafe and ​@takashi for your answers.

 

I’ve applied your suggestions (mainly ​@takashi’s following ​@evieatsafe’s commentary about GeometryExtractor and GeometryReplacer). The idea has worked and now I can select certain walls and add differentiate the walls with a housedoor with the ones that don’t have it.

 

There’s only one issue: The BoundingBoxReplacer and HorizontalAngleCalculator I used to determine which walls face which direction the walls face doesn’t work as it does directly from the 2D Footprint. Virtually the same angle will be applied on two sides of the wall (instead of every side having a distinct one) I’d like to corect this because doors are facing a exact direction of the street I’m simulating. It’s probably something easy I’m not capable to see with this BBoxReplacer or HorizontalAngleCalculator.

 

I’ve attached a workbench with an example reader (FGDB Format). The first process is my original workflow and the second one is takashi’s workaround. Hope it helps.

Quick update: I was able to merge the attributes from the walls whose angles correspond to a housedoor with the new footprints thanks to SpatialFilter.

The question about how HorizontalAngleCalculator works differently still stands. It was also not possible to use PointOnAreaOverlayer because the feature type is not valid? Does this mean that, although SurfaceFootprintReplacer changes to 2D, the geometry is technically still a solid? It’s somewhat intriguing considering that, if I use GeometryCoercer to make sure feature is a polygon, all results go through untouched!


takashi
Supporter
  • April 7, 2025

SurfaceFootprinter doesn't respect the direction of original wall surface, it's the reason why the angle calculated by HorizontalAngleCalculator wouldn't be as expected.
I think you can calculate required angle for each wall surface using normal vector calculated with PlanarityFilter. See the attached workspace example.


takashi
Supporter
  • April 7, 2025

Ah, it's not necessary to use footprint, if you calculate angle with surface normals. See the attachement.


javierml
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • April 8, 2025

Thank you very much ​@takashi! That was a very simple but beatiful way to solve and explain it


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