File: pathintersectsurface.asy

package info (click to toggle)
asymptote 3.05%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,420 kB
  • sloc: cpp: 172,663; ansic: 69,690; python: 14,957; sh: 5,605; javascript: 4,871; lisp: 1,507; perl: 1,417; makefile: 1,026; yacc: 610; lex: 449; xml: 182; asm: 8
file content (21 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
size(500);
import graph3;

currentprojection=perspective(-5,-4,2);

path3 g=randompath3(10);

draw(g,red);

triple[][] P=
  {
   {(0,0,0),(1,0,0),(1,0,0),(2,0,0)},
   {(0,4/3,0),(2/3,4/3,2),(4/3,4/3,2),(2,4/3,0)},
   {(0,2/3,0),(2/3,2/3,0),(4/3,2/3,0),(2,2/3,0)},
   {(0,2,0),(2/3,2,0),(4/3,2,0),(2,2,0)}};

surface s=surface(patch(P));
s.append(unitplane);

draw(s,lightgray+opacity(0.9));
dot(intersectionpoints(g,s),blue);