Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4

Author Topic: COMMUNITY RESOURCE: Circle Templates 3 to 45  (Read 12740 times)

Ampersand

  • Bay Watcher
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #30 on: February 07, 2009, 08:19:51 pm »

Why not designate a square and take out the corners as necessary?
Logged
!!&!!

Fensfield

  • Bay Watcher
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #31 on: February 18, 2009, 01:56:59 pm »

Because above 3x3 in size, the end result of that looks more and more like square turned 45 degrees as you increase its area.

What a shame this template doesn't go higher, though x.x  The sphere I'm trying to make Starts at 41x41, then enlarges in increments of 6 with each z-level... and Photoshop keeps giving me wonky circles -.-
« Last Edit: February 18, 2009, 02:03:24 pm by Fensfield »
Logged

LegoLord

  • Bay Watcher
  • Can you see it now?
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #32 on: February 22, 2009, 09:36:25 am »


I got all MS Paint on it's ass... hope that helps whoever wanted them larger with distinct squares.

Spoiler (click to show/hide)
This is very useful.  Perhaps it should go on the wiki?
Logged
"Oh look there is a dragon my clothes might burn let me take them off and only wear steel plate."
And this is how tinned food was invented.
Alternately: The Brick Testament. It's a really fun look at what the bible would look like if interpreted literally. With Legos.
Just so I remember

Ampersand

  • Bay Watcher
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #33 on: February 22, 2009, 05:35:47 pm »

Because above 3x3 in size, the end result of that looks more and more like square turned 45 degrees as you increase its area.

What a shame this template doesn't go higher, though x.x  The sphere I'm trying to make Starts at 41x41, then enlarges in increments of 6 with each z-level... and Photoshop keeps giving me wonky circles -.-


What I meant was, instead of designating every space in the circle one by one, designate a square, and round out the corners. Sort of doing it backwards. Something tells me it would be quicker.
Logged
!!&!!

LegoLord

  • Bay Watcher
  • Can you see it now?
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #34 on: February 22, 2009, 07:04:17 pm »

What if you're building a tower.  Not that fast, really.
Logged
"Oh look there is a dragon my clothes might burn let me take them off and only wear steel plate."
And this is how tinned food was invented.
Alternately: The Brick Testament. It's a really fun look at what the bible would look like if interpreted literally. With Legos.
Just so I remember

Umi

  • Bay Watcher
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #35 on: March 13, 2009, 08:48:35 pm »

How does one use the AHK?  Every time I use it it just makes a random squiggle.
And how does one control the size of the circle?  I have no idea how to use that...>_<
Logged

Endemion

  • Bay Watcher
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #36 on: March 15, 2009, 12:53:26 pm »

Because above 3x3 in size, the end result of that looks more and more like square turned 45 degrees as you increase its area.

What a shame this template doesn't go higher, though x.x  The sphere I'm trying to make Starts at 41x41, then enlarges in increments of 6 with each z-level... and Photoshop keeps giving me wonky circles -.-


What I meant was, instead of designating every space in the circle one by one, designate a square, and round out the corners. Sort of doing it backwards. Something tells me it would be quicker.

Well, let's have all the math geeks correct me on this please, I'm sure I'm doing it wrong.

Geometry - the area of a circle (easy math, lets say a radius 5 circle) would be 78.5.
The square that would contain that circle would be a 10x10 square.  that's 100 units.
So, what '&' is trying to say in his quote is that instead of macroing the designation of 78.5 (79) mining squares for the circle, you could instead designate the whole 100, and then (x) remove designation on the 21 other squares to make the circle.  That would save a lot of time.

Now, I hate AHK and have no idea how to program with it, so...  Anyone else mind getting started on that?  =D
Logged

Guillo

  • Bay Watcher
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #37 on: March 15, 2009, 04:17:14 pm »

Since Rysith's code didn't seem to make very nice circles for me I decided to take a crack at an AHK script. I started with Rysith's code and then modified like crazy.
This is the first time I used the program and I'm not much of a coder so if somebody wants to streamline this that would be great.

The code produces clones of the chart most of the time...  Some of the sizes are slightly different than the chart's circles though, but they are still pretty good.

Hit [Windows Key] + c to activate the macro

/edit
I guess I should mention that you can modify the outerrad and innerrad variables to change the circles. Changing the innerrad from 0 makes it so a circular column is left in the middle of the room with radius = innerrad.
/endedit

*EDIT AGAIN*
Made a small change and now all my circles turn out beautifully.
I also had part of the code missing previously from a botched copy/paste

Code: [Select]
;One full circle
#c::

;Radius is considered as the distance from the origin to circle edge
;with the center square being the origin and considered dimensionless

