News:

All posts discussing pricing or where to buy TurboCAD will be deleted.

Main Menu
TurboCAD 2026 Platinum box
Now available

TurboCAD 2026.2

The latest update for TurboCAD 2026. It installs over any 2026 build and keeps your activation, drawings and settings. Get it from the Start Page or Help > Check for Update.

Sine wave

Started by Duram, September 26, 2014, 06:57:19 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Duram

How to draw a spline/bezier in a sine form?


Henry Hubich

One method is outlined in the two attached illustrations.

Henry H

Duram

for cosines is the same?

Henry Hubich


Dean

#4
Quote from: Duram on September 26, 2014, 06:57:19 PM
How to draw a spline/bezier in a sine form?

Aside from Henry’s Great Tip!, you can draw the sine wave >
Set up the grid as seen in the attached image and draw the curve with a 2d fitted spline (9 degrees)
Also, if you twist Marek’s arm, maybe he could write a ruby script that graphs the sine function.
Imsi really needs to offer some  :PMORE ruby scripts that are of some use.

The coordinates in the image are for only displaying the grid layout.
Place the spline snapping to the grid intersections. 
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

murray dickinson

#5
helixes and twisted extrusions are also sine waves in ortho view.  Exploded drafting palette section of a twisted extrude (of a line) is splines.  Helixes can be swept along a path and sectioned.

Henry Hubich

Quote from: murray dickinson on September 28, 2014, 07:33:12 PM
helixes and twisted extrusions are also sine waves in ortho view.  Exploded drafting palette section of a twisted extrude (of a line) is splines.  Helixes can be swept along a path and sectioned.

It seems that a TCad "Helix" cannot be flattened onto an ortho view, and neither can the 3D Spline that results from exploding the Helix. It is possible, however, to trace that 3D Spline with a 2D Spline, and the result is a sine curve. In fact, it's downright easy to do if one enables "Show Frame" for the 3D Spline and then snaps to the vertices of the Frame.

(It's also possible to create a new 3D Spline by tracing the frame of the exploded Helix. For some reason, this entity can be flattened.)

Henry H

murray dickinson

#7
Quote from: Henry Hubich on September 28, 2014, 09:25:49 PM
It seems that a TCad "Helix" cannot be flattened onto an ortho view, and neither can the 3D Spline that results from exploding the Helix.
Henry H

I'm finding the 3D spline will flatten in node editing, using selector mode.  Select all nodes and assign the zero value to the size box of the appropriate axis.

Duram

All of these solutions really give an sine curve o a "'almost like" sine curve?

is there any math to prove the flattened helixes is a real sine curve, all (X,Y) points
are in the Y=sine(x) function?

This Dean idea gives also a true function?

"Set up the grid as seen in the attached image and draw the curve with a 2d fitted spline (9 degrees) Also, if you twist Marek’s arm, maybe he could write a ruby script that graphs the sine function.
Imsi really needs to offer some  :PMORE ruby scripts that are of some use.

The coordinates in the image are for only displaying the grid layout.
Place the spline snapping to the grid intersections."




Marek

Hi Duram
I attach two simple Ruby scripts sin and cos. I have not tested them for a long time, but I think you can draw these functions with their help. The graph is a polyline, because then the exact value of x and y can be read from the graph. You can swap in the script "TCW30Polyline" to "TCW30Curve" or convert a polyline to curve and see what will happen.  You must be careful not to set the left and right range and interval dx, so that  values ​​90,180 and so on, will be omitted .
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

Cliff2


Henry Hubich

Quote from: Duram on September 29, 2014, 05:48:51 AM
All of these solutions really give an sine curve o a "'almost like" sine curve?

is there any math to prove the flattened helixes is a real sine curve, all (X,Y) points
are in the Y=sine(x) function?

This Dean idea gives also a true function?

"Set up the grid as seen in the attached image and draw the curve with a 2d fitted spline (9 degrees) Also, if you twist Marek’s arm, maybe he could write a ruby script that graphs the sine function.
Imsi really needs to offer some  :PMORE ruby scripts that are of some use.

The coordinates in the image are for only displaying the grid layout.
Place the spline snapping to the grid intersections."

It's not difficult to prove that a flattened helix is a true sine curve.

Henry H

Dean

Quote from: Marek on September 29, 2014, 07:23:39 AM
Hi Duram
I attach two simple Ruby scripts sin and cos. I have not tested them for a long time, but I think you can draw these functions with their help. The graph is a polyline, because then the exact value of x and y can be read from the graph. You can swap in the script "TCW30Polyline" to "TCW30Curve" or convert a polyline to curve and see what will happen.  You must be careful not to set the left and right range and interval dx, so that  values ​​90,180 and so on, will be omitted .
Marek


Hi Marek, that's awesome! thanks for sharing :)
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

Henry Hubich

#13
Quote from: murray dickinson on September 28, 2014, 10:20:27 PM
Quote from: Henry Hubich on September 28, 2014, 09:25:49 PM
It seems that a TCad "Helix" cannot be flattened onto an ortho view, and neither can the 3D Spline that results from exploding the Helix.
Henry H

I'm finding the 3D spline will flatten in node editing, using selector mode.  Select all nodes and assign the zero value to the size box of the appropriate axis.

That's great, Murray, and it's the simplest method yet for producing a sine curve. "Edit" mode didn't occur to me.

Henry H

Duram

Great solutions you all did but I think in the future versions Turbocad it must include
a Math Function tool, you write down the function  and TC draw it as a Spline,

what do you think of this idea?

Dean

I subtracted a cylinder from a Thread3D,  :)that works too....
> cyclinder dia = the thread dia
>Intersection
> flatten spline.
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

John B.

#16
I took a stab at it and came up with a couple of honest tries.  It's all in the trigonometry.
I tried Revolve and Spline By Fit Points.  The x and y of the sine wave should be calculated beforehand.  Also, for developers, a x-length and y-length could be used with the Spline By Fit Points tool.  Or, maybe just one wave could be made and then do a linear or fit linear copy?

http://www.purplemath.com/modules/triggrph.htm
https://www.google.com/search?q=how+to+draw+a+sine+wave&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=sb
https://www.youtube.com/results?search_type=search_videos&search_query=how+to+draw+a+sine+wave&search_sort=relevance&search_category=0&page=

John B.
John B.
TCv2019 Platinum
Windows 10 Pro 64 Bit
1 GB Hard Drive 16 GB RAM
AMD Radeon RX 580 Series

Henry Hubich

Quote from: Duram on September 29, 2014, 10:14:48 AM
Great solutions you all did but I think in the future versions Turbocad it must include
a Math Function tool, you write down the function  and TC draw it as a Spline,

what do you think of this idea?

I think it's a great idea.

Henry H