Esempio n. 1
0
fA = Face(p4, p3, p2, p1)
fB = Face(p2, p3, p7, p6)
fC = Face(p3, p4, p8, p7)
fD = Face(p4, p1, p5, p8)
fE = Face(p1, p2, p6, p5)
fF = Face(p5, p6, p7, p8)

cubesat = Geometry([fA, fB, fC, fD, fE, fF])

frame1 = Frame()
frame1.add_geometry(cubesat)
frame1.translate(0.5, 0.5, 0.5)
frame1.rotate(0, 0, d2r(1 * 360 / 12))

cubesat.rotate(d2r(-45), 0, 0, cor=list(cubesat.find_cuboid_centroid()))

f = Face(Vertex([0, 0, 0]), Vertex([1, 0, 0]), Vertex([1, 1, 0]),
         Vertex([0, 1, 0]))

for face in frame1.illuminated_faces(cubesat, 'xz'):
    print(frame1.illuminated_strength(face, 'xz'))

#%% ==== Plotting ====

# Toggle plotting functionality:
if True:

    # Setting up the plot:
    fig = plt.figure(figsize=(8, 8))
    ax = mp3d.Axes3D(fig)
Esempio n. 2
0
    
    ax.set_title("Wireframe visualization, A_xy = {} m^2".format(A_shadow))

    ax.set_xlim(0, 0.4)
    ax.set_ylim(0, 0.4)
    ax.set_zlim(0, 0.3)

    ax.set_xlabel('x')
    ax.set_ylabel('y')
    ax.set_zlabel('z')

    # Plotting the XYZ tripod
    plot_xyz_tripod(ax, scaling=0.25)

    # Plotting the centroid of the geometry (manually)
    COR = geometry1.find_cuboid_centroid()
    ax.scatter(COR.x, COR.y, COR.z, c='cyan', s=20, alpha=0.5)

    # Plot Cubesat model
    plot_geometry(ax, geometry1, linecolour='black', fill=1, alpha=1,
                  illumination=True)
    # Plot projection of Cubesat
    plot_geometry(ax, geometry1xy, linecolour='orange')

    # Highlight one of the faces in bright yellow (useful for debugging)
    # plot_face(ax, geometry1.faces[5], colour='yellow')    

    # Plotting the perpendiculars
    plot_geometry_perpendiculars(ax, geometry1)

    fig.show()