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.

Options

# Equation-driven curve

Edward_Goodwin
Member Posts:

**25**PRO
in General

Hi, is there any way to create an equation-driven curve? I've searched a bit on-line but can't seem to find something that does what I'd like. I'm looking to create a curve which follows a mathematical formula. It could be either polar or cartesian - doesn't matter which.

All thoughts gratefully received

Edward

All thoughts gratefully received

Edward

0

## Comments

124TVP, Onshape R&D

25PROIs that a feature available in Onshape?

1,187124https://cad.onshape.com/documents/9f37c17aa964f1f4f3bc7bf1/w/dc8b4abdb015d5cc66bfd1f7/e/8622366028535ec6b660fd28

TVP, Onshape R&D

25PRO25PRO1,187if I simply want to define x as a function of y, do I still have to use the independent parameter? Also, as I only want a 2d curve, I presume I simply make z=0mm (to draw on the top plane).

1,296✭✭✭✭✭25PROAlso, slightly unrelated to the (simple) maths that I'm failing to be do right now(!) is it possible to draw the parametric curve in a sketch as opposed to creating an independent curve? Or do I have to offset entities/use the curve within a new sketch? If so, the offset curve within the sketch doesn't appear to update if the parametric curve is modified. Is that correct?

Next, in your examples for the parametric curve feature, the actual curve functions appear to be hidden - I can't simply double-click the feature within the document to understand how you've set up the functions. Is that something that I can access (i.e. am I doing something wrong?) or is it hidden on purpose?

Finally, just so you know, Cartesian is spelt with an 'a' not an 'o' (you have 'Cartesion' in the feature script ;-)

Thanks for all your help!

Edward

1,1871. Not knowing if #t is in degrees or radians is precisely why it returns an error. Use cos(#t deg) or cos(#t rad). Also, you need to write out multiplication explicitly: a * cos(#t deg)

2. You can't draw a parametric curve in a sketch, but once you have it separately, you can reference it from a sketch -- project it and then you can offset it.

3. You can't see the functions in the example document because you don't have write access to the document (we're actually working on fixing that so you can see the expressions) -- for now, make a copy of the workspace for yourself and you'll be able to see the functions there.

1,296✭✭✭✭✭As for spherical/cylindrical coordinate systems, they're very handy and intuitive once you know how to use them. Instead of linear XYZ positions, you can use one or more angles instead - R/Theta/Z for cylindrical and R/Theta/Phi for spherical. For example, your circle is much easier in cylindrical coordinates. No messy trig functions - at least not that you can see. All the trig happens behind the scenes.

Cartesian Cylindrical

X=r*cos(#t deg) R=2*r

Y=r*sin(#t deg) Th=#t

36✭✭--Thank you Paul for the example file! This was a helpful contributionI was able to get a coshx curve usingCan I copy it into a sketch and then transform/scale it?1,296✭✭✭✭✭1✭1,296✭✭✭✭✭Try this. #t by itself is unitless. OS might assume a unit, but it won't necessarily be the right unit (rad vs deg).

R = 5*#t/360+5

Theta = #t deg

1✭2✭When we are talking about the wavelength of light though ... and 3D printing the mirror and coating it ...

I'm concerned about the accuracy that it will not be enough being for a Telescope.

It will need a Foucault Test as well. Or something better like it.

Moving to equations now.

So excuse me for asking with such ambiguity as I take Integrals are we able to do much of the stuff with curves we are learning about ?

(There is currently a Telescope Lawsuit on China for price gouging and monopoly)

2✭I mean you don't want jagged edges on mirrors reflecting telescope light back.

2,072PROWebsite: ovyl.io

2✭The only difference with the function for Y is a sin in place of a cosine. I have tried with and without the inch unit callout at the end, as well as putting the rad unit callout inside the parentheses of the parameter (#t*rad), and getting rid of the rad unit callouts next to the parameter callouts that aren't inside the cos, all without success. Any help would be appreciated, thank you!

1,296✭✭✭✭✭X: (cos((2*PI-#t)*rad)*(1-.00024964*#t)^6-.0047*#t^5-.0296*#t^4+.0619*#t^3)*in

Y: (sin((2*PI-#t)*rad)*(1-.00024964*#t)^6-.0047*#t^5-.0296*#t^4+.0619*#t^3)*in

https://cad.onshape.com/documents/305f97b18fef3b69ced065d7/w/a808a34d0b2cf12d791796ab/e/8a3c082a96807eda9e2f54f3

3EDUStudent: "What's a heart shaped cam for"

Me:"Let's see what we find... oh, Google says it's to create uniform velocity. Which means we need a cardioid function!"

I don't see a Polar coordinate system (unless that's what Cylindrical is).

Otherwise, how would I enter the Cartesian version into the Parametric curve function?

1,296✭✭✭✭✭