|
4面体2個の底面どうしをくっつけたような形です。
INPUT PROMPT "長さ=":L
INPUT PROMPT "H=":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:"distortion"
PRINT #1:"ASCII"
PRINT #1:"DATASET POLYDATA"
PRINT #1:"POINTS";5;"float"
PRINT #1:0;H;0
FOR TH=0 TO 359 STEP 120
PRINT #1:L*COS((90+TH)*PI/180),0,L*SIN((90+TH)*PI/180)
NEXT TH
PRINT #1:0;-H;0
PRINT #1:"POLYGONS";6;24
PRINT #1:"3 0 1 2"
PRINT #1:"3 0 2 3"
PRINT #1:"3 0 3 1"
PRINT #1:"3 4 1 2"
PRINT #1:"3 4 2 3"
PRINT #1:"3 4 3 1"
CLOSE #1
END
|
|