Lost curve name after Project to surface in Rhino 6


(J Stolk) #1

We use the curve name to separate sections made from our 3D models automatically.
We recently upgraded to Rhino 6 (6.4.18124.12321) and found that project curve to surface does not retain the curve name anymore.

Is there away to maintain the Rhino 5 behavior, where the projected curve keeps the original curve name?


(Lando Schumpich) #2

i can confirm there is no name transferred to the projected Curves.

i wrote a workaround haven’t tested it too much and especially if you want to use custom projection vectors it’s kind of clunky but i guess it should work just fine for what you are trying to do. If not just post here if there are any problems.

ProjectCurvesWithNames.py (2.5 KB)


(Pascal Golay) #3

Ugh…thanks for the report. I’ll see if I can cook something up for the meantime. Oh.I see @lando.schumpich has done the heavy lifting already.

https://mcneel.myjetbrains.com/youtrack/issue/RH-46137

-Pascal


(J Stolk) #4

Thank you for the quick response and the suggested workaround. I was on the road yesterday but my colleague tested the script.
We found a couple of issues with the script:

  • it did not work with multiple surfaces
  • if a surface has a hole, it only added one side of the projection in the document
  • if the number of generated curves did not match the number of original curves, the indexing of the array with object names would end up out-of sync or our of bounds.

I’m not very experienced in python but managed to modify the script to fix the above:
https://marimecsmanta.com/files/index.php/s/ZvjRKgMfuN5lpmV/download

remaining smaller issue:

  • the projected curves are not selected when the script has run (as in Rhino 5), so we need to figure out which curves where projected and select them before we can group them by name.
    Would it be possible to adapt the script to make Rhino select all the curves added to the document?

Unfortunately I also found a tolerance issue with the Rhino 6 project to surface (both the manual command and when used in this script) when projecting tangent onto a surface. Should I list this here or make separate post for that?


(Pascal Golay) #5

Hello - please start a new thread and attach an example - thanks.

@j.stolk - modify your script something like this to select the results.

			output = []
			for projectedCurve in projectedCurves:
				for projectedCurvePart in projectedCurve:
					#sc.doc.Objects.Add(projectedCurve[0], attr)
					output.append(sc.doc.Objects.Add(projectedCurvePart, attr))
					
			i += 1
	# return success
	if i > 0:
	    rs.SelectObjects(output)
	return Rhino.Commands.Result.Success

-Pascal


(J Stolk) #6

Great! I moved the “output = []” outside the surface loop and it works perfectly:
https://marimecsmanta.com/files/index.php/s/V2DpZVW5WPmQy0q/download