Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
Best approach for creating polygons with variable number of sides
alex_bryant170
Member Posts: 3 ✭
It seems it's not possible to declare an integer variable and use this in the value for side count for an inscribed polygon on a sketch, but it is possible to use a variable value for feature patterns.
Given this is the case, what would the most efficient approach be for creating a polygon of any number of sides with a variable? Essentially my aim is to have a number variable that (for example) could be changed from 3 to 4 to change a basic 1cm depth equilateral triangle into a square.
I can see this being possible by constructing shapes with >3 sides from triangles with a feature pattern and calculating the internal angles using this variable but it would be quite slow to apply this multiple times in a sketch and could get quite messy to maintain.
Given this is the case, what would the most efficient approach be for creating a polygon of any number of sides with a variable? Essentially my aim is to have a number variable that (for example) could be changed from 3 to 4 to change a basic 1cm depth equilateral triangle into a square.
I can see this being possible by constructing shapes with >3 sides from triangles with a feature pattern and calculating the internal angles using this variable but it would be quite slow to apply this multiple times in a sketch and could get quite messy to maintain.
0
Best Answers
-
emagdalenaC2i Member, Developers, Channel partner Posts: 863 ✭✭✭✭✭Here it is...
You can use 360º/NumberSides as input
Un saludo,
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común10 -
Cris_Bowers Member Posts: 281 PROYou have a few options with the variables. One option is what @emagdalenaC2i shows.If you want a more robust part you can use configuration variables to control the number of sides, depth of the extrusion, and size of the part. That would look like this6
Answers
You can use 360º/NumberSides as input
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común