|
5角柱ですが、ねじれています。
INPUT PROMPT "長さ=":L
INPUT PROMPT "高さ=":H
FILE GETSAVENAME F$,"vtkファイル|*.vtk"
IF F$="" THEN STOP
IF POS(UCASE$(F$),".VTK")=0 THEN LET F$=F$&".vtk"
OPEN #1:NAME F$
ERASE #1
PRINT #1:"# vtk DataFile Version 2.0"
PRINT #1:"poly"
PRINT #1:"ASCII"
PRINT #1:"DATASET POLYDATA"
PRINT #1:"POINTS";10;"float"
FOR TH=0 TO 359 STEP 72
LET X=L*COS(TH*PI/180)
LET Y=L*SIN(TH*PI/180)
LET Z=0
PRINT #1:X,Y,Z
NEXT TH
FOR TH=0 TO 359 STEP 72 !'ねじる
LET X=L*COS((TH+36)*PI/180)
LET Y=L*SIN((TH+36)*PI/180)
LET Z=H
PRINT #1:X,Y,Z
NEXT TH
PRINT #1:"POLYGONS";16;64
PRINT #1:"3 0 1 2"
PRINT #1:"3 0 2 3"
PRINT #1:"3 0 3 4"
PRINT #1:"3 5 6 7"
PRINT #1:"3 5 7 8"
PRINT #1:"3 5 8 9"
PRINT #1:"3 0 5 1"
PRINT #1:"3 5 1 6"
PRINT #1:"3 1 6 2"
PRINT #1:"3 6 2 7"
PRINT #1:"3 2 7 3"
PRINT #1:"3 7 3 8"
PRINT #1:"3 3 8 4"
PRINT #1:"3 8 4 9"
PRINT #1:"3 4 9 0"
PRINT #1:"3 9 0 5"
CLOSE #1
END
|
|