1

This is what I'm wondering about. You have a stroke and the actual brush stroke rendering.

enter image description here

The final result looks something like this:

<svg xmlns="http://www.w3.org/2000/svg" height="200" width="200">
  <mask id="mask" maskUnits="userSpaceOnUse">
    <path d="M 137.923,52.0955 C 197.547,117.297 120.785,171.431 77.8931,158.984 16.6083,141.199 39.0066,84.7602 83.9134,34.9954" />
  </mask>
  <path mask="url(#mask)" d="M 71.8654,57.7571 C 67.7486,63.0074 63.1483,68.1642 59.3235,74.3017 55.4987,80.4392 52.4299,87.4218 50.1172,95.2493 49.1388,98.9851 48.6941,102.877 48.783,106.924 48.8719,110.971 49.5168,114.907 50.7177,118.732 51.9185,122.557 53.6752,126.07 55.9879,129.272 58.3006,132.475 61.1914,135.099 64.6605,137.144 69.019,139.546 73.8,141.214 79.0035,142.148 84.207,143.082 89.544,143.438 95.0144,143.215 100.485,142.993 105.933,142.215 111.359,140.88 116.785,139.546 121.922,137.767 126.769,135.543 131.617,133.32 136.065,130.718 140.112,127.738 144.159,124.758 147.517,121.489 150.185,117.931 150.185,109.837 148.962,102.299 146.516,95.316 144.07,88.3335 140.712,81.5066 136.443,74.8354 137.154,69.4985 138.6,64.3172 140.779,59.2915 142.958,54.2659 145.338,49.4849 147.917,44.9484 148.628,43.6142 149.407,42.9693 150.252,43.0138 151.097,43.0583 151.919,43.4808 152.72,44.2813 153.521,45.0818 154.277,46.038 154.989,47.1499 155.7,48.2618 156.323,49.218 156.856,50.0185 158.101,51.9754 159.547,54.7774 161.193,58.4243 162.838,62.0712 164.506,66.9634 166.196,73.1009 167.886,79.2384 168.331,88.9338 167.53,102.187 166.819,103.877 166.085,106.679 165.329,110.593 164.573,114.507 163.239,118.977 161.326,124.002 159.414,129.028 156.59,134.321 152.854,139.88 149.118,145.439 143.914,150.665 137.243,155.557 131.639,159.56 125.924,163.073 120.098,166.097 114.272,169.122 108.312,171.457 102.219,173.102 96.1262,174.748 89.8554,175.615 83.4065,175.704 76.9577,175.793 70.2643,174.903 63.3262,173.035 56.7439,171.078 51.3403,168.432 47.1152,165.097 42.8901,161.761 39.6212,157.914 37.3085,153.556 34.9958,149.197 33.5282,144.416 32.9055,139.212 32.2829,134.009 32.3274,128.605 33.039,123.001 33.8395,115.44 35.9743,106.501 39.4433,96.1832 41.2223,90.8463 43.4905,85.2647 46.2479,79.4385 49.0054,73.6124 52.4299,67.4971 56.5216,61.0927 60.6133,54.4215 64.7716,48.1951 68.9967,42.4134 70.8673,40.3316 72.9819,37.3648 75.5539,34.6022 76.9771,33.1791 77.9777,32.5787 78.5559,32.801 79.1341,33.0234 79.69,33.4904 80.2237,34.202 81.6469,36.2478 84.9311,39.3336 84.9963,42.3304 79.8043,48.214 76.2939,52.1092 71.8654,57.7571 Z" />
</svg>

My question is how that complicated <path> got calculated. It seems like a complicated algorithm. I have also seen how to do something like this with the canvas, as here. I am specifically wondering how to calculate this for SVG.

3
  • 3
    I can appreciate the question, but I wonder if mathematical algorithms based upon specific code languages are on topic for a graphic design stack. It seems far more engineering or computer science based than design based, to me at least.
    – Scott
    Commented Jan 10, 2019 at 23:22
  • 1
    You might want to read the pomax bezier primer it explains how curve offsetting is done. Not much more to it. But in this case its clear that the stroke is static and the mask just hides parts of it in sequence as the svg does not do the offsetting
    – joojaa
    Commented Jan 11, 2019 at 5:49
  • Oh MY - @joojaa - THANK you - what a great resource for explaining the maths and operations of a bézier to a wide range of folks... I'm bookmarking that URL and saving it as a network wide resource for my current client! Commented Jan 15, 2019 at 16:10

1 Answer 1

0

from your linked demo of the "animated SVG calligraphic brush" I copy the info section about the design base of the final example (a highly complex Arabic calligraphic sample):

The original design, the Tughra of Osmanic Sultan Mahmud II., is by an unknown 19th-century calligrapher. The vectorized version was done by Wikipedia illustrator Baba66. The animation is my attempt to visualize the position of the Arabic letters inside the drawing. It builds upon an earlier version by Baba66. Creative Commons Attribution-Share Alike 2.5.

This leads me to believe that it's most likely that all the design work for the calligraphic strokes was similarly started in a vector graphics application such as Adobe Illustrator, Affinity Designer or InkScape, and was then exported to SVG, which was used as a codebase for the particular code poet to whose work you were referring.

I could well be wrong, but I think it's a case of Occam's Razor here.

Not the answer you're looking for? Browse other questions tagged or ask your own question.