New in Wolfram
Mathematica
8: Enhanced 2D and 3D Graphics
◄
previous
|
next
►
Graphics & Visualization
Extracting Outline Curves from a Glyph
Extract outline curves from a glyph and apply geometric transforms.
In[1]:=
X
g = First[\!\(\* GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}}, {{1, 4, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}}}, {CompressedData[" 1:eJxdVQ1MVWUYZkwBSYlREhHylxJEF7hy/7xw7n3O/UESUCFTMnOMoFECkSGw YioaKhkJiZo5wEBgLWJkakbEGENyasCIUiKxAjV0dP0rMXP1vee7+9g62925 zznn/b73fd7neb+QzNfTsl1dXFyK2Y/uoe0bc6pVKsRcXOhWptUB2vUdzyar sXbJsdNFY7F4/0C+z/atGlwLU3u0dsagqUDyPD+uwy8rKg/kp6nwTveZj+1F BlwomQxTJ0biZe/0Jcc8jAiIZgvKETz+cBzgeb6xQArH7NVeqqOSJHCN36zV XpVmgQfvPjfedBbYdT31ZOCpCHwwVWrWtsnwa1v661vDz+D58aZDvVUWTD8Y Lpm8Eg0dS3euq5Xnf1wtcOvNoZTM9liBC3Oqp0qDtJhiy5afteCI/cTtB6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KnxzzuU8i zXz+jHgjgvj2N6Gc5lO5O7KUc0ZCPM2TfFd0kG5Pxgn89DoSnFHgGvJLnQGT 1OcUd4yRjlbpeZ92eMOD2pesQwqTTUb2fN4vu5afY2VPcH/2aOBO3+WGCByk JLRIYK5v57ll0uL/5+t/DcQpTA== "], CompressedData[" 1:eJxTTMoPSmViYGAQBmIQrWHIsUYmSstBQHfT3Pfp5g6rPl7yTRJQdzh3BgTM HCDyKg7rZKJSrOvNHOa9X37M21wJzjcxBgF5OF8PaMxyN2kHj22f/17ZYeag FdN/6OsKCYeql2qGHDrmDmpsjVOducUg6uebO6jc/lmXtUcEYp+PBZx/D0SZ WML5+0omS7Bcs3SQ0b+rwtYo6mB33793up+VA/f1xQW2XOIOUZZbTpTNs3L4 BVQNVOogBzT+/nsrhyJbruuLP0g5NIGFrR0KhJoPnFKUg/NbDpxa6FqmBOdf Afo+wlLNgS2MT3fTXUsH9PABAM3qfG8= "]}]]\)]; Graphics[{Opacity[0.3], Table[{Translate[Rotate[g, t, {0, 0}], {1.25, -1.25}]}, {t, \[Pi]/6, 2 \[Pi], \[Pi]/6}], Opacity[1], EdgeForm[Black], Table[{ColorData["TemperatureMap", t/(2 \[Pi])], Rotate[g, t, {0, 0}]}, {t, \[Pi]/6, 2 \[Pi], \[Pi]/6}]}]
Out[1]=
In[2]:=
X
og = First[\!\(\* GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, { 1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {0, 1, 0}, { 1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, { 1, 3, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3},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PnFKUg/NbDpxa6FqmBOdf Afo+wlLNgS2MT3fTXUsH9PABAM3qfG8= "]}]]\)] /. FilledCurve[a__] :> JoinedCurve[a]; Graphics[{AbsoluteThickness[4], Opacity[0.3], Table[{Translate[Rotate[og, t, {0, 0}], {1, -1}]}, {t, \[Pi]/6, 2 \[Pi], \[Pi]/6}], Opacity[1], GrayLevel[0.2], Table[{Rotate[og, t, {0, 0}]}, {t, \[Pi]/6, 2 \[Pi], \[Pi]/6}], AbsoluteThickness[2], Table[{ColorData["BrightBands", t/(2 \[Pi])], Rotate[og, t, {0, 0}]}, {t, \[Pi]/6, 2 \[Pi], \[Pi]/6}]}]
Out[2]=