algorithmic modeling for Rhino
I have a curve in 3d. I know what the x,y coordinates on the world plane are of a point that would be on that curve, but I don't know what the z value is.
Any suggestions on how to find the z value of the curve point that would match up with x,y known values?
Tags:
hi,
you can make a line ("Line" component). First point of your line will be the point X/Y/0. Set the second point X/Y/1000 or more.
Then use the "Curve Proximity" component. Plug in your first curve (the 3d one) and the second line.
Read your point.
Hope this helps,
Raul
Thanks Raul. I tried this and it worked. The only thing I did different was rather than using the Curve Proximity component I used the Curve|Line intersect component. That worked because the xy of the line matched the xy of the curve I'm trying to discover the z for.
Option number 2:
--
David Rutten
david@mcneel.com
Ah, yes, makes sense David. In following your same train of thought I took the world xy point that I know, and used the Project Point component to place that point on the curve I'm trying to read z for (since I know the projection direction has to be z). That gave me my 3D point to evaluate.
Looks like both methods work. Are there any caveats to either method, or is it simply a matter of taste?
I prefer my option as it relies on Curve|Point proximity instead of Curve|Curve proximity. The latter is a more involved algorithm that is more likely to go wrong and take longer.
Also it's not always clear how long you should make the vertical lines. They need to extend beyond the boundingbox of the curve, which means additional components if you want to make this work for all cases.
You can also get away with projecting the original curve once, meaning you don't have to create a new curve for every point you're sampling, but that should only become a consideration if you're doing this for thousands upon thousands of coordinates.
--
David Rutten
david@mcneel.com
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by