我怎样才能像这张图片一样填充这个金字塔?

我怎样才能像这张图片一样填充这个金字塔?

我怎样才能像这张图片一样填充这个金字塔?(使用 GeoSpacW) 在此处输入图片描述

我尝试过(使用 GeoGebra)

\documentclass[12pt]{standalone}
\usepackage{fouriernc}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(-0.5165217391304349,-3.515177065767286) rectangle (8.983478260869564,5.484822934232715);
\draw [line width=1.2pt] (1.9204347826086954,4.665261382799326)-- (0.,0.);
\draw [line width=1.2pt] (1.9204347826086954,4.665261382799326)-- (2.,-3.);
\draw [line width=1.2pt] (1.9204347826086954,4.665261382799326)-- (6.,-3.);
\draw [line width=1.2pt] (1.9204347826086954,4.665261382799326)-- (8.,0.);
\draw [line width=1.2pt] (8.,0.)-- (6.,-3.);
\draw [line width=1.2pt] (6.,-3.)-- (2.,-3.);
\draw [line width=1.2pt] (2.,-3.)-- (0.,0.);
\draw [dash pattern=on 2pt off 2pt] (0.,0.)-- (8.,0.);
\draw [dash pattern=on 2pt off 2pt] (0.,0.)-- (6.,-3.);
\draw [dash pattern=on 2pt off 2pt] (4.960217391304347,2.332630691399663)-- (1.,-1.5);
\draw [line width=1.2pt] (1.9204347826086954,4.665261382799326)-- (1.,-1.5);
\draw [dash pattern=on 2pt off 2pt] (1.,-1.5)-- (8.,0.);
\draw [dash pattern=on 2pt off 2pt] (1.,-1.5)-- (4.,-3.);
\draw [dash pattern=on 2pt off 2pt] (1.9204347826086954,4.665261382799326)-- (2.4,-1.2);
\draw [dash pattern=on 2pt off 2pt] (0.3200724637681158,0.7775435637998873)-- (4.960217391304347,2.332630691399663);
\draw [line width=1.2pt] (4.960217391304347,2.332630691399663)-- (5.320072463768115,-1.7224564362001122);
\draw [line width=1.2pt] (5.320072463768115,-1.7224564362001122)-- (4.,-3.);
\draw [line width=1.2pt] (1.,-1.5)-- (0.3200724637681158,0.7775435637998873);
\draw [dash pattern=on 2pt off 2pt] (0.3200724637681158,0.7775435637998873)-- (5.320072463768115,-1.7224564362001122);
\draw [fill=black] (0.,0.) circle (1.5pt);
\draw[color=black] (-0.12826086956521748,-0.25210792580101227) node {$A$};
\draw [fill=black] (8.,0.) circle (1.5pt);
\draw[color=black] (8.25,0.15) node {$B$};
\draw [fill=black] (6.,-3.) circle (1.5pt);
\draw[color=black] (6.0260869565217385,-3.2116357504215856) node {$C$};
\draw [fill=black] (2.,-3.) circle (1.5pt);
\draw[color=black] (1.928695652173913,-3.2116357504215856) node {$D$};
\draw [fill=black] (1.9204347826086954,4.665261382799326) circle (1.5pt);
\draw[color=black] (1.978260869565217,4.877740303541315) node {$S$};
\draw [fill=black] (1.,-1.5) circle (1.5pt);
\draw[color=black] (0.8,-1.7242833052276565) node {$M$};
\draw [fill=black] (4.960217391304347,2.332630691399663) circle (1.5pt);
\draw[color=black] (5.018260869565217,2.6) node {$N$};
\draw [fill=black] (4.,-3.) circle (1.5pt);
\draw[color=black] (3.944347826086956,-3.226812816188871) node {$E$};
\draw [fill=black] (2.4,-1.2) circle (1.5pt);
\draw[color=black] (2.399565217391304,-1.45) node {$O$};
\draw [fill=black] (2.320072463768116,-0.2224564362001124) circle (1.5pt);
\draw[color=black] (2.250869565217391,-0.5101180438448571) node {$I$};
\draw [fill=black] (0.3200724637681158,0.7775435637998873) circle (1.5pt);
\draw[color=black] (0.2186956521739129,1.0379426644182121) node {$G$};
\draw [fill=black] (5.320072463768115,-1.7224564362001122) circle (1.5pt);
\draw[color=black] (5.5,-1.5118043844856666) node {$F$};
\end{tikzpicture}
\end{document}

并得到 在此处输入图片描述

答案1

添加coordinatesgeogebra 定义顶点的位置(circle (1.5pt)),例如

\draw [fill=black] (0.,0.) circle (1.5pt) coordinate (A);

并用你喜欢的图案填充所需的封闭区域

\path[pattern=vertical lines, pattern color=red] (G)--(M)--(E)--(F)--(N)--cycle;

完整代码:

