From: sunspeed
Hi,
I am looking for an efficient way to create a spiral that follows the inner outline of a closed curve with a defined distance between the lines.
For example, starting from the upper-left corner of a rectangle, the spiral would follow the shape’s interior outline, continuing inward turn by turn at a specific offset distance.
Could you suggest a method or tool to achieve this?
Thanks,
Joerg
From: Michael Gibson
Hi Joerg,
re:
> For example, starting from the upper-left corner of a rectangle, the spiral
> would follow the shape’s interior outline, continuing inward turn by turn at
> a specific offset distance.
Can you make a rough sketch of it?
Thanks,
- Michael
From: sunspeed
Hi Michael,
Thanks for your message!
I attached an example with a simple rectangle as closed curve and created the spiral manually with the Offset function, added short connection lines, trimmed the offset rectangles and joined the lines to a single spiral curve.
Cheers,
Joerg
Attachments:
Spiral example.3dm
From: Michael Gibson
Hi Joerg, so kind of like the snake or Tron lightcycle games where a path is grown leaving a trail behind which you don't want to run into?
Is it required that the closed curve must be made of line segments and not a continuous smooth curve? What if the closed curve is a circle for example?
One thing I noticed is if you put in diagonal lines like this:
Move the diagonal for the start down one step, a quick way to do this is to type 20 and push Enter, that will make a distance constraint active for the next point pick and then you can drag the line down one step:
You now have all the necessary structure to draw the spiral in one single polyline. Before placing the first polyline point type in r20,-20 and push Enter. That will enable an x,y offset to be applied to the next point pick:
From then on straight snap and intersection object snap will give the needed points:
- Michael
Image Attachments:
snake_spiral1.png
snake_spiral2.png
snake_spiral3.png
snake_spiral4.png
snake_spiral5.png
snake_spiral6.png
From: sunspeed
Thanks Michael,
a good idea with the diagonal lines for the example (rectangle).
The problem is that I'm looking for a solution that is also working for closed curves that were designed with a Freeform line. Here the the line behind the outline needs to be a child of the outline. Next line needs to be a child of the first child, etc.
I had in mind that such a function was/is existing in MoI or as script from Max Smirnov.
But thanks a lot for your trying to find a solution,
Joerg
From: Michael Gibson
Hi Joerg,
re:
> The problem is that I'm looking for a solution that is also working for closed curves that were
> designed with a Freeform line. Here the the line behind the outline needs to be a child of
> the outline. Next line needs to be a child of the first child, etc.
Do you have an example drawing of this type?
> I had in mind that such a function was/is existing in MoI or as script from Max Smirnov.
There is an OffsetMultiStep script here:
https://moi3d.com/forum/index.php?webtag=MOI&msg=4898.19
But it isn't very much like a continuous spiral.
- Michael
From: BurrMan
If you can figure out how to get the coords for your path, you can use a point file and import point file as polylines to generate the path

Attachments:
spiral.txt
Image Attachments:
spiral example.png
From: BurrMan
Maybe with more discussion we can get a result for you.
Like basically these points can be generated easily by my CAM software with a pocketing operation
Must be a bunch of free options available to do this
There is even a guy in this forum trying to develop a "toolpath" plugin!
From: BurrMan
Here is a 5x5 spiral pocket i got in about 45 seconds by asking google ai a couple questions
I'll post the questions next
Attachments:
ai plot edit spiral.txt
From: BurrMan
started with
"generate a 5x5 pocket with a .5 endmill outside to center coordinates text file""
google respnse
A 5x5-inch square pocket centered at X0, Y0 with a 0.5-inch endmill requires a 5.5-inch total programmed width to account for the tool's diameter on the outside edges. The stepover is typically set to 40% (0.2 inches) to clear the material.
Paste the following coordinate file (saved as a .txt or .nc file) into your conversational CNC software or CAD/CAM post-processor to generate the pocket:
google ai has an "ask anything right below its responses now
next i enter
"remove all gcode values"
response is
Here are the raw coordinates for a 5x5-inch square pocket using a 0.5-inch endmill, formatted as pure text with all G-codes, line numbers, and remarks removed.
The coordinates trace the toolpath from the outermost boundary (-2.75 to +2.75) inward to the center at X0, Y0, using a 0.2-inch stepover:
Next i enter
"spiral pocket"
and the response
Here are the raw coordinates for a 5x5-inch square pocket using a 0.5-inch endmill, formatted as a continuous inward spiral.
This toolpath starts at the outermost top-left corner (-2.75, 2.75) and spirals tightly inward toward the center (0,0) using a 0.2-inch stepover, keeping constant tool engagement:
last ask
"remove all x and y"
and the response which generated the attached file
Here are the raw coordinates for the spiral pocket with all letters, spaces, and G-codes removed, leaving only the bare numeric values:
From: BurrMan
So the next question is can you provide the search with your "custom shape", closed contour, and generate the same results!
From: BurrMan
The result

Image Attachments:
spiral pocket.png
From: sunspeed
Hi Michael,
I think the OffsetMultiStep script was the script I had in mind, reading about it more than 10 years ago. But I thought that this one would create a spiral...
But I tested the script and it is helping a lot to create a bunch of curves, especially when the number of curves gets double-digit or more.
I attached an example of a non-standard outline created with the Freeform tool.
BR
Joerg
Attachments:
Spiral example 1&2.3dm
From: sunspeed
Hi BurrMan,
using a CAM software is a good idea if the software is able to create a bare spiral. I followed your proposal and tested different toolpaths created by different milling strategies. The best result is attached (blue lines). But the CAM software is not creating a spiral and is automatically doing S-linking between the different offset lines. There is no option to get the CAM not doing that.
BR, Joerg
Image Attachments:
Pocket milling by Condacam.jpg
From: BurrMan
you'll need to be able to do some type of spiral pocketing. I think my software has it. I'll have to go crank it up and look in a few.
The ai is tricky to prompt to get results. Because it is actually a "Morph Spiral". Not just a standard pocket or boundary pocket
Here is me attempting to get results with your file
Started with to proper path
then tried to get more "revolutions"
Finally made it all the way to center with revolutions and lost ability to control step
Its getting complex

Attachments:
csv 25 conform.txt
file 30.txt
long 30.txt
Image Attachments:
how to prompt.png
trying to get stepover defined.png
working towards center.png
From: BurrMan
mostly outputs are rubbish.
Had better luck making progress with GROK and prompts to change its output. Still sortof painful to be any type of real solution for what you are asking...

Image Attachments:
grok better.png
From: sunspeed
Thank you for your efforts on this. It appears this task cannot be completed quickly using standard MoI tools. However, Michael showed a MoI-script that reduces the workload by helping to create the spiral manually.
The exploration of CAM was an interesting idea, though mine was unfortunately unable to generate the required construct in this case.
Ultimately, it seems that performing this task with standard tools is difficult without custom coding. Unless this is a task we need to perform daily, the manual script solution likely remains the most efficient approach.
BR, Joerg
From: BurrMan
Hey Joerg,
Not for lack of trying, eh!
Looked at my CAM software. What we are doing is called a “morph spiral” and its more complex for sure.
It was a good exercise looking at how ai failed with the “more complex” parts of the solve. It definitely highlighted what the “complex” part is. Thats where rubbish was returned
Happy trails….
From: BurrMan
Hi Joerg,
1 last note. A side note.
Thought about it more and vector programs can do this pretty easily. So draw a spiral then “fit it to another shape” basically.
Just in case you can do that as an option