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.

Split using plane size?

Lee_HeskethLee_Hesketh Member, Developers Posts: 148 ✭✭✭
I am trying to make a script that creates mitred corners. I thought of creating a plane and then calling opSplit. But then I realised that the plane is infinite and will not just split the desired corner, but the whole part. Is there a way of setting an "effect radius"? Such that it will only split a part in a certain radius.
If not, what will be the best way of making mitred corners using featurescript?
There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!
Tagged:

Comments

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    Add a chamfer?
    Senior Director, Technical Services, EMEAI
  • Lee_HeskethLee_Hesketh Member, Developers Posts: 148 ✭✭✭
    A chamfer won't work in this scenario. I am creating a rectangle and then a smaller rectangle inside it then extruding the profile, so the result is a hollow box. Then I want to create the mitred corners but this is my result
    So you can see it has split the corner, but it has extended past and split the back face. I would like to prevent this. I know that this is because the plane is infinite, but it would be nice if the split stopped at the boundary of the plane object.
    There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    Connect the corners of the rectangles with sketch lines, extrude surfaces, then split the solid?
    Senior Director, Technical Services, EMEAI
  • Lee_HeskethLee_Hesketh Member, Developers Posts: 148 ✭✭✭
    Same problem, not just the corners are split. Anything the surface intersects will be split.
    There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!
  • Lee_HeskethLee_Hesketh Member, Developers Posts: 148 ✭✭✭
    That method only works if the box is not rectangular.
    There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    OK you are right. If you connect the corners of the rectangle sketches, you have 4 regions to extrude independently with the miters already added - would that work?
    Senior Director, Technical Services, EMEAI
  • Lee_HeskethLee_Hesketh Member, Developers Posts: 148 ✭✭✭
    That would work, but I don't know how to select specific sketch regions using featurescript
    There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    Lee,

    qSketchRegion (https://cad.onshape.com/FsDoc/library.html#qSketchRegion-Id-boolean) can be used to select the sketch regions created by a certain sketch.
    Jake Rosenfeld - Modeling Team
  • Jose_MoralesJose_Morales Member Posts: 15 PRO
    @NeilCooke , I'm summoning you since you've handled all of my questions lately (thanks for that):

    I'm trying to do something very similar to what Lee initially asked on this thread. I have some reference geometries from which I draw line segments; then, I extrude them as surfaces in order to use it as a splitting tool.


    Here's my code:




    Note: I'd run a for-loop to go through all the tools (surfaces), but I simplified it for debugging purposes. 

    The issue I'm encountering is that when I call opSplit I get an issue where it's assuming the plane on which the "tools[0]" surface exists instead of the surface itself. Due to this the split that results is incorrect:



    I've debugged the query to make sure that it is indeed the surface, and verified that it is of non-infinite area:



    I've tried using the "useTrimmed" parameter for the opSplit, but then it throws a fit.





    What am I doing wrong?
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    @Jose_Morales
    Sharing the document here would help diagnose, but I believe opSplitPart will always extend a planar input to do an infinite cut.

    An annoying but functional workaround is to pass in a sheet body with an extra face. So, instead of extruding a line to form a planar tool, instead extrude that same line with another short line, angled off the end. When you pass in that resulting body to opSplitPart (as you already are doing) it will not be extended in any direction.
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,050 ✭✭✭✭✭
    @Jose_Morales
    You can use an opBoolean with a surface. 
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    @Jose_Morales

    useTrimmed should work.  If you make your doc public and give a link, or just contact support, we can take a look into why it is failing.  Maybe because the sheets don't cut all the way through the parts?  Are you intending to just split the faces or do you actually want to split the parts into separate parts.  If the former you could use opSplitFace, if the latter, make sure your bodies cut all the way though the parts they are trying to split.
    Jake Rosenfeld - Modeling Team
Sign In or Register to comment.