Jump to content

2d logarimithic spiral help please


Recommended Posts

Hi all, newbie here so (if anyone can/will help) please keep things simple!

I'm trying to draw a 2d spiral like this

Wikepedia

using the spiral tool in the basics toolset. can anyone help re working out the correct data for the object info box? I don't know the sizes for anything, except that I think 2 turns is about right. I can work on the physical size later... i just need some idea of how to make a start! So far I have managed to produce something on the right lines by producing 2 spirals from the same start point, but making one of them a metre smaller in the 'distance by turn' box, but this leaves a gap. It is for a paving pattern, so needs to be solid if that makes sense. I'll try and get a photo up of what i have..... many thanks

Edited by Sophie
Link to comment

I think the built in Spiral and Helix Spiral commands only do fixed pitch.

I did some work on this using Vectorscript a while ago to generate spirals with increasing pitch as the radius increased. I will be happy to share the scripts, but they are very poorly documented and if you have not used VS before may not help much.

Let me know if you want me to post them.

Link to comment

Sophie the Spiral tool in Vw does not produce a logarithmic spiral (ie. one with a widening gap between the lines). The spiral it produces is a parallel spiral where the distance between the lines remains fixed.

You will need to find a logarithmic spiral that you can import and scale up to what you need.

Link to comment

Sophie - you can sort of do this with Duplicate Array and connect the dots with a spline. The result is not likely a true logarithmic spiral, but it does expand and looks like a spiral.

My example has a 24" line (horizontal) and a 3" circle at right end.

Click through the layers to see the process.

Group the circle & line.

Dupe Array.

Center array on circle ctr.

48 dupes

45? rotation

scale x & y at 1.25

Rotate dupes at 45?

Connect the circle centers with a spline. Last few segments are distorted, so cut it before the distortion.

Control spiral size with initial line segment and x,y scale

-B

Link to comment
  • Vectorworks, Inc Employee

Hi Sophie et al,

Curiosity got the best of me and I found a code snip online. I ported this over to Vectorscript. You can play around with changing the three constants at the top (klength, ktaper,kangle ). While the results aren't perfect, I'm sure it could be improved. It currently creates a bezier curve to help smooth it out, but this may not give the correct size. If anyone would like to take a shot at improving this, please feel free.

---------------------------------------

PROCEDURE MAIN;

CONST

klength = 16.0;

ktaper = 0.1;

kangle = 10;

VAR

A, B : REAL;

theta : LONGINT;

r, x, y : REAL;

BEGIN

A := klength / Sqr( 1.0 + ktaper^2 - 2*ktaper*Cos(kangle) );

B := Ln( ktaper ) / kangle;

OpenPoly;

BeginPoly;

FOR theta := 0 TO (360) DO

BEGIN

r := A * Exp( B * theta );

x := r * Cos( theta );

y := r * Sin( theta );

IF ( theta > 0 ) OR ( theta < 360 )

THEN CurveTo( x, y )

ELSE AddPoint( x, y );

END;

EndPoly;

END;

RUN(MAIN);

Link to comment
  • Vectorworks, Inc Employee

I modified the script to increase the number of points along the spiral by 10 times. This makes for a much more correct spiral. If I have some time, I may improve it and put it in a linear plug-in object. Until then, this may help you:

--------------------------------------------

PROCEDURE MAIN;

CONST

klength = 16.0;

ktaper = 0.1;

kangle = 10;

VAR

A, B : REAL;

theta : LONGINT;

r, x, y : REAL;

BEGIN

A := klength / Sqr( 1.0 + ktaper^2 - 2*ktaper*Cos(kangle) );

B := Ln( ktaper ) / kangle;

OpenPoly;

BeginPoly;

FOR theta := 0 TO (3600) DO

BEGIN

r := A * Exp( B * theta/10 );

x := r * Cos( theta/10 );

y := r * Sin( theta/10 );

IF ( theta > 0 ) OR ( theta < 3600 )

THEN CurveTo( x, y )

ELSE AddPoint( x, y );

END;

EndPoly;

END;

RUN(MAIN);

Link to comment
  • Vectorworks, Inc Employee

Ok,

Here it is in a linear PIO. download this, unzip it, and place the entire "PanzerCAD Spiral Logarithmic" folder in your VW plug-ins folder. Then add it to your workspace. It's still a work in progress and the code is unlocked. Play around with the settings in the Obj Info palette. You'll notice that the spiral does not extend to the length of the PIO's line length. I'd explain the parameters, but I'm really not sure yet how to. Im sure one of you math wizards out there can spiff this up a bit and explain it to us math challenged. Raymond, are you listening? ;-)

PanzerCAD Spiral Logarithmic.zip

Let me know what you think if you try it.

Link to comment

Matt, thank you!

Too nice!

PS

Sophie, if you don't know how to install the plug-in:

* open your Application preferences

* click on the tab "User Folders"

* click on the button "Reveal.." (I don't know how it's called precisely in Vista)

* open the Vectorworks' folder that will autoselect in the next window

* Save the uncompressed copy of Matt's plug-in into the "Plug-ins" folder there included

* Restart your application

* Open the Tools>Workspace Editor, click on the tab Tools

* Add Matt's plug-in to your current workspace (or a copy) dragging it from the left to the right in a palette of your choice.

If you did know how to install, my apologizes. But great many don't know.

orso

(Matt sorry that it took me so long to discover this, but I am on my way down south, long long car ride to IT! soon no internet at all. I just could sneak a stolen connection using Ax's IPhone).

Link to comment
  • Vectorworks, Inc Employee

I've been contacted offlist and asked to qualify my statement about the Fibonacci series. Firstly, I should state that I'm no mathematician so really don't want to get into arguments about math(s).

However, the attached file contains a spiral drawn using the Polyline tool with Tangent Arc mode selected. Each segment of the curve uses the next in the Fibonacci series as its radius and a sweep of 90 degrees. Numbers are 1, 1, 2, 3, 5, 8, 13, 21...

The result is also I believe known as the Golden Spiral. It is not logarithmic, but is easy to use in a Landscape design scenario because it's easy and clear to set out on the ground.

Sophie - I will also Skype this file to the rest of your student colleagues!

Link to comment
  • Vectorworks, Inc Employee

You're welcome Tamsin and Orso. Glad to help.

Tamsin,

I was thinking about adding the Fibonacci spiral to the plug-in as an option. I'll look into it as time permits.

Orso,

Thank you for explaining the installation procedure. That reminds me, I need to make a tool icon for the Plug-in.

PS: Enjoy your trip to IT!

Link to comment

WOW thanks Guys, what a fantastic response........ I actually followed Benson's suggestions, which were very clear (thankyou), and created one myself.... which was v satisfying.... the hardest part was guessing the size, but with the help of the re-scale tool I got there in the end. It's taken me a few days to get back to the forum and say thanks, and when I got here I found all the extra ideas. The rest of the info looks amazingly useful though, so I will definately come back to this at a later stage (ie after the course finishes and life begins again!). I've had to limit what I want to do due to time constraints, but I'm sure there are possibilties here that would satisfy my desire for the outer curve of the spiral to flare outwards at an angle of my choosing! Maybe I'll call on you when I start playing around with the plug-ins etc at a later date? Til then, happy spiralling to you all, and thanks once again for such great support!

Link to comment
  • Vectorworks, Inc Employee

Good to hear you were able to create it yourself. The plug-in could come in handy, but I think it needs more polishing. Also, it should have an easy way to have it generate a golden spiral without having to figure out the parameters. Hopefully this will be added before you need something like this again. :-)

Link to comment

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...