I am having this issue with solid difference in grasshopper. The result is a union instead of a diffrence and I just cannot figure out what is wrong. Baking the objects and doing manual boolean in Rhino works fine. Both surfaces/polysurfaces are good, closed, and even the surface seams are not in the way.
What could it be?
thank you @martinsiegrist , wow I would have not thought of that. Now that I know, I cannot come up with any solution to check for that ? I am orienting the profile to a rail and do a sweep1. When I orient the curve at t=0 the boolean fails, any other value works correctly. However, the profile does not change direction ever, so as far as I can see, this happens internally in the sweep1, could that be true?
I am sorry, I did not know that it was relevant. I internalised the surfaces to not overcomplicate the definition for anyone willing to help. I did not know that it was possible that a surface normal of a closed untrimmed surface could point inwards. Thank you very much @martinsiegrist for pointing that out!
@Joseph_Oster the C# is for adjusting the srf seam, not the curve seam.
Joseph, thank you for your offer to help. Unfortunately the whole definition is quite complicated and part of a bigger “builder” system I have created and I would prefer not to share the whole thing.
My issue was definitely solved by checking for the srf normal, so thank you @martinsiegrist and of course also @Joseph_Oster for your very quick responses and help. It is very much appreciated and I can only suspect it would have taken me hours to find the issue otherwise.
I don’t want the whole thing, just the part where you create the ring using Sweep 1. Because that doesn’t work for me at all.
P.S. This is what I mean. Starting with @martinsiegrist’s code, I created a circle for a rail, adjusted its seam and Sweep 1 fails, no matter what. (As I was writing this, I added code to test alternate radii for the circle so the rail touches the top or bottom of the section curve, with the same result.)
The only way Sweep works is using SubCrv to leave a small gap at the end of the rail (yellow group).
ok @Joseph_Oster , here is something I put together for you.
I am doing the sweep in python and there I can do the check for the orientation.
And yes, vanilla sweep1 in gh is very likely to fail in many cases without any helpful error message. With my curve sorting, orientation and seampoint setting I got rid of almost all problems in my “builder”. Hope it helps.
sweep = rg.SweepOneRail.PerformSweep(so,rail,profiles)
for brep in sweep:
dir = brep.SolidOrientation
if dir == rg.BrepSolidOrientation.Inward:
It helps explain how you managed to create a defective brep that causes SDiff to fail. It’s great that @martinsiegrist was able to identify the flaw without seeing your code but his solution used RevSrf, not Sweep 1, so a mystery remained for everyone else who reads this thread.
It is always very relevant to see how the defect was created. You hadn’t mentioned Python at all and tried to justify not sharing your code:
That doesn’t help anyone, except perhaps yourself. That’s not what makes this forum work. I can see the Python in your post but your latest GH file is useless to me because it requires Pufferfish.
You started this thread to ask for help, which Martin and I provided, despite your non-compliance with the forum guidelines. My Sweep 2 solution is simpler and works better than your Python/C# approach. Hope it helps. And I really hope you understand what I meant when I said this:
There really wasn’t enough in your posted code to thoroughly explore this issue.
@Joseph_Oster Joseph, if you reread my question, I was asking why my boolean failed. Martin provided the answer and I am thankful for it. I was providing everything in the forum guidelines and removed all unecessary seeming code.
You were interested in what was causing the invalid brep to be generated and requested some more information from me, which I took 1,5 hours of my time this morning to put together for you. You were not clear about what you really want only mentioning
I understood this as YOU asking me for help, so I tried to provide it. Instead you now write this:
Excuse my bluntness, but in my estimation you have not provided any help for me and my problem at all, you were interested in something else and I was trying to provide you with the information you unclearly requested. I understand your attitude in your post as if I was ungreatful or not compliant with “how questions are asked here”. I am sorry you feel that way and kindly request that you do not waste more time with my problems that you yourself decided to spend your attention on. I was trying to be precise and providing everything that was asked of me.
Here is a definition that does not have any dependencies and uses vanilla sweep1. It also creates the same geometry.