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.
How can I split a part by multiple surfaces?
arthur_peters
Member Posts: 19 ✭✭
I would like to split a single part into two parts by more than one surface. The reason is that while two small cuts would separate the part fairly easily, however creating a single surface to split the part would be complex to the point I don't even know how to approach it in general. So I want a way to take a body and some surfaces and cut the body using all the surfaces at once in useTrimmed mode so that I don't cut off random other parts of the shape. opSplitPart only taking a single tool is the main limitation I'm trying to work around.
Here is a manual example of the situation I am trying to handle: https://cad.onshape.com/documents/dac69982a60f83e429567279/w/a21ff6bef62be4030dfe93a9/e/ee7ce2784d7b50842f798214 (the cutting planes are highlighted)
Clearly, I could construct this so that the cuts are not needed, but my goal is to provide custom features that enable cutting and unfolding a solid shape similar to what is supported by the sheet metal tool. And doing so requires cutting up an existing and arbitrary body in a very controlled way. The first step of cutting up a part that has loops in it is the main issue that requires multiple cuts at the same time.
My current prototype is here if you want to look at it: https://cad.onshape.com/documents/b25934ce231bc7cc54b5f71b/w/22d6559f521f6dd2f91c3c2c/e/8e145788671a67d49b5b2a02 The problem with it is that it is insanely slow, due to my silly use of evCollisions. There is a more involved example at: https://cad.onshape.com/documents/146fd7ba5fc8678a0760f717/w/f9737f85504f7bdd029475c7/e/a5b719e8c9ae48517efc2320 It works sort of. But it's extremely slow (regen takes 5s for simple operations) and hard to control since the splitting techniques I'm using is very messy.
- Arthur (he/him)
0
Best Answers
-
MichaelPascoe Member Posts: 1,988 PRO
- Nice FeatureScripting, this is super cool!
- Depending on the application, I've found that using an arc to connect the two splitting surfaces works fairly well.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴0 -
Alex_Kempen Member Posts: 248 EDUYou seem to be correct, which is rather unfortunate. There might be a complicated workaround where for each input plane, you start by splitting the part, then use a combination of startTracking, qSplitBy, and qAdjacent to identify which parts need to be booleaned back together (you could also get the cutting surfaces and use those to assist with identifying parts that need to be booleaned). Not fun, but theoretically workable?CS Student at UT DallasAlex.Kempen@utdallas.eduCheck out my FeatureScripts here:2
-
arthur_peters Member Posts: 19 ✭✭I implemented my idea above: https://cad.onshape.com/documents/b25934ce231bc7cc54b5f71b/v/749d47d9aaa8640d0c043f00/e/ffd0b7e213744c52f4161653Here is a simplified example as a picture.It's not as fast as I would like. It takes ~150ms to do the splits shown in the picture. But I think it's workable even as a sub-operation within a larger feature.- Arthur (he/him)0
Answers
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
This is basically my plan above. However, using startTracking is a great idea. I was having trouble figuring out how to reliably figure out how the resulting objects touch each other. It is a bit complex, but it should be fairly easy to hide inside a library that just provides an operation that splits by multiple trimmed surfaces that collectively split a body, but do not individually do so.
I'll take a crack at it tomorrow night probably. I'm a software engineer by day. So implementing connected components on the part "touching" graph isn't too scary too me. Union-find for the win.