# Specific formula when going about making octagonal roofs?

Please take a moment to consider if this thread is worth bumping.

## Recommended Posts

I'm not really new to building but this one has always eluded me, I can make octagonal rooms and floors but when it comes to making roofs I just can't work it out.

I know that there's some mathematics behind the process and I'd like to try and familiarize myself with it so I can use it on my builds in the future.

Could somebody please tell me how to work it out please?  I watched that video about making them but there is not real math's explained behind it and each triangle segment goes to a point in the middle which I don't really want, I'll use this as an example.

http://chestofbooks.com/architecture/Construction-Superintendence/images/81-Octagonal-Roofs-300194.jpg

I'm a very accurate builder so I don't want to just make a template octagonal roof and slap it on top of the octagonal/hexagonal wall assembly and call it a good days work.

So let's say that my wall is

Y: 4.00

Z: 6.00

And that is my base prim so each prim on either side is rotated at a 45 degree angle to make a window box for example.

What would be the math's to work out the dimensions of each roof segment but also so it's not a triangle but tapered?  I'm not asking anybody to do the math's for me I just wish to understand the process so I can learn to work it out for myself efficiently.  I'm also finding that the grid snap options need to be specific or it wont work properly.

Thank you!

##### Share on other sites

If I understand you correctly, you want to know the distance between C and D.

You have the distance between A and B, so you can figure out D to E (the 1:1: SQRT2 thing).

C to E you determine yourself, it can be anything.

So what is left is a simple pythagoras.

Or if you want to use a fixed angle for the roof (between DE and CD), use a tangent formula.

The fact you want to work in prims means you have to factor in the thickness of your objects also. You could make a longer formula, use a spreadsheet or if you do it the "builders way", you can dimple your prims so the pivot is on the outer plane. Even easier would be to build it in mesh then add some thickness. No need for any calculations at all then, but also no way to edit a whole lot by script.

##### Share on other sites

Actually i've spent the past half hour considering wether or not i should just build it in mesh.  I'm just concerned about re-sizing it and such.

I've been a 3D model artist for many years but i'm still familiarizing myself with its uses and implications on Second Life, plus having to upload various LODs is a waste of L\$ but with something like this it's not that complicated because of its shape so it's no big deal.

##### Share on other sites

Shrouded Kytori wrote:

.....plus having to upload various LODs is a waste of L\$......

The better your LoDs are, the less it will cost you, so adding LoDs should save you money over the SL uploader automated LoD calculations. Your upload shouldn't cost more than L\$11 I reckon.

##### Share on other sites

I would say mesh every time for this kind of thing. This has an LI of 5, and good LOD behaviour (frame goes progressively to alphas at low LODs). There are even beams under the roof that you can't see here.

##### Share on other sites

By the way, in Kwaks's diagram, DE is AB/(2*tan(pi/8)), approximately 1.2071*AB. Then CD, which is one of the dimensions (Y) for the tapered box (ABC) is sqrt(DE^2 + CE^2), where, as Kwak said, you can decide on CE. Having The other dimension (X) is AB. With the dimensions thus, and Z for the thickness, you can then truncate by lowering the upper value of Slice (to S), to get the flat top. The final height will then be S*CE.

ETA - corrected sin/tan error noticed by Kwak. Also note that pi/8 radians is 45 degrees, and the tan here is for angle in radians.

##### Share on other sites

Drongle McMahon wrote:

By the way, in Kwaks's diagram, DE is AB/(2*sin(pi/8)), approximately 1.2071*AB.

I'd say it's (1/2 + 1/SQRT 2)*AB, but that's the same 1.2071 etc

EDIT..ok you got me confused....

I know there are other ways to calculate DE, but the AB/(2*sin(pi/8)) you mention does not equal 1.2071*AB. I wish it did, since if that was the case we'd have defined the number PI and we would get a noble prize.

##### Share on other sites

:smileysurprised: Whoops! - your'e right  it's tan(pi/8), not sin(pi/8). I was reading the wrong line on my pad. Will correct the original! Note that pi/8 is in radians, not degrees; pi/8 radians = 22.5 degrees.

I don't see the problem with defining pi though. There are many possible definitions of it. You could use any trigonometric equation containing it, not just that for the circumference of a circle. Sinc 45 degrees is pi/4, and tan(45 degrees) is 1, we could define pi as four times the angle (in radians) whose tan is 1; pi = 4*arctan(1). However, I suspect the use of radians is implicitly assuming the value of pi is already known.

##### Share on other sites

I guess you just got me confused

You are right, of course the sin cos or tan of something is an actual number, but the "something" isn't, since it by definition includes pi....