Jump to content
impossybull

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:

Spoiler

skillwarz_1920x1200_2020-04-27_11-48-00.thumb.png.41344d7f773dc48441da7620aaa5b3fc.png

Another angle:

Spoiler

image.thumb.png.ae2c29c7caa740889c08ecd1f096d96e.png

 

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:

Spoiler

 

x = the number of objects

w = the width of each object

N = the number of blocks of space

y = the space between them

image.png.f6a381acb7b2197f611de2be429370bb.png

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:

image.png.8f6f8c65bab53b14f87d08aa7ac9176a.png

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:

image.png.8b984063220537759d96fccf10276c2b.png

and

image.png.7599e58d7de7d1f08f999c6b03a30a0d.png

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

 

Example:

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.

image.png.ebe917de82c5e5b2ceddd3fcccec2524.png

The resulting graph is:

image.thumb.png.a1bfa867b24aa4f684afce7df4db1179.png

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.

 

Q.E.D.

 

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.

Guest
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...