(******************************************************************* This file was generated automatically by the Mathematica front end. It contains Initialization cells from a Notebook file, which typically will have the same name as this file except ending in ".nb" instead of ".m". This file is intended to be loaded into the Mathematica kernel using the package loading commands Get or Needs. Doing so is equivalent to using the Evaluate Initialization Cells menu command in the front end. DO NOT EDIT THIS FILE. This entire file is regenerated automatically each time the parent Notebook file is saved in the Mathematica front end. Any changes you make to this file will be overwritten. ***********************************************************************) (*PieChart3D a package for making 3D pie charts*) (*Author: Jon McLoone*) (*Modified Nov 97*) (*Updated Sep 2002 for compaitbility with Mathematica 4.2*) (*Works by creating a normal PieChart and then modifying the Graphics object into a Graphics3D object*) BeginPackage["PieChart3D`",{"Graphics`Graphics`"}]; PieChart3D::usage= "PieChart3D[{y1, y2, ...}] generates a three dimensional pie chart of the \ values yi. The values yi need to be positive. Several options \ (PieThickness,PieBase,InteriorFaces,PieStyle,PieExploded) are available to \ modify the style of the pie."; PieThickness::usage= "Sets the thickness of the pie chart reletive to the diameter"; PieBase::usage= "Whether or not to fill the underside of the piechart with a disk"; PieTop::usage= "Whether or not to fill the top face of the piechart with a disk"; InteriorFaces::usage= "Whether or not to fill the interior faces of wedges of pie. Only \ necessary if used with the option PieExploded"; Options[PieChart3D]= {Axes\[Rule]False,AxesLabel\[Rule]None, AxesStyle\[Rule]Automatic,Boxed\[Rule]False,BoxRatios->Automatic, Background\[Rule]Automatic,ColorOutput\[Rule]Automatic, DefaultColor\[Rule]Automatic,Epilog\[Rule]{}, BoxLabels\[Rule]None,BoxStyle\[Rule]Automatic, FaceGrids\[Rule]None,ImageSize\[Rule]Automatic,InteriorFaces\[Rule]False, PieBase\[Rule]True,PieExploded\[Rule]None,PieLabels\[Rule]Automatic, PieLineStyle\[Rule]Automatic,PieStyle\[Rule]Automatic, PieThickness\[Rule]0.3,PieTop\[Rule]True,PlotLabel\[Rule]None, PlotRange\[Rule]All,PlotRegion\[Rule]Automatic,Prolog\[Rule]{}, Ticks\[Rule]Automatic, DefaultFont\[RuleDelayed]$DefaultFont, DisplayFunction\[RuleDelayed]$DisplayFunction, FormatType\[RuleDelayed]$FormatType,TextStyle\[RuleDelayed]$TextStyle}; PieChart3D[x_List,opts___]:=Show[PieChart3D`private`PieTo3D[ Graphics`Graphics`PieChart[x,opts,DisplayFunction->Identity] ,Utilities`FilterOptions`FilterOptions[PieChart3D,opts]],Utilities`FilterOptions`FilterOptions[Graphics3D,opts],DisplayFunction->$DisplayFunction]; Begin["`private`"]; PieTo3D[Graphics[x_,opts___],opts2___]:=Module[{thick,base,interior,top}, thick=First[Flatten[PieThickness/.{opts}/.{opts2}/.{Options[PieChart3D,PieThickness]}]]; top=First[Flatten[PieTop/.{opts}/.{opts2}/.{Options[PieChart3D,PieTop]}]]; base=First[Flatten[PieBase/.{opts}/.{opts2}/.{Options[PieChart3D,PieBase]}]]; interior=First[Flatten[InteriorFaces/.{opts}/.{opts2}/.{Options[PieChart3D,InteriorFaces]}]]; Graphics3D[Join[(x/.{Disk[{a_,b_},r_,{th1_,th2_}]:>Table[N[Polygon[{{a+r Cos[ang],b+r Sin[ang],0}, {a+r Cos[ang],b+r Sin[ang],thick}, {a+r Cos[ang+(th2-th1)/30],b+r Sin[ang+(th2-th1)/30],thick}, {a+r Cos[ang+(th2-th1)/30],b+r Sin[ang+(th2-th1)/30],0}, {a+r Cos[ang],b+r Sin[ang],0}}]], {ang,th1,th2-(th2-th1)/30,(th2-th1)/30}], Line[___]:>{}, Text[t_,{a_,b_}]:>Text[t,{a,b,thick}], Circle[___]:>{}}), If[base,(x/.{Disk[{a_,b_},r_,{th1_,th2_}]:>Polygon[Prepend[Append[ N[Table[{a+r Cos[ang],b+r Sin[ang],0},{ang,th1,th2,(th2-th1)/30}]] ,{a,b,0}],{a,b,0}]], (Circle[{a_,b_},r_,{th1_,th2_}]:>Line[N[Table[{a+r Cos[ang],b+r Sin[ang],0}, {ang,th1,th2,(th2-th1)/30}]]]), Line[a_List]:>Line[Map[Append[#,0]&,a]], Text[___]:>{}}),{}], If[top,(x/.{Disk[{a_,b_},r_,{th1_,th2_}]:>(Polygon[Prepend[Append[ N[Table[{a+r Cos[ang],b+r Sin[ang],thick},{ang,th1,th2,(th2-th1)/30}]], {a,b,thick}],{a,b,thick}]]), (Circle[{a_,b_},r_,{th1_,th2_}]:>Line[N[Table[{a+r Cos[ang],b+r Sin[ang],thick}, {ang,th1,th2,(th2-th1)/30}]]]), Line[a_List]:>(Line[Map[Append[#,0.3]&,a]]), Text[___]:>{}}), {}], If[interior,(x/.{Disk[___]:>{}, Circle[___]:>{}, Text[___]:>{}, Line[a_List]:>Polygon[{Append[First[a],0],Append[First[a],thick], Append[Last[a],thick],Append[Last[a],0],Append[First[a],0]}]}),{}]] ,Lighting->False,Utilities`FilterOptions`FilterOptions[Graphics3D,opts,opts2]] ]; End[]; EndPackage[];