买者自负 ...

买者自负 ...

我正在努力尝试fcc布里渊区如同维基百科 布里渊区他们把我带到 带路径的布里渊区

在下面的代码中我使用了多边形绘制大面积表面。我还能想到很多改进方法(只要时间和技能允许)。

我还是想补充一点,那就是全部边缘。我很乐意通过在六边形的边界上添加细黑线来做到这一点(类似于\填充绘制在 TikZ 中)。定义单独的六边形路径对我来说似乎相当繁琐......

我能找到的最接近的主题是 绘制线的边框

顺便说一句,我还会尝试将仍被主体部分覆盖的红色标签移到前面。这当然可以通过改变它们的位置来实现。但是,难道没有其他方法,比如“层”?

提前感谢您的提示和建议!

我的代码:

\documentclass[10pt,a4paper]{standalone}

% Use this form to include EPS (latex) or PDF (pdflatex) files:
%\usepackage{asymptote}
% Use this form with latex or pdflatex to include inline LaTeX code by default:
\usepackage[inline]{asymptote}
% Use this form with latex or pdflatex to create PDF attachments by default:
%\usepackage[attach]{asymptote}

% Enable this line to support the attach option:
%\usepackage[dvips]{attachfile2}

\begin{document}

% Optional subdirectory for latex files (no spaces):
%\def\asylatexdir{}
% Optional subdirectory for asy files (no spaces):
%\def\asydir{}

\begin{asydef}
// Global Asymptote definitions can be put here.
usepackage("fixmath");
import three;
import solids;
import patterns;
settings.toolbar=false;
\end{asydef}


\begin{asy}
size(22cm, 22cm);
currentprojection=orthographic(-6,-2,1);
currentlight=light(gray(0.4),specularfactor=3,viewport=false,
(-0.5,-0.25,0.45),
(0.5,-0.5,0.5),(0.5,0.5,0.75));

triple O=(0,0,0), X=(1,0,0), Y=(0,1,0), Z=(0,0,1);
draw(O--(-2.2,0,0),black,Arrow3);
draw(O--(0,-2.2,0),black,Arrow3);
draw(O--(0,0,2.2),black,Arrow3);
label("\huge$x$",scale3(1.1)*(-2.2,0,0),black);
label("\huge$y$",scale3(1.1)*(0,-2.2,0),black);
label("\huge$z$",scale3(1.1)*(0,0,2.05),black); 

//material unterfl=material(white+opacity(1),ambientpen=white);
material oberfl=material(white+opacity(0.6),ambientpen=white);

for (int n = -1; n <=1; n=n+2) {
    for (int l = 1; l <=1; l=l+2) {
        for (int m = -1; m <=1; m=m+2) {
        draw(rotate(90*l+45*(m+1),Z)*shift(1,1,n)*rotate(aTan(sqrt(2))*n,Y-X)*rotate(15,Z)*scale3(sqrt(2))*surface(polygon(6)), surfacepen=oberfl);
        }  
    }
}

draw(shift(-2,0,0)*rotate(45,X)*rotate(90,Y)*scale3(sqrt(2))*shift(-0.5,-0.5,0)*unitplane, surfacepen=oberfl,black+linewidth(0.2));
draw(shift(0,-2,0)*rotate(45,Y)*rotate(90,X)*scale3(sqrt(2))*shift(-0.5,-0.5,0)*unitplane, surfacepen=oberfl,black+linewidth(0.2));
draw(shift(0,0,2)*rotate(45,Z)*scale3(sqrt(2))*shift(-0.5,-0.5,0)*unitplane, surfacepen=oberfl,black+linewidth(0.2));

draw(O--(-1,-1,1),red + linewidth(2.0pt) + linetype(new real[] {2,2}));
draw(O--(0,-2,0),red + linewidth(2.0pt) + linetype(new real[] {2,2}));
draw((0,-2,0)--(-1,-2,0),red + linewidth(2.0pt));
draw((-1,-2,0)--(-1.5,-1.5,0),red + linewidth(2.0pt));
draw((-1.5,-1.5,0)--O,red + linewidth(2.0pt) + linetype(new real[] {2,2}));

