looking to find the closest building edge to a road

   402   3   1
User Avatar
Member
61 posts
Joined: 12月 2020
Offline
hay guys
I am looking for a way to find the closest edge to a road to place the front door on my buildings.

I have tried to get the closest point but I am doing something wrong?
I was planning to get the two closest points to the nearest road to make an edge group from them. To place a front door on the building. and help orientate for replacement with generic buildings.


In the example test my measurements are way off and the wrong points are getting selected.
Any help would be appreciated.

Attachments:
help.png (3.1 MB)

User Avatar
Member
61 posts
Joined: 12月 2020
Offline
sussed the distance out now
int near_point = nearpoint(1, "", @P);
float d = distance(@P, point(1, "P", near_point));

@dist = d;
User Avatar
Member
61 posts
Joined: 12月 2020
Offline

so got it mostly working at the moment it is just using the closest and furthest edge from road but comes with some errors that need refining.

so added measurements from buildings in the same way. but before I go through any madness with if statements has anyone got any good IDEAS?

also have buildings in mountains and farms, that don't really care where the roads are as they are at great distances. I was thinking if there is a cluster of buildings far from roads to point the door at the nearest building or use longest edge. that is more than a minimum distance. so not to open a door/window onto a wall of another building.
Edited by Getyamamout - 2025年6月16日 11:18:14

Attachments:
help1.png (1.1 MB)

User Avatar
Member
61 posts
Joined: 12月 2020
Offline
I now have the center point of each edge with Normal' looking outwards how do I limit my search for nearest point to a angle say 45deg ether side of the normal?
  • Quick Links