For bw printing, I'd like to rotate the filling pattern. How to do this ?
\documentclass[margin=2pt]{standalone}
\usepackage{tikz,siunitx}
\usetikzlibrary{%
calc,
intersections,
patterns}
\begin{document}
\hfill\begin{tikzpicture}[%
every node/.style={font=\small}]
\def\X{3.5}
\coordinate (A) at (90:\X) ;
\coordinate (B) at (210:\X) ;
\coordinate (C) at (-30:\X) ;
\coordinate (I) at ($(A)!.5!(B)$) ;
\coordinate (J) at ($(A)!.5!(C)$) ;
\coordinate (K) at ($(C)!.5!(B)$) ;
\coordinate (E) at ($(B)!.5!(K)$) ;
\coordinate (F) at ($(C)!.5!(K)$) ;
\coordinate (N) at ($(E)!(F)!(J)$) ;
\coordinate (M) at ($(E)!(I)!(J)$) ;
\coordinate (N') at ($(N)!2!(J)$) ;
\coordinate (F') at ($(F)!2!(J)$) ;
\coordinate (M') at ($(M)!2!(I)$) ;
\coordinate (E') at ($(E)!2!(I)$) ;
\begin{scope}
\clip (0,0) rectangle (0,0) ;
\draw[name path=P1] (N')--($(N')!3!(F')$) ;
\draw[name path=P2] (M')--($(M')!3!(E')$) ;
\path[name intersections={%
of= P1 and P2, % nom des paths
by=D, % nom des points
sort by=P1, % suivant le path
total=\t}] % nb de points
\pgfextra{\xdef\InterNb{\t} } ;
\end{scope}
\fill[pattern=checkerboard light gray] (M)--(I)--(A)--(J)--cycle ;
\path[pattern=horizontal lines light blue] (E)--(M)--(I)--(B)--cycle;
\path[pattern=horizontal lines light blue] (E')--(M')--(I)--(A)--cycle;
\path[pattern=horizontal lines light gray] (F)--(N)--(J)--(C)--cycle;
\path[pattern=horizontal lines light gray] (F')--(N')--(J)--(A)--cycle;
%\draw pic[%
% "\SI{71}{\degree}",
% draw,
% fill=blue!15,
% angle eccentricity=1.4,
% angle radius=.7cm
% ] {angle=B--I--M} ;
%\draw pic[%
% "\SI{131}{\degree}",
% draw,
% fill=blue!15,
% angle eccentricity=1.5,
% angle radius=.6cm
% ] {angle=C--F--N} ;
%\draw pic[%
% "\SI{101}{\degree}",
% draw,
% fill=blue!15,
% angle eccentricity=1.7,
% angle radius=.6cm
% ] {angle=A--J--E} ;
\draw (A)--(B)--(C)--cycle ;
\draw (J)--(E) ;
\draw (I)--(M) ;
\draw (F)--(N) ;
\draw (F')--(E') ;
\draw[thick] (M)--(N')--(D)--(M')--cycle ;
\foreach \Coor/\Text/\Pos in
{A/$A$/90,
B/$B$/-135,
C/$C$/-45,
E/$E$/-90,
F/$F$/-90,
I/$I$/180,
J/$J$/0,
M/$M$/-80,
N/$N$/100%
} {%
% \path (\Coor) pic {Cross={2 and black}} ;
%\node[small dot] at (\Coor) {} ;
\node[shift=(\Pos:8pt),anchor=center] at (\Coor) {\Text} ;
}
\end{tikzpicture}\hfill\strut
\end{document}
Best Answer
As bmv already answered, it's not possible to rotate a pattern, but it's not too difficult to define new rotated patterns.
Information about it can be found in section 104 Patterns and already defined styles can be found in file
pgflibrarypatterns.code.tex
.Based on
checkerboard light gray
andhorizontal lines light gray
I've definedrotated checkerboard light gray
andvertical lines light gray
. The code can be found in following lines:Update
With
patterns.meta
library is possible to rotate a pattern and also define new patterns with TiKZ syntax instead of only pgf syntax.Following code shows the previous answer adapted to
patterns.meta
library. Main changes are the use of parametricLines
pattern and an example oftikzdeclarepattern
applied to therotated checkboard
.