;From Circle Chart:
; Radius = (Chart#)/2 - 1

outerrad := 10
innerrad := 0

outerEighth("{NumPadDown}","{NumPadUp}","{NumPadRight}","{NumPadLeft}",outerrad)
outerEighth("{NumPadDown}","{NumPadUp}","{NumPadLeft}","{NumPadRight}",outerrad)
outerEighth("{NumPadLeft}","{NumPadRight}","{NumPadUp}","{NumPadDown}",outerrad)
outerEighth("{NumPadLeft}","{NumPadRight}","{NumPadDown}","{NumPadUp}",outerrad)
outerEighth("{NumPadRight}","{NumPadLeft}","{NumPadUp}","{NumPadDown}",outerrad)
outerEighth("{NumPadRight}","{NumPadLeft}","{NumPadDown}","{NumPadUp}",outerrad)
outerEighth("{NumPadUp}","{NumPadDown}","{NumPadLeft}","{NumPadRight}",outerrad)
outerEighth("{NumPadUp}","{NumPadDown}","{NumPadRight}","{NumPadLeft}",outerrad)

innerEighth("{NumPadDown}","{NumPadUp}","{NumPadRight}","{NumPadLeft}",innerrad)
innerEighth("{NumPadDown}","{NumPadUp}","{NumPadLeft}","{NumPadRight}",innerrad)
innerEighth("{NumPadLeft}","{NumPadRight}","{NumPadUp}","{NumPadDown}",innerrad)
innerEighth("{NumPadLeft}","{NumPadRight}","{NumPadDown}","{NumPadUp}",innerrad)
innerEighth("{NumPadRight}","{NumPadLeft}","{NumPadUp}","{NumPadDown}",innerrad)
innerEighth("{NumPadRight}","{NumPadLeft}","{NumPadDown}","{NumPadUp}",innerrad)
innerEighth("{NumPadUp}","{NumPadDown}","{NumPadLeft}","{NumPadRight}",innerrad)
innerEighth("{NumPadUp}","{NumPadDown}","{NumPadRight}","{NumPadLeft}",innerrad)



outerEighth(up,down,left,right,rad)
{
x := 0
y := rad

while y > rad/2
{
dig(up,y)
move(down,y)
dig(right,1)
x++
y := round((sqrt((rad*rad) - (x*x))))
}
move(left,x)
}

innerEighth(up,down,left,right,rad)
{
x := 0
y := rad

while y > rad/2
{
remove(up,y)
move(down,y)
remove(right,1)
x++
y := round((sqrt((rad*rad) - (x*x))))
}
move(left,x)
}

;Utility functions
remove(dir,number)
{
send x
send {Enter}
move(dir, number)
send {Enter}
}

dig(dir,number)
{
send d
send {Enter}
move(dir, number)
send {Enter}
}

move(dir,number)
{
loop {
if number <= 0
{
break
}
send %dir%
number--
}
}
« Last Edit: March 15, 2009, 05:07:18 pm by Guillo »
Logged

K4el

  • Bay Watcher
  • [BORED][AT_WORK]
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #38 on: March 31, 2009, 11:18:34 pm »

Has anyone been successful using either of these two scripts? They start out ok for me but they dont end up with a circle.

-EDIT-

I've been experimenting with using these scripts and it almost seems like the input is coming in too fast for DF to handle. Am i missing something?
« Last Edit: April 01, 2009, 01:48:35 am by K4el »
Logged

kotekzot

  • Bay Watcher
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #39 on: April 01, 2009, 02:34:30 am »

Spoiler (click to show/hide)
try this version, it has send replaced with sendplay, works for me with 40d11 (i believe the original script should work fine with 40d).
Logged
Dwarf Fortress: Where violent death is a renewable resource
Bro, your like... thinking like a square man... its like, the WHOLE lamprey is just like, one big NECK dude, you know? its like hahahaha! dude protect the trees though, seriously. *inhale*... anyways... you like, want this dead black bear, bro?

K4el

  • Bay Watcher
  • [BORED][AT_WORK]
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #40 on: April 01, 2009, 01:33:11 pm »

Spoiler (click to show/hide)
try this version, it has send replaced with sendplay, works for me with 40d11 (i believe the original script should work fine with 40d).

You win the thread, thanks.

K4el

  • Bay Watcher
  • [BORED][AT_WORK]
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #41 on: April 01, 2009, 02:32:57 pm »

Unfortunately it still is not producing a circle. Wonder what's going on.

Ampersand

  • Bay Watcher
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #42 on: April 01, 2009, 05:02:32 pm »

Are you changing the window? Pressing any buttons while the script is working?
Logged
!!&!!

Guillo

  • Bay Watcher
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #43 on: April 02, 2009, 01:17:03 am »

Yeah, ever since I changed from 40d9 to 40d11 my script doesn't work and the sendplay replacement doesn't fix it either... I really don't know what to do about it as I don't want to go back to manually making circles. kotekzot, can you reproduce the results with an unmodified init.txt? Maybe you went in there or elsewhere and changed your sticky key delay time.

On a side note, if someone could come up with a script that makes the circles more efficiently that would be nice. I just brute forced mine out, and though it works great (in 40d-40d9), it makes some unnecessary movements.

*EDIT*
I should mention that sendplay makes the script do NOTHING for me. It doesn't even make crappy circles
« Last Edit: April 02, 2009, 01:25:20 am by Guillo »
Logged

kotekzot

  • Bay Watcher
    • View Profile
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
« Reply #44 on: April 02, 2009, 04:55:11 am »

kotekzot, can you reproduce the results with an unmodified init.txt? Maybe you went in there or elsewhere and changed your sticky key delay time.
just unrarred a fresh 40d11 from the future of the fort thread and it worked perfectly. the only thing i can think of is that i've disabled sticky shift a while ago, but i think it worked ok before that, too.
Logged
Dwarf Fortress: Where violent death is a renewable resource
Bro, your like... thinking like a square man... its like, the WHOLE lamprey is just like, one big NECK dude, you know? its like hahahaha! dude protect the trees though, seriously. *inhale*... anyways... you like, want this dead black bear, bro?
Pages: 1 2 [3] 4