graymachine 0 Report post Posted September 14, 2007 Anyone have an easy way of drawing a sine curve in AI? Quote Share this post Link to post Share on other sites
graymachine 0 Report post Posted September 14, 2007 (edited) Oh wait.. I get to say this for the first time... This is SOO much easier in Cinema 4D. Just use a Formula spline and adjust the X & Y. Yay! Edit... sorry, I think I mean "Spline" and not "Curve". Edited September 14, 2007 by graymachine Quote Share this post Link to post Share on other sites
shinjin 0 Report post Posted September 14, 2007 Oh never tryed that one, thanks Quote Share this post Link to post Share on other sites
Guest dumbo Report post Posted September 14, 2007 http://www.telegraphics.com.au/sw/info/sinehow.html download the .ps file (which can be opened with illustrator) and modify the code inside the .ps with bbedit or similar. %!PS-Adobe %%BoundingBox: 30 200 650 400 % Sine wave drawing by Toby Thain (mailto:toby@telegraphics.com.au) % - straight line approximation % - simplistic Bezier curve fitting % both governed by "step" parameter (radians) % Copyright (C) 2001-3 Toby Thain, toby@telegraphics.com.au % % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, write to the Free Software % Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA /pi 3.14159265 def /step pi 4 div def % length of each line/curve segment; radians /curvelength 7 def % curve length in radians /r2d { 180 pi div mul } def % radians to degrees (approx) /f { r2d sin } def % function to plot /f' { r2d cos } def % first derivative /drawpolygon { 0 dup f moveto step dup curvelength { % loop parameters for straight lines (radian units) dup f lineto } for } def /drawcurve { /third step 3 div def 0 dup f moveto 0 step curvelength { % loop parameters for Bezier approximation /x exch def x third add x f x f' third mul add x step third sub add x step add dup f exch f' third mul sub x step add dup f curveto } for } def % transformation of unit sine wave - x radians, y -1..1 50 300 translate 80 80 scale .1 setlinewidth % drawpolygon .6 setgray stroke drawcurve 0 setgray stroke showpage Quote Share this post Link to post Share on other sites
C.Smith 0 Report post Posted September 14, 2007 Oh wait.. I get to say this for the first time... This is SOO much easier in Cinema 4D. I say that every day Quote Share this post Link to post Share on other sites
JonAndesign 0 Report post Posted September 18, 2007 I say that every day Me too! Hence why I do all my emails in Cinema 4D. Quote Share this post Link to post Share on other sites
snakedogman 0 Report post Posted September 25, 2007 I had to do the exact same thing yesteday. In the end I just created one cycle of the wave using the pen tool and snap to grid. Then copied this and connected the new cycles to the original one. I'm not really an expert in either Illustrator or Cinema 4d, but I also was thinking that C4d seems to have a lot more useful tools for drawing splines than AI does. Quote Share this post Link to post Share on other sites
C.Smith 0 Report post Posted September 25, 2007 I'm not really an expert in either Illustrator or Cinema 4d, but I also was thinking that C4d seems to have a lot more useful tools for drawing splines than AI does. It's true. Can't remember where but I saw a post once where a guy compared the spline editing functions between both and C4D bested Illustrator (save a few things). Quote Share this post Link to post Share on other sites
fishface 0 Report post Posted September 25, 2007 couldn't you just join two half circles in AI? Its not that hard. But - really, at this point why aren't there tools already incorporated in the damn program that can help with things like this? You could also try snapping to the grid, creating a linear spline and then rounding the corners effect at the proper radius. that might work. But really, joining two half circles seems faster and easier. Quote Share this post Link to post Share on other sites
graymachine 0 Report post Posted September 25, 2007 Problem is... two half circles are not a Sine wave, though Quote Share this post Link to post Share on other sites
fishface 0 Report post Posted September 25, 2007 Well, that may be true. The principle still holds true. A half circle is a good starting point - just adjust it to the profile of the wave. Duplicate. Move. Join it. Repeat. Quote Share this post Link to post Share on other sites
pixel_pimp 0 Report post Posted September 25, 2007 IS this how Joshua Davis writes programs to use Illustrator make his art? Does anyone know what program he is using to generate his images? QBN session also have sweet opens by Logan. Quote Share this post Link to post Share on other sites
graymachine 0 Report post Posted September 25, 2007 Well, that may be true. The principle still holds true. A half circle is a good starting point - just adjust it to the profile of the wave. Duplicate. Move. Join it. Repeat. Still, if you are manually adjusting the circle, you might as well just draw it.. which leads me back where we started Quote Share this post Link to post Share on other sites
Guest dumbo Report post Posted September 25, 2007 there is a sine wave here... just open it with illustrator. Quote Share this post Link to post Share on other sites
pixel_pimp 0 Report post Posted September 26, 2007 So you are using Illustrators Scripting to generate the spline? Like writing a javascript? Quote Share this post Link to post Share on other sites
droon 0 Report post Posted August 18, 2008 (edited) what i do is, i draw a line with the the pen tool, making sure they have long bezier handles, but the line is still straight, by holding down the shift key, then I apply a roughen effect, with 0% roughen, but "n" points per inch, this is to subdivide the line. then with the white arrow I select every second point and drag them up or down, illustrator will have kept the beziers during subdivision and you get a sine-like line. not a perfect sine probably.. Edited August 18, 2008 by droon Quote Share this post Link to post Share on other sites
the_Monkey 8 Report post Posted August 18, 2008 Half circles?! Dear lord my high school physics teacher is screaming from his grave! Does anybody remember that a sine wave is simply a 2D projection of a Helix? And that a helix is simply a point that is being translated and rotated at a constant velocity? (click image for movie) -m Quote Share this post Link to post Share on other sites
jazman 0 Report post Posted August 18, 2008 I know this is an old thread, but if your talking about doing it in AI then you should make a straight line then Effects>Distort>Zig Zag>Smooth. Quote Share this post Link to post Share on other sites
graymachine 0 Report post Posted August 18, 2008 I know this is an old thread, but if your talking about doing it in AI then you should make a straight line then Effects>Distort>Zig Zag>Smooth. Winner Quote Share this post Link to post Share on other sites
basilisk 0 Report post Posted August 18, 2008 I know this is an old thread, but if your talking about doing it in AI then you should make a straight line then Effects>Distort>Zig Zag>Smooth. Winner Not quite. Not as bad as the suggestion of making a sin curve out of half circles, but it is still some way off (the peaks are too rounded) - just try a zigzag effect against a real sin wave. What I would like to know is whether you can get a mathematically accurate sine wave with a bezier curve, or whether it is just an approximation. (you can actually get pretty close with points at 90 deg, 270 deg, 450 deg etc) Quote Share this post Link to post Share on other sites
graymachine 0 Report post Posted August 18, 2008 Not quite. Not as bad as the suggestion of making a sin curve out of half circles, but it is still some way off (the peaks are too rounded) - just try a zigzag effect against a real sin wave. What I would like to know is whether you can get a mathematically accurate sine wave with a bezier curve, or whether it is just an approximation. (you can actually get pretty close with points at 90 deg, 270 deg, 450 deg etc) Yeah, it's not quite ready for the Department of Weights and Measures. I deemed it "close enough". Silver Medal. Quote Share this post Link to post Share on other sites
jazman 0 Report post Posted August 18, 2008 Yeah, it's not quite ready for the Department of Weights and Measures. I deemed it "close enough". Silver Medal. I guess it depends on your use. I changed the ZigZag to relative and expanded the appearance, then worked the scaling a little and got it really close. If it's just going to be a graphic element, I doubt anyone would call you on it. Quote Share this post Link to post Share on other sites
Rei1 0 Report post Posted April 14, 2010 (edited) I found an easy solution for drawing a sine curve in AI!! Go to the free mathematics software at http://www.geogebra.org and just put the formula you want for any 2D-curve you like. Export the result as an .EPS file and Illustrator will read it beautifully!!! Have fun! Edited April 14, 2010 by Rei1 Quote Share this post Link to post Share on other sites