Author Topic: Draw a spiral without script  (Read 13648 times)

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7566
    • View Profile
    • Cambam V1.0 French Doc
Draw a spiral without script
« on: December 23, 2010, 21:44:21 pm »
Hello,

I found a way to draw a spiral without using script, it's a lot tortuous but it works !!

1) draw a point like below then select Transform/polar array copy



2) for this example I use 100 points and I want 2 turn (720°) with 2mm between A and B centered on 0,0







the parameters:

0,0,7.2,0.02

0,0 = rotation x and y -> none

720° / 100 points = 7.2° per increment for Z rotation

the last parameter, the scale, define distance between A and B point -> 100 points * 0.02 = 2mm

3) We must then obtain a point list instead of separated points ; with all points selected, use Edit/joint with anything for joint value, you obtain a unique point object.

4) convert it to polyline, you must have this



5) Explode the object to remove the line between A and B points then joint again the lines to create a spiral polyline.



to reverse the winding direction, use negative value for the angle

++
David


 





Offline c.sitas

  • CNC Jedi
  • *****
  • Posts: 573
    • View Profile
Re: Draw a spiral without script
« Reply #1 on: December 23, 2010, 22:04:54 pm »
Hello  Dh42;   This proves the old addage,Where there is a will, there is a way. This is pretty cool . Thanks for sharing. c.sitas

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 9075
    • View Profile
Re: Draw a spiral without script
« Reply #2 on: December 23, 2010, 22:31:16 pm »
You say, "tortuous".  I say, "brilliant" (and pretty simple, too).

I'll have use for that.  Keep up this sort of work, and I'll not have need of my rotary table!

LLoyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7566
    • View Profile
    • Cambam V1.0 French Doc
Re: Draw a spiral without script
« Reply #3 on: December 23, 2010, 23:34:46 pm »
other possibility





++
David

Offline Desertrunner

  • Wookie
  • ****
  • Posts: 459
    • View Profile
Re: Draw a spiral without script
« Reply #4 on: December 24, 2010, 07:09:06 am »
David,
I tried but failed to find a way to do it with the Z changing at the same time.  Do you know a way?

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7566
    • View Profile
    • Cambam V1.0 French Doc
Re: Draw a spiral without script
« Reply #5 on: December 24, 2010, 12:06:52 pm »
Hello

Yesterday I try too, but I think it's not possible to do without script or external soft. (for 3D spiral or other strange path I use 3DSmax tools to create splines)

I think that my formula to calculate the scale parameter is wrong, she work only if the point is at 1 unit of the center.

++
David

Offline 10bulls

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 2163
  • Coding Jedi
    • View Profile
    • www.cambam.info
Re: Draw a spiral without script
« Reply #6 on: December 24, 2010, 14:17:57 pm »
This is a great idea David... I knew that 4th parameter would come in handy one day!  :)

I know this is a 'Draw a spiral without a script' thread but...
In the scripts folder installed with 0.9.8, there is a new script called 'tapered.js'.
This can be used to generate a tapered spiral by specifying start and end radius, start and end Z coordinates and the depth increment for each loop.  It also uses arc segments rather than line segments so should be more compact and cut smoother.

The polyline generated with this can be used as a toolpath by selecting it and inserting an engraving operation.

As with all scripts, open the tapered.js file using the Script - Open menu in CamBam, then with the cursor anywhere in the script text, press F5.

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7566
    • View Profile
    • Cambam V1.0 French Doc
Re: Draw a spiral without script
« Reply #7 on: December 25, 2010, 14:08:08 pm »
Hello

I have not coded since a long time but I liked this, maybe I should take out my old VB ....

Merry Christmas all

++
David