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.

New FeatureScript - 4D fold (Foldin'-the-box)

wille_jwille_j Member Posts: 51 ✭✭✭

Link first

This feature is inspired from Hackaday post by Arya Voronova that showcase some really cool ways to make complex parts with support-less additive manufacturing. Its original intent is to target additive manufacturing, but there's likely more use cases, as @elijahpekaar pointed out. The idea for an Onshape FeatureScript was triggered by CAD Battle #2, thank you @Derek_Van_Allen_BD for an incredibly thought provoking, exciting and challenging competition!

image.png

What it does

This feature is a two-set feature, alike Sheet metal model, and Finish sheet metal model.

The first one, 4D Fold model is taking a set of coplanar sketch faces, thickens them to a nominal thickness and then folds them to a desire angle across the shared edges. The order of selected faces don't matter, except that the first face selected will be stationary in space as it's folded. The second feature, Finish 4D fold, takes the result from the first feature and unfolds it back to a planar part ready to be printed.

image.png

The feature creates the folds with what's called living hinges, a thinner section intended to bent more easily. The user may have to experiment with thickness, bend radius and printer materials to get the hinge to work well for the particular use case. The K-factor is fixed to 0.5 for now. Where two edges that don't have a living hinge meet, the separation can be adjusted with a print offset variable.

image.png

One aspect of the design that may be a little counter intuitive at first; the design sections shrink in the fold-direction. The dimensions in 2D sketches are intended to be those of the part in the folded state, and as the living hinge is shorter than the theoretical sharp corner, it needs to move in slightly in the unfolded state.

image.png

Individual edges can be overridden with unique fold angle or fold direction to make even more complex folded structures.

image.png

The magic

You can do any* additional processing to the parts in between the fold model and the finish fold model. Such that complicated models can be designed for support-less 3D print.

image.png image.png image.png image.png

*Limitations

This is coded by me without always a perfectly clear view of how to solve the next hurdle. So I’m sure there’s loads of efficiencies to be had. And it would definitely benefit from a refactoring. A lot of downstream information is re-queried where needed, and there’s likely much better data structures that would work from the start to the end. It’s the first version.

Known bugs:

  1. Partial edges are not working
  2. Too large nominal thickness will break it
  3. It assumes all faces are in the same plane, and will break if not
  4. Unfold produce weird shapes of the living hinges in some areas, hopefully not a deal breaker but not the most pretty.
  5. The folding cause loads of literal edge cases in handling of corner truncation, I’ve had a look at some.
  6. Attribute-destructive edits will break it, I’m not sure if it’s possible to safe-guard to. Warning would be nice.
  7. It should probably tell if the user has added features that interfere with the build plate after unfold, as it’s designed to target 3D printing.
  8. It can be picky about not complete edges that form the fold line.
  9. It's lacking user-facing error and exception handling.
  10. It would probably be handy with editing logic and manipulator change functions.
image.png

Please do reach out in this thread or forum PM if you want to contribute, I'm more than happy to share the edit permission for this feature and collaborate.

Comments

  • Chris_TiltonChris_Tilton Member Posts: 10 EDU

    This is AWESOME! I wish I had this in college for electronics enclosure design! I can't even tell you the amount of filament I wasted on printing boxes. Excited to find a project to try this out with!

    Technical Services Engineer, Onshape

  • S1monS1mon Member Posts: 4,169 PRO

    @wille_j
    Very cool.

    I'm curious what improvements or changes have happened since the competition?

    Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

  • wille_jwille_j Member Posts: 51 ✭✭✭

    Yeah, totally agree @Chris_Tilton, 3D print support is a waste! Glad you like this and hope it comes to good use 😃

    @S1mon Sadly not much has happened on the code/function side since, I’ve been to busy with other things. Mostly icons, instruction pdf and the things to publish it and make this post. I would be curious to tackle the aspects of ACM manufacturing process as an expansion of this next if there’s interest.
    I don’t think I’m there yet to dive into a refactoring to clean up some of the technical debt, but more user-friendly error handling is probably next on the menu.

  • EvanReeseEvanReese Member, Mentor Posts: 2,906 PRO

    This is still such an awesome feature! Thanks for sharing @wille_j

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 928 PRO

    I'd be interested in getting my fingers into the development of a workflow that lets you start from a 3d state similar to @S1mon's Origami feature, but probably I wouldn't be able to get into it until some time in May with my availability

  • MichaelPascoeMichaelPascoe Member Posts: 2,835 PRO

    Wow, dope! And well introduced too. Thanks!

    .


    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    ▚▞▚▞▚▞▚▞▚
    ________________________________________________________________________
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.