Different kinds of triangle shapes

Recently I was looking for the best way to create a regular prim in the shape of an equilateral triangle (i.e. a triangle in which all three sides are equal). I specifically needed this kind of triangle to make a floor panel for a six-sided structure, which can be made out of six identical triangles (see image 1). Let’s look at a couple of ways to create a triangle.

hexagon with six triangles

Image 1. Putting the last floor segment in

Using the Prism building block type

This is the method I ended up using for my floor panel. It just involves two quick steps:

  1. Create a simple box.
  2. When the box rezzes, and with the box still selected, click on the Object tab in the build tool. Locate the “Building block type” selection list, and change its value to Prism. (image 2)

    Image 2. Selecting the Prism building block type gives you a triangle-shaped prism.

I used this method, because it instantly gives you an equilateral triangle. It will stay equilateral as long as you keep the shape’s X and Y sizes equal, and it will rotate neatly around the triangle’s center (also called centroid or center of gravity). This is an important difference with other ways to make a triangle, as we will see below.

Using the Prism default shape

An obvious way to make a triangle is to take the second shape in the list of available base shapes. Confusingly, this shape is called Prism too. Please note the difference between the Prism building block type (which we used in the previous paragraph), and the Prism shape, which actually uses a Box as its building block type (image 3).

Image 3. The Prism shape creates a different kind of triangle

The box you get has been sheared and tapered to create the triangular shape. This is okay for triangle shapes that need a 90-degree angle. However, an equilateral triangle has three 60-degree angles, and the 90-degree angle in this shape will not change when you resize the prim. (see image 4)

Image 4. Sizing the prim does not change the 90-degree angle

Calculating the right triangle size

The 90-degree angle is caused by the Top shear value. When you change the top shear X and Y values back to zero, the triangle starts to look better. It’s too tall though: to change it into a perfect equilateral triangle, you need to calculate the height of the prim. If you want to try this, do the following (see image 5).

  1. Create a default box (sized 0.5 x 0.5 x 0.5).
  2. Make sure the Top shear values are zero.
  3. Set the Taper X value to 1.00.
  4. Change the Z size value (the triangle’s height) to 0.433.

Image 5. For a box-based triangle, check Taper, Top Shear and Height

The height calculation is not difficult, but it takes some extra work, compared to the first method. Besides this, there is another drawback of this approach. This becomes apparent when you need to rotate some triangles in order to create a pattern. If you use this type of triangle, it won’t stay aligned with adjacent triangles, because it has an awkward center of rotation. Since the shape is still based on a box, it will rotate around the center of the box (image 6), rather than the center of the triangle, which you get with the prism building block (image 7).

Image 6. A box-based triangle doesn't rotate neatly around the center

Image 7. A prism-based triangle rotates around the triangle centroid

Conclusion

For equilateral triangles, start with the Prism building block type. For triangles with a right angle, use the Prism default shape.

Happy building with triangles!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s