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.

Options

How to loft sketches that were created by patterns

fstfst Member Posts: 44 ✭✭
Hi Onshape community,
have started to play around with Onshape - it's very promising!

As a first exercise (to find out whether Onshape can do what I need) I tried to create a conic rectangular shape with conic, rectangular holes. The number of holes should be parametric. I create both the conic body shape as well as the conic holes with lofts.
Haven't found out yet how I can create lots over all pairs of sketches that were created via two patterns. My "hack" was to manually define four lofts between four pairs of sub-faces of these patterns. This works - but only for up to the maximum pattern size I have created lofts for. And when reducing the pattern size the additional lofts are shown as red  because their reference geometry is missing.

My description is probably not very intuitive. Please open the following example

https://cad.onshape.com/documents/86776a461ce86e88145657f8/w/2d27b485e436813cdaebe2bb/e/d97df18d012fa3b31f1ed490

and play with "num_pipes" in the variable table, change it first to numbers <= 4 and then to numbers > 4, then you will see what I mean. Would there be a more generic way to model this, so I don't need the explicit lofts anymore?

Thanks and all the best,
Ferdinand

Comments

  • Options
    SethFSethF Member Posts: 129 PRO
    Well, to get rid of the red, you could set up a configuration option for the num_pipes, and configure the suppression of the unused lofts. I know that doesn't answer your main question, but it will at least let you get rid of the red.
  • Options
    SethFSethF Member Posts: 129 PRO
    edited August 2021
    Nevermind, I got it.

    Also, I think you may need to change your sharing options. I'm having a hard time making a copy of your document to fiddle with.
    I think there are some instructions about sharing here: Forum Post Checklist **** READ THIS FIRST ****

  • Options
    NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,377
    That was a bit of a challenge, but the fact that the top and bottom profiles pattern at different spacing makes it more difficult. I got around this with patterning surfaces, transforms and variables to make the lofts. 
    https://cad.onshape.com/documents/e6501b337551dc9a7d5af58f/w/2d98f28f6045631459c40fa0/e/2aefa9a7cf5278a7e2c513b7
    Senior Director, Technical Services, EMEAI
  • Options
    fstfst Member Posts: 44 ✭✭
    Thank you @SethF and @NeilCooke for your feedback  - @NeilCooke thanks for your effort, great solution! Didn't have on the radar that one can put even variables into patterns - this is quite powerful! On first sight this should scale to arbitrary num_pipes - at least I didn't see that you had to hardcode anything. But at least on first try it stops working at 20 pipes? (More a hypothetically me-trying-to-understand-what-is-going-on question, less a super critical limitation as 20 would be plenty for my scenario)
  • Options
    NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,377
    @ferdinand_strixner - it does work > 20 - what you are seeing is the unhidden surfaces that were used for construction. I had set it to 20, hidden all the surfaces then reduced the number, so if you go over 20 it will show them (just hide them again).
    Senior Director, Technical Services, EMEAI
  • Options
    fstfst Member Posts: 44 ✭✭
    Ah, I see. Thanks a lot!
  • Options
    Evan_ReeseEvan_Reese Member Posts: 2,064 PRO
    Hi Ferdinand,

    You actually picked a pretty tricky first exercise, but it seemed like a fun challenge. If you needed to make these a lot of these for some reason, it is possible write a whole custom feature that does all of it with a single command. You can also do it with just the native features, but the method is very Onshapey. See below.

    I found a way to do it using some variables for math and a feature pattern to create a sort of "for loop" to iterate over. Note, I patterned surfaces, not sketches since it's more stable. I'm not going to cover everything I did since you can dig into my example document for that, but there are a number of important things with this method:
    1. set a variable #i and then set it again equal to "#i + 1". Only pattern the second one so #i increases by 1 every loop.
    2. set other things as multiples of #i. in this case the distance I'm translating the squares is the size of the square, and the gap between them, times #i. Like this: (#bigSquare+#gap)*#i
    3. Make sure the circular pattern angle is 0. This makes it just loop over the features you pick without moving anything.
    4. Set the circular pattern to "Apply per instance" so it actually repeats the features each loop.

    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • Options
    fstfst Member Posts: 44 ✭✭
    Thanks @Evan_Reese, very cool! The DeletePart step makes deleting the surfaces unnecessary!
    It seems that #i isn't used in your final solution anymore, right? So multiplying with i would probably be an alternative to putting the Transform step into the pattern?
  • Options
    NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,377
    @Evan_Reese - interesting. Similar, but interesting.... :wink:
    Senior Director, Technical Services, EMEAI
  • Options
    Evan_ReeseEvan_Reese Member Posts: 2,064 PRO
    @NeilCooke
    haha, I didn't mean to rip you off 😬. I didn't see that you'd already done it since I queued up my reply last night, but didn't refresh the page to see new comments when I sent it this morning. I'm honestly just happy to have come up with something similar to Neil Cooke.

    @ferdinand_strixner
    You're right, I ended up making the #i obsolete without noticing. It's what I get for doing it at night.

    I'm not sure why mine works without also patterning the Offset Surface feature, but Neil's doesn't like it. Since his is creating a new surface with each loop, I tried adding a Delete Part feature to it, and that works to get rid of all of the surfaces too.


    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • Options
    NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,377
    @Evan_Reese I hate to admit it but yours is better. 
    Senior Director, Technical Services, EMEAI
  • Options
    fstfst Member Posts: 44 ✭✭
    Thanks to both of you again! Have learned a lot about Onshape from this single example!
Sign In or Register to comment.