Valdemir Carrara
Homepage

Figuras 3D de Mecânica Celeste


Este programa foi criado em linguagem POV (Persistence of Vision Raytracer) para auxiliar na geração de figuras geométricas 3D, com a intenção de ilustrar trabalhos acadêmicos.




A versão atual permite desenhar esferas (ou segmentos esféricos) transparentes, com ou sem textura dos continentes, vetores, arcos de círculos e órbitas de satélites.





Para usar o programa, é necessário baixar e instalar o POV, que é gratuito. A seguir, deve-se baixar o arquivo compactado contendo o programa figuras.pov, e descompactar o arquivo em alguma pasta. O POV deve agora ser executado, e na opção File/Open, deve-se abrir o arquivo figuras.pov e figuras.txt. Este último é um arquivo de dados que controla a geração das figuras no POV.
O arquivo figuras.txt apresenta um exemplo dos dados que geram a figura ao lado, e também um resumo de todos os comandos e seus significados.








3D Images for Celestial Mechanics

This is a small script in Povray to generate images of spheres, circles and vectors in 3D space, to ilustrate academic papers. Directions are given by a text file containing a sequence of two lines with coded numbers, like

 1,
 1.8, 0.3, 30, 50, 30, 0, 360, 0, 0, 0,

The first line means the object to be drawn, and in the second line are the properties of such an object.





Present version can draw segment or  wedge spheres with or without transparency, with solid colors or with the Earth texture, vectors in 3D space, circles, arcs, and orbits.




Initially download and install Povray from here (it's free). Then, download this compressed file with the pov script "figuras.pov", and unzip it in an empty folder. Now you can run Povray and from the pov's menu File/Open, open the "figuras.pov" file. Also open "figuras.txt", which contains the scene descriptors. This file already has some  previous stores scenes that you  can use, besides an explanation of all the drawing commands.

Scene descriptor commands (figuras.txt)

Command format:

n,
n1, n2, n3, n4, ...,

where

n, is the command code with ending comma
n1, n2, ... are the command descriptors. All descriptors must be in the right place, even if zeros, separated by comma and with ending comma

Command list:

0 - Camera position and view direction
1 - Elipse or elipse arc to draw an orbit
2 - Draw axes of a rectangular coordinate system
3 - Sphere or spherical segment
4 - Draw a vector with rectangular coordinates
5 - Draw a circle, an arc or a parallel
6 - Draw a vector with spherical coordinates
9 - Stop drawing

Command descriptors (with example between parenthesis)

Camera

n = 0,
n1 = (20)        // Right ascension of camera position (deg)
n2 = (30)        // Declination of camera position (deg)
n3 = (10)        // Radius of camera position

n4 = (.2)         // x component of looking point
n5 = (.1)         // y component of looking point
n6 = (.2)         // z component of looking point
n7 = (20)        // Camera field of view (angle in degress)

Elipses and orbit

n = 1,             // Elipses and orbit command
n1 = (1.6)       // Semimajor axis in Earth radius units
n2 = (0.2)       // Eccentricity
n3 = (30)        // Inclination (deg)
n4 = (40)        // Right ascension of the ascending node (deg)
n5 = (60)        // Perigee argument (deg)
n6 = (0)          // Eccentric anomaly of the beggining orbit arc (deg)
n7 = (-10)       // Eccentric anomaly of the final orbit arc (gr) (deg)
n8 = (1)          // Beggining mark: 0-No mark | 1-Arrow | 2-Ball
n9 = (1)          // Ending mark: 0-No mark | 1-Arrow | 2-Ball
n10 = (0)        // Arc color: 0, 1, or 2

Coordinate system axes

n = 2,             // Rectangular coordinate system
n = (1)            // Ending mark: 0-No mark | 1-Arrow | 2-Ball
n = (20)          // First rotation angle (deg)
n = (3)            // First rotation axis (1-x, 2-y, 3-z)
n = (40)          // Second rotation angle (deg)
n = (1)            // Second rotation axis (1-x, 2-y, 3-z)
n = (0)            // Third rotation angle (deg)
n = (3)            // Third rotation axis (1-x, 2-y, 3-z)
n = (1)            // Axes lenght in units of 1.2 radius unit
n = (0.5)         // Origin position in x direction
n = (0.2)         // Origin position in y direction
n = (-0.3)        // Origin position in z direction

Sphere

n = 3,             // Sphere, spherical segment, spherical wedge  
n = (0.)           // Initial radius (radius units)
n = (1.0)         // Final radius
n = (0)            // Initial meridian (deg)
n = (360)         // Final meridian (deg)
n = (30)          // Initial parallel (graus)
n = (90)          // Final parallel (deg)
n = (0)            // Sphere material: 0-transparent | 1-Earth texture

Vector in rectangular coordinates

n = 4,             // Vector in rectangular coordinates

n = (0.3)         // x coordinate of vector origin
n = (-0.5)        // y coordinate of vector origin
n = (-.2)          // z coordinate of vector origin
n = (2)            // Beggining mark: 0-No mark | 1-Arrow | 2-Ball
n = (0.5)         // x coordinate of vector
n = (1)            // y coordinate of vector
n = (1)            // z coordinate of vector
n = 2;             // Vector mark: 0-No mark | 1-Arrow | 2-Ball

Circle arc

n = 5,             // Circle or circle arc

n1 = (0)          // Initial angle (deg)
n2 = (-10)       // Final angle (deg)
n3 = (1)          // Initial mark: 0-No mark | 1-Arrow | 2-Ball
n4 = (1)          // Final mark: 0-No mark | 1-Arrow | 2-Ball
n5 = (20)        // First rotation angle (deg)
n6 = (3)          // First rotation axis (1-x, 2-y, 3-z)
n7 = (40)        // Second rotation angle (deg)
n8 = (1)          // Second rotation axis (1-x, 2-y, 3-z)
n9 = (0)          // Third rotation angle (deg)
n10 = (3)        // Third rotation axis (1-x, 2-y, 3-z)
n11 = (1)        // Circle or arc radius
n12 = (0.5)     // Shift of the circle perpendicular to circle plane
n13 = (1)        // Material color: 0, 1 or 2

Vector radius

n = 6,            // Vector in spherical coordinates
n = (1)           // Vector mark: 0-No mark | 1-Arrow | 2-Ball
n = (20)         // First rotation angle (deg)
n = (3)           // First rotation axis (1-x, 2-y, 3-z)
n = (40)         // Second rotation angle (deg)
n = (1)           // Second rotation axis (1-x, 2-y, 3-z)
n = (0)           // Third rotation angle (deg)
n = (3)           // Third rotation axis (1-x, 2-y, 3-z)
n = (1.)          // Vector length in radius units
n = (0.5)        // x coordinate of vector origin
n = (0.2)        // y coordinate of vector origin
n = (-0.3)       // z coordinate of vector origin

End command

n = 9,            // Stop reading commands and draw figure


Copyright: Carrara, V. 2023

Contact: