Check the distance of the point from the wall


Have you guys tried to check if a list of points is about 2 m from a wall. Then if the distance is more than 2.3 add a new point and if it is smaller than 0.1m than move the point 0.5 m in inside? I have got a list of points in side the room.
Any ideas on how to make it?

Thanks very much for any help!

You’d either have to know which points go with which walls or find the closest wall for each point. Then use ClosestPointTo to get a point on the wall and find the distance between those two points. The rest is a simple If statement.

1 Like

Thanks @Nick_Boyts, you have been helping me a lot! In the list, two continuous sub lists will go with one room. Is there a way where I can extract that information and then fo check the points! I am so new to python so it would be great if you can so me an example!

You probably don’t need python. Use Geometry.ClosestPointTo to find the closest points on each wall in a room. Get the distance between your original point and the new wall points. The smallest distance will represent the nearest wall and be the value that you need to compare against.

Many Thanks for that, @Nick_Boyts . But Can you tell me how to use Geometry.ClosestPointTo since there are 2 inputs and I’m not sure what to put in those. The Elements as the rooms? I am so new to this, sorry!

Hover over the node and it will give you a description. It also usually tells you what the inputs should be. The node gives you the closest point on a piece of geometry (wall geometry) to another piece of geometry (point).

Thanks @Nick_Boyts, I get my distance, but it seems to only measures the furthest distances, even if I use Geometry.ClosestPointTo or not. Am I mising something? At the same time, how can I now check the distance and move the whole line of points if the distance is bigger than 2.3 m? I saw you mentioned Line.Direction in another post, but since the input is a line, I am not sure how to make it?

We would need to see more of your graph, with previews. I’m guessing your grouping and/or your lacing isn’t correct.

Here is my whole things with previews, just missing the in the begining. So sorry for the mess. All of my lacing is auto. I only need to check and move the points inside the room.
Really appreciate your information.

We need to see node previews, not geometry previews (although the geometry in question would also be helpful).