Skip to content

Main content

Vector Stroke Dash Period Remainder Tool

SVG-style dash-array odd-list duplication and signed offset wrapping for a nonempty pattern with strictly positive total length. All-zero solid-stroke patterns have no wrapping period and are rejected; no path flattening or raster rendering.

Loading tool…

Description

Duplicate an odd-length array, sum the effective array as period, and normalize signed offset into [0, period).

A vector stroke has width as well as a centerline, and a dashed stroke alternates painted lengths and gaps. Pattern phase and visible clearance depend on these dimensions even before a path is rendered.

Duplicate an odd-length array, sum the effective array as period, and normalize signed offset into [0, period).

When to use this tool

Use Vector Stroke Dash Period Remainder when you need a numerical stroke allowance or repeating-pattern calculation before rendering.

How to use the tool and how it works

  1. Enter dashArray, offset. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read effectiveDashArray, period, normalizedOffset. Use the output convention below.

Require 1-128 nonnegative dashArray values with positive sum. Duplicate an odd-length array, sum the effective array as period, and normalize signed offset into [0, period).1

Odd dash lists repeat to make an even pattern. Unlike SVG solid-stroke handling, this tool rejects an all-zero pattern because no positive wrapping period exists.2

Input fieldMeaning and unitsAccepted input
dashArrayNonnegative alternating painted/gap lengths, 1-128 entries with positive sum; common stroke length unit.Required. Array of finite number; maximum items 256.
offsetSigned phase displacement in the same length unit.Required. Finite number.
Output fieldInterpretationReturned shape
effectiveDashArrayEffective Dash ArrayRequired. Array of finite number; maximum items 256.
periodPeriodRequired. Finite number.
normalizedOffsetOffset modulo effective period in [0, period).Required. Finite number.
json
{
  "input": {
    "dashArray": [
      3,
      2,
      1
    ],
    "offset": -1
  },
  "output": {
    "effectiveDashArray": [
      3,
      2,
      1,
      3,
      2,
      1
    ],
    "period": 12,
    "normalizedOffset": 11
  }
}

Limitations and assumptions

  • Lengths and offset share units; no actual path, rendering, line caps, scaling, or dash visibility is evaluated and a zero-length element is allowed.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Inspect the result in the target vector renderer at final size. Curved paths, joins, caps, and rasterization may require geometry or visual checks beyond a local length calculation.

References

  1. Calculation and input contract: graphic-design/vector-stroke-dash-period-remainder — tool.io

  2. SVG 2: stroke dashing — W3C

Similar or alternative tools

  • Baseline Grid Half Step Rule

    Normalize coordinate around origin, round to the nearest grid index, resolve exact half steps by the selected policy, and return index and snapped coordinate.

  • Baseline Grid Phase Offset

    Reduce baseline-origin modulo step into [0, step) and divide by step for fraction.