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.

Determining Proper Split/Thicken Direction

Griffin_PriceGriffin_Price Member, Developers Posts: 1 PRO
Hey FScripters,
I'm working on a script right now that splits a body based on an arbitrary sketch region. Most things are working, except that I am having trouble figuring out a programmatic way to determine which direction the "KEEP_FRONT" and "KEEP_BACK" directions for a surface split are. For example, a simple circle profile surface will preserve bodies in a different direction than a rectangle or something a little more esoteric like a combination of curves and straights. 

My guess is that "FRONT" and "BACK" are determined by the normal of one of the edges of the splitting tool. This is supported by the fact that qDependency(surface) returns one edge rather than all edges comprising a surface. However, I don't know how I would use this information to predict whether "FRONT" or "BACK" refers to the interior or the exterior of a sketch region. Is there a clever way to do this?

Likewise, this same issue arises from the thicken command on a surface. I would benefit from some explanation of how FRONT and BACK are determined, and hopefully an outline of how I can determine which direction is the interior or exterior of the sketch region bounded by such an edge. Currently I am doing some very convoluted bounding box comparisons to try to determine which bodies created by the sketch are closest to the bounding box around my sketch region. It works, but it is not a great solution and there are some difficult edge cases to address. I'd prefer to learn how to predict opSplitPart() and opThicken() reliably and save myself the headache in future code.

Cheers,
-Griffin

Comments

  • lanalana Onshape Employees Posts: 706
    I think, you'll have easier time controlling your feature behavior, if instead of opSplitPart you use opBoolean subtraction or subtract-compliment options.
Sign In or Register to comment.