Skip to main content
Solved

Neighborfinder 3d, calculate 3d distance.

  • September 15, 2024
  • 4 replies
  • 117 views

gbd
Contributor
Forum|alt.badge.img+1
  • Contributor

I´m in need to calculate the shortest distance in 3d between a set of basepoints and a line.
Something similar to a Neighborfinder in 3d mode.
Do any of you know a way to do this? 

Best answer by hkingsbury

An approach could be that you extract the vertices of the line and then use them and the coordinates of the candidate points to create a 3d line, then get the length of the resulting line. This will give you the shortest distance been a 3d point and a vertex of the line. I’ve attached and example workbench (2024.1)

If you want to find the closest point along the line, you could use the Densifier to emulate segment snapping. This will make a heap of vertices along your line and will get exponentially slower as your line gets longer.

 

 

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

4 replies

hkingsbury
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • Best Answer
  • September 15, 2024

An approach could be that you extract the vertices of the line and then use them and the coordinates of the candidate points to create a 3d line, then get the length of the resulting line. This will give you the shortest distance been a 3d point and a vertex of the line. I’ve attached and example workbench (2024.1)

If you want to find the closest point along the line, you could use the Densifier to emulate segment snapping. This will make a heap of vertices along your line and will get exponentially slower as your line gets longer.

 

 


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • September 15, 2024

I’ve done a previous Proof-of-Concept using Spatialite, which does support 3D closest distance calculations.  It isn’t fully “within” FME, however,

 

Noted is that there is also a Community Hub Transformer 3DAnchoredSnapper that could also work, but not tested.  This could output a point on the line that is closest to the origin node, and then can calculate the distance between the origin point and the snapped point.


gbd
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • September 16, 2024
hkingsbury wrote:

An approach could be that you extract the vertices of the line and then use them and the coordinates of the candidate points to create a 3d line, then get the length of the resulting line. This will give you the shortest distance been a 3d point and a vertex of the line. I’ve attached and example workbench (2024.1)

If you want to find the closest point along the line, you could use the Densifier to emulate segment snapping. This will make a heap of vertices along your line and will get exponentially slower as your line gets longer.

 

 

Thanks I think this will work for me 👍


gbd
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • September 16, 2024
bwn wrote:

I’ve done a previous Proof-of-Concept using Spatialite, which does support 3D closest distance calculations.  It isn’t fully “within” FME, however,

 

Noted is that there is also a Community Hub Transformer 3DAnchoredSnapper that could also work, but not tested.  This could output a point on the line that is closest to the origin node, and then can calculate the distance between the origin point and the snapped point.

Interesting, I will have a look at the 3DAnchoredSnapper...


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