Surface32¶
giant.ray_tracer.shapes.surface
:
- class giant.ray_tracer.shapes.surface.Surface32(self, vertices, albedos, facets, normals=None, compute_bounding_box=True, bounding_box=None, compute_reference_ellipsoid=True, reference_ellipsoid=None)¶
This class serves as the backbone for surfaces in GIANT represented using single precision.
As such it provides the default
__init__()
,__reduce__()
,__eq__()
,merge()
,rotate()
,translate()
,compute_bounding_box()
, andcompute_reference_ellipsoid()
methods which are generally shared by all surfaces. It additionally provides propertiesfacets
,albedos
,vertices
,normals
,stacked_vertices
, andnum_faces
which are commonly shared.You should only use this class when developing a new surface in GIANT using single precision vertices. Beyond that this shouldn’t even be used as an instance check. For an example of how to implement a new surface, examine the
Triangle32
class code. If you want to develop a new surface using single precision vertices then look at theSurface32
andTriangle32
classes. Though you can technically initialize an instance of this class, there’s not real reason to since the tracing interface is undefined making the instance mostly worthless.- Parameters:
vertices (ARRAY_LIKE) – The vertices for the surface as a n by 3 array
albedos (Union[ARRAY_LIKE, float]) – The albedo(s) for the surface as either a scalar or a length n array
facets (ARRAY_LIKE) – The connectivity map for the surface as a mxp array where m is the number of faces, p is the number of vertices for each face, and each element is an index into the
vertices
arraynormals (Optional[ARRAY_LIKE]) – The normal vectors for each face of the surface. If
None
then the normals will be computedcompute_bounding_box (Optional[AxisAlignedBoundingBox]) – A flag specifying whether to compute the axis aligned bounding box for the surface
bounding_box – The axis aligned bounding box for the surface. This will be overwritten if
compute_bounding_box
isTrue
compute_reference_ellipsoid (bool) – A flag specifying whether to compute the reference ellipsoid for the surface.
reference_ellipsoid (Optional[Ellipsoid]) – The reference ellipsoid for the surface. If
compute_reference_ellipsoid
isTrue
this will be overwritten
- bounding_box: AxisAlignedBoundingBox¶
The
AxisAlignedBoundingBox
that fully contains this solid.
- albedos¶
This property represents the albedo for the surface.
The albedo can either be a scalar, if there is a single albedo for the entire array, or an array of length n if there is a different albedo value for each vertex. Both are accessed through this property
- facets¶
This property returns the facets for the surfaces(s) as a mxp ndarray where each face has p vertices and there are m faces overall.
The facet elements are indices into the
vertices
array. They must be positive.Each row of this array corresponds to the same row of the
normals
array
- normals¶
This property returns the normals for the surfaces(s) as a mx3 ndarray where there are m surfaces contained
Each row of this array corresponds to the same row in the
facets
array.
- num_faces¶
The number of faces in this surface.
This is the length of the first axis of the
facets
array.
- stacked_vertices¶
This property returns the vertices for the surfaces(s) as a mx3xp ndarray where each surface has p vertices and there are m surfaces overall.
This returns self.vertices[self.facets].swapaxes(-1, -2). Note that this will always produce a copy, so be cautious about using this property frequently
Summary of Methods
This method computes the bounding box that contains all of the vertices. |
|
This method computes the intersects between a single ray and the surface describe by this object. |
|
This method computes the linear change in the limb location given a change in the relative position between the surface and the observer. |
|
This method computes the reference ellipsoid that best represents the vertices. |
|
This method determines the limb points for a surface (visible edge of the surface) that would be visible for an observer located at |
|
This method is used to merge two surface collections together. |
|
This method rotates the surface into a new frame. |
|
This python method provides an easy interface to trace a number of Rays through the surface. |
|
This method translates the surface |