Jump to content
Developer Wiki and Function Reference Links ×

creating graphics of equations, sine wave


schreib

Recommended Posts

I have NO knowledge of Vector Script.

I am looking for someone to advise me or consult with OR even to hire to create a SINE wave using CAD. I am assuming there is no way to creat a SINE wave using typical Vector Works CAD itself -- only by using script.

Any suggestions or leads to folks to create this is appreciated.

Specifically, I need to create a sine wave with a 2 mm period and approx one mm amplitude that ends up EXACTLY 21 inches long.

Brian

Link to comment

Hi islandmon,

out of interest, would VectorScript be a good way to go about this? Is it possible to write a script to kind of wrap round a simple mathematical function and then get VectorWorks to plot it?

I've wanted to do this on numerous occasions, but never really been able to work out if it was something that could be done simply with VectorScript.

Regards, nick

[ 04-11-2006, 04:36 PM: Message edited by: NickB ]

Link to comment

quote:

Originally posted by NickB:

Hi islandmon,

out of interest, would VectorScript be a good way to go about this? Is it possible to write a script to kind of wrap round a simple mathematical function and then get VectorWorks to plot it?

I've wanted to do this on numerous occasions, but never really been able to work out if it was something that could be done simply with VectorScript.

Regards, nick

Yes your idea is more like what I was thinking of. . . my response to islandmon. . .

"I am not much of a power user, sorry to say. I tried to use the cubic spline tool in the tool pallet for polylines as you suggested. I assume that is what you described but even after building a matrix of boxes as guides for snap-to points could not get it to make a good looking ACTUAL sine wave curve.

I did not mention that the sine wave must be accurate too. It cannot just look like a sine wave or a cyclic wave. It must follow the mathematical / graphical point locations of a TRUE sine wave. Thus, I was expecting to see something that would lead me to using a sine wave function in Vectorscript if such a thing exists. I noticed the period in yours is not exactly 2.000 either. That also must be met. So, I need a 2 mm period x 1 mm amplitude(2 mm total amplitude) x exactly 533.4mm (21.00") long pure sine wave."

any further suggestions are appreciated.

Brian S.

Link to comment

This simple script will generate a Sinewave & duplicate it :

_______________________________

PROCEDURE makeSineWave;

{This script by EJ Armstrong is based on original 'makesin' by Mike Swift}

VAR

h :HANDLE;

x,y,xdif,ydif,DX,DY,d,w :REAL;

i,A,P,s,f :INTEGER;

BEGIN

d:=1; { amplitude/2 }

x:=0;

y:=0;

A:=2;

P:=2;

s:=360; { curve segmentation multiple of 36 }

f:=360/s; { wave frequency }

w:=d*2; { wave period }

xdif:=A/s;

FOR i:=1 TO s DO BEGIN;

x:=x+(d/s)*P;

y:=d*sin(Deg2Rad((i)*f));

LineTo (x,y);

END;

FOR i:=1 TO 10 DO BEGIN {number of duplicates}

Duplicate(w,0); {duplicate offset x,y }

END;

END;

RUN(makeSineWave);

  • Like 1
Link to comment
  • 8 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...