Primitives

Abstract

Meshes.PrimitiveType
Primitive{Dim,T}

We say that a geometry is a primitive when it can be expressed as a single entity with no parts (a.k.a. atomic). For example, a sphere is a primitive described in terms of a mathematical expression involving a metric and a radius. See https://en.wikipedia.org/wiki/Geometric_primitive.

Concrete

Meshes.RayType
Ray(p, v)

A ray originating at point p, pointed in direction v. It can be called as r(t) with t > 0 to cast it at p + t * v.

Meshes.PlaneType
Plane(p, u, v)

A plane embedded in R³ passing through point p, defined by non-parallel vectors u and v.

Plane(p, n)

Alternatively specify point p and a given normal vector n to the plane.

Meshes.BoxType
Box(min, max)

An axis-aligned box with min and max corners. See https://en.wikipedia.org/wiki/Hyperrectangle.

Examples

Box(Point(0,0,0), Point(1,1,1)) # unit cube
Meshes.CylinderType
Cylinder(radius, bottom, top)

A solid circular cylinder embedded in R³ with given radius, delimited by bottom and top planes.

Cylinder(radius, segment)

Alternatively, construct a right circular cylinder with given radius and segment between origin of bottom and top planes.

Cylinder(radius)

Finally, construct a right vertical circular cylinder with given radius.

See https://en.wikipedia.org/wiki/Cylinder.

Meshes.BallType
Ball(center, radius)

A ball with center and radius.

See also Sphere.

Meshes.SphereType
Sphere(center, radius)

A sphere with center and radius.

See also Ball.