clip-path polygon Vertex Count Validator

Check polygon coordinate-pair count: CSS syntax requires at least one pair, while at least three vertices are necessary to enclose area; coordinates and degeneracy are not validated.

Description

A CSS polygon can be syntactically specified with very few coordinate pairs, but enclosing a two-dimensional area requires at least three vertices.

A CSS polygon can be syntactically specified with very few coordinate pairs, but enclosing a two-dimensional area requires at least three vertices. Vertex count alone cannot show whether those vertices form a nondegenerate shape.1

Check polygon coordinate-pair count: CSS syntax requires at least one pair, while at least three vertices are necessary to enclose area; coordinates and degeneracy are not validated.

When to use clip-path polygon Vertex Count Validator

Use this tool to check polygon coordinate-pair count: CSS syntax requires at least one pair, while at least three vertices are necessary to enclose area; coordinates and degeneracy are not validated.

Choose the CSS values, dimensions or counts for this calculation. Supply resolved numeric measurements in matching units and the explicit reference box or writing mode where required.

How to use clip-path polygon Vertex Count Validator and understand its results

  1. Choose the CSS values, dimensions or counts for this calculation. Supply resolved numeric measurements in matching units and the explicit reference box or writing mode where required.
  2. Enter vertexCount using the field table and calculation rules, then run the tool.
  3. Read validCount, canEncloseArea, minimumSyntaxVertices, minimumAreaVertices. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
Input fieldMeaningValue type; see rules belowRequirement
vertexCountVertex countinteger; minimum: 0; maximum: 9007199254740991Required

Enter a nonnegative safe-integer number of coordinate pairs. The tool compares it with the syntax threshold 1 and the area threshold 3, returning both flags and both fixed thresholds. One or two vertices pass the count syntax check but do not meet the area threshold; zero meets neither.

validCount = vertexCount ≥ 1; canEncloseArea = vertexCount ≥ 3

Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.

Output fieldMeaningValue type
validCountValid countboolean
canEncloseAreaCan enclose areaboolean
minimumSyntaxVerticesMinimum syntax verticesinteger; minimum: 0; maximum: 9007199254740991
minimumAreaVerticesMinimum area verticesinteger; minimum: 0; maximum: 9007199254740991
json
{
  "input": {
    "vertexCount": 3
  },
  "output": {
    "validCount": true,
    "canEncloseArea": true,
    "minimumSyntaxVertices": 1,
    "minimumAreaVertices": 3
  }
}

Limitations and assumptions

Despite the canEncloseArea field name, three or more vertices are only necessary, not sufficient, for area. Actual coordinates, collinearity, repeated points, self-intersection and fill rules are not checked. It does not parse clip-path syntax or calculate an area.

Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors. A successfully returned false flag is an evaluated outcome; its meaning is explained above.

Alternative or Complementary methods

Use inset All-Four Offsets Shorthand: Expand one to four finite pixel inset values into top, right, bottom, and left offsets. For a complementary task, use Negative scale Flip Mirror Check: Classify axis reflections, orientation reversal, and collapsed axes of a two-dimensional CSS scale.

References

  1. clip-path polygon Vertex Count Validator — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies