File: colorpatch.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 (18 lines) | stat: -rw-r--r-- 436 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import three;
currentlight=Viewport;

size(10cm);

surface s=surface(patch(new triple[][] {
      {(0,0,0),(1,0,0),(1,0,0),(2,0,0)},
        {(0,1,0),(1,0,1),(1,0,1),(2,1,0)},
          {(0,1,0),(1,0,-1),(1,0,-1),(2,1,0)},
            {(0,2,0),(1,2,0),(1,2,0),(2,2,0)}}));

s.s[0].colors=new pen[] {red,green,blue,black};
draw(s,nolight);

surface t=shift(Z)*unitplane;
t.s[0].colors=new pen[] {red,green,blue,black};

draw(t,nolight);