triangle

This cython module defines surfaces for GIANT tesselated using Triangles as the geometry primitive.

Description

The triangle is the most commonly used geometry primitive for tesselating a surface in the general rendering/modelling community and GIANT is no different. the vast majority of surfaces in GIANT are represented using the classes defined in this module. They represent surfaces as a collection of triangles (defined by an array of vertices, an array of albedos, an array of normal vectors, and a facet map which specifies how the vertices are connected into Triangles) which is a very memory efficient way to represent these structures (and is very similar to the format used for the ubiquitous wavefront obj format). There are 2 classes that implement this that are identical except for the precision with which they store these values, Triangle64 which stores the values using double precision and Triangle32 which store these values using single precision. In many cases single precision is sufficient, however, if you are dealing with very high resolution terrain of a large object, or are translating/rotating the terrain frequently then you may need to consider using the double precision representation. One way to get around this is to use the KDTree acceleration structure (recommended in general anyway) since this never actually translates/rotates the terrain, therefore avoiding loss of precision.

The triangle representations in this module are fully featured and can be used throughout GIANT for ray tracing, rendering, and relative OpNav. That being said, due to the nature of tesselation, they are typically not the most efficient when it comes to ray tracing. Therefore, we strongly recommend that you wrap these objects in the acceleration structure provided by class KDTree, which dramatically accelerates the ray tracing performance while still providing exact tracing results.

Use

In general users will rarely directly need to create instances of these classes, as GIANT provides tools the create them from common formats in the scripts ingest_shape, spc_to_feature_catalogue, and tile_shape. If you do need to use these classes directly the documentation below should help you (and examining the aforementioned scripts as examples would also be helpful).

Classes

Triangle64

This class represents surfaces as tessellated triangles, storing the vertices, albedos, and normal vectors using double precision.

Triangle32

This class represents surfaces as tessellated triangles, storing the vertices, albedos, and normal vectors using single precision.