Measure distance from Point to Point etc. to construct new polyline

Hello everyone,

Situation: I’m working on the geometry of ribbed vaults and I’m trying to write a little program in Grasshopper, which should calculate the radius of a circle best fitting to measured points with a laser total station. So, I have some measured points and Grasshopper should fit a circle through them. Until now, we used a really old program and we always had to extract the points in Rhino, save it as a txt-file and open it with the other program. It would be much easier to do all the steps in Rhino/Grasshopper, so that’s what I’m trying to achieve.

Problem: The curve of the points has a kink in it and does not form a “straight line”, where I could easily fit a circle. Without this kink, the curve would form a quadrant of a circle - so the parts of the curve before and after the kink have the same radius. Here’s a picture of one of those curves for a better understanding:

and the Rhino-File of the curve shown in the picture:

Testkurve.3dm (33.4 KB)

Possible Solution: What I’m trying to do now, is to measure the distance between the points. So as a first step, Grasshopper should measure the distance between Point 0 to Point 1, Point 1 to Point 2, Point n to Point n+1 etc. (the points have to be in in order, of course). I guess it should be enough to measure the distance using the x- and y-coordinates of the points, kinda like an Euclidiean distance:

euclidiandistance

In a second step, the distances should draw new 2D-points (x = measured distance from step 1, y = 0), to combine them with the z-value of the intilal points to construct a new 3D-Points (x= distance, y= 0, z= initial points). In a last step, I can fit a circle through the new points an measure the radius of it.

I tried now for some hourse to solve step 1 and 2, but I’m still new to Grasshopper and nothing I tried worked. If anyone could help me with my problem or give me some hints on how to solve the first two steps, I would be eternally grateful!

Best regards and thanks in advance,
Manuel

The other solution didn’t work?

Hej Aris! Your solution did work, of course, but I kept getting a bit too big radii in the end. Probably because of this darn kink. So now I’m trying another method (actually, it’s a bit similar to the method our old program is using), to check if our old program is correct or not. :slight_smile:

hola Manuel,

In the last script, the x and y coordinates were measured according to a plane that was defined by the first group of points (up to the kink)

That means that any slight error in the measurement of the (first group of) points could accumulate and affect the plane.

Do you have another geometry that would help you define the plane?
vault.gh (12.4 KB)

edit:
here is another way of defining the base plane (by using the first and last points of the 1st group and the z axis)
vault2.gh (15.8 KB)

1 Like

Hi again Manuel,
mea culpa!

because of this misconception I thought that the plane I was defining was completely vertical.
It wasn’t.
In this definition, it is constructed in the correct way and indeed it gives a -somewhat- smaller radius.

vault3.gh (13.4 KB)

1 Like

Thank you very much! Your second version looks really elaborate! Still, I have a difference of 0,15 m to the radius calculated by the old program (3,35 m) and I don’t know where this slight error could come from. It looks like the problem is next to the kink, where the points are suddenly lower than the previous ones. I will test some similar curves and compare the results :slight_smile:

What do you think of the above mentioned idea with the distances between each point to construct new points? Do you think this could even work?

Thank you so much for all your effort and help, it is really appreciated!! And I will check your newest solution now :slight_smile:

Edit: The third solution is wonderful! I don’t know why, but if I ignore the kink in “number of coplanar points” and just insert them all, the result is perfect!

Ok,
now I completely understood you and recreated the algorithm you’re describing. the results seem to match your previous ones.
In my mind I cannot grasp why the two methods should give so different results (15cm difference).

vault4.gh (11.3 KB)

1 Like

It works like a charm! Thank you so, so much, Aris! No wonder your parents named you after a god! :slight_smile:

I really don’t understand, why the different solutions produce different results, but now it’s working perfect :heart:

1 Like

You know your mythology!
after 4 tries, I finally managed to find a solution that you were describing in your first post.
No wonder my parents named me after the only of the 12 gods that everybody hated! hahahahaha!!!
just joking, glad to help!

1 Like

Ah, they just had a healthy amount of respect because of his strenght and power :slight_smile: thanks again, Aris! Your help is very much appreciated!