BeginPackage[ "AVSGeometry`"] AVSExportGeometry::usage = "AVSExportGeometry is the name of the DisplayFunction which is used to send Mathematica three-dimensional graphics into AVS." AVSLinkName::usage = "AVSLinkName is the name of the MathLink connection which is used to connect Mathematica and AVS." Begin["Private`"] $DisplayFunction = AVSExportGeometry AVSExportGeometry::twodim = "It is only possible to export three-dimensional primitives into AVS." AVSLinkName = LinkOpen[ AVSSocket, LinkMode -> Connect] AVSExportGeometry[ Graphics3D[ g_, opts___]] := Block[{ }, LinkWrite[ AVSLinkName, Flatten[{g}]]; Graphics3D[ g, opts] ] AVSExportGeometry[ g_SurfaceGraphics] := Block[{ }, AVSExportGeometry[ Graphics3D[g]] ; g ] AVSExportGeometry[ x_] := (Message[ AVSExportGeometry::twodim]; x) End[] EndPackage[]