label("\Huge$\Gamma$",(0,0,-0.15),red); 
label("\Huge$L$",(-0.9,-1.1,1),red);
label("\Huge$X$",(0,-2,-0.15),red);
label("\Huge$W$",(-1,-2,-0.15),red); 
label("\Huge$K$",(-1.5,-1.5,-0.15),red); 
\end{asy}
\end{document}

答案1

请注意,我以最肤浅的方式涉猎了 Asymptote,因此这可能是一种完全错误的方法。另一方面,它来自一个似乎非常受好评的教程,所以希望它不是错误的。

买者自负 ...

您可以使用 Charles Staats 的 Asymptote 教程 (86) 中的技巧将标签移近相机,避免遮挡它们。

\documentclass[border=10pt,multi]{standalone}
\usepackage[inline]{asymptote}
\standaloneenv{asy}
\begin{document}
\begin{asydef}
  // Global Asymptote definitions can be put here.
  usepackage("fixmath");
  import three;
  import solids;
  import patterns;
  settings.toolbar=false;
\end{asydef}
\begin{asy}
  size(22cm, 22cm);
  currentprojection=orthographic(-6,-2,1);
  currentlight=light(gray(0.4), specularfactor=3, viewport=false, (-0.5,-0.25,0.45), (0.5,-0.5,0.5),(0.5,0.5,0.75));

  triple O=(0,0,0), X=(1,0,0), Y=(0,1,0), Z=(0,0,1);
  draw(O--(-2.2,0,0), black, Arrow3);
  draw(O--(0,-2.2,0), black, Arrow3);
  draw(O--(0,0,2.2), black, Arrow3);
  label("\huge$x$", scale3(1.1)*(-2.2,0,0), black);
  label("\huge$y$", scale3(1.1)*(0,-2.2,0), black);
  label("\huge$z$", scale3(1.1)*(0,0,2.05), black);

  //material unterfl=material(white+opacity(1), ambientpen=white);
  material oberfl=material(white+opacity(0.6), ambientpen=white);

  for (int n = -1; n <=1; n=n+2) {
    for (int l = 1; l <=1; l=l+2) {
      for (int m = -1; m <=1; m=m+2) {
        draw(rotate(90*l+45*(m+1),Z)*shift(1,1,n)*rotate(aTan(sqrt(2))*n,Y-X)*rotate(15,Z)*scale3(sqrt(2))*surface(polygon(6)), surfacepen=oberfl);
      }
    }
  }

  draw(shift(-2,0,0)*rotate(45,X)*rotate(90,Y)*scale3(sqrt(2))*shift(-0.5,-0.5,0)*unitplane, surfacepen=oberfl, black+linewidth(0.2));
  draw(shift(0,-2,0)*rotate(45,Y)*rotate(90,X)*scale3(sqrt(2))*shift(-0.5,-0.5,0)*unitplane, surfacepen=oberfl, black+linewidth(0.2));
  draw(shift(0,0,2)*rotate(45,Z)*scale3(sqrt(2))*shift(-0.5,-0.5,0)*unitplane, surfacepen=oberfl, black+linewidth(0.2));

  draw(O--(-1,-1,1), red + linewidth(2.0pt) + linetype(new real[] {2,2}));
  draw(O--(0,-2,0), red + linewidth(2.0pt) + linetype(new real[] {2,2}));
  draw((0,-2,0)--(-1,-2,0), red + linewidth(2.0pt));
  draw((-1,-2,0)--(-1.5,-1.5,0), red + linewidth(2.0pt));
  draw((-1.5,-1.5,0)--O, red + linewidth(2.0pt) + linetype(new real[] {2,2}));

  % Charles Staats's Asymptote tutorial, 86
  label("\Huge$\Gamma$", shift(0,0,-0.15)*(currentprojection.camera), red);
  label("\Huge$L$", shift(-0.9,-1.1,1)*(currentprojection.camera), red);
  label("\Huge$X$", shift(0,-2,-0.15)*(currentprojection.camera), red);
  label("\Huge$W$", (-1,-2,-0.15), red);
  label("\Huge$K$", (-1.5,-1.5,-0.15), red);
\end{asy}
\end{document}

将指定的标签移近:

靠近相机的标签

据推测,您不想将轴或线条移得更近,因为这样看起来很奇怪,但我想如果您这样做的话,您可能会使用类似的技巧。

相关内容