Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: An easy way to draw circles?  (Read 2660 times)

Hishan

  • Bay Watcher
  • [ALCOHOL_DEPENDANT]
    • View Profile
An easy way to draw circles?
« on: April 14, 2009, 05:13:52 am »

Im planning a fort based heavily on circles, is there anyway to designate them easily? (they will be of the same size)
Logged

LrZeph

  • Bay Watcher
    • View Profile
Re: An easy way to draw circles?
« Reply #1 on: April 14, 2009, 05:15:54 am »

I always do Hexagons Personally, Easier for me to do.

There is no Real "Easy Way" of drawing a circle, so, you may want to take up a slightly easier shape (hexagons, octogons)
Logged
And everyone knows, when the Dwarves come out of the walls, it's all over.

ThtblovesDF

  • Bay Watcher
    • View Profile
Re: An easy way to draw circles?
« Reply #2 on: April 14, 2009, 05:20:16 am »

Your Mouse
Logged

Hishan

  • Bay Watcher
  • [ALCOHOL_DEPENDANT]
    • View Profile
Re: An easy way to draw circles?
« Reply #3 on: April 14, 2009, 05:30:29 am »

Mouse drawn circles are very hard to get exactly right, I think I may downgrade to octagons. Also doesnt dTil have some function to designate complex patterns?
Logged

kotekzot

  • Bay Watcher
    • View Profile
Re: An easy way to draw circles?
« Reply #4 on: April 14, 2009, 06:59:30 am »

you mean apart from the ones that you can find through the search facility?
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?

Eviltyphoon

  • Bay Watcher
    • View Profile
Re: An easy way to draw circles?
« Reply #5 on: April 14, 2009, 07:01:38 am »

AHK ftw:

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 := 4
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--
}
}

Source:    
Re: COMMUNITY RESOURCE: Circle Templates 3 to 45
Logged
"If you can't build a tower upon a sheer cliff face over which you may throw precisely one hundred and fifty-two kittens and seven stalwart dwarves to their explosive doom some fifty stories below, then brother, your game ain't much of a sandbox, is it?"

Hishan

  • Bay Watcher
  • [ALCOHOL_DEPENDANT]
    • View Profile
Re: An easy way to draw circles?
« Reply #6 on: April 14, 2009, 09:32:31 am »

Excuse me, what?
Logged

Smew

  • Bay Watcher
  • I'll kill you with my bear face.
    • View Profile
    • Deep Games for Deep Gamers
Re: An easy way to draw circles?
« Reply #7 on: April 14, 2009, 09:38:59 am »

Take that script, execute it with Autohotkey(which is a seperate program).
Note though: it only works well with 40d, if you're using 40d# you'll need to replace all instances of send with sendplay.

Marko

  • Bay Watcher
    • View Profile
    • Roomies
Re: An easy way to draw circles?
« Reply #8 on: April 14, 2009, 11:16:13 am »

If you're running in windowed mode, open up ms paint. Zoom in to 800%. Turn on Grid. Click on the hand-dandy circle tool. Hold down shift. Draw a circle based on how large you want it. Copy pattern tile-by-tile into DF. Viola: circle!
Logged
Hm.
WHERE IS THE SAVE?
AN HOUR LATE?
OFF WITH HIS HEAD

Hishan

  • Bay Watcher
  • [ALCOHOL_DEPENDANT]
    • View Profile
Re: An easy way to draw circles?
« Reply #9 on: April 14, 2009, 12:16:30 pm »

Ok and ill try the autohotkey thing,


also marko that would be incredibly tedious

Logged

Hishan

  • Bay Watcher
  • [ALCOHOL_DEPENDANT]
    • View Profile
Re: An easy way to draw circles?
« Reply #10 on: April 14, 2009, 01:04:59 pm »

Your code has an error on line 38, theres no valid function.
Logged

Marko

  • Bay Watcher
    • View Profile
    • Roomies
Re: An easy way to draw circles?
« Reply #11 on: April 14, 2009, 01:30:39 pm »

It's really not that tedious. Honestly

It's really like over five, up one, over 3, up one, over one, up one, up three, over one, up five, over one, etc. etc.
Logged
Hm.
WHERE IS THE SAVE?
AN HOUR LATE?
OFF WITH HIS HEAD

Loki

  • Bay Watcher
    • View Profile
Re: An easy way to draw circles?
« Reply #12 on: April 14, 2009, 07:14:44 pm »

I use an autohotkey script I found in the circle templates topic as well, only it's done using fourths instead of eighths. I've personally edited it a bit and it works just fine for me, using 40d9.

Spoiler (click to show/hide)


windows key + g for the full circle, windows key + c for sections
Logged
Dwarf Fortress: The only game you can play without even unpausing.