How to create a perfect (or atleast very close) sine wave

How to create a perfect (or atleast very close) sine wave

drakejest
Participant Participant
16,460 Views
18 Replies
Message 1 of 19

How to create a perfect (or atleast very close) sine wave

drakejest
Participant
Participant

Hello very new to fusion 360 and i could not even get past the sketch phase. I am attempting to create 1 cycle of a perfect or atleast very near where the areas inside are very close inside a 150 by 1035 rectangle

 

I have tried dividing the long side of the rectangle and using those as points for spline. although spline is sinewave looking it can be tricky to get a near perfect sine wave with spline

 

Capture.JPG

 

 

Please teach me how to get a perfect sine wave

 

0 Likes
Accepted solutions (1)
16,461 Views
18 Replies
Replies (18)
Message 2 of 19

JHRendon
Advocate
Advocate

Hi! Maybe you should add "tangent" constraint. You do not need add rectangles, you can add a dimensions directly to a point of a curve. you can add points and add constraints. If you do not feel good making a sin wave like that. You coudl try "Driven equation" add-in 

JHRendon_0-1613348446434.png

You could find it in autodesk appstore https://apps.autodesk.com/en for free

JHRendon_1-1613348489726.png

 

0 Likes
Message 3 of 19

etfrench
Mentor
Mentor

Three point arcs will also give you something which looks like a sine curve.

ETFrench

EESignature

0 Likes
Message 4 of 19

laughingcreek
Mentor
Mentor
Accepted solution

you can get a mathematically accurate sinewave by projecting the edge of a spiral.

laughingcreek_0-1613367008210.png

 

Message 5 of 19

drakejest
Participant
Participant

can tell me how you did the spiral sir? what what parameters do i use to create a perfect sine wave ? or a spiral always is a sine wave, a already have made my spiral with this settings how do i project its edge?

 

Capture.JPG

0 Likes
Message 6 of 19

etfrench
Mentor
Mentor

