I have run into a bug when projecting a curve to a mesh, as seen in this file:
ProjectToMesh_Error.3dm (100.1 KB)
(this is a rhino 5 file but the error is repeatable in 6 as well)
When you project the straight line on the layer “CurveToProject” to the mesh, horizontally (use the “Right” view) you get two curves. Ontop of this, one of the curve segments switches back over itself so the two segments cannot be easily joined.
Here is an image with the two curves slightly moved apart so you can clearly see them. I have also moved the curve start point upwards slightly to demonstrate the problem. in the example, this start point lies directly over the control point just below it:
This error was found as part of a script that is being run on a significant number of these examples (all are slightly different) and I am trying to handle any exceptions that may pop up. I am not so concerned with there being two curves, I can detect and join them, what is causing me some grief here is the fact that this is not possible in this example.
Is this something that you can fix easily? Can anyone suggest a workaround in a script to detect this and join these curves?
Hello - I see that - just guessing that is has to do with the shallow angle to the mesh at that location. The Connect command on the two segments cleans up.
(I have moved the 2 input curves to the left for clarity. the output curve is on the right)
Interestingly enough, this works on Rhino 6 however unfortunately I am limited to 5 for the time being until I get the rest of our scripts functional there.
Yes, that is indeed the problem from the start. There is a bug in rhino’s ProjectCurveToMesh algorithm - this is an example.
I will try to detect this and flip one of the curves…