I’m trying to develop a script in Python that offsets a curve and joins a “wart” onto it. However I’m plagued by rhinoscriptsyntax being unable to recognize a curve as a curve. For example, in the below picture the trim command works on a curve, and then fails on the same curve on the very next line! Is there something I’m missing here about how to consistently give these functions good inputs?
I realise this probably isn’t going to be immediately super helpful:
But this is a good example of why not to use rhinoscriptsyntax for geometry modelling in GHPython. One issue is that jumping back and forth between guids and RhinoCommon types is confusing and needlessly complex. Another (arguably larger) issue is that it becomes really difficult to debug, because errors aren’t super explicit to their function (this is a good example of this). I’d advice trying to implement your algorithm directly in RhinoCommon. You can look up the rhinoscriptsyntax source code to identify the methods you’re currently using:
I don’t do that But in this case, it is IMO warranted (and useful information). Especially if one is a newcomer (i.e. one can avoid many headaches by going directly to RhinoCommon).
Edit: I’ve advised against using rhinoscriptsyntax five times (including this thread), out of a total 25 times I’ve mentioned rhinoscriptsyntax, out of 500+ topics dealing with rhinoscriptsyntax. So maybe cool it with the accusations.
Thank you! That is exactly the missing piece I was looking for. I had the default backwards in my head.
Thanks for you input, and I’ll keep that in mind. I think at my level reading the source code is more of a computer science dive than my project warrants. To my understanding rhinoscriptsyntax works just like grasshopper - I trade some control and specificity for ease of use, which makes computational processes accessible to people without a CS background. That being said some day I’d like to learn what’s going on behind the curtain, so I’ll keep your technique in mind.