Convet To Java Applet

Loading Package

\(Remove["Global`*"]; 
Get["Graphics`Polyhedra`"]\)\(Get["knife`"]; 
Get["Graphics`Shapes`"]; \)

DEF The Function

\(WriteLiveForm[filename_, \ g_]\  := \ 
      \((\ \ \ WriteString[filename, \ 
\ \ \ 
          ToString[NumberForm[InputForm[N[g]], \ 5]]]; \ \ \ 
        Close[filename]; )\)\)

Cut The Cone

\(cone = Graphics3D[Cone[]]; 

    gr = knife[cone, {1, 1, 1, 0}, {0, 0, 0}, { .3,  .3,  .3}]; 

    Show[gr]\)WriteLiveForm["cut_cone.g3d",  gr]

Cut The Cube

\(cube = Graphics3D[Cube[]]; 

    gr = knife[cube, {1, 1, 1, 0}, {0, 0, 0}, { .3,  .3,  .3}]; 

    Show[gr]\)\(WriteLiveForm["cut_cube.g3d", \ gr]\ 	\)

Draw the Coil

\(\(gr = 	
      ParametricPlot3D\ [
        \ {\ \((\ 2\  + \ 0.5\ Cos\ [u]\ )\)\ Cos\ [v]\ , \ 
          \((\ 2\  + \ 0.5\ Cos\ [u]\ )\)\ Sin\ [v]\ , \ 
          0.5\ Sin\ [u] + v/5\ }\ , \ {\ u\ , \ 0.5\ Pi\ , \ 2.5\ Pi\ }\ , 
        \ {\ v\ , \ \(-2\) Pi\ , \ 2\ Pi\ }\ ]\ \ ; 

    WriteLiveForm["coil.g3d", \ gr]
\)\)