Visibility Analysis

Main Functions

AsteroidShapeModels.build_face_visibility_graph!Function
build_face_visibility_graph!(shape::ShapeModel)

Build face-to-face visibility graph for the shape model.

This function computes which faces are visible from each face and stores the results in a FaceVisibilityGraph structure using CSR (Compressed Sparse Row) format.

Arguments

  • shape : Shape model of an asteroid

Notes

  • The visibility graph is stored in shape.face_visibility_graph
  • This is a computationally intensive operation, especially for large models
  • The resulting graph contains view factors, distances, and direction vectors
source
AsteroidShapeModels.isilluminatedFunction
isilluminated(shape::ShapeModel, r☉::StaticVector{3}, i::Integer) -> Bool

Return if the i-th face of the shape model is illuminated by the direct sunlight or not

Arguments

  • shape : Shape model of an asteroid
  • r☉ : Sun's position in the asteroid-fixed frame, which doesn't have to be normalized.
  • i : Index of the face to be checked
source
AsteroidShapeModels.view_factorFunction
view_factor(cᵢ, cⱼ, n̂ᵢ, n̂ⱼ, aⱼ) -> fᵢⱼ, dᵢⱼ, d̂ᵢⱼ

Calculate the view factor from face i to face j, assuming Lambertian emission.

Arguments

  • cᵢ::StaticVector{3}: Center position of face i
  • cⱼ::StaticVector{3}: Center position of face j
  • n̂ᵢ::StaticVector{3}: Unit normal vector of face i
  • n̂ⱼ::StaticVector{3}: Unit normal vector of face j
  • aⱼ::Real : Area of face j

Returns

  • fᵢⱼ::Real: View factor from face i to face j
  • dᵢⱼ::Real: Distance between face centers
  • d̂ᵢⱼ::StaticVector{3}: Unit direction vector from face i to face j

Notes

The view factor is calculated using the formula:

fᵢⱼ = (cosθᵢ * cosθⱼ) / (π * dᵢⱼ²) * aⱼ

where θᵢ and θⱼ are the angles between the line connecting the faces and the respective normal vectors.

The view factor is automatically zero when:

  • Face i is facing away from face j (cosθᵢ ≤ 0)
  • Face j is facing away from face i (cosθⱼ ≤ 0)
  • Both conditions ensure that only mutually visible faces have non-zero view factors

Visual representation

(i)   fᵢⱼ   (j)
 △    -->    △
source

FaceVisibilityGraph Functions