Shapes v0.1.0 GEOF.Shapes

Shared utility functions for working with 3D geometry.

Link to this section Summary

Types

A line in three dimensions represented by two points on the line

A triangle in three dimensions represented by its vertices

A point in three dimensions

Functions

Given a position on a planetary sphere, determines which face of the unit tetrahedron the position lies within

Given a position on a planetary sphere, determines which face of the unit octahedron the position lies within

Given a line and a triangle in 3D space, determines whether the line intersects with the triangle

Link to this section Types

Link to this type

line3()
line3() :: {vector3(), vector3()}

A line in three dimensions represented by two points on the line.

Link to this type

triangle3()
triangle3() :: {vector3(), vector3(), vector3()}

A triangle in three dimensions represented by its vertices.

Link to this type

vector3()
vector3() :: {number(), number(), number()}

A point in three dimensions.

Link to this section Functions

Link to this function

face_of_4_hedron(arg)
face_of_4_hedron(GEOF.Planet.Geometry.position()) :: pos_integer()

Given a position on a planetary sphere, determines which face of the unit tetrahedron the position lies within.

Link to this function

face_of_8_hedron(arg)
face_of_8_hedron(GEOF.Planet.Geometry.position()) :: pos_integer()

Given a position on a planetary sphere, determines which face of the unit octahedron the position lies within.

Link to this function

line_intersects_triangle?(arg1, arg2)
line_intersects_triangle?(line3(), triangle3()) :: boolean()

Given a line and a triangle in 3D space, determines whether the line intersects with the triangle.