Skip to content

Latest commit

 

History

History
79 lines (53 loc) · 2.52 KB

File metadata and controls

79 lines (53 loc) · 2.52 KB

Some DFHack scripts

Some dfhack scripts from friends of keupo on twitch

Usage

note: any of the drawing commands can be appended with a digging designation [dujihrx] at the end, or will default to 'd'

for example, digshape star 5 2 j will dig a 5 pointed star out of downstairs with the mark as the center and the cursor as a vertex on the star

in-game help

digshape ?

set mark

digshape origin

draw a line

digshape line

from cursor to mark

draw an ellipse

digshape ellipse [filled]

cursor and mark as bounding box

draw an ellipse using 3 pt

digshape major  

set the end of the major axis from origin to mark

digshape ellipse 3p

draw the ellipse using new cursor as the semiminor axis length (center->cursor) Note: ellipse3p cannot yet be filled

draw a circle with arbitrary diameter

digshape circle 2p

cursor and mark form the diameter of the circle (at any tilt)

draw a 3 pt bezier curve

digshape major

set the end point of the curve

digshape bez [sharpness=1.5]

draw the curve between mark and endpoint, pulled towards the cursor. A weight may be specified to adjust the sharpness of the curve.

draw a polygon with cursor as vertex

digshape polygon <n sides>

mark as center and cursor as a vertex

draw a polygon with cursor as apothem

digshape polygon <n sides> apothem

mark as center and cursor as a midpoint

draw a star polygon

digshape star <n sides> [skip=2]

in Schläfli symbol notation mark as center and cursor as a vertex

Contributors

  • flipvine
  • Qvatch
  • keupo
  • flavorstreet

Resources of interest

DFHack Lua API

DFHack dig plugin - digcircle

Bresenham's line algorithm

A Fast Bresenham Type Algorithm For Drawing Ellipses, alternate link, also in resources/belipse.pdf

A Rasterizing Algorithm for Drawing Curves

Writeable Bitmap Shape Extensions used under the MIT license

Drawing equidistant points on a spiral