Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "ops/area"

Index

Variables

Variables

Const area

area: MultiFn1O<IShape, boolean, number> = defmulti(dispatch)

Returns the possibly signed (unsigned by default) surface area of given shape. For groups calls area for each child and returns sum of unsigned areas.

In general, for polygons and triangles, the sign of the result can be used as indication of the shapes orientation (clockwise / counterclockwise).

For curves, lines, point clouds and rays the function returns 0.

Implemented for:

  • AABB
  • Circle
  • Cubic
  • Ellipse
  • Group
  • Line
  • Plane
  • Points
  • Polygon
  • Polyline
  • Quad
  • Quadratic
  • Ray
  • Rect
  • Sphere
  • Triangle
param

shape to operate on

param

true, if signed area

Generated using TypeDoc