walkmap.polygon

Essentially the specification for things we shall consider to be polygons.

centre

(centre poly)

TODO: write docs

check-polygon

macro

(check-polygon o)

If o is not a polygon, throw an IllegalArgumentException with an appropriate message; otherwise, returns o. Macro, so exception is thrown from the calling function.

check-polygons

macro

(check-polygons o)

If o is not a sequence of polygons, throw an IllegalArgumentException with an appropriate message; otherwise, returns o. Macro, so exception is thrown from the calling function.

check-triangle

macro

(check-triangle o)

If o is not a triangle, throw an IllegalArgumentException with an appropriate message; otherwise, returns o. Macro, so exception is thrown from the calling function.

gradient

(gradient triangle)

Return a polygon like triangle but with a key :gradient whose value is a unit vector representing the gradient across triangle.

on2d?

macro

(on2d? vertex poly)

Is the projection of this vertex on the x, y plane within the projection of this polygon poly on that plane?

on2drectangle?

(on2drectangle? vertex rectangle)

Is the projection of this vertex on the x, y plane within the projection of this rectangle on that plane?

on2dtriangle?

macro

(on2dtriangle? vertex poly)

Is the projection of this vertex on the x, y plane within the projection of this triangle on that plane?

polygon

(polygon & vertices)

Return a polygon constructed from these vertices.

polygon?

(polygon? o)

True if o satisfies the conditions for a polygon. A polygon shall be a map which has a value for the key :vertices, where that value is a sequence of vertices.

rectangle

(rectangle vsw vne)

Return a rectangle, with edges aligned east-west and north-south, whose south-west corner is the vertex vsw and whose north-east corner is the vertex vne.

triangle-centre

(triangle-centre facet)

Return a canonicalised facet (i.e. a triangular polygon) with an added key :centre whose value represents the centre of this facet in 3 dimensions. This only works for triangles, so is here not in walkmap.polygon. It is an error (although no exception is currently thrown) if the object past is not a triangular polygon.

triangle?

(triangle? o)

True if o satisfies the conditions for a triangle. A triangle shall be a polygon with exactly three vertices.