Intersectionpoints 3D => path3 與貝塞爾三角形的交點尚未實現

Intersectionpoints 3D => path3 與貝塞爾三角形的交點尚未實現

我在 W10 PC 上使用 Asymptote 版本 2.80。我嘗試重新使用舊的(2019)程式碼來繪製球體與圓錐體的交點。 2019年產生的圖已加入。 ?原始結果

我在 2019 年這樣做了,但是當我現在編譯時,我收到以下錯誤訊息:

if(s.triangle) 中止(三角形); ^ C:\Program Files\Asymptote2_80/third_surface.asy: 1296.25: path3 與貝塞爾三角形的交會點尚未實現。

程式碼如下——畫出了所有的建置步驟。


\begin{figure}[h]
    \centering
    \begin{asy} 
    size(10cm);
    import graph3;
    currentprojection=orthographic((5,1,2),up=Z);

    settings.render=4;      // Pose pb si =0 : Le plan devant la sphere est absent
    settings.prc=false;

    currentlight=Viewport;
    real k=1;

    path3 Directrice = rotate(30,Y)*unitcircle3;
    draw(Directrice,orange);

    triple S=(0,-1.5,2);
    draw(Label ("S",green),S);
    
    path3 Directrice = rotate(60,-Y)*unitcircle3;
    path3 Directrice = shift(1.5,0,0)*Directrice;
    
    triple P1 = relpoint(Directrice,0);
    triple P2 = relpoint(Directrice,0.25);
    triple P3 = relpoint(Directrice,0.5);
    triple P4 = relpoint(Directrice,0.75);
    
    // t.x => point m de D -- t.y => facteur k 
    triple f(pair t) {
    triple Point =relpoint(Directrice,t.x);
    real X= S.x+t.y*(Point.x-S.x);
    real Y= S.y+t.y*(Point.y-S.y);
    real Z= S.z+t.y*(Point.z-S.z);
    //dot((X,Y,Z),orange);
    return (X,Y,Z);
    }
    
    surface s1=surface(f,(0,0),(1,1),36,36,Spline);
    draw(s1,orange+opacity(.7));
    
    surface sph=shift(0,0,0)*scale3(1)*unitsphere;
    draw(sph,blue);
    
    limits((0,0,0),(k+2,k+2,k+2));
    xaxis3("$x$",Arrow3);
    yaxis3("$y$",Arrow3);
    zaxis3("$z$",Arrow3);
    
    draw(Directrice,red);
    
    dot(Directrice^^S,orange);
    
    // size(p) = C'est le nombre de points qui définissent le path p
    for(int i=0; i<size(Directrice);++i) {
         draw(point(Directrice,i)--S,dashed);
    }

/////// INTERSECTION -- On recherche les points d'intersection de 100 segments [Sm] avec la sphère.
    triple[][] inter;
    path3 ch1,ch2;
    int n=100;
    for(int i=0; i<n; ++i){
        path3 p=S--relpoint(Directrice,i/n);
        inter.push(intersectionpoints(p,sph,0.001));
        draw(p,yellow);
    }
    for(int i=0; i<inter.length; ++i){
        if (inter[i].length!=0){
            ch1=ch1..inter[i][0]; 
            dot(inter[i][0],2bp+green);
        }
        if(inter[i].length==2){
        ch2=ch2..inter[i][1]; 
        dot(inter[i][1],2bp+red);}
    }
draw(ch1..cycle,1bp+green);
draw(ch2..cycle,1bp+red);

// Il reste à fermer la boucle : du 1er point de construction de ch1 au 1er point de construction ce ch2, et idem pour le dernier point

draw(point(ch1,0)..point(ch2,0),5bp+orange );
draw(point(ch1,(size(ch1)-1) )..point(ch2,(size(ch2)-1) ) ,5bp+orange    );
    
    \end{asy}
    \caption{Projection gnomonique 3D \label{Fig_Proj_Gnomo_3D} }
\end{figure}

我可以要求重新調整的交叉點是什麼(什麼和什麼之間)

這個想法是在與北極相切的平面上繪製地球平行線的日心投影,然後在與赤道相切的平面上繪製,然後在與北緯50度相切的平面上繪製:歡迎任何不使用“交點」的解決方案

相關內容