Attached file shows both the correct sine wave (  @laughingcreek's version) and the 3 point arc version.  In the image, the purple is the sine wave, blue is the 3 point arc:

SineWaves.JPG

 

Sine waves are usually drawn from the midline, but it's simple to move it to the desired position.

Check the coil settings in the attached file.  You can edit the dimensions to create other sizes.

 

I've been looking at sine waves this week trying to determine what the formula would be in polar coordinates. 

 

ETFrench

EESignature

0 Likes
Message 7 of 19

MichaelT_123
Advisor
Advisor

Hi Mr DrakeJest,
Drawing the perfect sin-curve is not facilitated by F360 interface, although it’s 2D&3D descendant are. It’s the norm in contemporary society, so there is no point to complain.
One obvious way to overcome this is to substitute the parent/grandparent with the common universal template, spline that is. Well, this has been pointed out by other interlocutors of this post.
I would like you and others to consider the additional (not necessary time saving) method. As I am not at the front of a computer, the recipe will be in the verbose form.
1. Draw a circle (or any other curve, could be eg. CAM profile)

2. Draw a line segment from the circle centre (preferably X or Y axis parallel)
3. Place, on both curves an equal number of points.
4. On the line segment, the placement of equidistant points would be preferable.
5. On the circle (or an arbitrary curve) points positions will depend upon the mapping method, you desire. I think in the case of sin() parametric pattern on a curve should do the job, but another more sophisticated delineation is possible here.
6. Collect index by index (x, y) coordinates pairs from both curves and draw the respective points.
7. Construct a fitted spline based on them.
8. In your particular case, the result would approximate sin-curve. (I assume that a circle is defined in F360 by the standard parametric equation, ... would be very strange if it is not)
9. In other cases, one could create even a quite complex in-sketch CAM mapping, ready to be used in subsequent steps of a design process.


Regards
Michael

MichaelT
0 Likes
Message 8 of 19

etfrench
Mentor
Mentor

@MichaelT_123 That works quite well 😊 

SineWaves2.JPG

Now, how to express it in polar coordinates?

ETFrench

EESignature

Message 9 of 19

MichaelT_123
Advisor
Advisor

Hi Mr. ETFrench,

 

 You are asking:

Now, how to express it in polar coordinates?

 

In a general case, it is a little bit trickier process to accomplish. (Sin curve is so trivial that it is not attractive).

On a side note, there are a vast number of specialized coordinate systems, particularly in higher dimensions (>3D). In the mechanical world, which is staunchly conservative, the cartesian system suffices for most. The polar/cylindrical one would also be useful. Not surprisingly, it is easy to conceptualize as it resembles a can of beer we are so fond of. People would love it and study it extensively, I suppose 😁. Other coords systems in F360? Dreaming is free… so far.

 

TangoPetal.png

 

Attachments:

TangoPetal_mono.mp4           4K_mono (60MB)   link: https://a360.co/2NJlljN

TangoPetal_arcd.mp4             4K_stereo (170MB) link: https://a360.co/3dzO71c

 

To be viewed on 4K media devices (monitors, UHD TVs, projectors,..) of reasonable performance. For the best experience, use stand-alone media applications and the native resolution 3840x2160 – full screen. The stereo file requires an anaglyph red/cyan glasses . Download the files over a network, where the cost of doing so is not a concern. The files are to be used for private, non-commercial purposes only.

 

Regards

MichaelT

 

MichaelT
Message 10 of 19

etfrench
Mentor
Mentor

That is definitely nice.  This is one of the formulas I'd like to convert to polar coordinates: (x, y) = (cos(t), sin(t)) + 2 (cos(7t), sin(7t)) + (sin(17t), cos(17t)).   This paper describes it.

ETFrench

EESignature

0 Likes
Message 11 of 19

MichaelT_123
Advisor
Advisor

Hi Mr ETFrench,

Unfortunately, I have looked into the publication of the Mathematics and Computer Science of Santa Clara University by Frank A. Farris. (https://scholarcommons.scu.edu/cgi/viewcontent.cgi?article=1004&context=math_compsci).

My aim was spending 0.25h to generate the curve you are interested in. However, it took me much more time than I was originally expected. While entering formulas, I encountered some confusions in the article, something went wrong, hence the innocent project has had self-bloated to dangerous proportions.

The author claims that the first curve shown in Fig2. represents equation:

(x,y) = (cos(t),sin(t)) + (cos(7t),sin(7t))/2 + (sin(17t),cos(17t))/3                       t∈[0,2π)             Eq.1

(x,y) = (cos(t),sin(t)) + (cos(7t),sin(7t))/2 + (cos(π/2-17t),sin(π/2-17t))/3        t∈[0,2π)             Eq.1a

Then in the example which shows the core methodology/algorithm developed by the author, he claims that the above equation is equivalent to one written in complex numbers notation:

f(t) = x(t) + iy(t) = exp(it) + exp(7it)/2 + exp(-17it)/3                                                                       Eq.2

Well, based on my very dusty old algebraic abilities, the conversion of Eq.2 to the trigonometric form yields:

(x,y) = (cos(t),sin(t)) + (cos(7t),sin(7t))/2 + (cos(-17t),sin(-17t))/3                                                Eq.3

(x,y) = (cos(t),sin(t)) + (cos(7t),sin(7t))/2 + (cos(17t),-sin(17t))/3                                                  Eq.3a

The last term is different, so there is no equivalency between formulas  Eq.1 and Eq.2. as the writer professes.

Continuing and introducing π/2 phase shift as in Eq.1a it leads to:

(x,y) = (cos(t),sin(t)) + (cos(7t),sin(7t))/2 + (sin(17t),cos(17t))/3                                                    Eq.3b

This is the equation which is depicted on Fig.2 and Eq.1. The article’s equation Eq.2 (without phase shift) produces a different outcome. The difference is in the sign mark (and π/2) , which is such annoying creature in math and physics. How about making + & - equal… by an executive order?

Additionally, the presented universal mathematical model does not match the quoted description and the depiction in Fig.1.

“The first term represents the largest wheel, of radius 1, turning counter-clockwise at one radian per second. The second term represents a smaller wheel centered at the edge of the first, turning 7 times as fast. The third term is for the smallest wheel centered at the edge of the second, turning 17 times as fast as the first, clockwise and out of phase.”

In situ kinematic simulation with parameters taken from Eq.2 leads to the different outcome as in the following picture and video file Eq_2_HD_mono.mp4. They are based on the model in the attached file WoWoW_A.f3d. Please, feel free to investigate it and modify if necessary.

EQ_2.png

In the following portion of the article the evaluation of Eq.2 for different parameter values (-2, 5, 19) represented by Fig.3 is correct, although it still  doesn’t match the kinematic as per the illustration on Fig.1.

f(t) = x(t) + iy(t) = exp(-2it) + exp(5it)/2 + exp(19it)/4                    (complex# notation)                 Eq.4a

(x,y) = (cos(-2t),sin(-2t))+(cos(5t),sin(5t))/2+(cos(19t),sin(19t))/4         (trig.notation)                  Eq.4b

R(t)  = sqrt(x**2+y**2)                                                                       (polar representation)                  Eq.4c

I have cut short delving into the following publication’s sections because the math can cause dizziness, sleeplessness, or even deep addiction… not recommended. In brief, these parts prove that imposition of modulo() functions to systems result in periodic/symmetrical outcomes. As such, they can be conveniently modelled by the Fourier series.

 

Mr ETFrench, because for some reason, you like the curve in Fig.2/Eg.1, please find its rendering in the attached file WoWoW_A.f3d. I am sure that after modifications/extensions of the file, you will be able to construct many other incredibly attractive curvatures if this is your favourite past time. Generally, they are relatively safe to watch… and without obligations even if a good vine is on a table 😊.

I have also tossed some CADrtistic variations for Eq.1, Eq.2 and Eq.4/Fig.3 as WoWoW_A*.mp4 videos.

LaSpline.png

Attachments:

Eq_2_HD_mono.mp4             HD_mono  ( 27MB)          link: https://a360.co/2MNhp1q

WoWoW_A_mono.mp4          4K_mono   ( 71MB)          link: https://a360.co/3uTPQo7

WoWoW_A_arcd.mp4            4K_stereo  (203MB)        link: https://a360.co/2OjiAWH

WoWoW_A.f3d                        model          (   2MB)          link: https://a360.co/3baMohg

WoWoW_A.pdf                        this doc       (   1MB)          link: https://a360.co/2PoB9Jw

To be viewed on 4K media devices (monitors, UHD TVs, projectors...) of reasonable performance. For the best experience, use stand-alone media applications and the native resolution 3840x2160 – full screen. The stereo file requires an anaglyph red/cyan glasses. Download the files over a network, where the cost of doing so is not a concern. The files are to be used for private, non-commercial purposes only.

Summary but not conclusion:

The proposed mathematical formula does not correctly describe kinematics of the model as illustrated on Fig.1 and/or its verbal explanation. The minor issue of the negative sign chasing adds to the confusement.

Challenge:

Some modifications are needed to bring a tolerant sync to the publication’s mathematical concoction. What change is required? Specifically, how to achieve model’s kinematics illustrated on Fig.2?  I will leave this for readers to find out. Resources are in place. I hope that couple of days would be enough for the examination. Regardless of the outcome, I will post the answer on 8th of March, early ET. File(s) are ready… already.

 

P.S.

As you have noticed, I have had switched from beer analogy to a vine metaphor … to match the sophistication of Le Connoisseur Français. I have a strong sense that Beer Gulping Commoners will swallow this change … sip by sip also 😊.

 

 

 

 

MichaelT
0 Likes
Message 12 of 19

etfrench
Mentor
Mentor

 

I thought you might like it.  Hopefully you had enough wine.😀  I'm going to need more than wine, I think. 

The videos are impressive. I'm sure it will take me long after the 8th to figure out how you did it.

My main reason for asking about the formulas is I would like to reproduce them on wooden boxes and forms using my Rose Engine.  Mechanically, these have been done since the invention of the geometric chuck in 1835.  My Rose Engine has stepper driven axes and spindle, but doesn't use gcode.

Here is an example of a piece done with a Rose formula:  

20191030_143153_001p.jpg

ETFrench

EESignature

0 Likes
Message 13 of 19

MichaelT_123
Advisor
Advisor

Hi Mr ETFrench,

The magic numbers corresponding to (1,7,-17) are (1,6,-24). There are not so magical as simple calculations can explain them. 

Picture_Guilloche.png

 

 

The above formula is a part of the attached file WoWoWo_Guilloche.pdf  containing a more detailed explanation of how it has been derived. Unfortunately, I can't place the content of it directly here because I can't stand the cruelty of the Limited Intelligence (LI) web editor, which destroys the formatting I have put so many efforts into.

I hope that you will find the formula intuitive. If you close your eyes and connect successfully to funiverse (by the back of your head), the equation's geometrical meaning will be clear. Start with two circles only, and all will be revealed transcendentally like after… a crisp shot of Baltic region vodka.

 

I hope that it is now apparent how to modify WoWoW_A.f3d  file attached in my previous post so as to force the pointer to follow the enticing function of your dream… GuillocheFunc((1,6,-24)|(1,7,-17)) that is.

 

Mr ETFrench, in order to conclude this lengthy exercise, I am tossing in the CADrtistic variations of it as WoWoW_B*.mp4 videos for good measure 😉.

Glass_Guilloche.png

 

 

 

Attachments:

WoWoW_B_mono.mp4          4K_mono    ( 22MB)         link: https://a360.co/3uTPQo7

WoWoW_B_arcd.mp4            4K_stereo   (60MB)         link: https://a360.co/2PNeTJP

WoWoW_B.f3d                        model          (   2MB)         link: https://a360.co/3rsBRnn WoWoW_Guilloche.pdf                               (   1MB)         link: https://a360.co/3rycmBe

To be viewed on 4K media devices (monitors, UHD TVs, projectors...) of reasonable performance. For the best experience, use stand-alone media applications and the native resolution 3840x2160 – full screen. The stereo file requires an anaglyph red/cyan glasses. Download the files over a network, where the cost of doing so is not a concern. The files are to be used for private, non-commercial purposes only.

 

With Regards

MichaelT

 

P.S.

The piece of art you presented in your last post is … splendid! It will be very hard to improve…

 

 

MichaelT
0 Likes
Message 14 of 19

etfrench
Mentor
Mentor

Well, my head is still hurting, I'm out of beer and I still haven't figured out how the 'Curves' sketches were made 🤔

ETFrench

EESignature

0 Likes
Message 15 of 19

MichaelT_123
Advisor
Advisor

Hi Mr ETFrench,

 

Many features, curves, pictures and videos were made using the extension to F360 I call MT123, which weights many tens of thousands (if not more) code lines. So it is not a problem with your head😉.

There are some add-ins in F360 depositories that you can try to generate the curves based on functions describing them. I have never tried them, so you are on your own there.

 

With Regards

MichaelT

 

PS.

I think in the previous post, I linked not the necessary files I wanted. Here are updated links.

WoWoW_B1_mono.mp4          4K_mono    ( 48MB)                               https://a360.co/2Oz7AEN 

WoWoW_B1_arcd.mp4             4K_stereo   (150MB)                              https://a360.co/3ceTC3e 

 

 

 

MichaelT
0 Likes
Message 16 of 19

webweave
Explorer
Explorer

Sadly "equation driven curve" is no longer in the autodesk appstore. 

It's a shame there's no way to have an equation drive a sketch tool. I just needed a more accurate sine wave to correct errors I was getting while making a pattern using a sine wave. I used the "Spline" tool over construction lines thinking that would be accurate enough. It turns out that the first couple cycles of my line are not usable and if you trim a Spline curve it will modify the line and effect the adjacent cycle. Look at my diagram and see how the first two cycles are off. To eliminate this I had to draw extra cycles and use "Distance" in Features of the Sweep tool to eliminate the unwanted cycles.

 

The Spline tool is more for drawing artwork than engineering as it makes compensations that aren't easily seen while drawing them. The spline tool resembles something in Adobe Illustrator used to create typefaces.

 

Screenshot 2025-02-17 at 12.03.41 PM.pngScreenshot 2025-02-17 at 12.11.39 PM.png

0 Likes
Message 17 of 19

etfrench
Mentor
Mentor

Did you constrain the endpoint handles to horizontal with the Horizontal/Vertical constraint tool?  You can also use the Tangent constraint on spline endpoints.

ETFrench

EESignature

0 Likes
Message 18 of 19

RA_Nouveau
Enthusiast
Enthusiast

https://www.reddit.com/r/Fusion360/comments/v0a1b7/approximating_sine_curve_with_cv_spline/

I came up with this very close approximation a few years ago. 

 

 

 

 

0 Likes
Message 19 of 19

webweave
Explorer
Explorer

Thanks, both good replies!

 

Dragging the endpoint handles is still a manual job. What I got to work for me was to create a sine wave in Desmos and import it as a graphic using "Insert"- "Canvas" calibrating it, then opening a sketch on the same plane and drawing construction lines, then tracing over using the spline tool. It's extremely manual but solves the problem I was having with reproducing patterns not matching at the transitions.

 

Autodesk please bring back "equation driven curve" to the autodesk appstore. 

 

Screenshot 2025-02-25 at 8.40.44 AM.png

0 Likes