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.

Swept Profile Boolean Subtract

famadorianfamadorian ✭✭Member Posts: 306 ✭✭
When doing a boolean subtract, is it possible to use a swept profile?

Do I really need to create a solid here?

In ArchiCAD, this is called a Solid Element Operation Subtraction with Downward Extrusion


Tagged:

Best Answer

«13

Answers

  • john_mcclaryjohn_mcclary PRO Member, Developers Posts: 2,055 PRO
    edited May 1
    Boolean is comparing two volumes against each other.

    From the profile you show, if you close the sketch with a horizontal line, then you could do an extrude cut rather than dealing with the surface extrude altogether.

    I'm sure someone around here may be able to create a custom feature for you if you have more information.
  • famadorianfamadorian ✭✭ Member Posts: 306 ✭✭
    Sure, I was just trying to make a simple example, but here's the actual sink profile I'm trying to subtract from the cabinets

    It actually creates parts here, cause it just cuts the cabinets;)


  • famadorianfamadorian ✭✭ Member Posts: 306 ✭✭
    Here's a better image:

  • john_mcclaryjohn_mcclary PRO Member, Developers Posts: 2,055 PRO
    I see now.

    You will need to select the remaining parts and "delete" them after the boolean.

    Again, you may want to ask someone if they can make you a boolean subtract feature that deletes new bodies it creates.
  • owen_sparksowen_sparks PRO Member, Developers Posts: 2,418 PRO
    edited May 1
    There is also an IR for a "solid body sweep" that if implemented would do what you want.  So select the "sink" and boolean remove it in a straight up direction.  It'd be useful should there be overhangs too.
    @konstantin_shiriazdanov another use case for being able to reference a feature as an input parameter.  That way we could uses the native delete part feature but just point it at our previous boolean operation :)
    Cheers, Owen S.

    Production Engineer
    HWM-Water Ltd
  • famadorianfamadorian ✭✭ Member Posts: 306 ✭✭
    There is also an IR for a "solid body sweep" that if implemented would do what you want.  So select the "sink" and boolean remove it in a straight up direction.  It'd be useful should there be overhangs too.
    @konstantin_shiriazdanov another use case for being able to reference a feature as an input parameter.  That way we could uses the native delete part feature but just point it at our previous boolean operation :)
    Cheers, Owen S.


    Yes, that would indeed solve the problem;)

    , but why limit yourself to calling it a solid body, when it can be just a surface?


  • owen_sparksowen_sparks PRO Member, Developers Posts: 2,418 PRO
    edited May 1
    @famadorian because surfaces are evil.  :p  You have to be at @billy2 levels of CAD-guru-ness to play with them B)

    In all seriousness surfaces sound like a perfectly sensible idea, please add it to the IR.  I'd do it myself but then @lougallo 'd get all upset with me for project creep. o:)

    Cheers, Owen S.

    Production Engineer
    HWM-Water Ltd
  • john_mcclaryjohn_mcclary PRO Member, Developers Posts: 2,055 PRO
    I'm like @owen_sparks I avoid surfaces typically, for no reason other than I deal with simple shapes that need to have mass :) (cubes/cylinders)

    But really in this case I too have come across many times where I want to split a solid with a plane or surface, and want the remainder parts to be purged (often times there are many children that need to manually be deleted afterwards.

    If I were better at FS i'd take a stab at it. but I assume it is just a copy of the boolean command or split command, but at the end you do something like a:

    bodiesToDelete = qCreatedBy(...)

    That would be a valuable tool
  • konstantin_shiriazdanovkonstantin_shiriazdanov ✭✭✭✭✭ Member Posts: 918 ✭✭✭✭✭
    If I'm not mistaken in SW it is a surface cut feature, in OS you have to split solids by surface and delete unwanted pieces.
  • owen_sparksowen_sparks PRO Member, Developers Posts: 2,418 PRO
    edited May 1

    If I were better at FS i'd take a stab at it. but I assume it is just a copy of the boolean command or split command, but at the end you do something like a:

    bodiesToDelete = qCreatedBy(...)

    That would be a valuable tool
    Agreed.  It might be worth throwing in an additional input for a face, edge or vertex of the bit you want to keep just in case the part with the original ID ends up as one of the bits you end up purging.  Other options might just be to keep the biggest lump and kill all the little bits?
    Owen S.
    Production Engineer
    HWM-Water Ltd
  • konstantin_shiriazdanovkonstantin_shiriazdanov ✭✭✭✭✭ Member Posts: 918 ✭✭✭✭✭
     It might be worth throwing in an additional input for a face, edge or vertex of the bit you want to keep just in case the part with the original ID end up as one of the bits you end up purging.  Other options might just be to keep the biggest lump and kill all the little bits?
    Owen S.
    in documentaton there is a thing like this:

    SplitOperationKeepType enum

    See opSplitPart.

    ValueDescription
    KEEP_ALL
    KEEP_FRONT
    KEEP_BACK
    so seems like you can just modify original split feature adding keep parameter selector
  • konstantin_shiriazdanovkonstantin_shiriazdanov ✭✭✭✭✭ Member Posts: 918 ✭✭✭✭✭
    Something like this then?
    yep, can't guess why it still not added in the official split feature
  • john_mcclaryjohn_mcclary PRO Member, Developers Posts: 2,055 PRO
    True, I had to double check the original feature to make sure I didn't miss that option
  • john_mcclaryjohn_mcclary PRO Member, Developers Posts: 2,055 PRO
    @famadorian

    Try out that featurescript against your sink, let me know if it works for you
  • owen_sparksowen_sparks PRO Member, Developers Posts: 2,418 PRO
    Sweeeeeeeet!
    Nice job B)
    I hope there are some Ons folks saying things like "Look, look, they're doing it. We wrote it and they came..." 
    OwS
    Production Engineer
    HWM-Water Ltd
  • famadorianfamadorian ✭✭ Member Posts: 306 ✭✭
    @famadorian

    Try out that featurescript against your sink, let me know if it works for you
    1. Is this script supposed to let me select more than one part for "Parent part"?
    2. Is this script supposed to let me select a part for the subtract? It seems it wants face or surface

  • john_mcclaryjohn_mcclary PRO Member, Developers Posts: 2,055 PRO
    edited May 2
    Try this, I had to change tactics and make it a boolean between solids.

    I am a stupid amateur when it comes to featurescript, so I can't figure out how to query all of the internal faces of a solid (Pocket)
    So you will have to use the Onshape (create selection) tool instead :(

    Switch to subtract mode to use with solid bodies.

    It is doing a delete face on all of the cutting surfaces, and then boolean subtracting the solid box in creates.
    This will delete the sink, I'm not sure how to copy in place and use that tool instead of the original body. (Again I'm an amateur)

    If only there was a crazy Russian hacker watching this thread that could scrape this off the bottom of his shoe and make it a real thing ;p

    The two modes are just to make sure the split feature (Legacy) still worked 


  • owen_sparksowen_sparks PRO Member, Developers Posts: 2,418 PRO
    @john_mcclary that's an awesome approach, I wouldn't have thought of that.   B)   (Freely admit I had to read the FS to see what you did!) For those reading along John first deletes the inner faces of the pocket in the "tool" to make it a solid "space representation" then booleans that away from the target.  Thus there are no left over unwanted parts so no need to delete them.  Clever :+1:

    One suggestion if I may.  If you copy the "tool" and then do the delete face on that then after the feature has run your original part will still be there so the user can check visually that it fits.  A "keep tools" checkbox would be familiar territory for users.

    Oh, sorry and another you're calling the boolean function presumably we could have an offset parameter to allow for fit tolerance?

    @onshape folks it'd really be nice to have some sort of push request to if we make tweaks to other peoples features we could ask for them to be included by the author.

    I make a lot of fixtures for hollow parts so I too have a workflow similar to the tasks we're discussing above.  I'd not found a good way, delete face with many internal fillets isn't always robust so it tended to be a multi feature operation to delete the internal voids and make a solid part.  Performance is then improved as you've halved the complexity of the model.  As such I tend to keep a library of "dumbed down" copies of some of our parts for such uses.

    Side note:- Reading other people's featurescript code is a great way of learning / finding alternative approaches / soaking up methods etc. without the pressure and frustration of working from scratch on a blank screen or a buggy bit of code.  Thanks for sharing.

    Cheers, Owen S.
    Production Engineer
    HWM-Water Ltd
  • john_mcclaryjohn_mcclary PRO Member, Developers Posts: 2,055 PRO
    @owen_sparks if you like i can share doc with you, and you can tweek it
  • owen_sparksowen_sparks PRO Member, Developers Posts: 2,418 PRO
    Thanks @john_mcclary ; I'll send a PM with my email address. 

    Which raises another q.  From within a public document it'd be nice (as we're already logged into Ons so it knows who we are) to have a "request share with me" button that the author can either then approve or decline, similar to the current release management workflow.

    Actually how are you awake, isn't it stupid o'clock in your part of the world?

    Cheers,
    Owen S.
    Production Engineer
    HWM-Water Ltd
  • john_mcclaryjohn_mcclary PRO Member, Developers Posts: 2,055 PRO
    I'm only in bed between 1am and 5 am...  :s
  • romeograhamromeograham PRO Member Posts: 238 PRO
    @owen_sparks
    I'd like this "request share" option too!
  • owen_sparksowen_sparks PRO Member, Developers Posts: 2,418 PRO
    edited May 2
    @owen_sparks
    I'd like this "request share" option too!
    IR Here should you care to cast a vote.
    Cheers, Owen S.
    Production Engineer
    HWM-Water Ltd
  • john_mcclaryjohn_mcclary PRO Member, Developers Posts: 2,055 PRO
    Voted
  • owen_sparksowen_sparks PRO Member, Developers Posts: 2,418 PRO
    Thanks!
    Production Engineer
    HWM-Water Ltd
  • famadorianfamadorian ✭✭ Member Posts: 306 ✭✭
    I'm trying this, but it's not working here for me

    Parts of the cabinets are remaining

    Is there sink also supposed to disappear in the end?



  • owen_sparksowen_sparks PRO Member, Developers Posts: 2,418 PRO
    Are you able/willing to share the doc or a copy of it?  I suspect the delete face part is missing bits.
    Production Engineer
    HWM-Water Ltd
  • famadorianfamadorian ✭✭ Member Posts: 306 ✭✭
  • john_mcclaryjohn_mcclary PRO Member, Developers Posts: 2,055 PRO
    It looks like the left sink needs to be selected for pocket as well from the video clip
Sign In or Register to comment.