Baby Mesh

Directory[];
SetDirectory["/home/campus03/struther/Desktop/Link to Courses/4620/ClassSampleMathematica"];
NodeData=Drop[Import["Triangle.node","Table"],1][[All,{2,3}]]
ElData =Drop[Import["Triangle.element","Table"],1][[All,{2,3,4}]]
Show[
ListPlot[NodeData],
Graphics[
Table[
{Hue[RandomReal[]],Polygon[NodeData[[ElData[[i]]]] ]},
{i, Length[ElData]}
]
]
]

Baby Mesh IO

MeshExport[name_,NodeData_,ElementData_]:= Module[
{TempNodeData},
TempNodeData=Table[
{i, NodeData[[i,1]],NodeData[[i,2]]},
{i, Length[NodeData]}];
TempNodeData=Join[{Length[NodeData]}, TempNodeData];
Export[StringJoin[name,".node"], TempNodeData,"TSV" ];
(* NOT fixed yet *)
Export[StringJoin[name,".xelement"], ElementData,"TSV" ];
]

MeshExport["test",NodeData,ElementData]

Junk

Plot[Cos[x], {x, -16.6, 76.6}]

Plot3D[Cos[x y], {x, -6.3, 6.3}, {y, -1, 1}]