|
以Dodecahedron(正十二面体) 为例, 投影到XY平面
- PolyhedronData["Dodecahedron", "Points"] /. Point -> (#[[1 ;; 2]] &) //N
- PolyhedronData["Dodecahedron", "FaceIndices"]
Copy the Code
注意Mathematica的列表index是从1开始的,导入Asymptote需注意p=p--Points[i-1];
主要的代码可以重复使用:- for(int[] face:FaceIndices){
- guide p;
- for(int i:face){
- p=p--Points[i-1];
- }
- draw(p--cycle);
- }
- for(pair i:Points){
- dot(i,red);
- }
Copy the Code |
|