Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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 INTERSECT returning INVALID_INPUT when passed qUnion

adamohernadamohern Member, OS Professional Posts: 216 PRO
            var to_intersect = qUnion([
                            qCreatedBy(id + "extrude1", EntityType.BODY),
                            qNthElement(qCreatedBy(id + "splitPart1"), 1)
                        ]);
                        
            // opDeleteBodies(context, id + "deleteBodies1", {
            //         "entities" : to_intersect
            // });
                    
            opBoolean(context, id + "tenon", {
                    "tools" : to_intersect,
                    "operationType" : BooleanOperationType.INTERSECTION
            }); // Result: // @opBoolean: INVALID_INPUT

I'm trying to intersect two bodies: an extrude, and the result of an opSplitPart().

To insure that my qUnion is working, I inserted the opDeleteBodies() code. It works as expected: the two bodies are deleted. Why would opBoolean not want to accept the query?

Comments

  • adamohernadamohern Member, OS Professional Posts: 216 PRO
    Ah, I see. Bodies are  not "created" by the split operation, they are "split" by it. So instead of qCreatedBy(), I needed to use qSplitBy(). Problem solved.
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    Yep, qSplitBy is the right tool for the job.

    To be pedantic: New bodies *are* created by a split operation. I think you would have succeeded if you had specified EntityType.BODY in your qCreatedBy (otherwise you would pick up the newly created edges and faces as well). The advantage of qSplitBy is just that you can robustly specify which of the newly created bodies you want, based on their position w/r/t the normal of your split entity.

    For debugging the contents of Queries, I love using the debug function, since it tells me how many of each EntityType I've got and highlights the query contents in red when I have the feature open.

Sign In or Register to comment.