

Re: Why isn't an equation driven curve generating correctly to specifications?
Mark Szlazak Jun 2, 2018 2:41 PM (in response to Josh Brady)The spiral is black but turns blue to select it and bring up the Equation Driven Curve manager. Also the position of the endpoints is correct.
In polar coordinates for any point Q(r, theta) of an Archimedean spiral centered at the origin but not necessarily starting there, with pitch P, r = Rc and a = P / (2*pi) then it's equation is:
Q(r, theta) = Rc + a*theta
So when theta is 0 then point Q is Rc units from the origin to the right. Theta positively increases counterclockwise.
In Cartesian coordinates you simply project point Q onto the x and y axes and get these formulas:
x(theta) = (Rc + a*theta)*cos(theta)
y(theta) = (Rc + a*theta)*sin(theta)
Instead, if you want the spiral referenced from it's outer radius Rs winding inward then r = Rs and the equation for Q(r, theta) is:
Q(r, theta) = Rs  a*theta

Re: Why isn't an equation driven curve generating correctly to specifications?
Mark Szlazak May 30, 2018 6:52 AM (in response to Mark Szlazak)CORRECTION: The position of the first endpoint is correct but the second endpoint is slightly off.

Re: Why isn't an equation driven curve generating correctly to specifications?
Josh Brady May 30, 2018 9:06 AM (in response to Mark Szlazak)Mark Szlazak wrote:
The spiral is black but turns blue to select it and bring up the Equation Driven Curve manager. Also the position of the endpoints is correct.
The equation in polar coordinates for any point P of an Archimedean spiral centered at the origin but not starting there is:
P(r, theta) = a + b*theta
So when theta is 0 then P is "a" units from the origin to the right. Theta positively increases counterclockwise.
In Cartesian coordinates you simply project point P onto the x and y axes and get these formulas
x(theta) = (a + b*theta)*cos(theta)
y(theta) = (a + b*theta)*sin(theta)
Thanks... I can math.
You don't need "P" in your equation. P is just calculated directly from Rc, Rs, and N. Examine what I posted above and keep mathing...
The reason your spiral was black is that it had a "Fixed" relation. I just noticed that in your original post. It looks like it's still out of position on your final screenshot. If you've done this right (and you're really going for 13.25 turns), the endpoint should be straight vertical from the origin.
See the attached file. It updates correctly upon rebuild with correct spiral position for any Rc, Rs, or N as you change the dimensions in Sketch1. There are no additional parameters, intermediate calculations, or equations.

SpiralEquation.SLDPRT.zip 58.5 KB

Re: Why isn't an equation driven curve generating correctly to specifications?
Mark Szlazak Jun 2, 2018 1:07 PM (in response to Josh Brady)Thanks but going for 13.25 turns is not my problem. N is calculated from Rs, Rc and P as shown in the equations. The endpoint positions are now correct as shown in my post below. Yes one can calculate P if one likes and it may simplify things for me in an expanded equation for the spiral later on down the road. Thanks again for pointing that out.

Re: Why isn't an equation driven curve generating correctly to specifications?
Josh Brady May 30, 2018 11:27 AM (in response to Mark Szlazak)OK... Your original post showed Rs, Rc, and N as the first things. Therefore, I assumed that P was intended to be driven by N.
For anyone else, the parametrized equation in terms of Rs, Rc, and P only would be:
("Rc@sketch1" + ("Rs@sketch1""Rc@sketch1")*t*0.5/pi)*cos(("Rs@sketch1""Rc@sketch1")/"P@sketch1"*t)





Re: Why isn't an equation driven curve generating correctly to specifications?
Roland Schwarz May 29, 2018 10:25 AM (in response to Mark Szlazak)Interesting.
First thing I would do is handcalculate the beginning and end result using exact same parameters.
Second thing I would look at is rounding error do to approximation of 2*pi.
Not sure what to make of the "t*0.5/pi" portion of your radius. Might be better to rearrange your equations so that you're going from t=0 to t=turns*2*pi.

Re: Why isn't an equation driven curve generating correctly to specifications?
Josh Brady May 29, 2018 10:50 AM (in response to Roland Schwarz)The t*0.5/pi stuff is due to the rearrangement of the equation to keep # of turns out of the parameter limit. Pretty sure the equations are OK, the spiral's position is just undefined. The equation driven curve is not "locked in" to the sketch's coordinate system.

Re: Why isn't an equation driven curve generating correctly to specifications?
Roland Schwarz May 29, 2018 10:52 AM (in response to Josh Brady)Didn't mean to run over what you stated, Josh. Your first reply wasn't visible for some reason.

Re: Why isn't an equation driven curve generating correctly to specifications?
Josh Brady May 29, 2018 11:17 AM (in response to Roland Schwarz)Maybe I got moderated again... :D
Just some additional info... No need to calculate P.
("Rc@Spiral properties" + ("Rs@Spiral properties""Rc@Spiral properties")*t*0.5/pi)*sin("N@Spiral properties"*t)


Re: Why isn't an equation driven curve generating correctly to specifications?
Mark Szlazak Jun 2, 2018 1:10 PM (in response to Josh Brady)Correct about keeping the number of turns out but the bigger issue for me was that I cannot get t1 nor t2 to accept a sketch dimension names like "N@Spiral properties" and leave them open to updating. "N@Spiral properties" gets it's value inserted in and it stays hard code to that value.
Also, I get no indication that my Spiral is underdefined and not locked in.




Re: Why isn't an equation driven curve generating correctly to specifications?
Casey Bergman May 30, 2018 9:49 AM (in response to Mark Szlazak)Mark, would you mind sharing the corrected file? I am curious as we use this type of curve often and I have not seen it done this way before.

Re: Why isn't an equation driven curve generating correctly to specifications?
Josh Brady May 30, 2018 10:15 AM (in response to Casey Bergman)Casey Bergman wrote:
Mark, would you mind sharing the corrected file? I am curious as we use this type of curve often and I have not seen it done this way before.
Use my file. It's simpler. And correct.

Re: Why isn't an equation driven curve generating correctly to specifications?
Casey Bergman May 30, 2018 10:22 AM (in response to Josh Brady)I am not able to open your file, we are still on 2016

Re: Why isn't an equation driven curve generating correctly to specifications?
Josh Brady May 30, 2018 10:35 AM (in response to Casey Bergman)Hmm, in that case, his file will also likely be useless to you. He's running the educational version.
Here is a screenshot containing all the info required to recreate:
And here's a copypaste equation so you don't have to type so much, as long as you name your dimensions. Just change the "cos" to "sin" for the y(t)
("Rc@sketch1" + ("Rs@sketch1""Rc@sketch1")*t*0.5/pi)*cos("N@Sketch1"*t)

Re: Why isn't an equation driven curve generating correctly to specifications?
Casey Bergman May 30, 2018 2:39 PM (in response to Josh Brady)I am still not able to get this to work. If someone has 2016 or older and has done this would they share the file?

Re: Why isn't an equation driven curve generating correctly to specifications?
Josh Brady May 30, 2018 4:21 PM (in response to Casey Bergman)If you'll post what you've got I may be able to tell you how to fix it with a screenshot or two.
Casey Bergman wrote:
I am still not able to get this to work. If someone has 2016 or older and has done this would they share the file?


Re: Why isn't an equation driven curve generating correctly to specifications?
Josh Brady May 30, 2018 5:23 PM (in response to Casey Bergman)R is for Radius. Your circle dimensions are actually diameters.
Yes, the "t" comes from the t1 and t2 boxes. Basically, because it's a parametric equation, both the X and Y equations are evaluated for every value of t from t1 to t2.

Re: Why isn't an equation driven curve generating correctly to specifications?
Casey Bergman May 30, 2018 5:34 PM (in response to Josh Brady)Good catch Josh, I didn't even think about that being a radius instead of diameter.
I knew the parametric equation needed it but was confused when I was seeing Mark using "t" as a variable for thickness. Thought I was missing something.










Re: Why isn't an equation driven curve generating correctly to specifications?
Mark Szlazak May 30, 2018 1:28 PM (in response to Mark Szlazak)I case anyone is wondering why i am doing things this way. First I do not initial want to run a macro/script although i might down the road. Second, I have a complicated curve to sketch which will be update manually (or by a macro). The equations for the Archimedean spiral i posted previously can be updated so P is moved to a new point position P'(r', theta') where r' and theta' are modifications to r and theta as shown here: