1

I want to generate a Geodesic Dome (sphere) with triangles using the panda3d engine. I have searched in python for a function to position my all triangles in 3d world (x,y and z) and rotation to create the sphere. enter image description here

For rotation i use function setHpr(0,0,0) H for heading p for pitch r for roll

I have search for a mathematical function to replace my 0 values in:

class Triangle(GeometricObject):
    def __init__(self, x, y, z, h, p, r):
        self.x = x
        self.y = y
        self.z = z
        self.x = h
        self.y = p
        self.z = r  

Triangle_List=[]        
for i in range(0,2000):
    mytriangle=Triangle(0, 0, 0, 0, 0, 0)
    Triangle_List.append(mytriangle)

How can I transform the Triangle(0, 0, 0, 0, 0, 0) coordinates to the required values ? Thanks in advance.

intotecho
  • 4,925
  • 3
  • 39
  • 54
ilapasle
  • 349
  • 4
  • 16
  • The usual way is to start with an [icosahedron](https://en.wikipedia.org/wiki/Regular_icosahedron#Spherical_coordinates) and then subdivide its faces & project the new points from the centre to the surface of the sphere, as illustrated [here](https://upload.wikimedia.org/wikipedia/commons/thumb/f/ff/Geodesic_icosahedral_polyhedron_example.png/320px-Geodesic_icosahedral_polyhedron_example.png). – PM 2Ring Aug 07 '18 at 20:45

1 Answers1

0

The concepts to subdivide the faces and project to new points are described in the blog designing a geodesic house (part 1). A more thorough treatment is the book Geodesic Math and How to Use It by Hugh Kenner 1976.

PyDome will provide the coordinates for many types of geodesic dome configurations. Python Code on GitHub.

Rick Bono's DOME Program written in C++ has extensive documentation and features.

Acid Dome is one online calculator that provides the templates for edges and faces, but not the coordinates.

intotecho
  • 4,925
  • 3
  • 39
  • 54