Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
opBoolean on Surface Bodies
mahir
Member, Developers Posts: 1,307 ✭✭✭✭✭
I'm playing around with a new FS for generating reference points from various inputs. One the potential inputs is 3 surfaces or planes. The first step to getting the point intersection between 3 bodies is to generate a robust curve intersection between 2 bodies. This seems to work well enough for simple cases where 2 bodies create 1 curve. However, opBoolean generates a "BOOLEAN_INVALID" error when intersecting 2 surfaces that should generate 2 curves due to a hole in one of the surfaces. Is there some way to remedy this and get the desired wire bodies? Here's the code I'm using, mostly borrowed from projectedCurve, and a screenshot of the input surfaces being used as tools. Intersecting orange and green works fine, but blue and green gives an error due to blue going through a hole.
try { opBoolean(context, id + "boolean", { "tools" : definition.tools, "operationType" : BooleanOperationType.INTERSECTION, "allowSheets" : true, "eraseImprintedEdges" : false, "keepTools" : definition.keepTools }); } catch { throw regenError(ErrorStringEnum.REGEN_ERROR); }
0
Comments
I can't really find a way to get around this either.
IR for AS/NZS 1100
Please file a support ticket on the document with the surfaces in question so that we can investigate where this limitation is coming from.
It seems to happen whenever it creates more than 1 curve
IR for AS/NZS 1100
Can't you remove the trimming boundaries from the surfaces and clean the problem up.
Does OS give you the polynomials for the intersection of 2 surfaces?
And then the solution would be simultaneous equations of 3 curves to resolve 3 unknowns x, y, z?
Is the solution implicit or explicit?
And no, I don't believe OS exposes the polynomal coefficients for curve objects. Even if they did, intersecting 3 curves mathematically seems like more work. That would require that I generate 3 curves from the intersection 3 surfaces (2 surfaces at a time). That's 4 steps (3 intersects + 1 set of simultaneous equations). My plan for getting a point from 3 surfaces is to generate a curve(s) from the first 2 surfaces, then intersection the resulting curve with the last surface to get a point. That's only 2 steps. You can actually do what you're suggesting with just 2 curves, but that's still 3 steps - which is more than 2
Does OS provide the base surface definition without boundaries? The only way to remove boundaries is to fill'm in?
I haven't played with surface definitions in OS.
On another note, OS has informed me that fixing this shortcoming in opBoolean is probably not happening anytime soon since it could be an issue with Parasolid itself. But I think I can get around the problem by using opSplit instead. It's a roundabout way of getting what I want, but it will hopefully be robust. A query for the resulting edges would look something like qCreatedBy(opSplit, entityType.edge).
Would it work if you did an opBoolean on all three surfaces at once?
EDIT it doesn't work. I got the intersection another way, though, https://cad.onshape.com/documents/84d939daceef6a928b8abcba/w/9e0dafb21fbe2ec8b983bbdc/e/9a25ae6f38e7d1396b81ed88
IR for AS/NZS 1100
You can also fill surface holes using opEdgeChange
IR for AS/NZS 1100
Onshape's new Intersection Curve feature uses a new operation, opIntersectFaces, which also works if the intersections should result in multiple curves
Documentation
geomOperations.fs
faceIntersection.fs
IR for AS/NZS 1100