Skip to content

Main content

Icon Stroke Clearance Gap Tool

Calculate icon stroke clearance gap from explicit caller-supplied inputs.

Loading tool…

Description

Subtract half each nonnegative stroke width from nonnegative centerlineGap for visibleGap, then subtract requiredVisibleGap for margin.

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.

Subtract half each nonnegative stroke width from nonnegative centerlineGap for visibleGap, then subtract requiredVisibleGap for margin.

When to use this tool

Use Icon Stroke Clearance Gap when you need a numerical stroke allowance or repeating-pattern calculation before rendering.

How to use the tool and how it works

  1. Enter centerlineGap, firstStrokeWidth, secondStrokeWidth, requiredVisibleGap. 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 visibleGap, margin. Use the output convention below.

Subtract half each nonnegative stroke width from nonnegative centerlineGap for visibleGap, then subtract requiredVisibleGap for margin.1

Input fieldMeaning and unitsAccepted input
centerlineGapCenterline GapRequired. Finite number; minimum 0.
firstStrokeWidthFirst Stroke WidthRequired. Finite number; minimum 0.
secondStrokeWidthSecond Stroke WidthRequired. Finite number; minimum 0.
requiredVisibleGapRequired Visible GapRequired. Finite number; minimum 0.
Output fieldInterpretationReturned shape
visibleGapVisible GapRequired. Finite number.
marginSigned allowance under the subtraction convention above.Required. Finite number.
json
{
  "input": {
    "centerlineGap": 10,
    "firstStrokeWidth": 4,
    "secondStrokeWidth": 2,
    "requiredVisibleGap": 5
  },
  "output": {
    "visibleGap": 7,
    "margin": 2
  }
}

Limitations and assumptions

  • Lengths share units; negative gaps are retained and this straight-stroke model omits joins, caps, curvature, rasterization, and actual icon geometry.
  • 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/icon-stroke-clearance-gap — tool.io

Similar or alternative tools