コード例 #1
0
import numpy as np
import math
from math import pi
import imageio as im
import matplotlib.pyplot as plt
from PIL import Image
from datetime import datetime

degrees = 180 / pi

# octahedron
octahedronFaces = [[0, 90], [-90, 0], [0, 0], [90, 0], [180, 0], [0, -90]]
# octahedronFaces = [[0, 2, 1], [0, 3, 2], [5, 1, 2], [5, 2, 3], [0, 1, 4], [0, 4, 3], [5, 4, 1], [5, 3, 4]]
octahedronParent = [-1, 0, 0, 1, 0, 1, 4, 5]
f1 = polFace([
    polVertex(octahedronFaces[0]),
    polVertex(octahedronFaces[1]),
    polVertex(octahedronFaces[2])
], "OCTA", "A")
f2 = polFace([
    polVertex(octahedronFaces[0]),
    polVertex(octahedronFaces[3]),
    polVertex(octahedronFaces[2])
], "OCTA", "B")
f3 = polFace([
    polVertex(octahedronFaces[5]),
    polVertex(octahedronFaces[1]),
    polVertex(octahedronFaces[2])
], "OCTA", "C")
f4 = polFace([
    polVertex(octahedronFaces[5]),
コード例 #2
0
ファイル: iconsohedron.py プロジェクト: chubylive/TetraPano
# f15 = polFace([polVertex(polIcos[11]), polVertex(polIcos[1]), polVertex(polIcos[7])],"ICOS")
# f16 = polFace([polVertex(polIcos[6]), polVertex(polIcos[7]), polVertex(polIcos[8])],"ICOS")
# f17 = polFace([polVertex(polIcos[6]), polVertex(polIcos[8]), polVertex(polIcos[9])],"ICOS")
# f18 = polFace([polVertex(polIcos[6]), polVertex(polIcos[9]), polVertex(polIcos[10])],"ICOS")
# f19 = polFace([polVertex(polIcos[6]), polVertex(polIcos[10]), polVertex(polIcos[11])],"ICOS")
# f20 = polFace([polVertex(polIcos[6]), polVertex(polIcos[11]), polVertex(polIcos[7])],"ICOS")

degrees = 180 / pi
icosahedronVert = [[0, 90], [0, -90]]
for i in range(0, 10):
    theta = math.atan(0.5) * degrees
    phi = (i * 36 + 180) % 360 - 180
    icosahedronVert.append([phi, (theta if i & 1 else -theta)])

f1 = polFace([
    polVertex(icosahedronVert[0]),
    polVertex(icosahedronVert[3]),
    polVertex(icosahedronVert[11])
], "ICOS", "A")
f2 = polFace([
    polVertex(icosahedronVert[0]),
    polVertex(icosahedronVert[5]),
    polVertex(icosahedronVert[3])
], "ICOS", "B")
f3 = polFace([
    polVertex(icosahedronVert[0]),
    polVertex(icosahedronVert[7]),
    polVertex(icosahedronVert[5])
], "ICOS", "C")
f4 = polFace([
    polVertex(icosahedronVert[0]),
コード例 #3
0
ファイル: tetrahedron.py プロジェクト: chubylive/TetraPano
import matplotlib.pyplot as plt

degrees = 180 / pi
asin1_3 = math.asin(1 / 3)
vertices = [[0, 90], [-180, asin1_3 * degrees], [-60, asin1_3 * degrees],
            [60, asin1_3 * degrees]]

# centroidLat = -(asin1_3 * degrees)

# centers = [[0, 90],
#           [-120, centroidLat],
#           [0,centroidLat],
#           [120, centroidLat]]

f1 = polFace(
    [polVertex(vertices[1]),
     polVertex(vertices[2]),
     polVertex(vertices[3])], "TETRA")
f2 = polFace(
    [polVertex(vertices[0]),
     polVertex(vertices[2]),
     polVertex(vertices[3])], "TETRA")
f3 = polFace(
    [polVertex(vertices[0]),
     polVertex(vertices[1]),
     polVertex(vertices[2])], "TETRA")
f4 = polFace(
    [polVertex(vertices[0]),
     polVertex(vertices[3]),
     polVertex(vertices[1])], "TETRA")
コード例 #4
0
ファイル: cube.py プロジェクト: chubylive/TetraPano
import math
from math import pi
import imageio as im
import matplotlib.pyplot as plt
from PIL import Image
from datetime import datetime

degrees = 180 / pi
asin1_3 = math.asin(1 / 3)
phi1 = math.atan(math.sqrt(1 / 2)) * degrees
cube = [[0 + 45, phi1], [90 + 45, phi1], [180 + 45, phi1], [-90 + 45, phi1],
        [0 + 45, -phi1], [90 + 45, -phi1], [180 + 45, -phi1],
        [-90 + 45, -phi1]]

f1 = polFace([
    polVertex(cube[0]),
    polVertex(cube[3]),
    polVertex(cube[2]),
    polVertex(cube[1])
], "CUBE", "A")
f2 = polFace([
    polVertex(cube[0]),
    polVertex(cube[1]),
    polVertex(cube[5]),
    polVertex(cube[4])
], "CUBE", "B")
f3 = polFace([
    polVertex(cube[1]),
    polVertex(cube[2]),
    polVertex(cube[6]),
    polVertex(cube[5])
コード例 #5
0
                [-1 / sqrt5, (5 + sqrt5) / 10, (np.sqrt((5 - sqrt5) / 10))],
                [-1 / sqrt5, (-5 + sqrt5) / 10, (np.sqrt((5 + sqrt5) / 10))]]

    for elm in cartIcos:
        polIcos.append(cartesianToLatLon(elm[1], elm[2], elm[0]))

    print(polIcos)

    icosahedronFacesPointUp = [[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5],
                               [0, 5, 1], [1, 7, 2], [2, 8, 3], [3, 9, 4],
                               [4, 10, 5], [5, 11, 1], [7, 2, 8], [8, 3, 9],
                               [9, 4, 10], [10, 5, 11], [11, 1, 7], [6, 7, 8],
                               [6, 8, 9], [6, 9, 10], [6, 10, 11], [6, 11, 7]]

    f1 = polFace(
        [polVertex(polIcos[0]),
         polVertex(polIcos[1]),
         polVertex(polIcos[2])])
    f2 = polFace(
        [polVertex(polIcos[0]),
         polVertex(polIcos[2]),
         polVertex(polIcos[3])])
    f3 = polFace(
        [polVertex(polIcos[0]),
         polVertex(polIcos[3]),
         polVertex(polIcos[4])])
    f4 = polFace(
        [polVertex(polIcos[0]),
         polVertex(polIcos[4]),
         polVertex(polIcos[5])])
    f5 = polFace(