I recently finished my first circuit contraption and it is a total mess. I'm glad it works the way it is intended to, but now I'm curios about your theoretical thoughts how to calculate coordinates in a spiral shape. So the desired output should be:
(TickA is the first tick that holds coordinates, x is the time you need to calculate the next coordinates)
TickA + 0x: ( 0/ 0)
TickA + 1x: ( 1/ 0)
TickA + 2x: ( 1/ 1)
TickA + 3x: ( 0/ 1)
TickA + 4x: (-1/ 1)
TickA + 5x: (-1/ 0)
TickA + 6x: (-1/-1)
TickA + 7x: ( 0/-1)
TickA + 8x: ( 1/-1)
TickA + 9x: ( 2/-1)
TickA + 10x: ( 2/ 0)
TickA + 11x: ( 2/ 1)
TickA + 12x: ( 2/ 2)
TickA + 13x: ( 1/ 2)
And so on...
(I'm so sad table layouts aren't supported)
This thread needn't to be one to show me perfect solutions, to offer blueprints or savegames, I'm just curios about your theorycrafted solutions, to compare how good my solution was, to get known to some tricks in circuit networks and so on...
Calculating coordinates in a spiral shape
-
- Burner Inserter
- Posts: 17
- Joined: Tue Sep 26, 2017 5:46 pm
- Contact:
Re: Calculating coordinates in a spiral shape
Using R=right, L=left, U=up, D=down, we get this pattern to create a spiral:
RD
LLUU
RRRDDD
LLLLUUUU
RRRRRDDDDD
LLLLLLUUUUUU
So you want a couple memory cells, a resettable one to track the current number of RDLU's, and a permanent one to track the maximum before you switch directions.
RD
LLUU
RRRDDD
LLLLUUUU
RRRRRDDDDD
LLLLLLUUUUUU
So you want a couple memory cells, a resettable one to track the current number of RDLU's, and a permanent one to track the maximum before you switch directions.
-
- Filter Inserter
- Posts: 503
- Joined: Tue Jun 26, 2018 10:14 am
- Contact:
Re: Calculating coordinates in a spiral shape
I have made a spiral coordinate generator. It has four run cycles for every square side, run length is increased every two cycles, dX and dY are changed every time cycle ends. That’s all.
-
- Burner Inserter
- Posts: 17
- Joined: Tue Sep 26, 2017 5:46 pm
- Contact:
Re: Calculating coordinates in a spiral shape
May I see a blueprint of your solution? I'm curios about how much space you needed.
Would it be okay, if I would use your solution? I'm sure it's better than my spaghetti.
-
- Filter Inserter
- Posts: 503
- Joined: Tue Jun 26, 2018 10:14 am
- Contact:
Re: Calculating coordinates in a spiral shape
Here is my BP, feel free to use and modify it.
BTW, this is not a perfect generator, several tiles in the very center are not generated, because there are bad transitional processes during generator start. But this is not important for my goals.
BTW, this is not a perfect generator, several tiles in the very center are not generated, because there are bad transitional processes during generator start. But this is not important for my goals.
-
- Burner Inserter
- Posts: 17
- Joined: Tue Sep 26, 2017 5:46 pm
- Contact:
Re: Calculating coordinates in a spiral shape
Funny, you face the some problems I do. And you invented it for the same purpose.coppercoil wrote: Sun Apr 26, 2020 1:33 pm Here is my BP, feel free to use and modify it.
BTW, this is not a perfect generator, several tiles in the very center are not generated, because there are bad transitional processes during generator start. But this is not important for my goals.