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.

# Parameter input for n-sided polygon in sketches

imants_smidchens
Member Posts:

**9**EDU
I found myself designing a configurable 3-sprocket chain for a robotics project, and as I read up on how chain pitch works, I found the simplest way to generate a variable n-toothed sprocket was to define a polygon with n sides and a side length of the chain pitch (seen below)

Currently the polygon tool does not allow for parameter-driven polygons, as variables are not considered valid expressions.

I realize this is likely because the input for such a polygon must be a natural number, but being able to configure this would be nice.

I also realize I could just define the diameter of the circle to be (# of sides)*(pitch length)/(pi) and call it good enough, but my brain prefers the geometric visual solution ¯\_(ツ)_/¯

Thanks for your time!

Currently the polygon tool does not allow for parameter-driven polygons, as variables are not considered valid expressions.

I realize this is likely because the input for such a polygon must be a natural number, but being able to configure this would be nice.

I also realize I could just define the diameter of the circle to be (# of sides)*(pitch length)/(pi) and call it good enough, but my brain prefers the geometric visual solution ¯\_(ツ)_/¯

Thanks for your time!

0

## Comments

9EDUPerhaps a more robust solution (in my case, at least) is to define the circle with an isosceles triangle.

definitely works well enough, at some point i'll get around to writing a featurescript that doesn't have this bothersome intersection issue between chain links