我有兴趣通过 tikz 绘制这个图形:
我自己通过 Inkscape 制作了这个图形。
通过 tikz 制作这个图形的最佳策略是什么?
答:对我们来说,最好的方法似乎是从头开始。
但是,有一种方法可以解决此问题,我可以从 Inkscape 输出 LaTex 文件,但这会给出一组可怕的代码:
(最小模板对于我来说太复杂了……)
\psset{xunit=.5pt,yunit=.5pt,runit=.5pt}
\begin{pspicture}(765,990)
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linewidth=1.14910579,linecolor=curcolor]
{
\newpath
\moveto(299.92544556,567.14279765)
\curveto(299.92544556,517.47834546)(269.73804532,477.21735209)(232.5,477.21735209)
\curveto(195.26195468,477.21735209)(165.07455444,517.47834546)(165.07455444,567.14279765)
\curveto(165.07455444,616.80724983)(195.26195468,657.06824321)(232.5,657.06824321)
\curveto(269.73804532,657.06824321)(299.92544556,616.80724983)(299.92544556,567.14279765)
\closepath
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linewidth=1.0828284,linecolor=curcolor,linestyle=dashed,dash=2.16565676 2.16565676]
{
\newpath
\moveto(298.84422493,572.90091532)
\curveto(298.84422493,567.18191377)(284.58927956,562.54574698)(267.00491333,562.54574698)
\curveto(249.4205471,562.54574698)(235.16560173,567.18191377)(235.16560173,572.90091532)
\curveto(235.16560173,578.61991688)(249.4205471,583.25608367)(267.00491333,583.25608367)
\curveto(284.58927956,583.25608367)(298.84422493,578.61991688)(298.84422493,572.90091532)
\closepath
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linewidth=1.15467751,linecolor=curcolor,linestyle=dashed,dash=2.30935495 2.30935495]
{
\newpath
\moveto(298.63410187,561.31006449)
\curveto(298.63410187,555.70701116)(284.40304402,551.16483897)(266.84814453,551.16483897)
\curveto(249.29324504,551.16483897)(235.06218719,555.70701116)(235.06218719,561.31006449)
\curveto(235.06218719,566.91311783)(249.29324504,571.45529002)(266.84814453,571.45529002)
\curveto(284.40304402,571.45529002)(298.63410187,566.91311783)(298.63410187,561.31006449)
\closepath
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linewidth=1.08282836,linecolor=curcolor]
{
\newpath
\moveto(248.97476509,565.46463068)
\curveto(249.93808067,562.10313064)(248.24191028,558.50571212)(244.95206337,556.93285711)
\curveto(241.66221645,555.36000209)(237.72844142,556.26577929)(235.62257399,559.0810325)
\curveto(233.51670656,561.89628572)(233.84669121,565.80827736)(236.40517803,568.35885957)
\curveto(238.96366485,570.90944177)(243.01204236,571.36228503)(246.00646294,569.43283973)
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linewidth=1.08282839,linecolor=curcolor]
{
\newpath
\moveto(235.08519035,570.18087765)
\curveto(234.8335141,573.51597922)(237.01461527,576.55022831)(240.25797222,577.37701732)
\curveto(243.50132916,578.20380634)(246.87061471,576.58444895)(248.24869703,573.53648821)
\curveto(249.62677933,570.48852746)(248.61581877,566.89188145)(245.85106478,565.00654677)
\curveto(243.08631081,563.12121208)(239.36592234,563.4914674)(237.02765103,565.88465828)
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linewidth=1.0828284,linecolor=curcolor]
{
\newpath
\moveto(284.50482559,564.10562724)
\curveto(284.50482559,560.77317289)(287.13110286,557.92174292)(290.7334039,557.34306829)
\curveto(294.33570494,556.76439366)(297.87407873,558.62553238)(299.12514476,561.75701514)
\curveto(300.3762108,564.8884979)(298.97879787,568.38629457)(295.8109875,570.05252176)
\curveto(292.64317714,571.71874895)(288.61948692,571.07238227)(286.26825189,568.51957415)
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linewidth=1.08282835,linecolor=curcolor]
{
\newpath
\moveto(297.24213117,566.18176625)
\curveto(295.02301394,563.55181179)(291.23445287,562.89348676)(288.2570367,564.62045776)
\curveto(285.27962054,566.34742877)(283.97290182,569.96113523)(285.15797325,573.19086044)
\curveto(286.34304469,576.42058564)(289.67778711,578.33393777)(293.06677427,577.72863857)
\curveto(296.45576143,577.12333937)(298.92062405,574.17413313)(298.91253551,570.73418971)
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linestyle=none,fillstyle=solid,fillcolor=curcolor,opacity=0.1118881]
{
\newpath
\moveto(266.18227386,569.85709208)
\curveto(266.18227386,541.35048823)(252.17234784,518.24131983)(234.89022827,518.24131983)
\curveto(217.60810871,518.24131983)(203.59818268,541.35048823)(203.59818268,569.85709208)
\curveto(203.59818268,598.36369593)(217.60810871,621.47286433)(234.89022827,621.47286433)
\curveto(252.17234784,621.47286433)(266.18227386,598.36369593)(266.18227386,569.85709208)
\closepath
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linewidth=1.14849877,linecolor=curcolor]
{
\newpath
\moveto(266.18227386,569.85709208)
\curveto(266.18227386,541.35048823)(252.17234784,518.24131983)(234.89022827,518.24131983)
\curveto(217.60810871,518.24131983)(203.59818268,541.35048823)(203.59818268,569.85709208)
\curveto(203.59818268,598.36369593)(217.60810871,621.47286433)(234.89022827,621.47286433)
\curveto(252.17234784,621.47286433)(266.18227386,598.36369593)(266.18227386,569.85709208)
\closepath
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linestyle=none,fillstyle=solid,fillcolor=curcolor,opacity=0.1418919]
{
\newpath
\moveto(216.7935,639.237078)
\curveto(216.43218,639.232078)(216.06928,639.208278)(215.70561,639.160878)
\curveto(203.64985,637.588038)(193.56358,613.094408)(191.57084,580.555408)
\curveto(191.05553,572.140658)(191.36192,556.903628)(192.19779,549.412838)
\curveto(193.91108,534.059098)(197.13728,521.596878)(201.78373,512.389398)
\curveto(205.53042,504.964928)(209.62818,500.397268)(213.69975,499.110098)
\curveto(219.96915,497.128088)(225.96892,501.143498)(231.10405,510.756588)
\curveto(232.93372,514.181768)(234.54227,518.045438)(235.9478,522.352288)
\curveto(235.8952,522.350288)(235.84223,522.356288)(235.78959,522.360288)
\curveto(235.76549,522.345788)(235.74319,522.333388)(235.71729,522.317288)
\curveto(235.68239,522.295688)(235.66509,522.253388)(235.63919,522.221588)
\lineto(235.02786,521.881748)
\curveto(234.27831,521.561168)(233.61022,521.685688)(232.85208,521.801648)
\curveto(232.70648,521.823948)(232.54684,521.766948)(232.41068,521.823148)
\curveto(232.15744,521.927608)(231.91422,522.055288)(231.66849,522.176668)
\curveto(230.4265,518.489288)(229.00427,515.232458)(227.31693,512.215728)
\curveto(224.83789,507.783618)(222.77276,505.475588)(220.10794,504.155178)
\curveto(214.79522,501.522748)(209.85018,504.514378)(205.27786,513.129788)
\curveto(200.10228,522.881958)(196.63588,537.654338)(195.35403,555.411038)
\curveto(194.82746,562.704948)(194.90572,577.319128)(195.51419,584.955968)
\curveto(197.85389,614.322248)(206.55501,635.172758)(216.46927,635.172758)
\curveto(220.48516,635.172758)(224.38753,631.932758)(227.63919,625.897368)
\curveto(229.12073,623.147488)(230.4447,619.940998)(231.61771,616.393468)
\curveto(231.68561,616.487768)(231.75496,616.580888)(231.84036,616.659088)
\curveto(232.31799,617.096398)(232.51561,617.194108)(232.92044,617.405178)
\curveto(233.69848,617.721798)(234.40361,617.458378)(235.1763,617.493078)
\curveto(235.2053,617.480778)(235.209,617.479378)(235.2368,617.467678)
\curveto(230.47195,631.152528)(223.89127,639.327888)(216.79344,639.237218)
\closepath
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linewidth=0.4348149,linecolor=curcolor]
{
\newpath
\moveto(216.7935,639.237078)
\curveto(216.43218,639.232078)(216.06928,639.208278)(215.70561,639.160878)
\curveto(203.64985,637.588038)(193.56358,613.094408)(191.57084,580.555408)
\curveto(191.05553,572.140658)(191.36192,556.903628)(192.19779,549.412838)
\curveto(193.91108,534.059098)(197.13728,521.596878)(201.78373,512.389398)
\curveto(205.53042,504.964928)(209.62818,500.397268)(213.69975,499.110098)
\curveto(219.96915,497.128088)(225.96892,501.143498)(231.10405,510.756588)
\curveto(232.93372,514.181768)(234.54227,518.045438)(235.9478,522.352288)
\curveto(235.8952,522.350288)(235.84223,522.356288)(235.78959,522.360288)
\curveto(235.76549,522.345788)(235.74319,522.333388)(235.71729,522.317288)
\curveto(235.68239,522.295688)(235.66509,522.253388)(235.63919,522.221588)
\lineto(235.02786,521.881748)
\curveto(234.27831,521.561168)(233.61022,521.685688)(232.85208,521.801648)
\curveto(232.70648,521.823948)(232.54684,521.766948)(232.41068,521.823148)
\curveto(232.15744,521.927608)(231.91422,522.055288)(231.66849,522.176668)
\curveto(230.4265,518.489288)(229.00427,515.232458)(227.31693,512.215728)
\curveto(224.83789,507.783618)(222.77276,505.475588)(220.10794,504.155178)
\curveto(214.79522,501.522748)(209.85018,504.514378)(205.27786,513.129788)
\curveto(200.10228,522.881958)(196.63588,537.654338)(195.35403,555.411038)
\curveto(194.82746,562.704948)(194.90572,577.319128)(195.51419,584.955968)
\curveto(197.85389,614.322248)(206.55501,635.172758)(216.46927,635.172758)
\curveto(220.48516,635.172758)(224.38753,631.932758)(227.63919,625.897368)
\curveto(229.12073,623.147488)(230.4447,619.940998)(231.61771,616.393468)
\curveto(231.68561,616.487768)(231.75496,616.580888)(231.84036,616.659088)
\curveto(232.31799,617.096398)(232.51561,617.194108)(232.92044,617.405178)
\curveto(233.69848,617.721798)(234.40361,617.458378)(235.1763,617.493078)
\curveto(235.2053,617.480778)(235.209,617.479378)(235.2368,617.467678)
\curveto(230.47195,631.152528)(223.89127,639.327888)(216.79344,639.237218)
\closepath
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linestyle=none,fillstyle=solid,fillcolor=curcolor]
{
\newpath
\moveto(183.24148686,577.17186099)
\curveto(183.27403862,577.13117129)(183.2903145,577.09861953)(183.2903145,577.07420571)
\curveto(183.29845244,577.05792983)(183.30252141,577.01317117)(183.30252141,576.93992971)
\lineto(183.30252141,562.24281126)
\curveto(183.30252141,561.61618993)(183.46934916,561.2174309)(183.80300468,561.04653418)
\curveto(184.13666019,560.87563745)(184.75921255,560.77391321)(185.67066176,560.74136145)
\lineto(185.67066176,560.399568)
\lineto(178.78596507,560.399568)
\lineto(178.78596507,560.76577527)
\curveto(179.77065573,560.81460291)(180.41355294,560.94887891)(180.7146567,561.16860327)
\curveto(181.01576045,561.38832763)(181.16631233,561.86439708)(181.16631233,562.59681162)
\lineto(181.16631233,573.90040937)
\curveto(181.16631233,574.29103046)(181.11748469,574.58806524)(181.01982942,574.79151373)
\curveto(180.92217415,574.99496221)(180.71058773,575.09668645)(180.38507015,575.09668645)
\curveto(180.17348373,575.09668645)(179.89679379,575.03565191)(179.55500034,574.91358282)
\curveto(179.22134483,574.79965167)(178.90803416,574.67758258)(178.61506835,574.54737555)
\lineto(178.61506835,574.889169)
\lineto(183.09500395,577.17186099)
\lineto(183.24148686,577.17186099)
\closepath
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linestyle=none,fillstyle=solid,fillcolor=curcolor]
{
\newpath
\moveto(236.58871145,582.57227691)
\curveto(239.56719725,585.66469386)(241.58947518,587.93517893)(242.65554523,589.38373214)
\curveto(243.72161528,590.83228534)(244.25465031,592.24421782)(244.25465031,593.61952956)
\curveto(244.25465031,594.82394459)(243.92913274,595.73946276)(243.27809759,596.36608409)
\curveto(242.62706244,597.00084336)(241.84988923,597.318223)(240.94657797,597.318223)
\curveto(239.83168028,597.318223)(238.92836901,596.91132603)(238.23664417,596.09753209)
\curveto(237.85416102,595.64994543)(237.48795375,594.96228956)(237.13802236,594.03456447)
\lineto(236.61312527,594.14442665)
\curveto(237.02002224,596.0161527)(237.70767811,597.31415403)(238.67609289,598.03843063)
\curveto(239.65264561,598.77084517)(240.69837082,599.13705244)(241.81326851,599.13705244)
\curveto(243.18858026,599.13705244)(244.29940898,598.70167268)(245.14575467,597.83091317)
\curveto(246.0002383,596.9682916)(246.42748012,595.91035949)(246.42748012,594.65711683)
\curveto(246.42748012,593.32249478)(245.96768654,592.03670036)(245.0480994,590.79973358)
\curveto(244.12851225,589.5627668)(242.13064814,587.36145421)(239.05450707,584.19579581)
\lineto(244.65747831,584.19579581)
\curveto(245.43872048,584.19579581)(245.98803139,584.28938211)(246.30541102,584.47655471)
\curveto(246.62279066,584.66372732)(246.98085999,585.11945192)(247.37961902,585.84372852)
\lineto(247.69699865,585.69724561)
\lineto(246.34203175,582.291518)
\lineto(236.58871145,582.291518)
\lineto(236.58871145,582.57227691)
\closepath
}
}
{
\newrgbcolor{curcolor}{0 0 0}
\pscustom[linestyle=none,fillstyle=solid,fillcolor=curcolor]
{
\newpath
\moveto(238.13288853,538.04187017)
\curveto(238.5804752,538.04187017)(239.1704758,537.8099389)(239.90289034,537.34607635)
\curveto(240.64344282,536.88221381)(241.27006415,536.65028254)(241.78275433,536.65028254)
\curveto(242.92206584,536.65028254)(243.76841153,537.03276569)(244.3217914,537.79773199)
\curveto(244.87517128,538.57083623)(245.15186122,539.40904398)(245.15186122,540.31235525)
\curveto(245.15186122,541.18311475)(244.92806788,541.94808105)(244.48048122,542.60725414)
\curveto(243.72365286,543.72215183)(242.44599638,544.27960067)(240.64751179,544.27960067)
\curveto(240.54171858,544.27960067)(240.43999434,544.2755317)(240.34233906,544.26739377)
\curveto(240.24468379,544.26739377)(240.13075264,544.25925583)(240.00054561,544.24297995)
\lineto(239.97613179,544.56035958)
\curveto(241.27820209,545.03236006)(242.30358245,545.57353303)(243.05227287,546.18387848)
\curveto(243.80096329,546.79422393)(244.1753085,547.59987993)(244.1753085,548.60084647)
\curveto(244.1753085,549.48788185)(243.87827371,550.16333082)(243.28420414,550.62719336)
\curveto(242.6982725,551.0910559)(242.02689251,551.32298718)(241.27006415,551.32298718)
\curveto(240.37489082,551.32298718)(239.58551071,550.99340063)(238.9019238,550.33422755)
\curveto(238.52757859,549.97615821)(238.12475059,549.42277834)(237.69343981,548.67408792)
\lineto(237.31502563,548.75953628)
\curveto(237.6405432,549.99650306)(238.24681968,550.98526269)(239.13385507,551.72581517)
\curveto(240.02089046,552.46636765)(241.04627082,552.83664389)(242.20999614,552.83664389)
\curveto(243.45510086,552.83664389)(244.41537771,552.49485044)(245.09082667,551.81126354)
\curveto(245.77441358,551.12767663)(246.11620703,550.33829652)(246.11620703,549.44312319)
\curveto(246.11620703,548.65374307)(245.83544812,547.92946647)(245.27393031,547.27029338)
\curveto(244.95655067,546.89594817)(244.46420534,546.4768443)(243.79689432,546.01298175)
\curveto(244.57813649,545.67932624)(245.20475782,545.28870515)(245.6767583,544.84111849)
\curveto(246.56379369,543.98663486)(247.00731139,542.90428893)(247.00731139,541.59408069)
\curveto(247.00731139,540.04787222)(246.39696594,538.68476738)(245.17627503,537.50476617)
\curveto(243.96372207,536.32476497)(242.23440996,535.73476436)(239.9883387,535.73476436)
\curveto(238.98737216,535.73476436)(238.28344041,535.88124727)(237.87654344,536.17421309)
\curveto(237.47778442,536.47531684)(237.2784049,536.79676545)(237.2784049,537.1385589)
\curveto(237.2784049,537.35014532)(237.34350842,537.55359381)(237.47371545,537.74890435)
\curveto(237.61206042,537.9442149)(237.83178478,538.04187017)(238.13288853,538.04187017)
\closepath
}
}
\end{pspicture}
答案1
我不知道如何解释这个问题。用 Ti 画这个图显然不太难钾Z. 最好的策略是什么?也许从例子中学习是最快的方法。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{bbm}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle (2 and pi);
\draw[fill=gray!20] (0,0) circle (1 and pi-1);
\draw (0,0.1) circle (0.2);
\draw (0,-0.1) circle (0.2);
\draw (1.78,0.1) circle (0.2);
\draw (1.78,-0.1) circle (0.2);
\draw[densely dotted] (1.78,0.1) +(80:0.2) to[out=170,in=10]
node[pos=0.3,above]{$\mathbbm{T}^2$} ([yshift=0.1cm]100:0.2);
\draw[densely dotted] (1.78,-0.1) +(80:0.2) to[out=170,in=10] ([yshift=-0.1cm]100:0.2);
\draw[densely dotted] (1.78,-0.1) +(-80:0.2) to[out=190,in=-10]
node[pos=0.3,below]{$\mathbbm{T}^2$} ([yshift=-0.1cm]-100:0.2);
\draw[densely dotted] (1.78,0.1) +(-80:0.2) to[out=190,in=-10] ([yshift=0.1cm]-100:0.2);
\node[anchor=south] at (0,0.2) {2};
\node[anchor=north] at (0,-0.2) {3};
\node at (2,2) {$\mathbbm{S}^4$};
\draw[double=gray,double distance=2pt,very thin,opacity=0.3] (0,2) to[out=135,in=-135,looseness=1.5]
node[midway,left,opacity=1]{1} node[pos=0.9,below,opacity=1]{$\mathbbm{T}^2$} (0,-2);
\end{tikzpicture}
\end{document}