How to add your knowledge

polygonCheck()

    Table of contents
    1. 1. Synopsis
    2. 2. Syntax
    3. 3. Example 1
    4. 4. Example 2
    5. 5. Example 3
    6. 6. Example 4

    Synopsis

    Checks the list of points for various flaws and returns a Name indicating the status. The correct result is :normal. Only :normal polygons are proper arguments to the polygon functions. Potential problems are:

    • :TooFewPoints when the polygon has zero, one, or two points.
    • :TooManyPoints when the polygon has more than 10000 points.
    • :NonSimplePolygon when the polygon uses a vertex more than once.
    • :SelfIntersectingPolygon when edges of the polygon intersect.
    • :UnknownIllegalPolygon when there is some other problem.

    Polygons are represented in a "lightweight" way by a list of points. The first three non-colinear points define the "plane" of the polygon, even if the rest of the points do not lie in that plane, they will be projected onto that plane for all computations.

    Syntax

    polygonCheck ( points As List ) As Name
    Argument Type Description
    points List The polygon to be checked.

    Example 1

    Intent >polygonCheck({Point(0,0,0), Point(2,0,0), Point(2,2,0)})
    --> :normal

    Example 2

    Intent >polygonCheck({Point(0,0,0), Point(2,0,0)})
    --> :TooFewPoints

    Example 3

    Intent >polygonCheck({Point(0,0,0), Point(2,0,0), Point(2,2,0), Point(2,0,0), Point(3,3,0)})
    --> :NonSimplePolygon

    Example 4

    Intent >polygonCheck({Point(0,0,0), Point(4,0,0), Point(4,4,0), Point(2,-1,0), Point(0,4,0)})
    --> :SelfIntersectingPolygon