Shield Outline SVG Path Complexity Rater

Lexical command/numeric-token complexity of supplied shield path text, not rendered curvature, self-intersection or SVG grammar validity.

Description

SVG path text contains command letters and numeric parameters, but lexical counts do not establish geometric complexity.

SVG path text contains command letters and numeric parameters, but lexical counts do not establish geometric complexity.1

Parsing the characters of a path is different from validating or rendering it.

When to use Shield Outline SVG Path Complexity Rater

Use this tool to calculate or review the supplied observations under the stated rules. Establish the source tradition, viewing frame, coordinate units and independently annotated features.

How to use Shield Outline SVG Path Complexity Rater and understand its results

  1. Establish the source tradition, viewing frame, coordinate units and independently annotated features.
  2. Enter svgPathText, using the field meanings and rules below, then run the tool.
  3. Read result.lexicalCommandCount, result.numericLiteralCount, using the output meanings and calculation rules below.
  4. Correct any reported input issue and run again. Before using a successful result, check the stated units, signs, reference scope and observation coverage.
Input fieldMeaningValue typeRequirement
svgPathTextSvg path textstringRequired

Enter at most 8192 UTF-16 units of path text containing only SVG path command letters, numeric/scientific-notation characters, commas and whitespace. Count supported command letters and number tokens matching the numeric regular expression. Blank text returns zero counts.

commandCount=countMatches(/[MmLlHhVvCcSsQqTtAaZz]/); numberCount=countNumericRegexMatches(text)

Use the matching field units and the exact boundary, ordering and reference rules above.

Output fieldMeaningValue type
resultCalculated observation or referenceobject
result.lexicalCommandCountlexical Command Countnumber
result.numericLiteralCountnumeric Literal Countnumber
json
{
  "input": {
    "svgPathText": "M0 0 L10 0 L10 10 Z"
  },
  "output": {
    "result": {
      "lexicalCommandCount": 4,
      "numericLiteralCount": 6
    }
  }
}

Limitations and assumptions

This is lexical counting, not SVG grammar validation. Command argument counts, arc flags, valid separators, geometry, rendering and visual complexity are not checked; incomplete path text can still be counted.

Missing required fields, unknown fields, wrong types and violated rules return input issues. Numeric values and outputs must be finite. Extremely large composite outputs are rejected.

Alternative or Complementary methods

For a related step, use Blazon Text Tokenizer to Structured Fields Parser: A blazon is a conventional verbal description of arms, while a restricted parser recognizes only an explicitly supported subset. For a complementary comparison, use Structured Fields to Blazon Sentence Serializer: A blazon orders a field description and charge descriptions according to an adopted convention.

References

  1. Shield Outline SVG Path Complexity Rater — tool.io

Similar or alternative tools

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