First time poster, so please bear with me. I am looking to utilize Grasshopper to rotate a 5 axis machine spindle. I’m running into an issue with collision checking. I want to take a polysurface (milling bit) to a location then systematically rotate the bit and check for collisions with the model. I know how to do this in other programs like Unity using C#. It’s seemingly harder in Grasshopper without having “if/then” or “looping” nodes.
Attached is an image of what I am looking to do. I’m not looking for someone to solve this problem for me, but more or less just point me in the right direction. I’m under the impression that this is something that should be handled by a C# or VB script. My goal is to come up with a solution that does not rely on surface directions from Rhino objects as some of the objects I plan to use this on may be meshes or even point locations.
dont have my project with me, which would rotate by 1 degree then 0.1 then 0.01 which would be much more proper and efficient, if you’d see any help of the proper version, let me know.
This is awesome, thank you so much. Its going to take me a while to figure out everything in this script as I am new to using C# for Grasshopper, but I’ll try to respond again once I figure something out.
After messing around with this idea for the past week. I unfortunately think that I just don’t have the programming knowledge to tackle the issue. Thanks for your help though!
sorry for my super late answer. I allowed myself to have a look at the first two steps of your instructions and kinda coded them like I can. If I got it correctly, further steps are more repetition of step 2, right?
guess this should help a bit more, I also added some comments to make it more comprehensive, but if you have any questions, don’t hesitate to ask!
Thanks for taking a crack at this! You really didn’t have to. What you produced worked and did what I was looking for. However, there’s so much more that I want to do and its just super clear to me after tinkering around, I just don’t understand the Rhino Common stuff. When trying to check true vs false it seems to operate differently from any other C# I’ve ever used.
All that said, I just don’t think I have the programming background to get grasshopper + C# to do what I am looking for without huge frustration. Especially for a pet project which is what this was.
Thanks again for the help! I really appreciate it.
indeed its kinda annoying to learn new libraries, but always comes with new possibilities.
in this particular case, the boolean value returned from the command does return if the command was successful, not if a intersection was found.
due to the fact that you can have different types of intersection, a simple bool isnt enough to represent this.
in usage this means that you have to check whats inside the “out” arrays or wether they are empty to have a result.
I can understand it can be frustrating, but maybe you eventually retake this project after having cuddled a bit with your pet