Feeds:
Posts

## Pseudo Code  Below is pseudo code and screen shots of the corresponding hand modelling  for making an irregular geodesic dome based on lengths of bamboo. There is a function for actually creating the fabrication files for the joints that I’ve not been able to do yet, but it similar to a script I was working on earlier, so I’m confident that I will be able to code it.

Main

1. Define arrAllPts

2. Define arrPerimeterPts

3. Get sphereRadius and draw strSphere

4. Get sides of triangle.

5. Draw triangle.

6. Draw circum-circle of triangle.

7. Move circle and triangle to centre of sphere using circle centre as base point.

8. Draw vertical line from circle to sphere.

9. Move triangle to the top of the vertical line using the bottom of the line as base point.

10. Store the coordinates of the triangle vertex (vPt1, vPt2 and vPt3) in an array, arrAllPts 1. Repeat until length of arrPerimeterPts = 3

2. Call function PerimeterPts to get values of arrPerimeterPts from arrAllPts

3. If a point vPt(x) is a part of arrAllPts and not a part of arrPerimeterPts then call function CreateJoint

4. End Repeat Function PerimeterPoints

1. arrPerimeterPoints = arrAllPts

2. Loop i through all points in arrPerimeterPts –

3. Draw a line connecting the point to the apex of strSphere.

4. For all points on the same side of the line as point arrPerimeterPts(i+1) connect them with a line to arrPerimeterPts(i).

5. Of these lines find the one with a mid point fartherest from the apex of strSphere

6. If there are any points in arrPerimeterPts between this point and arrPerimeterPts(i), then remove the intermediate points from the array and draw a line between these two points, else, draw a triangle using these two points as the endpoints of one side using Function1 (also, align the triangle to strSphere using Function3) and insert the resulting third vertex of the triangle between these two points in arrPeremiterPts and arrAllpts.

7. Next i

Function 1

1. Select endPoint1 and endPoint2 of the existing line.

2. Get point1 to define the orientation of the triangle

3. Get sideLength1 and sideLength2.

4. Draw a circle circ1 with centre at endPoint1 and radius of sideLength1.

5. Draw a circle circ2 with centre at endPoint2 and radius of sideLength2.

6. Find the intersection points intPt1 and intPt2 of circ1 and circ2.

7. Find the distance between intPt1 and point1 and the distance between intPt2 and point1.

8. If intPt1 is closer to point1 then endPoint3 = intPt1, else, endPoint3 = intPt2.

9. Draw and return lines connecting endPoint1 to endPoint2, endPoint2 to endPoint3, and endPoint3 to endPoint1.

Function3

1. Select endPtOnSrf1, endPtOnSrf2, and endFree of the triangle.

2. Select the sphere1 on which endPtOnSrf1 and endPtOnSrf2 lie, and select the apexPt of spher1.

3. Draw a line1 from endPtOnSrf1 and endPtOnSrf2.

4. Draw a linePerp with start point at endFree and perpendicular to line1.

5. Draw intPt at the intersection linePerp and line1.

6. Draw circle on the plane perpendicular to line1 with centre at intPt and radius equal to linePerp.

7. Trim circle using sphere1 as a cutting object to get arc1.

8. Compare the distance of the two end points of arc1 to apexPt. endPtOnSrf3 = the end point with greater distance to apexPt.

9. Draw and return lines connecting endPtOnSrf1 to endPtOnSrf2, endPtOnSrf2 to endPtOnSrf3, and endPtOnSrf3 to endPtOnSrf1. 