Curve proximity along parent surface

Description
Assume I have a torus and two curves on it that are mirrored of each other.

I need to rotate one of them along the torus axis so that they just touch each other at a single point. Something like this (which I have manually rotated - this is definitely not an exact solution, solely for the purpose of depicting).

Heed
The Curve Proximity component can’t find the touching point because it detects the closest points between curves in 3D space. This means that the proximity point would change during the rotation of a curve. Presumably, the proximity should be found along the UV of the torus, but I don’t know how to implement this. Are there any other solutions to get a precise rotation to the touching point? Any thoughts are welcome!

Just my thoughts
Perhaps the solution can be found by implementing a recursive function that makes multiple incremental rotations of one of the curves until the intersection event becomes false. The last successful intersection can then return an approximation of the touch point. However, there may already be a ready-made solution.
Rotation.gh (7.7 KB)

One possible solution is the long way round of measuring the angle between two points and rotate curve with that angle.


ROTATE.gh (12.8 KB)

That’s just a simple Ccx case (where you can control the section Plane (VS the Brep) by pos (pAt var below) and angle (rot1 below)).


Notify if you need a C# that does that.

Unfortunately, such a method doesn’t detect the touch point. It should be a single point, but here we get an intersection of two curves at two points. This is happening, since we actually can’t use a random height for the intersection plane, as you did in your solution. It must be an exact height I supose.

Thank you for your reply, but what is the logic under the hood? I don’t have any clue.

Get torus, Define a Plane at axis. Rotate it (option). Get the Ccx events (2 Crvs as circles). Define a point p at each (if using t in 0-1 set their Domain to 0-1). Using CrossProduct define the section planes. Get the Ccx events VS torus. If the result is 2 Crvs get the prox Crv to p else get the first Crv. Sample it in a List. Clone and Mirror the prox Crv and sample it into the List. So we have 4 Crvs in total.

1 Like

does the Ccx mean curve|curve intersection?

Ccx means Intersection events in general as exposed in Rhino SDK (in this case: some Plane VS Brep (the torus)).

For instance white Plane (rotated if rot != 0) yields the white Crvs and the Yellows yield your desired result.



BTW: For the shown Yellows pos obviously we have 2 Curves per Plane Ccx event thus we must get the prox to the given Plane origin.

But for this angle we have one Crv per event.

1 Like