假设有一个规则的金字塔,T.ABCD
其中
P
是TC
这样的TP:PC = 1:3
R
BC
是这样的扩展BR:BC = 1:3
Q
任意位于平面上TAD
,但既不在外部也不在边界上
画出平面PQR
切割金字塔的横截面。
平均能量损失
我自己的解决方案如下,但我正在寻找其他更简单的方法(如果有的话)。
\documentclass[pstricks,border=0pt,12pt]{standalone}
\usepackage{pst-eucl}
\newpsstyle{aux}
{
linestyle=dashed,
linecolor=lightgray,
}
\begin{document}
\begin{pspicture}[showgrid=false](-5,-2)(11,11)
\pstGeonode[PosAngle={-45,0,45,180}](0,0){A}(8,0){B}(4,2){C}(-4,2){D}
\pstMiddleAB[PointName=none,PointSymbol=none]{A}{C}{O}
\pstGeonode(O|0,9){T}
\psline(D)(A)(B)
\psline[linestyle=dashed](B)(C)(D)
\psline[linestyle=dashed](T)(C)
% additional
\pstHomO[HomCoef=\pscalculate{1/4}]{T}{C}[P]
\pstHomO[HomCoef=\pscalculate{-1/3}]{B}{C}[R]
\pstGeonode[PosAngle=180](.65,5){Q}
%
\pstMiddleAB{A}{B}{E}
\pstMiddleAB{C}{D}{F}
\pstTranslation[PosAngle={0,-135}]{O}{T}{E,F}
%
\pstInterLL{T}{B}{P}{R}{S}
\pcline[style=aux,nodesep=-5mm](T)(B)
\psline(T)(B)
%
\pstInterLL[PosAngle=45]{E'}{F'}{P}{R}{U}
\pcline[style=aux,nodesep=-5mm](U)(R)
\pcline[style=aux,nodesep=-5mm](E')(F')
%
\pstInterLL{T}{D}{U}{Q}{V}
\pcline[style=aux,nodesep=-5mm](T)(D)
\psline(T)(D)
%
\pstInterLL[PosAngle=180]{T}{A}{U}{Q}{W}
\pcline[style=aux,nodesep=-5mm](U)(W)
\pcline[style=aux,nodesep=-5mm](T)(A)
\psline(T)(A)
\pspolygon[fillstyle=solid,fillcolor=blue,opacity=.1,linestyle=none](F)(F')(E')(E)
\pspolygon[fillstyle=solid,fillcolor=yellow,opacity=.3,linestyle=none](W)(S)(P)(V)
\end{pspicture}
\end{document}
注意:这个问题更具数学性,但它比要求在动物园里画猪、鸭和它们的家庭更有教育意义。
答案1
感谢您的评论。是的,我认为这是可以做到的。我们“仅”需要找出 PS 线的斜率。这在 ATD 平面上的投影平面的斜率上进行转换,当然,它必须穿过 Q。为了使讨论保持一般性,我没有使用 P 和 S 的构造信息,我使用的只是它们分别位于边缘 BT 和 CT 上,而 Q 位于 ATD 平面上。我卡住的原因是我无法在超过 6 次迭代中运行动画。我不知道为什么,所以这附带了一个简短的动画。(我还看到动画因为边界框变大而跳跃,但与运行较大动画时遇到的“一般错误”相比,这是一个小问题。我制作了大量动画,从未遇到过这样的错误。)
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{backgrounds}
\newcounter{coordi}
\begin{document}
\tdplotsetmaincoords{70}{-30}
\foreach \BB in {1.5,1.6,...,2} %,1.9,1.8,...,1.6}
{\begin{tikzpicture}[tdplot_main_coords,declare function={B=3;H=B*sqrt(2);}]
\foreach \Y in {-B,B} {\foreach \X in {-B,B}
{\stepcounter{coordi} \path ({-1*sign(\Y)*\X},\Y,0) coordinate[label=right:$\Alph{coordi}$] (\Alph{coordi});}}
\path (0,0,H) coordinate[label=right:$T$] (T);
\draw[thick] (B) -- (T);
\draw[thick,dashed] (B) -- (C) -- (D) (C) -- (T);
\draw[thick] (A) -- (T) -- (D) -- (A) -- (B);
% this implements BR:BC = 1:3
\path (C) -- (B) coordinate[pos=4/3,label=right:$R$] (R)
(T) -- (C) coordinate[pos=1/4,label=right:$P$] (P)
(intersection cs:first line={(B)--(T)}, second line={(R)--(P)})
coordinate[label=right:$S$] (S);
\foreach \X/\Y [count=\Z] in {B/S,C/P}
{\path let \p1=($(\X)-(T)$),\p2=($(\Y)-(\X)$),
\n1={veclen(\x2,\y2)/veclen(\x1,\y1)} in \pgfextra{\pgfmathsetmacro{\myratio}{\n1}
\pgfmathsetmacro{\myz}{\myratio*H}
\ifnum\Z=1
\xdef\LstZ{\myz}
\else
\xdef\LstZ{\LstZ,\myz}
\fi}; }
\typeout{\LstZ} %<- contains the z-values of S and P
% this brings you in the A-T-D plane
\begin{scope}[shift={(D)},x={($(A)-(D)$)},y={($(T)-(D)$)}]
\path (0.25,{\BB/3}) coordinate[label=right:$Q$] (Q);
\end{scope}
% the B-T and C-T lines have the equation p=(B*(1-t),\mp B*(1-t),H*t), t\in[0,1]
% so for a given z value y=\mp B*(1-z/H)
% or dy/dz=\pm B/H, dx/dz=\pm B/H
% this gives us the slope of the plane in the ATD plane
\path ($(Q)+({(B/H)*({\LstZ}[1]-{\LstZ}[0])},
{B*(1-{\LstZ}[1]/H)+B*(1-{\LstZ}[0]/H)},
{{\LstZ}[1]-{\LstZ}[0]})$) coordinate(aux);
\path (intersection cs:first line={(Q)--(aux)}, second line={(A)--(T)})
coordinate[label=right:$W$] (W)
(intersection cs:first line={(Q)--(aux)}, second line={(D)--(T)})
coordinate[label=right:$V$] (V);
\begin{scope}[on background layer]
\fill[yellow,fill opacity=0.4] (W) -- (S) -- (P) -- (V) -- cycle;
\end{scope}
\end{tikzpicture}}
\end{document}
旧答案:我认为你构建这个的整体方式很好,+1。但是,我认为有三点可以补充。
- 正交投影。这就是我在这里使用的原因
tikz-3dplot
,我认为也可以用 pstricks 来实现。 - 一个可以说更简单的固定
Q
在所需平面上的方法:切换到具有原点的平面,例如,在D
和轴A-D
和处T-D
。 - 3D 排序。这是本答案的要点:计算黄色和蓝色平面相交的线,并在背景层上绘制黄色平面的隐藏部分。
它试图标记代码中的相关部分。我认为这些事情可以在 pstricks 中重做,但我做不到,我已经有一段时间没有积极使用它了。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{backgrounds}
\newcounter{coordi}
\begin{document}
\tdplotsetmaincoords{70}{-30}
\begin{tikzpicture}[tdplot_main_coords,declare function={B=3;H=B*sqrt(2);}]
\foreach \Y in {-B,B} {\foreach \X in {-B,B}
{\stepcounter{coordi} \path ({-1*sign(\Y)*\X},\Y,0) coordinate[label=right:$\Alph{coordi}$] (\Alph{coordi});}}
\foreach \Y in {-B,B}
{\stepcounter{coordi}
\path (0,\Y,0) coordinate[label=right:$\Alph{coordi}$] (\Alph{coordi})
(0,\Y,H) coordinate[label=right:$\Alph{coordi}'$] (\Alph{coordi}');}
\path (0,0,H) coordinate[label=right:$T$] (T);
\draw[thick] (B) -- (T);
\draw[thick,dashed] (B) -- (C) -- (D) (C) -- (T);
\fill[blue!50,fill opacity=0.4] (E) -- (F) -- (F') -- (E') -- cycle;
\draw[thick] (A) -- (T) -- (D) -- (A) -- (B);
% this implements BR:BC = 1:3
\path (C) -- (B) coordinate[pos=4/3,label=right:$R$] (R);
\path (intersection cs:first line={(R)--(F')}, second line={(C)--(T)})
coordinate[label=right:$P$] (P)
(intersection cs:first line={(R)--(F')}, second line={(B)--(T)})
coordinate[label=right:$S$] (S);
\draw[gray,thin,dashed] (R) -- (F');
% this brings you in the A-T-D plane
\begin{scope}[shift={(D)},x={($(A)-(D)$)},y={($(T)-(D)$)}]
\path (0.25,2/3) coordinate[label=right:$Q$] (Q);
\end{scope}
% compute intersection points V and W
\path (intersection cs:first line={(Q)--(F')}, second line={(A)--(T)})
coordinate[label=right:$W$] (W)
(intersection cs:first line={(Q)--(F')}, second line={(D)--(T)})
coordinate[label=right:$V$] (V);
% compute intersections of W-S and V-P with the blue plane
\foreach \X/\Y [count=\Z] in {A/W,B/S,D/V,C/P}
{\path let \p1=($(\X)-(T)$),\p2=($(\Y)-(T)$),
\n1={veclen(\x2,\y2)/veclen(\x1,\y1)} in \pgfextra{\pgfmathsetmacro{\myratio}{\n1}
\ifnum\Z=1
\xdef\LstRatios{\myratio}
\else
\xdef\LstRatios{\LstRatios,\myratio}
\fi}; }
%\typeout{\LstRatios}
\path (W) -- (S) coordinate[pos={{\LstRatios}[0]/({\LstRatios}[0]+{\LstRatios}[1])}] (WS)
(V) -- (P) coordinate[pos={{\LstRatios}[2]/({\LstRatios}[2]+{\LstRatios}[3])}] (VP);
\draw (WS) circle (1pt);
\begin{scope}[on background layer]
\fill[yellow,fill opacity=0.4] (WS) -- (S) -- (P) -- (VP) -- cycle;
\end{scope}
\fill[yellow,fill opacity=0.4] (WS) -- (W) -- (V) -- (VP) -- cycle;
\end{tikzpicture}
\end{document}
答案2
也许当你看到我的代码时你会大吃一惊。我计算了所有交点的坐标。
\documentclass[border=3mm,12pt]{standalone}
\usepackage{fouriernc}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{intersections,calc,backgrounds}
\tikzset{ hidden/.style = {thick, dashed}}
\tikzset{%
add/.style args={#1 and #2}{
to path={%
($(\tikztostart)!-#1!(\tikztotarget)$)--($(\tikztotarget)!-#2!(\tikztostart)$)%
\tikztonodes}}}
\begin{document}
\tdplotsetmaincoords{70}{20}
\begin{tikzpicture}[tdplot_main_coords,scale=1.3]
\pgfmathsetmacro\a{4}
\pgfmathsetmacro\h{5}
% definitions
\path
coordinate(A) at (0,0,0)
coordinate (B) at (\a,0,0)
coordinate (C) at(\a,\a,0)
coordinate (D) at (0,\a,0)
coordinate (T) at (1/2*\a, 1/2*\a, \h)
coordinate (Q) at (1/6*\a, 1/2*\a, 1/3*\h)
coordinate (P) at (2/3*\a, 2/3*\a, 2/3*\h)
coordinate (R) at (\a, -1/3*\a, 0)
coordinate (Y) at (5/18*\a, 13/18*\a, 5/9*\h)
coordinate (E) at (5/6*\a, 1/6*\a, 1/3*\h)
coordinate (V) at (1/3*\a, 0, 0)
coordinate (Z) at (0, 1/6*\a, 0)
coordinate (X) at (1/2*\a, 7/6*\a, \h);
\draw[hidden,thick]
(A) -- (C) (B) -- (D) (A)--(D) (T)-- (C) (T)-- (D) (C) -- (D) (X) -- (Z) (Y) -- (P) (V) -- (Z);
\draw [thick] (T)-- (C) (A) -- (B) -- (C) (T)-- (A) (T)-- (R) -- (X) -- cycle (T)-- (B) (E) -- (V) -- (R)
;
\fill[yellow,fill opacity=0.4] (P) -- (Y) -- (Z) -- (V) -- (E) -- cycle;
\foreach \point/\position in {A/below,B/below,C/below,D/right,T/above,P/right,R/below,E/right,Q/left,V/below,X/right,Y/left,Z/right}
{
\fill (\point) circle (1.2pt);
\node[\position=.3pt] at (\point) {$\point$};
}
\end{tikzpicture}
\end{document}
和\tdplotsetmaincoords{70}{290}
\documentclass[border=3mm,12pt]{standalone}
\usepackage{fouriernc}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{intersections,calc,backgrounds}
\tikzset{ hidden/.style = {thick, dashed}}
\begin{document}
\tdplotsetmaincoords{70}{290}
\begin{tikzpicture}[tdplot_main_coords,scale=1.3]
\pgfmathsetmacro\a{4}
\pgfmathsetmacro\h{5}
% definitions
\path
coordinate(A) at (0,0,0)
coordinate (B) at (\a,0,0)
coordinate (C) at(\a,\a,0)
coordinate (D) at (0,\a,0)
coordinate (T) at (1/2*\a, 1/2*\a, \h)
coordinate (Q) at (1/6*\a, 1/2*\a, 1/3*\h)
coordinate (P) at (2/3*\a, 2/3*\a, 2/3*\h)
coordinate (R) at (\a, -1/3*\a, 0)
coordinate (Y) at (5/18*\a, 13/18*\a, 5/9*\h)
coordinate (E) at (5/6*\a, 1/6*\a, 1/3*\h)
coordinate (V) at (1/3*\a, 0, 0)
coordinate (Z) at (0, 1/6*\a, 0)
coordinate (X) at (1/2*\a, 7/6*\a, \h);
\draw[hidden,thick]
(A) -- (C) (B) -- (D) (B) -- (C) (T)-- (C) (T)-- (C) (C) -- (D) (Y) -- (P) (V) -- (Z) (B) -- (R);
\draw [thick] (T)-- (D) (T)-- (A) (T)-- (R) -- (X) -- cycle (T)-- (B) (E) -- (V) -- (R) (A)--(D) (A)-- (B) (X) -- (Z)
;
\fill[yellow,fill opacity=0.4] (P) -- (Y) -- (Z) -- (V) -- (E) -- cycle;
\foreach \point/\position in {A/below,B/below,C/below,D/below,T/above,P/right,R/below,E/above,Q/left,V/below,X/above,Y/left,Z/below}
{
\fill (\point) circle (1.2pt);
\node[\position=.3pt] at (\point) {$\point$};
}
\end{tikzpicture}
\end{document}
Q
此代码可以在三角形内使用TAD
(参见https://en.wikipedia.org/wiki/Convex_combinationu
)。您可以通过改变和 的值来从多个角度进行查看v
。
\documentclass[border=3mm,12pt]{standalone}
\usepackage{fouriernc}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{intersections,calc,backgrounds}
\tikzset{ hidden/.style = {thick, dashed}}
\begin{document}
\tdplotsetmaincoords{70}{290}
\begin{tikzpicture}[tdplot_main_coords,scale=1.3,line join = round, line cap = round]
\pgfmathsetmacro\a{6}
\pgfmathsetmacro\h{5}
\pgfmathsetmacro\u{2/5}
\pgfmathsetmacro\v{1/6}
% definitions
\path
coordinate(A) at (0,0,0)
coordinate (B) at (\a,0,0)
coordinate (C) at(\a,\a,0)
coordinate (D) at (0,\a,0)
coordinate (T) at (1/2*\a, 1/2*\a, \h)
coordinate (Q) at ({1/2*\v*\a}, {1/2*\v*\a+(1-\v-\u)*\a}, {\v*\h})
coordinate (P) at (2/3*\a, 2/3*\a, 2/3*\h)
coordinate (R) at (\a, -1/3*\a, 0)
coordinate (Y) at ({\a*(3*\u+2*\v)/(2*(2+3*\u))}, {(3*\u-2*\v+4)*\a/(2*(2+3*\u))}, {(3*\u+2*\v)*\h/(2+3*\u)})
coordinate (E) at (5/6*\a, 1/6*\a, 1/3*\h)
coordinate (V) at ({\a*(3*\u+5*\v-3)/(3*\u+6*\v-4)},0,0)
coordinate (Z) at (0,{\a*(3*\u+5*\v-3)/(3*(-1+\v))},0)
coordinate (X) at (1/2*\a, 7/6*\a, \h);
\draw[hidden,thick]
(A) -- (C) (B) -- (D) (B) -- (C) (T)-- (C) (T)-- (C) (C) -- (D) (Y) -- (P) (V) -- (Z) (B) -- (R) ;
\draw [thick] (T)-- (D) (T)-- (A) (T)-- (R) -- (X) -- cycle (T)-- (B) (E) -- (V) -- (R) (A)--(D) (A)-- (B) (X) -- (Z)
;
\fill[yellow,fill opacity=0.4] (P) -- (Y) -- (Z) -- (V) -- (E) -- cycle;
\foreach \point/\position in {A/below,B/below,C/below,D/below,T/above,P/right,R/below,E/above,Q/left,V/below,X/above,Y/left,Z/below}
{
\fill (\point) circle (1.2pt);
\node[\position=.3pt] at (\point) {$\point$};
}
\end{tikzpicture}
\结束{中心}
\begin{center}
\begin{tikzpicture}[tdplot_main_coords,scale=1.3,line join = round, line cap = round]
\pgfmathsetmacro\a{6}
\pgfmathsetmacro\h{5}
\pgfmathsetmacro\u{3/5}
\pgfmathsetmacro\v{1/3}
% definitions
\path
coordinate(A) at (0,0,0)
coordinate (B) at (\a,0,0)
coordinate (C) at(\a,\a,0)
coordinate (D) at (0,\a,0)
coordinate (T) at (1/2*\a, 1/2*\a, \h)
coordinate (Q) at ({1/2*\v*\a}, {1/2*\v*\a+(1-\v-\u)*\a}, {\v*\h})
coordinate (P) at (2/3*\a, 2/3*\a, 2/3*\h)
coordinate (R) at (\a, -1/3*\a, 0)
coordinate (Y) at ({\a*(3*\u+2*\v)/(2*(2+3*\u))}, {(3*\u-2*\v+4)*\a/(2*(2+3*\u))}, {(3*\u+2*\v)*\h/(2+3*\u)})
coordinate (E) at (5/6*\a, 1/6*\a, 1/3*\h)
coordinate (V) at ({\a*(3*\u+5*\v-3)/(3*\u+6*\v-4)},0,0)
coordinate (Z) at (0,{\a*(3*\u+5*\v-3)/(3*(-1+\v))},0)
coordinate (X) at (1/2*\a, 7/6*\a, \h);
\draw[hidden,thick]
(A) -- (C) (B) -- (D) (B) -- (C) (T)-- (C) (T)-- (C) (C) -- (D) (Y) -- (P) (V) -- (Z) (B) -- (R) ;
\draw [thick] (T)-- (D) (T)-- (A) (T)-- (R) -- (X) -- cycle (T)-- (B) (E) -- (V) -- (R) (A)--(D) (A)-- (B) (X) -- (Z)
;
\fill[yellow,fill opacity=0.4] (P) -- (Y) -- (Z) -- (V) -- (E) -- cycle;
\foreach \point/\position in {A/below,B/below,C/below,D/below,T/above,P/right,R/below,E/above,Q/left,V/below,X/above,Y/left,Z/below}
{
\fill (\point) circle (1.2pt);
\node[\position=.3pt] at (\point) {$\point$};
}
\end{tikzpicture}