gfm.math.shapes

This module implements some abstract geometric shapes:

  • Line segments.
  • Triangle.
  • Circles/spheres.
  • Rays
  • Planes
  • Frustum

Members

Aliases

DimensionType
alias DimensionType(T : Segment!U, U...) = U[0]
alias DimensionType(T : Triangle!U, U...) = U[0]
alias DimensionType(T : Sphere!U, U...) = U[0]
alias DimensionType(T : Ray!U, U...) = U[0]
alias DimensionType(T : Plane!U, U) = U
alias DimensionType(T : Frustum!U, U) = U

Get the numeric type used to measure a shape's dimensions.

Enums

isFrustum
eponymoustemplate isFrustum(T)

True if T is a kind of Frustum

isPlane
eponymoustemplate isPlane(T)

True if T is a kind of Plane

isRay
eponymoustemplate isRay(T)

True if T is a kind of Ray

isRay2D
eponymoustemplate isRay2D(T)

True if T is a kind of 2 dimensional Ray

isRay3D
eponymoustemplate isRay3D(T)

True if T is a kind of 3 dimensional Ray

isSegment
eponymoustemplate isSegment(T)

True if T is a kind of Segment

isSegment2D
eponymoustemplate isSegment2D(T)

True if T is a kind of 2 dimensional Segment

isSegment3D
eponymoustemplate isSegment3D(T)

True if T is a kind of 3 dimensional Segment

isSphere
eponymoustemplate isSphere(T)

True if T is a kind of Sphere

isSphere2D
eponymoustemplate isSphere2D(T)

True if T is a kind of 2 dimensional Sphere

isSphere3D
eponymoustemplate isSphere3D(T)

True if T is a kind of 3 dimensional Sphere

isTriangle
eponymoustemplate isTriangle(T)

True if T is a kind of Triangle

isTriangle2D
eponymoustemplate isTriangle2D(T)

True if T is a kind of 2 dimensional Triangle

isTriangle3D
eponymoustemplate isTriangle3D(T)

True if T is a kind of 3 dimensional Triangle

Structs

Frustum
struct Frustum(T)

3D frustum.

Plane
struct Plane(T)

3D plane.

Ray
struct Ray(T, int N)

A Ray ir a point + a direction.

Segment
struct Segment(T, int N)

A Segment is 2 points. When considered like a vector, it represents the arrow from a to b.

Sphere
struct Sphere(T, int N)

A Sphere is a point + a radius.

Triangle
struct Triangle(T, int N)

A Triangle is 3 points.

Meta