Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. \makeatletter
  2. \tikzset{
  3. @arc through/.style 2 args={
  4. to path={
  5. \pgfextra
  6. \pgfextract@process\pgf@tostart{\tikz@scan@one@point\pgfutil@firstofone(\tikztostart)\relax}%
  7. \pgfextract@process\pgf@tothrough{\tikz@scan@one@point\pgfutil@firstofone#1}%
  8. \pgfextract@process\pgf@totarget{\tikz@scan@one@point\pgfutil@firstofone(\tikztotarget)\relax}%
  9. \pgfextract@process\pgf@topointMidA{\pgfpointlineattime{.5}{\pgf@tostart}{\pgf@tothrough}}%
  10. \pgfextract@process\pgf@topointMidB{\pgfpointlineattime{.5}{\pgf@totarget}{\pgf@tothrough}}%
  11. \pgfextract@process\pgf@tocenter{%
  12. \pgfpointintersectionoflines{\pgf@topointMidA}
  13. {\pgfmathrotatepointaround{\pgf@tothrough}{\pgf@topointMidA}{90}}
  14. {\pgf@topointMidB}{\pgfmathrotatepointaround{\pgf@tothrough}{\pgf@topointMidB}{90}}}%
  15. \pgfcoordinate{arc through center}{\pgf@tocenter}%
  16. \pgfpointdiff{\pgf@tocenter}{\pgf@tostart}%
  17. \pgfmathveclen@{\pgfmath@tonumber\pgf@x}{\pgfmath@tonumber\pgf@y}%
  18. \edef\pgf@toradius{\pgfmathresult pt}
  19. \pgfmathanglebetweenpoints{\pgf@tocenter}{\pgf@tostart}%
  20. \let\pgf@tostartangle\pgfmathresult
  21. \pgfmathanglebetweenpoints{\pgf@tocenter}{\pgf@totarget}%
  22. \let\pgf@toendangle\pgfmathresult
  23. \ifdim\pgf@tostartangle pt>\pgf@toendangle pt\relax
  24. \pgfmathsetmacro\pgf@tostartangle{\pgf@tostartangle-360}%
  25. \fi
  26. #2%
  27. \pgfmathsetmacro\pgf@toendangle{\pgf@toendangle-360}%
  28. \fi
  29. \endpgfextra
  30. arc [radius=+\pgf@toradius, start angle=\pgf@tostartangle, end angle=\pgf@toendangle] \tikztonodes
  31. }},
  32. arc through ccw/.style={@arc through={#1}{\iffalse}},
  33. arc through cw/.style={@arc through={#1}{\iftrue}},
  34. }
  35. \makeatother
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement