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.


michael_mcewenmichael_mcewen OS Professional Posts: 77 PRO
I'm trying to create a file for a 5 axis laser to cut a "random" pattern of a few sizes of holes in a hemispherical metal spinning. I have no idea how to approach this with any efficiency. If I create a plane perpendicular to the center of the hemisphere, there is really only one hole (at the center of the plane) that is truly round; all others will be elliptical. Using the circular pattern tool to multiply planes with one hole each seems like a ridiculous approach. There has to be a better way.

It doesn't help that I want to achieve the appearance of a random hole pattern AND that I need to taper off the density of holes as I move from the mid-line of the hemisphere to the top. Please, any guidance or suggestions would be so appreciated.  Here's my link.  You can see what I've tried.  Thank you.  -Michael




  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646

    From the perspective of a programmer, I see this as the perfect task for FeatureScript.  What I would do here is the following:

    Define some CSV file full of "directions" and "radiuses" in some consistent format.  What I'm thinking is direction from center and radius of each hole.

    For each of these holes, make a circular sketch with the specified radius at the origin of the sphere, and extrude it through all in the specified direction.  Then subtract from the sphere.

    These steps are not really feasible manually, but something that would be super easy with a custom feature.  I'll put together an example you can "borrow" :)
    Jake Rosenfeld - Modeling Team
  • michael_mcewenmichael_mcewen OS Professional Posts: 77 PRO
    Hi Jake, so sorry for the late response. I've been fairly distracted by the virus. I hope you are well!
    Thank you so much for suggesting an approach to my issue, although I'm not certain I fully understand how to go about it. You mentioned putting together an example. Is that something you'd still be willing to do?

    Thanks again, -Michael
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    edited March 2020
    Hi @michael_mcewen

    Apologies for the delay, here's that feature I promised:

    To add it to your toolbar just navigate to the example part studio and press the "+ custom features" button.  You'll have to make your own CSV file and import it into your own document.  There is a link to an example in google docs provided in the documentation.  You can make a copy of this google doc and edit it to your liking, then save as CSV and import into your Onshape doc.  Or if you have some other preferred method of making the CSV you can do it a different way.
    Jake Rosenfeld - Modeling Team
  • michael_mcewenmichael_mcewen OS Professional Posts: 77 PRO
    Thank you Jake. I'll give it a try.  Much obliged!
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    To add to Jake's approach, you can now use Excel to generate a CSV with the "random" pattern of hole locations and sizes using RANDBETWEEN(min,max) or min+RAND()*(max-min). There would need to be some manual tweaking or extra formulas to taper the density.
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    Since we're discussing how to get the numbers, @anton_b suggested that I could use the Fibonacci sphere algorithm to get a uniform distribution, then use a random number generator in FeatureScript to get the hole radius at each point (scaled in some way by elevation angle) to achieve the result that you want in your original picture.  I opted to not go down that route because I felt that it would be better to leave it to the end user to decide where their holes go and how big they are.  But we would be happy to discuss further here if anyone is interested! 
    Jake Rosenfeld - Modeling Team
  • michael_mcewenmichael_mcewen OS Professional Posts: 77 PRO
    Thanks for your input Mahir. It's great to have a few options to play around with.
  • michael_mcewenmichael_mcewen OS Professional Posts: 77 PRO
    Thanks again Jake. I've had very little experience with using feature script, but I've been able to play with your method a bit and it's pretty easy to employ.  Just need to get the hang of "driving" the excel file, so to speak!
Sign In or Register to comment.