Jump to content

Equal division of posts, beams, or patterns

Recommended Posts

Posted (edited)

In designing maps, it is common to want to design something with some number of equally spaced something, like beams, posts, columns, or decorative elements. For example, the beams on a roof:



Another angle:




We can see that the roof is 39 blocks wide, and that we can install 9 beams with a spacing of 3 blocks between them (not counting the main beams at the ends). But, is there a way to figure out all the arrangements that will work? Yes, there is. Here is the equation to use:



x = the number of objects

w = the width of each object

N = the number of blocks of space

y = the space between them


where w, x, and y are counting numbers.


Let's say, instead of excluding the end beams, we include them. This would probably be appropriate for, say, a fence. The equation is:


where w, x, and y are counting numbers.


Because this only works for the counting numbers and not the reals, plotting it on a graph of reals will not be super useful. We can get around this by using the floor function where necessary. Our equations become:




respectively, and are now over the positive reals. Obviously, results in the negative reals are neither unique, nor useful in their own right.


The derivations are left as an exercise to the reader.



Because I recognize that most of my readers don't have more than trivial algebra skills, don't worry if you don't understand the above formulae. I've made a couple graphs in Desmos and provided an example below.

This one is if you want your repeating objects to be on each end: https://www.desmos.com/calculator/lnrgfxrmie

This one is if you want equal gaps to be on each end: https://www.desmos.com/calculator/frja9sdfwa



Let's say you have a ceiling 76 blocks wide, and you want to put rafters on it. Additionally, you want to make each rafter 2 blocks wide. And you don't want rafters directly next to the walls on each end.

You choose the link above for gaps on each end: https://www.desmos.com/calculator/frja9sdfwa

In Desmos, you set N = 76, and w = 2.


The resulting graph is:


You know that the x-axis is the number of rafters, and the y-axis is the space between them. Look at the points at the bottom corner of each 'L' shape. We can see that we can have:

1 rafter with a spacing of 37 blocks, or

2 rafters with a spacing of 24 blocks, or

5 rafters with a spacing of 11 blocks, or

12 rafters with a spacing of 4 blocks, or

25 rafters with a spacing of 1 block between them.




I'll make a video about this once the new editor comes out and/or when I have some time.

Edited by impossybull
  • Like 4

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...