\documentclass[12pt]{standalone}
\usepackage{fouriernc}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows,patterns}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(-0.5165217391304349,-3.515177065767286) rectangle (8.983478260869564,5.484822934232715);
\draw [line width=1.2pt] (1.9204347826086954,4.665261382799326)-- (0.,0.);
\draw [line width=1.2pt] (1.9204347826086954,4.665261382799326)-- (2.,-3.);
\draw [line width=1.2pt] (1.9204347826086954,4.665261382799326)-- (6.,-3.);
\draw [line width=1.2pt] (1.9204347826086954,4.665261382799326)-- (8.,0.);
\draw [line width=1.2pt] (8.,0.)-- (6.,-3.);
\draw [line width=1.2pt] (6.,-3.)-- (2.,-3.);
\draw [line width=1.2pt] (2.,-3.)-- (0.,0.);
\draw [dash pattern=on 2pt off 2pt] (0.,0.)-- (8.,0.);
\draw [dash pattern=on 2pt off 2pt] (0.,0.)-- (6.,-3.);
\draw [dash pattern=on 2pt off 2pt] (4.960217391304347,2.332630691399663)-- (1.,-1.5);
\draw [line width=1.2pt] (1.9204347826086954,4.665261382799326)-- (1.,-1.5);
\draw [dash pattern=on 2pt off 2pt] (1.,-1.5)-- (8.,0.);
\draw [dash pattern=on 2pt off 2pt] (1.,-1.5)-- (4.,-3.);
\draw [dash pattern=on 2pt off 2pt] (1.9204347826086954,4.665261382799326)-- (2.4,-1.2);
\draw [dash pattern=on 2pt off 2pt] (0.3200724637681158,0.7775435637998873)-- (4.960217391304347,2.332630691399663);
\draw [line width=1.2pt] (4.960217391304347,2.332630691399663)-- (5.320072463768115,-1.7224564362001122);
\draw [line width=1.2pt] (5.320072463768115,-1.7224564362001122)-- (4.,-3.);
\draw [line width=1.2pt] (1.,-1.5)-- (0.3200724637681158,0.7775435637998873);
\draw [dash pattern=on 2pt off 2pt] (0.3200724637681158,0.7775435637998873)-- (5.320072463768115,-1.7224564362001122);
\draw [fill=black] (0.,0.) circle (1.5pt) coordinate (A);
\draw[color=black] (-0.12826086956521748,-0.25210792580101227) node {$A$};
\draw [fill=black] (8.,0.) circle (1.5pt) coordinate (B);
\draw[color=black] (8.25,0.15) node {$B$};
\draw [fill=black] (6.,-3.) circle (1.5pt) coordinate (C);
\draw[color=black] (6.0260869565217385,-3.2116357504215856) node {$C$};
\draw [fill=black] (2.,-3.) circle (1.5pt) coordinate (D);
\draw[color=black] (1.928695652173913,-3.2116357504215856) node {$D$};
\draw [fill=black] (1.9204347826086954,4.665261382799326) circle (1.5pt) coordinate (S);
\draw[color=black] (1.978260869565217,4.877740303541315) node {$S$};
\draw [fill=black] (1.,-1.5) circle (1.5pt) coordinate (M);
\draw[color=black] (0.8,-1.7242833052276565) node {$M$};
\draw [fill=black] (4.960217391304347,2.332630691399663) circle (1.5pt) coordinate (N);
\draw[color=black] (5.018260869565217,2.6) node {$N$};
\draw [fill=black] (4.,-3.) circle (1.5pt) coordinate (E);
\draw[color=black] (3.944347826086956,-3.226812816188871) node {$E$};
\draw [fill=black] (2.4,-1.2) circle (1.5pt) coordinate (O);
\draw[color=black] (2.399565217391304,-1.45) node {$O$};
\draw [fill=black] (2.320072463768116,-0.2224564362001124) circle (1.5pt) coordinate (I);
\draw[color=black] (2.250869565217391,-0.5101180438448571) node {$I$};
\draw [fill=black] (0.3200724637681158,0.7775435637998873) circle (1.5pt) coordinate (G);
\draw[color=black] (0.2186956521739129,1.0379426644182121) node {$G$};
\draw [fill=black] (5.320072463768115,-1.7224564362001122) circle (1.5pt) coordinate (F);
\draw[color=black] (5.5,-1.5118043844856666) node {$F$};
\path[pattern=vertical lines, pattern color=red] (G)--(M)--(E)--(F)--(N)--cycle;
\end{tikzpicture}
\end{document}

结果:

在此处输入图片描述

答案2

我尝试用tkz-euclide 我的代码

\documentclass[border=2mm,12pt]{standalone}
\usepackage{fouriernc}
\usepackage{tkz-euclide,amsmath} 
\usetkzobj{all} 
\tikzset{hidden/.style = {thick, dotted}}
\begin{document}
\begin{tikzpicture}[scale=1]
\tkzDefPoints{0/0/A,
8/0/B,
6/-3/C,
2/-3/D,
1/5/S}
\tkzDefMidPoint(A,D)                      \tkzGetPoint{M}
\tkzDefMidPoint(S,B)                      \tkzGetPoint{N}
\tkzDefMidPoint(D,C)                      \tkzGetPoint{E}
\tkzInterLL(A,C)(M,B) \tkzGetPoint{O}
\tkzInterLL(M,N)(S,O) \tkzGetPoint{I}
\tkzDefLine[parallel=through I](A,C)
 \tkzGetPoint{d}
\tkzInterLL(d,I)(S,C) \tkzGetPoint{F}
\tkzInterLL(d,I)(S,A) \tkzGetPoint{G}
\tkzLabelPoints[right](B,C,I,F)
\tkzLabelPoints[left](A,D,M,G)
\tkzLabelPoints[above](S)
\tkzLabelPoints[below](O,E)
\tkzLabelPoints[above,right](N)
\tkzDrawPoints[color=black](A,B,C,D,S,M,N,O,I,F,G,E)
\tkzDrawSegments[hidden](A,B A,C M,N M,B S,O G,F M,E G,N)
\tkzDrawSegments(B,C C,D D,A S,A S,B S,C S,D S,M G,M E,F F,N)
\tkzFillPolygon[pattern color=red, pattern=vertical lines](G,M,E,F,N)
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容