Debian Codegraph @

texmf-dist/source/latex/na-tikzornament/na-tikzornament.dtx

raw
1 %\iffalse meta-comment
2 %
3 % na-tikzornament.dtx
4 % Version: 1.0 (Initial Release)
5 % Date: 2026/05/14
6 %
7 % --- LICENSE / الترخيص ---
8 % English:
9 % This work (the na-tikzornament package) is licensed under the
10 % LaTeX Project Public License (LPPL), version 1.3c or later.
11 %
12 % Arabic:
13 % هذا العمل (حزمة na-tikzornament) مرخص تحت شروط رخصة مشروع لاتيك
14 % العامة (LPPL)، الإصدار 1.3c أو أي إصدار لاحق.
15 %
16 % \fi
17 %
18 % \iffalse
19 %<*driver>
20 \ProvidesFile{na-tikzornament.dtx}
21 \documentclass{ltxdoc}
22 \usepackage[x11names,svgnames]{xcolor}
23 \usepackage{na-tikzornament}
24 \usepackage[explicit]{titlesec}
25 \usepackage{etoolbox}
26 \usepackage{contour}
27 \usepackage{array}
28 \usepackage{verbatim}
29 \usepackage{tikz,geometry,eso-pic,polyglossia}
30 \usetikzlibrary{shapes.geometric, calc}
31 \usetikzlibrary{shadows.blur}
32 \usetikzlibrary{calc,backgrounds,positioning,decorations.markings,shapes.geometric}
33 \geometry{left=2.5cm, right=2.5cm, top=2.5cm, bottom=2.5cm}
34 \setmainlanguage[numerals=maghrib,locale=algeria]{arabic}
35 \setotherlanguage{english}
36 \newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Amiri}
37 \newfontfamily\na[Script=Arabic,Scale=1.2]{Amiri}
38 \newfontfamily\arabicfontsf[Script=Arabic,Scale=1.2]{Amiri}
39 \AtBeginEnvironment{verbatim}{%
40 \selectlanguage{english}%
41 \setLTR%
42 }
43 \renewcommand{\thesection}{\arabic{section}}
44 \titleformat{\section}
45 {\bf\Large\sffamily}
46 {\begin{tikzpicture}[baseline=(a.base)]
47 \node[text=white,scale=1,anchor=east,draw=blue!50!black,
48 fill=red!50!black,rounded corners=1pt] (a) {\thesection};
49 \node [text=black,anchor=east] at (a.west) (2){\large\textarabic{\bf\sffamily #1}};
50 \end{tikzpicture}}
51 {0pt}{}
52 \titleformat{\subsection}
53 {\bf}
54 {\begin{tikzpicture}[baseline=(a.base)]
55 \node[text=white,scale=1,anchor=east,draw=blue!50!black,
56 fill=blue!50!black,rounded corners=1pt] (a) {\thesubsection};
57 \node [text=black,anchor=east] at (a.west) (2){\large\textarabic{\bf\sffamily #1}};
58 \end{tikzpicture}}
59 {0pt}{}
60 \setnonlatin
61 \definecolor{Navy}{RGB}{0,0,128}
62 \definecolor{DeepBlue}{HTML}{0A192F}
63 \definecolor{SoftSlate}{HTML}{2C3E50}
64 \definecolor{coverfgcolor}{RGB}{20, 60, 100}
65 \EnableCrossrefs
66 \CodelineIndex
67 \RecordChanges
68 \AddToShipoutPictureBG*{\begin{tikzpicture}[remember picture,overlay]
69 \natikzornament{7}{coverfgcolor}{0.7}
70 \draw[fill=coverfgcolor!40, tile fill] (current page.north west) rectangle(current page.south east);
71 \end{tikzpicture}}
72 \tikzset{ render blur shadow/.prefix code={
73 \colorlet{black}{black}}}
74 \newcommand\boxtitle[1]{%
75 \begin{tikzpicture}
76 \natikzornament{1}{Navy}{0.2}
77 \node[text width=\textwidth-1cm, rectangle,draw,line width=1pt,minimum width=\textwidth ,inner ysep=1cm,fill=Navy!10,tile fill,blur shadow]{%
78 \huge
79 \begin{RTL}
80 \begin{center}
81 #1
82 \end{center}
83 \end{RTL}};
84 \end{tikzpicture}}
85 \begin{document}
86 \OnlyDescription % <--- هذا السطر هو التعديل الوحيد: يمنع ظهور صفحة الأكواد الأخيرة
87 \DocInput{na-tikzornament.dtx}
88 \end{document}
89 %</driver>
90 % \fi
91 %
92 %\title{\boxtitle{\fontsize{1.4cm}{1cm}\color{orange}\bf na-tikzornament\\[0.4cm]\fontsize{1.4cm}{1cm}\color{Navy}\bf\textarabic{ حزمة الزخارف الهندسية - الإصدار 1.0}}}
93 %\author{} \date{}
94 %\maketitle
95 %\newpage
96 %
97 %\section{مقدمة وتوافقية المعالجة}
98 %\selectlanguage{arabic}
99 % نضع بين أيدي الأساتذة الكرام هذه الحزمة لإنشاء خلفيات وزخارف هندسية معقدة بلمسة واحدة.\\
100 %\textbf{ملاحظة هامة:}\\
101 %تعمل الحزمة بكفاءة مع المعالجات التالية \texttt{pdfLaTeX}, \texttt{XeLaTeX}, و \texttt{LuaLaTeX}.
102 %
103 %\section{نماذج من زخارف}
104 % سنعرض هنا أول خمس زخارف، حيث تظهر كل واحدة منها مطبقة داخل حيز مستطيل أبعاده $4 \times 3$ سم لبيان كيفية تكرار النمط آلياً.
105 %
106 % \subsection*{الزخرفة الأولى: النمط الكلاسيكي}
107 % لاستخدام الزخرفة رقم 1 باللون الأزرق:
108 % \begin{verbatim}
109 % \begin{tikzpicture}
110 % \natikzornament{1}{blue}{0.6}
111 % \draw[tile fill] (0,0) rectangle (4,3);
112 % \end{tikzpicture}
113 % \end{verbatim}
114 % \begin{center}
115 % \begin{tikzpicture}
116 % \natikzornament{1}{blue}{0.6}
117 % \draw[tile fill] (0,0) rectangle (4,3);
118 % \end{tikzpicture}
119 % \end{center}
120 % \hrulefill
121 %
122 % \subsection*{الزخرفة الثانية: نمط المربعات المتقاطعة}
123 % \begin{verbatim}
124 % \begin{tikzpicture}
125 % \natikzornament{2}{Red2}{0.6}
126 % \draw[tile fill] (0,0) rectangle (4,3);
127 % \end{tikzpicture}
128 % \end{verbatim}
129 % \begin{center}
130 % \begin{tikzpicture}
131 % \natikzornament{2}{Red2}{0.6}
132 % \draw[tile fill] (0,0) rectangle (4,3);
133 % \end{tikzpicture}
134 % \end{center}
135 % \hrulefill
136 %
137 % \subsection*{الزخرفة الثالثة: النمط الانسيابي}
138 % \begin{verbatim}
139 % \begin{tikzpicture}
140 % \natikzornament{3}{Green4}{0.6}
141 % \draw[tile fill] (0,0) rectangle (4,3);
142 % \end{tikzpicture}
143 % \end{verbatim}
144 % \begin{center}
145 % \begin{tikzpicture}
146 % \natikzornament{3}{Green4}{0.6}
147 % \draw[tile fill] (0,0) rectangle (4,3);
148 % \end{tikzpicture}
149 % \end{center}
150 % \hrulefill
151 %
152 % \subsection*{الزخرفة الرابعة: النمط الهندسي المركب}
153 % \begin{verbatim}
154 % \begin{tikzpicture}
155 % \natikzornament{4}{orange}{0.6}
156 % \draw[tile fill] (0,0) rectangle (4,3);
157 % \end{tikzpicture}
158 % \end{verbatim}
159 % \begin{center}
160 % \begin{tikzpicture}
161 % \natikzornament{4}{orange}{0.6}
162 % \draw[tile fill] (0,0) rectangle (4,3);
163 % \end{tikzpicture}
164 % \end{center}
165 % \hrulefill
166 %
167 % \subsection*{الزخرفة الخامسة: نمط النجمة المركزية}
168 % \begin{verbatim}
169 % \begin{tikzpicture}
170 % \natikzornament{5}{purple}{0.6}
171 % \draw[tile fill] (0,0) rectangle (4,3);
172 % \end{tikzpicture}
173 % \end{verbatim}
174 % \begin{center}
175 % \begin{tikzpicture}
176 % \natikzornament{5}{purple}{0.6}
177 % \draw[tile fill] (0,0) rectangle (4,3);
178 % \end{tikzpicture}
179 % \end{center}
180 % \section{شرح الأوامر والمحرك البرمجي}
181 % تتكون الحزمة من جزأين أساسيين: تحديد "بصمة" الزخرفة، ثم "تعبئة" الحيز بها.
182 %
183 % \subsection{الأمر \texttt{\textbackslash natikzornament}}
184 % يستخدم هذا الأمر لتحديد هوية الزخرفة التي ترغب في استخدامها، ويتطلب ثلاثة معاملات إجبارية:
185 % \begin{quote}
186 % \texttt{\textbackslash natikzornament\{#1\}\{#2\}\{#3\}}
187 % \end{quote}
188 % \begin{itemize}
189 % \item \textbf{\texttt{#1} (رقم الزخرفة):} عدد صحيح من 1 إلى 34 يحدد شكل النمط.
190 % \item \textbf{\texttt{#2} (اللون):} اسم اللون (مثل \texttt{blue}, \texttt{Red2}, \texttt{Gold1}). تدعم الحزمة ألوان \texttt{x11names}.
191 % \item \textbf{\texttt{#3} (الشفافية):} قيمة عشرية من 0 إلى 1 (مثلاً 0.5 تعني شفافية بنسبة 50\%).
192 % \end{itemize}
193 % \textbf{ملاحظة:} هذا الأمر لا يرسم شيئاً بمفرده، بل يجهز "القالب" للخطوة التالية.
194 %
195 % \subsection{الخيار \texttt{tile fill}}
196 % هذا هو المحرك السحري الذي يقوم برصف القالب المختار داخل أي شكل هندسي في بيئة \texttt{tikzpicture}.
197 % عند إضافة هذا الخيار لأي مسار (\texttt{path} أو \texttt{draw})، تقوم الحزمة بحساب أبعاد الشكل وتكرار الزخرفة داخله آلياً.
198 %
199 % \subsubsection*{مثال توضيحي:}
200 % \begin{verbatim}
201 % \begin{tikzpicture}
202 % % 1. نجهز القالب (الزخرفة 11، لون أخضر، شفافية كاملة)
203 % \natikzornament{11}{SpringGreen4}{1}
204 %
205 % % 2. نرسم الشكل ونطلب ملأه بالتبليط
206 % \draw[tile fill, rounded corners=10pt] (0,0) rectangle (4,2);
207 % \end{tikzpicture}
208 % \end{verbatim}
209 %
210 % \subsection{تخصيص المظهر (اللون والثخانة)}
211 % \begin{itemize}
212 % \item \textbf{تغيير اللون:} يتم مباشرة عبر المعامل الثاني كما سبق ذكره.
213 % \item \textbf{التحكم في الثخانة:} الزخارف مصممة بثخانة افتراضية تناسب التبليط. إذا أردت تقليل الثخانة (جعل الخطوط أنحف)، يمكنك تغليف الرسم داخل بيئة \texttt{scope} وتمرير خيار \texttt{thin} أو \texttt{very thin}، مثال:
214 % \end{itemize}
215 % \begin{verbatim}
216 % \begin{scope}[very thin]
217 % \natikzornament{1}{black}{0.4}
218 % \filldraw[tile fill] (0,0) circle (1.5);
219 % \end{scope}
220 % \end{verbatim}
221 % \section{استخدام الزخارف كخلفية كاملة للورقة}
222 % يمكنك استخدام الحزمة لتزيين خلفية الصفحة بالكامل، وهذا مفيد جداً عند تصميم أغلفة المجلات أو أوراق العمل.
223 % يتم ذلك باستخدام حزمة \texttt{eso-pic} وربطها بأمر التبليط الخاص بحزمتنا.
224 %
225 % \subsection*{كود وضع زخرفة في كامل الخلفية:}
226 % ضع الكود التالي في الديباجة (Preamble) قبل \texttt{\textbackslash begin\{document\}}:
227 %
228 % \begin{verbatim}
229 % \AddToShipoutPictureBG{%
230 % \begin{tikzpicture}[remember picture, overlay]
231 % % 1. نختار الزخرفة (مثلاً رقم 7) واللون والشفافية
232 % \natikzornament{7}{blue!20}{0.5}
233 %
234 % % 2. نرسم مستطيلاً يغطي كامل أبعاد الصفحة ويملؤه التبليط
235 % \draw[tile fill] (current page.north west) rectangle (current page.south east);
236 % \end{tikzpicture}
237 % }
238 % \end{verbatim}
239 %
240 % \textbf{توضيح الكود:}
241 % \begin{itemize}
242 % \item \texttt{AddToShipoutPictureBG}: يضمن ظهور الزخرفة في خلفية جميع صفحات الملف.
243 % \item \texttt{current page}: تجعل التيكنز يدرك حدود الورقة أياً كان حجمها (A4, A5, إلخ).
244 % \item \texttt{tile fill}: هو المحرك الذي يكرر الزخرفة المختارة لتملأ كامل مساحة الورقة.
245 % \end{itemize}
246 %
247 % \StopEventually{\PrintIndex \PrintChanges}
248 %
249 % \iffalse
250 %<*package>
251 % \fi
252 % \begin{macrocode}
253 \NeedsTeXFormat{LaTeX2e}
254 \ProvidesPackage{na-tikzornament}[2026/05/14 v1.0 Na TikZ Ornaments with Tiling]
255 \RequirePackage[x11names,svgnames]{xcolor}
256 \RequirePackage{tikz}
257 \usetikzlibrary{shapes.geometric, calc}
258 \newcommand{\dicedotsNa}[1]{%
259 \ifnum#1=1 \fill[black] (0.5,0.5) circle (0.11); \fi
260 \ifnum#1=2 \fill[black] (0.2,0.2) circle (0.11) (0.8,0.8) circle (0.11); \fi
261 \ifnum#1=3 \fill[black] (0.2,0.2) circle (0.11) (0.5,0.5) circle (0.11) (0.8,0.8) circle (0.11); \fi
262 \ifnum#1=4 \fill[black] (0.2,0.2) circle (0.11) (0.2,0.8) circle (0.11) (0.8,0.2) circle (0.11) (0.8,0.8) circle (0.11); \fi
263 \ifnum#1=5 \fill[black] (0.2,0.2) circle (0.11) (0.2,0.8) circle (0.11) (0.5,0.5) circle (0.11) (0.8,0.2) circle (0.11) (0.8,0.8) circle (0.11); \fi
264 \ifnum#1=6 \fill[black] (0.2,0.2) circle (0.11) (0.2,0.5) circle (0.11) (0.2,0.8) circle (0.11) (0.8,0.2) circle (0.11) (0.8,0.5) circle (0.11) (0.8,0.8) circle (0.11); \fi
265 }
266
267 % --- مجموعة الزخارف (1-10) ---
268 \newcommand{\NaOrnaOne}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 60, ..., 300} { \begin{scope}[rotate=\a] \draw[line width=1.1pt, #3] (0.2,0) -- (0.8,0.3) -- (1.4,0) -- (0.8,-0.3) -- cycle; \draw[line width=0.5pt, #3, opacity=0.6] (0.2,0) -- (1.4,0); \fill[#3] (1.4,0) circle (1.5pt); \end{scope} } \foreach \r in {0.2, 0.35} { \draw[line width=1pt, #3, opacity=0.8] (0,0) circle (\r); } \fill[white] (0,0) circle (0.15); \draw[line width=1.2pt, #3] (0,0) circle (0.15); \end{scope}}
269 \newcommand{\NaOrnaTwo}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \r in {0, 45} { \draw[line width=1.3pt, #3, rotate=\r] (-1,-1) rectangle (1,1); } \draw[line width=1pt, #3] (0,0) circle (0.4); \foreach \x in {-1, 1} \foreach \y in {-1, 1} { \fill[#3] (\x,\y) circle (2.5pt); } \end{scope}}
270 \newcommand{\NaOrnaThree}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \r in {0, 45, ..., 315} { \begin{scope}[rotate=\r] \draw[line width=1.1pt, #3] (0.1,0) .. controls (0.5,0.6) and (1.2,0.6) .. (1.4,0); \draw[line width=1.1pt, #3] (0.1,0) .. controls (0.5,-0.6) and (1.2,-0.6) .. (1.4,0); \end{scope} } \end{scope}}
271 \newcommand{\NaOrnaFour}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \r in {0, 45} { \draw[line width=1.2pt, #3, rotate=\r] (-1,-1) rectangle (1,1); } \draw[line width=1pt, #3] (0,0) circle (0.7); \foreach \a in {0, 45, ..., 315} { \fill[#3] (\a:1.414) circle (2pt); } \end{scope}}
272 \newcommand{\NaOrnaFive}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \r in {0, 45} { \draw[line width=1.2pt, #3, rotate=\r] (-1,-1) rectangle (1,1); } \draw[line width=1.5pt, #3] (0,0) circle (0.5); \fill[#3] (0,0) circle (0.15); \end{scope}}
273 \newcommand{\NaOrnaSix}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 60, ..., 300} { \draw[line width=1.2pt, #3, rotate=\a] (0.2,0) -- (1.5,0.4) -- (1.1,0) -- (1.5,-0.4) -- cycle; } \fill[#3] (0,0) circle (1.5pt); \end{scope}}
274 \newcommand{\NaOrnaSeven}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 30, ..., 330} { \draw[line width=1pt, #3, rotate=\a] (0.3,0) .. controls (0.8,0.5) .. (1.4,0); \draw[line width=1pt, #3, rotate=\a] (0.3,0) .. controls (0.8,-0.5) .. (1.4,0); } \draw[line width=1.2pt, #3, double] (0,0) circle (0.3); \end{scope}}
275 \newcommand{\NaOrnaEight}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 60, ..., 300} { \draw[line width=1.1pt, #3, rotate=\a] (0.2,0) -- (1.2,0.6) -- (1.2,-0.6) -- cycle; } \draw[line width=1pt, #3] (0,0) circle (0.4); \end{scope}}
276 \newcommand{\NaOrnaNine}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 45, ..., 315} { \draw[line width=1pt, #3, rotate=\a] (0.2,0) -- (1.5,0.2) -- (1.5,-0.2) -- cycle; } \draw[line width=1.2pt, #3, double] (0,0) circle (0.25); \end{scope}}
277 \newcommand{\NaOrnaTen}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 60, ..., 300} { \draw[line width=1.2pt, #3, rotate=\a] (0.1,0) -- (1.3,0.5) -- (0.8,0.8) -- cycle; } \draw[line width=1pt, #3, fill=white] (0,0) circle (0.4); \end{scope}}
278
279 % --- 11. النرد الملون ---
280 \newcommand{\NaOrnaEleven}[3]{ \begin{scope}[shift={#1}, scale={#2*0.8}, rotate=25] \fill[#3] (0,0) rectangle (1,1); \dicedotsNa{5} \fill[#3!80!black] (0,1) -- (0.35,1.35) -- (1.35,1.35) -- (1,1) -- cycle; \begin{scope}[shift={(0,1)}, x={(0.35cm,0.35cm)}, y={(1cm,0cm)}] \dicedotsNa{6} \end{scope} \fill[#3!60!black] (1,0) -- (1.35,0.35) -- (1.35,1.35) -- (1,1) -- cycle; \begin{scope}[shift={(1,0)}, x={(0.35cm,0.35cm)}, y={(0cm,1cm)}] \dicedotsNa{3} \end{scope} \draw[black!40, thin] (0,0) rectangle (1,1) (0,1)--(0.35,1.35)--(1.35,1.35)--(1,1) (1,0)--(1.35,0.35)--(1.35,1.35); \end{scope} }
281
282 % --- الزخارف (12-20) ---
283 \newcommand{\NaOrnaTwelve}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,45,...,315} { \draw[#3, line width=1pt, rotate=\a] (0.2,0) -- (1.2,0) (1.2,0) circle (2pt); } \draw[#3, line width=1.2pt] (0,0) circle (0.2); \end{scope}}
284 \newcommand{\NaOrnaThirteen}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,60,...,300} { \draw[#3, line width=1pt, rotate=\a] (0.3,0) -- (1,0.5) -- (1,-0.5) -- cycle; } \fill[#3] (0,0) circle (2pt); \end{scope}}
285 \newcommand{\NaOrnaFourteen}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,90,...,270} { \draw[#3, line width=1.2pt, rotate=\a] (0.5,0.5) circle (0.4); } \draw[#3, fill=white] (0,0) circle (0.3); \end{scope}}
286 \newcommand{\NaOrnaFifteen}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,30,...,330} { \draw[#3, line width=0.8pt, rotate=\a] (0.4,0) -- (1.2,0.2); \draw[#3, line width=0.8pt, rotate=\a] (0.4,0) -- (1.2,-0.2); } \draw[#3, double] (0,0) circle (0.4); \end{scope}}
287 \newcommand{\NaOrnaSixteen}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,60,...,300} { \draw[#3, line width=1pt, rotate=\a] (0.2,-0.2) rectangle (1.2,0.2); } \fill[#3] (0,0) circle (0.25); \end{scope}}
288 \newcommand{\NaOrnaSeventeen}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,45,...,315} { \draw[#3, line width=1.1pt, rotate=\a] (0.3,0) .. controls (0.6,0.8) .. (1.2,0); } \draw[#3] (0,0) circle (0.3); \end{scope}}
289 \newcommand{\NaOrnaEighteen}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,120,240} { \draw[#3, line width=1.5pt, rotate=\a] (0,0.2) -- (1,1.2) -- (1,-1.2) -- cycle; } \draw[#3, fill=white] (0,0) circle (0.35); \end{scope}}
290 \newcommand{\NaOrnaNineteen}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,60,...,300} { \draw[#3, line width=1pt, rotate=\a] (0.2,0) -- (1.4,0) arc (0:180:0.2); } \fill[#3] (0,0) circle (0.2); \end{scope}}
291 \newcommand{\NaOrnaTwenty}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,45,...,315} { \draw[#3, line width=1pt, rotate=\a] (0.2,0) -- (1.3,0.4); \draw[#3, line width=1pt, rotate=\a] (0.2,0) -- (1.3,-0.4); } \draw[#3, fill=white, double] (0,0) circle (0.3); \end{scope}}
292
293 % --- الزخارف (21-29) ---
294 \newcommand{\NaOrnaTwentyOne}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,60,...,300} { \draw[#3, line width=1pt, rotate=\a] (0.3,0) -- (1.2,0); \draw[#3, line width=1pt, rotate=\a] (1.2,0) circle (3pt); \fill[#3, rotate=\a] (1.2,0) circle (1pt); } \end{scope}}
295 \newcommand{\NaOrnaTwentyTwo}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,90,...,270} { \draw[#3, line width=1.2pt, rotate=\a] (0.2,0.2) -- (1,0.2) -- (1,1) -- cycle; } \fill[#3] (0,0) circle (2.5pt); \end{scope}}
296 \newcommand{\NaOrnaTwentyThree}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,45,...,315} { \draw[#3, line width=1pt, rotate=\a] (0.4,0) arc (0:120:0.5); } \draw[#3, double] (0,0) circle (0.3); \end{scope}}
297 \newcommand{\NaOrnaTwentyFour}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,72,...,288} { \draw[#3, line width=1pt, rotate=\a] (0,0.3) -- (0.8,1.2) -- (1.2,0.4) -- cycle; } \end{scope}}
298 \newcommand{\NaOrnaTwentyFive}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,60,...,300} { \draw[#3, line width=1pt, rotate=\a] (0.2,0) -- (1.4,0.6); \fill[#3, rotate=\a] (1.4,0.6) circle (2pt); } \draw[#3, fill=white] (0,0) circle (0.3); \end{scope}}
299 \newcommand{\NaOrnaTwentySix}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,45,...,315} { \draw[#3, thin, rotate=\a] (0.2,0) -- (1.5,0); \draw[#3, line width=1.2pt, rotate=\a] (0.8,0) circle (4pt); } \end{scope}}
300 \newcommand{\NaOrnaTwentySeven}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,120,240} { \draw[#3, line width=2pt, rotate=\a] (0.3,0) -- (1.5,0); \draw[#3, line width=1pt, rotate=\a] (1.5,0) circle (5pt); } \end{scope}}
301 \newcommand{\NaOrnaTwentyEight}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,60,...,300} { \draw[#3, line width=1pt, rotate=\a] (0.2,0) .. controls (0.5,0.5) .. (1,0) .. controls (0.5,-0.5) .. (0.2,0); } \end{scope}}
302 \newcommand{\NaOrnaTwentyNine}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,90,...,270} { \draw[#3, line width=1.2pt, rotate=\a] (0.3,0) -- (1.2,0.8); \draw[#3, line width=1.2pt, rotate=\a] (0.3,0) -- (1.2,-0.8); } \end{scope}}
303
304 % --- الزخارف الإسلامية الجديدة (30-34) ---
305 \newcommand{\NaOrnaThirty}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,45,...,315} { \draw[#3, line width=1.2pt, rotate=\a] (0.2,0) -- (1.2,0.5) -- (1.2,-0.5) -- cycle; } \draw[#3, line width=1pt, double] (0,0) circle (0.3); \end{scope}}
306 \newcommand{\NaOrnaThirtyOne}[3]{\begin{scope}[shift={#1}, scale=#2] \draw[#3, line width=1.3pt] (0:1) -- (90:1) -- (180:1) -- (270:1) -- cycle; \draw[#3, line width=1.3pt, rotate=45] (0:1) -- (90:1) -- (180:1) -- (270:1) -- cycle; \foreach \a in {0,45,...,315} { \fill[#3] (\a:1.1) circle (2pt); } \end{scope}}
307 \newcommand{\NaOrnaThirtyTwo}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,30,...,330} { \draw[#3, line width=1pt, rotate=\a] (0.2,0) .. controls (0.7,0.5) and (1.2,0.5) .. (1.5,0); \draw[#3, line width=1pt, rotate=\a] (0.2,0) .. controls (0.7,-0.5) and (1.2,-0.5) .. (1.5,0); } \fill[white, draw=#3] (0,0) circle (0.3); \end{scope}}
308 \newcommand{\NaOrnaThirtyThree}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,60,...,300} { \draw[#3, line width=1.2pt, rotate=\a] (0.3,0) -- (1.4,0.4) -- (1.4,-0.4) -- cycle; } \draw[#3, double] (0,0) circle (0.4); \end{scope}}
309 \newcommand{\NaOrnaThirtyFour}[3]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0,90,180,270} { \draw[#3, line width=1.2pt, rotate=\a] (0,0) -- (1,0) -- (1,1) -- (0,1) -- cycle; \draw[#3, line width=1pt, rotate=\a] (0.5,0.5) circle (0.4); } \end{scope}}
310
311 % --- محرك makeTile ---
312 \makeatletter
313 \newcommand{\natikzornament}[3]{%
314 \sbox{\tilenaam}{%
315 \begin{tikzpicture}[x=1cm,y=1cm]
316 \clip (0,0) rectangle (2,2);
317 \begin{scope}[opacity=#3]
318 \foreach \x in {0,1} \foreach \y in {0,1} {
319 \ifnum#1=1 \NaOrnaOne{(2*\x, 2*\y)}{0.4}{#2} \NaOrnaOne{(2*\x+1, 2*\y+1)}{0.4}{#2} \fi
320 \ifnum#1=2 \NaOrnaTwo{(2*\x, 2*\y)}{0.4}{#2} \NaOrnaTwo{(2*\x+1, 2*\y+1)}{0.4}{#2} \fi
321 \ifnum#1=3 \NaOrnaThree{(2*\x, 2*\y)}{0.45}{#2} \NaOrnaThree{(2*\x+1, 2*\y+1)}{0.45}{#2} \fi
322 \ifnum#1=4 \NaOrnaFour{(2*\x, 2*\y)}{0.45}{#2} \NaOrnaFour{(2*\x+1, 2*\y+1)}{0.45}{#2} \fi
323 \ifnum#1=5 \NaOrnaFive{(2*\x, 2*\y)}{0.45}{#2} \NaOrnaFive{(2*\x+1, 2*\y+1)}{0.45}{#2} \fi
324 \ifnum#1=6 \NaOrnaSix{(2*\x, 2*\y)}{0.4}{#2} \NaOrnaSix{(2*\x+1, 2*\y+1)}{0.4}{#2} \fi
325 \ifnum#1=7 \NaOrnaSeven{(2*\x, 2*\y)}{0.4}{#2} \NaOrnaSeven{(2*\x+1, 2*\y+1)}{0.4}{#2} \fi
326 \ifnum#1=8 \NaOrnaEight{(2*\x, 2*\y)}{0.4}{#2} \NaOrnaEight{(2*\x+1, 2*\y+1)}{0.4}{#2} \fi
327 \ifnum#1=9 \NaOrnaNine{(2*\x, 2*\y)}{0.4}{#2} \NaOrnaNine{(2*\x+1, 2*\y+1)}{0.4}{#2} \fi
328 \ifnum#1=10 \NaOrnaTen{(2*\x, 2*\y)}{0.4}{#2} \NaOrnaTen{(2*\x+1, 2*\y+1)}{0.4}{#2} \fi
329 \ifnum#1=11 \NaOrnaEleven{(2*\x-0.2, 2*\y-0.2)}{0.5}{Red2} \NaOrnaEleven{(2*\x+0.8, 2*\y+0.8)}{0.5}{Gold1}
330 \NaOrnaEleven{(2*\x+0.8, 2*\y-0.2)}{0.5}{RoyalBlue1} \NaOrnaEleven{(2*\x-0.2, 2*\y+0.8)}{0.5}{SpringGreen3} \fi
331 \ifnum#1=12 \NaOrnaTwelve{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaTwelve{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
332 \ifnum#1=13 \NaOrnaThirteen{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaThirteen{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
333 \ifnum#1=14 \NaOrnaFourteen{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaFourteen{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
334 \ifnum#1=15 \NaOrnaFifteen{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaFifteen{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
335 \ifnum#1=16 \NaOrnaSixteen{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaSixteen{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
336 \ifnum#1=17 \NaOrnaSeventeen{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaSeventeen{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
337 \ifnum#1=18 \NaOrnaEighteen{(2*\x, 2*\y)}{0.5}{#2} \NaOrnaEighteen{(2*\x+1, 2*\y+1)}{0.5}{#2} \fi
338 \ifnum#1=19 \NaOrnaNineteen{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaNineteen{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
339 \ifnum#1=20 \NaOrnaTwenty{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaTwenty{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
340 \ifnum#1=21 \NaOrnaTwentyOne{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaTwentyOne{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
341 \ifnum#1=22 \NaOrnaTwentyTwo{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaTwentyTwo{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
342 \ifnum#1=23 \NaOrnaTwentyThree{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaTwentyThree{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
343 \ifnum#1=24 \NaOrnaTwentyFour{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaTwentyFour{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
344 \ifnum#1=25 \NaOrnaTwentyFive{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaTwentyFive{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
345 \ifnum#1=26 \NaOrnaTwentySix{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaTwentySix{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
346 \ifnum#1=27 \NaOrnaTwentySeven{(2*\x, 2*\y)}{0.5}{#2} \NaOrnaTwentySeven{(2*\x+1, 2*\y+1)}{0.5}{#2} \fi
347 \ifnum#1=28 \NaOrnaTwentyEight{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaTwentyEight{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
348 \ifnum#1=29 \NaOrnaTwentyNine{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaTwentyNine{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
349 \ifnum#1=30 \NaOrnaThirty{(2*\x, 2*\y)}{0.5}{#2} \NaOrnaThirty{(2*\x+1, 2*\y+1)}{0.5}{#2} \fi
350 \ifnum#1=31 \NaOrnaThirtyOne{(2*\x, 2*\y)}{0.6}{#2} \NaOrnaThirtyOne{(2*\x+1, 2*\y+1)}{0.6}{#2} \fi
351 \ifnum#1=32 \NaOrnaThirtyTwo{(2*\x, 2*\y)}{0.5}{#2} \NaOrnaThirtyTwo{(2*\x+1, 2*\y+1)}{0.5}{#2} \fi
352 \ifnum#1=33 \NaOrnaThirtyThree{(2*\x, 2*\y)}{0.5}{#2} \NaOrnaThirtyThree{(2*\x+1, 2*\y+1)}{0.5}{#2} \fi
353 \ifnum#1=34 \NaOrnaThirtyFour{(2*\x, 2*\y)}{0.5}{#2} \NaOrnaThirtyFour{(2*\x+1, 2*\y+1)}{0.5}{#2} \fi
354 }
355 \end{scope}
356 \end{tikzpicture}%
357 }%
358 }
359 \@ifundefined{tilenaam}{\newsavebox{\tilenaam}}{}
360 % --- إضافة محرك الرصف لحزمة na-tikzornament ---
361 \newcommand{\naFillTile}{%
362 % استخراج أبعاد المنطقة المراد ملؤها
363 \pgfextractx{\pgf@x}{\pgfpointdiff{\pgfpointanchor{path picture bounding box}{south west}}{\pgfpointanchor{path picture bounding box}{north east}}}%
364 \edef\pw{\the\pgf@x}%
365 \pgfextracty{\pgf@y}{\pgfpointdiff{\pgfpointanchor{path picture bounding box}{south west}}{\pgfpointanchor{path picture bounding box}{north east}}}%
366 \edef\ph{\the\pgf@y}%
367 % قياس أبعاد الزخرفة الخاصة بك (يفترض أن \tilenaam معرف في الحزمة)
368 \pgfmathsetmacro{\tw}{\wd\tilenaam}%
369 \pgfmathsetmacro{\th}{\ht\tilenaam + \dp\tilenaam}%
370 % حساب التكرار
371 \pgfmathsetmacro{\nx}{ceil(\pw/\tw)}%
372 \pgfmathsetmacro{\ny}{ceil(\ph/\th)}%
373 % تنفيذ التكرار
374 \foreach \i in {0,...,\nx} {%
375 \foreach \j in {0,...,\ny} {%
376 \node[anchor=south west, inner sep=0pt]
377 at ([shift={(\i*\tw pt, \j*\th pt)}]path picture bounding box.south west) {\usebox{\tilenaam}};%
378 }%
379 }%
380 }
381
382 % تعريف الستايل داخل TikZ
383 \tikzset{
384 tile fill/.style={
385 path picture={\naFillTile}
386 }
387 }
388 \makeatother
389 % \end{macrocode}
390 % \iffalse
391 %</package>
392 % \fi
393 % \Finale
394 \endinput