(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 19691, 425]*) (*NotebookOutlinePosition[ 22447, 510]*) (* CellTagsIndexPosition[ 22280, 500]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "The Utah Teapot in ", StyleBox["Mathematica", FontSlant->"Italic"] }], "Title", CellTags->"0.1"], Cell[TextData[{ "by Jan Mangaldan\n", ButtonBox["hokenjan@yahoo.com", ButtonData:>{ URL[ "mailto:hokenjan@yahoo.com"], None}, ButtonStyle->"Hyperlink"] }], "Subsubtitle", CellTags->{"S0.0.1", "1.2"}], Cell[TextData[{ "In this notebook, we use ", StyleBox["Mathematica", FontSlant->"Italic"], " to render the Utah teapot from a list of vertices and patches. This is \ then fitted to a Bezier spline surface." }], "Text", CellTags->{"S0.0.2", "1.3"}], Cell[TextData[{ "For a brief background on how the Utah teapot came to be, visit ", ButtonBox["The History of The Teapot", ButtonData:>{ URL[ "http://sjbaker.org/teapot/"], None}, ButtonStyle->"Hyperlink"], " by Steve Baker." }], "Text", CellTags->{"S0.0.2", "1.3"}], Cell[CellGroupData[{ Cell["The Teapot Data", "Section"], Cell[TextData[{ "The data for the Utah teapot was obtained from ", ButtonBox["http://sjbaker.org/teapot/teaset.tgz", ButtonData:>{ URL[ "http://sjbaker.org/teapot/teaset.tgz"], None}, ButtonStyle->"Hyperlink"], " . The original teapot had no bottom, but the dataset from this site has a \ bottom included." }], "Text", CellTags->{"S0.0.2", "1.3"}], Cell[BoxData[ \(\(potPoints = {{1.4, 0, 2.4}, {1.4, \(-0.784\), 2.4}, {0.784, \(-1.4\), 2.4}, {0, \(-1.4\), 2.4}, {1.3375, 0, 2.53125}, {1.3375, \(-0.749\), 2.53125}, {0.749, \(-1.3375\), 2.53125}, {0, \(-1.3375\), 2.53125}, {1.4375, 0, 2.53125}, {1.4375, \(-0.805\), 2.53125}, {0.805, \(-1.4375\), 2.53125}, {0, \(-1.4375\), 2.53125}, {1.5, 0, 2.4}, {1.5, \(-0.84\), 2.4}, {0.84, \(-1.5\), 2.4}, {0, \(-1.5\), 2.4}, {\(-0.784\), \(-1.4\), 2.4}, {\(-1.4\), \(-0.784\), 2.4}, {\(-1.4\), 0, 2.4}, {\(-0.749\), \(-1.3375\), 2.53125}, {\(-1.3375\), \(-0.749\), 2.53125}, {\(-1.3375\), 0, 2.53125}, {\(-0.805\), \(-1.4375\), 2.53125}, {\(-1.4375\), \(-0.805\), 2.53125}, {\(-1.4375\), 0, 2.53125}, {\(-0.84\), \(-1.5\), 2.4}, {\(-1.5\), \(-0.84\), 2.4}, {\(-1.5\), 0, 2.4}, {\(-1.4\), 0.784, 2.4}, {\(-0.784\), 1.4, 2.4}, {0, 1.4, 2.4}, {\(-1.3375\), 0.749, 2.53125}, {\(-0.749\), 1.3375, 2.53125}, {0, 1.3375, 2.53125}, {\(-1.4375\), 0.805, 2.53125}, {\(-0.805\), 1.4375, 2.53125}, {0, 1.4375, 2.53125}, {\(-1.5\), 0.84, 2.4}, {\(-0.84\), 1.5, 2.4}, {0, 1.5, 2.4}, {0.784, 1.4, 2.4}, {1.4, 0.784, 2.4}, {0.749, 1.3375, 2.53125}, {1.3375, 0.749, 2.53125}, {0.805, 1.4375, 2.53125}, {1.4375, 0.805, 2.53125}, {0.84, 1.5, 2.4}, {1.5, 0.84, 2.4}, {1.75, 0, 1.875}, {1.75, \(-0.98\), 1.875}, {0.98, \(-1.75\), 1.875}, {0, \(-1.75\), 1.875}, {2. , 0, 1.35}, {2. , \(-1.12\), 1.35}, {1.12, \(-2. \), 1.35}, {0, \(-2. \), 1.35}, {2. , 0, 0.9}, {2. , \(-1.12\), 0.9}, {1.12, \(-2. \), 0.9}, {0, \(-2. \), 0.9}, {\(-0.98\), \(-1.75\), 1.875}, {\(-1.75\), \(-0.98\), 1.875}, {\(-1.75\), 0, 1.875}, {\(-1.12\), \(-2. \), 1.35}, {\(-2. \), \(-1.12\), 1.35}, {\(-2. \), 0, 1.35}, {\(-1.12\), \(-2. \), 0.9}, {\(-2. \), \(-1.12\), 0.9}, {\(-2. \), 0, 0.9}, {\(-1.75\), 0.98, 1.875}, {\(-0.98\), 1.75, 1.875}, {0, 1.75, 1.875}, {\(-2. \), 1.12, 1.35}, {\(-1.12\), 2. , 1.35}, {0, 2. , 1.35}, {\(-2. \), 1.12, 0.9}, {\(-1.12\), 2. , 0.9}, {0, 2. , 0.9}, {0.98, 1.75, 1.875}, {1.75, 0.98, 1.875}, {1.12, 2. , 1.35}, {2. , 1.12, 1.35}, {1.12, 2. , 0.9}, {2. , 1.12, 0.9}, {2. , 0, 0.45}, {2. , \(-1.12\), 0.45}, {1.12, \(-2. \), 0.45}, {0, \(-2. \), 0.45}, {1.5, 0, 0.225}, {1.5, \(-0.84\), 0.225}, {0.84, \(-1.5\), 0.225}, {0, \(-1.5\), 0.225}, {1.5, 0, 0.15}, {1.5, \(-0.84\), 0.15}, {0.84, \(-1.5\), 0.15}, {0, \(-1.5\), 0.15}, {\(-1.12\), \(-2. \), 0.45}, {\(-2. \), \(-1.12\), 0.45}, {\(-2. \), 0, 0.45}, {\(-0.84\), \(-1.5\), 0.225}, {\(-1.5\), \(-0.84\), 0.225}, {\(-1.5\), 0, 0.225}, {\(-0.84\), \(-1.5\), 0.15}, {\(-1.5\), \(-0.84\), 0.15}, {\(-1.5\), 0, 0.15}, {\(-2. \), 1.12, 0.45}, {\(-1.12\), 2. , 0.45}, {0, 2. , 0.45}, {\(-1.5\), 0.84, 0.225}, {\(-0.84\), 1.5, 0.225}, {0, 1.5, 0.225}, {\(-1.5\), 0.84, 0.15}, {\(-0.84\), 1.5, 0.15}, {0, 1.5, 0.15}, {1.12, 2. , 0.45}, {2. , 1.12, 0.45}, {0.84, 1.5, 0.225}, {1.5, 0.84, 0.225}, {0.84, 1.5, 0.15}, {1.5, 0.84, 0.15}, {\(-1.6\), 0, 2.025}, {\(-1.6\), \(-0.3\), 2.025}, {\(-1.5\), \(-0.3\), 2.25}, {\(-1.5\), 0, 2.25}, {\(-2.3\), 0, 2.025}, {\(-2.3\), \(-0.3\), 2.025}, {\(-2.5\), \(-0.3\), 2.25}, {\(-2.5\), 0, 2.25}, {\(-2.7\), 0, 2.025}, {\(-2.7\), \(-0.3\), 2.025}, {\(-3. \), \(-0.3\), 2.25}, {\(-3. \), 0, 2.25}, {\(-2.7\), 0, 1.8}, {\(-2.7\), \(-0.3\), 1.8}, {\(-3. \), \(-0.3\), 1.8}, {\(-3. \), 0, 1.8}, {\(-1.5\), 0.3, 2.25}, {\(-1.6\), 0.3, 2.025}, {\(-2.5\), 0.3, 2.25}, {\(-2.3\), 0.3, 2.025}, {\(-3. \), 0.3, 2.25}, {\(-2.7\), 0.3, 2.025}, {\(-3. \), 0.3, 1.8}, {\(-2.7\), 0.3, 1.8}, {\(-2.7\), 0, 1.575}, {\(-2.7\), \(-0.3\), 1.575}, {\(-3. \), \(-0.3\), 1.35}, {\(-3. \), 0, 1.35}, {\(-2.5\), 0, 1.125}, {\(-2.5\), \(-0.3\), 1.125}, {\(-2.65\), \(-0.3\), 0.9375}, {\(-2.65\), 0, 0.9375}, {\(-2. \), \(-0.3\), 0.9}, {\(-1.9\), \(-0.3\), 0.6}, {\(-1.9\), 0, 0.6}, {\(-3. \), 0.3, 1.35}, {\(-2.7\), 0.3, 1.575}, {\(-2.65\), 0.3, 0.9375}, {\(-2.5\), 0.3, 1.125}, {\(-1.9\), 0.3, 0.6}, {\(-2. \), 0.3, 0.9}, {1.7, 0, 1.425}, {1.7, \(-0.66\), 1.425}, {1.7, \(-0.66\), 0.6}, {1.7, 0, 0.6}, {2.6, 0, 1.425}, {2.6, \(-0.66\), 1.425}, {3.1, \(-0.66\), 0.825}, {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, \(-0.25\), 2.1}, {2.4, \(-0.25\), 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, {2.7, \(-0.25\), 2.4}, {3.3, \(-0.25\), 2.4}, {3.3, 0, 2.4}, {1.7, 0.66, 0.6}, {1.7, 0.66, 1.425}, {3.1, 0.66, 0.825}, {2.6, 0.66, 1.425}, {2.4, 0.25, 2.025}, {2.3, 0.25, 2.1}, {3.3, 0.25, 2.4}, {2.7, 0.25, 2.4}, {2.8, 0, 2.475}, {2.8, \(-0.25\), 2.475}, {3.525, \(-0.25\), 2.49375}, {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, \(-0.15\), 2.475}, {3.45, \(-0.15\), 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4}, {2.8, \(-0.15\), 2.4}, {3.2, \(-0.15\), 2.4}, {3.2, 0, 2.4}, {3.525, 0.25, 2.49375}, {2.8, 0.25, 2.475}, {3.45, 0.15, 2.5125}, {2.9, 0.15, 2.475}, {3.2, 0.15, 2.4}, {2.8, 0.15, 2.4}, {0, 0, 3.15}, {0, \(-0.002\), 3.15}, {0.002, 0, 3.15}, {0.8, 0, 3.15}, {0.8, \(-0.45\), 3.15}, {0.45, \(-0.8\), 3.15}, {0, \(-0.8\), 3.15}, {0, 0, 2.85}, {0.2, 0, 2.7}, {0.2, \(-0.112\), 2.7}, {0.112, \(-0.2\), 2.7}, {0, \(-0.2\), 2.7}, {\(-0.002\), 0, 3.15}, {\(-0.45\), \(-0.8\), 3.15}, {\(-0.8\), \(-0.45\), 3.15}, {\(-0.8\), 0, 3.15}, {\(-0.112\), \(-0.2\), 2.7}, {\(-0.2\), \(-0.112\), 2.7}, {\(-0.2\), 0, 2.7}, {0, 0.002, 3.15}, {\(-0.8\), 0.45, 3.15}, {\(-0.45\), 0.8, 3.15}, {0, 0.8, 3.15}, {\(-0.2\), 0.112, 2.7}, {\(-0.112\), 0.2, 2.7}, {0, 0.2, 2.7}, {0.45, 0.8, 3.15}, {0.8, 0.45, 3.15}, {0.112, 0.2, 2.7}, {0.2, 0.112, 2.7}, {0.4, 0, 2.55}, {0.4, \(-0.224\), 2.55}, {0.224, \(-0.4\), 2.55}, {0, \(-0.4\), 2.55}, {1.3, 0, 2.55}, {1.3, \(-0.728\), 2.55}, {0.728, \(-1.3\), 2.55}, {0, \(-1.3\), 2.55}, {1.3, 0, 2.4}, {1.3, \(-0.728\), 2.4}, {0.728, \(-1.3\), 2.4}, {0, \(-1.3\), 2.4}, {\(-0.224\), \(-0.4\), 2.55}, {\(-0.4\), \(-0.224\), 2.55}, {\(-0.4\), 0, 2.55}, {\(-0.728\), \(-1.3\), 2.55}, {\(-1.3\), \(-0.728\), 2.55}, {\(-1.3\), 0, 2.55}, {\(-0.728\), \(-1.3\), 2.4}, {\(-1.3\), \(-0.728\), 2.4}, {\(-1.3\), 0, 2.4}, {\(-0.4\), 0.224, 2.55}, {\(-0.224\), 0.4, 2.55}, {0, 0.4, 2.55}, {\(-1.3\), 0.728, 2.55}, {\(-0.728\), 1.3, 2.55}, {0, 1.3, 2.55}, {\(-1.3\), 0.728, 2.4}, {\(-0.728\), 1.3, 2.4}, {0, 1.3, 2.4}, {0.224, 0.4, 2.55}, {0.4, 0.224, 2.55}, {0.728, 1.3, 2.55}, {1.3, 0.728, 2.55}, {0.728, 1.3, 2.4}, {1.3, 0.728, 2.4}, {0, 0, 0}, {1.5, 0, 0.15}, {1.5, 0.84, 0.15}, {0.84, 1.5, 0.15}, {0, 1.5, 0.15}, {1.5, 0, 0.075}, {1.5, 0.84, 0.075}, {0.84, 1.5, 0.075}, {0, 1.5, 0.075}, {1.425, 0, 0}, {1.425, 0.798, 0}, {0.798, 1.425, 0}, {0, 1.425, 0}, {\(-0.84\), 1.5, 0.15}, {\(-1.5\), 0.84, 0.15}, {\(-1.5\), 0, 0.15}, {\(-0.84\), 1.5, 0.075}, {\(-1.5\), 0.84, 0.075}, {\(-1.5\), 0, 0.075}, {\(-0.798\), 1.425, 0}, {\(-1.425\), 0.798, 0}, {\(-1.425\), 0, 0}, {\(-1.5\), \(-0.84\), 0.15}, {\(-0.84\), \(-1.5\), 0.15}, {0, \(-1.5\), 0.15}, {\(-1.5\), \(-0.84\), 0.075}, {\(-0.84\), \(-1.5\), 0.075}, {0, \(-1.5\), 0.075}, {\(-1.425\), \(-0.798\), 0}, {\(-0.798\), \(-1.425\), 0}, {0, \(-1.425\), 0}, {0.84, \(-1.5\), 0.15}, {1.5, \(-0.84\), 0.15}, {0.84, \(-1.5\), 0.075}, {1.5, \(-0.84\), 0.075}, {0.798, \(-1.425\), 0}, {1.425, \(-0.798\), 0}};\)\)], "Input"], Cell[BoxData[ \(\(potPatches = {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}, {4, 17, 18, 19, 8, 20, 21, 22, 12, 23, 24, 25, 16, 26, 27, 28}, {19, 29, 30, 31, 22, 32, 33, 34, 25, 35, 36, 37, 28, 38, 39, 40}, {31, 41, 42, 1, 34, 43, 44, 5, 37, 45, 46, 9, 40, 47, 48, 13}, {13, 14, 15, 16, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60}, {16, 26, 27, 28, 52, 61, 62, 63, 56, 64, 65, 66, 60, 67, 68, 69}, {28, 38, 39, 40, 63, 70, 71, 72, 66, 73, 74, 75, 69, 76, 77, 78}, {40, 47, 48, 13, 72, 79, 80, 49, 75, 81, 82, 53, 78, 83, 84, 57}, {57, 58, 59, 60, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96}, {60, 67, 68, 69, 88, 97, 98, 99, 92, 100, 101, 102, 96, 103, 104, 105}, {69, 76, 77, 78, 99, 106, 107, 108, 102, 109, 110, 111, 105, 112, 113, 114}, {78, 83, 84, 57, 108, 115, 116, 85, 111, 117, 118, 89, 114, 119, 120, 93}, {121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136}, {124, 137, 138, 121, 128, 139, 140, 125, 132, 141, 142, 129, 136, 143, 144, 133}, {133, 134, 135, 136, 145, 146, 147, 148, 149, 150, 151, 152, 69, 153, 154, 155}, {136, 143, 144, 133, 148, 156, 157, 145, 152, 158, 159, 149, 155, 160, 161, 69}, {162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177}, {165, 178, 179, 162, 169, 180, 181, 166, 173, 182, 183, 170, 177, 184, 185, 174}, {174, 175, 176, 177, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197}, {177, 184, 185, 174, 189, 198, 199, 186, 193, 200, 201, 190, 197, 202, 203, 194}, {204, 204, 204, 204, 207, 208, 209, 210, 211, 211, 211, 211, 212, 213, 214, 215}, {204, 204, 204, 204, 210, 217, 218, 219, 211, 211, 211, 211, 215, 220, 221, 222}, {204, 204, 204, 204, 219, 224, 225, 226, 211, 211, 211, 211, 222, 227, 228, 229}, {204, 204, 204, 204, 226, 230, 231, 207, 211, 211, 211, 211, 229, 232, 233, 212}, {212, 213, 214, 215, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245}, {215, 220, 221, 222, 237, 246, 247, 248, 241, 249, 250, 251, 245, 252, 253, 254}, {222, 227, 228, 229, 248, 255, 256, 257, 251, 258, 259, 260, 254, 261, 262, 263}, {229, 232, 233, 212, 257, 264, 265, 234, 260, 266, 267, 238, 263, 268, 269, 242}, {270, 270, 270, 270, 279, 280, 281, 282, 275, 276, 277, 278, 271, 272, 273, 274}, {270, 270, 270, 270, 282, 289, 290, 291, 278, 286, 287, 288, 274, 283, 284, 285}, {270, 270, 270, 270, 291, 298, 299, 300, 288, 295, 296, 297, 285, 292, 293, 294}, {270, 270, 270, 270, 300, 305, 306, 279, 297, 303, 304, 275, 294, 301, 302, 271}};\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Viewing The Control Points", "Section"], Cell[TextData[{ "Set the ", StyleBox["Boxed", "Input"], " option of ", StyleBox["Graphics3D", "Input"], " to ", StyleBox["False", "Input"], "." }], "Text", CellTags->{"S0.0.2", "1.3"}], Cell[BoxData[ \(\(SetOptions[Graphics3D, Boxed \[Rule] False];\)\)], "Input"], Cell[TextData[{ "We visualize the control points using the function ", StyleBox["toPolygons[]", "Input"], ", which accepts a list of points and a list of patches as its arguments, \ and returns the corresponding polygons." }], "Text", CellTags->{"S0.0.2", "1.3"}], Cell[BoxData[ \(toPolygons[pnts_, pats_] := Map[Polygon[ Flatten[MapAt[Reverse, Part[Partition[#, 2], {1, 3}], {2}], 1]] &, Map[NestList[RotateLeft, #, 2] &, Partition[Part[pnts, pats], 8, 4]], {2}]\)], "Input"], Cell[BoxData[ \(\(roughTeapot = Show[Graphics3D[{\(toPolygons[potPoints, #] &\) /@ potPatches}]];\)\)], "Input"], Cell["We can also show the \"parts\" of the teapot.", "Text", CellTags->{"S0.0.2", "1.3"}], Cell[BoxData[ \(\(Show[ GraphicsArray[{{Graphics3D[{\(toPolygons[potPoints, #] &\) /@ Take[potPatches, 4]}, PlotLabel \[Rule] "\"], Graphics3D[{\(toPolygons[potPoints, #] &\) /@ Take[potPatches, {5, 12}]}, PlotLabel \[Rule] "\"], Graphics3D[{\(toPolygons[potPoints, #] &\) /@ Take[potPatches, {13, 16}]}, PlotLabel \[Rule] "\"]}, {Graphics3D[{\(toPolygons[ potPoints, #] &\) /@ Take[potPatches, {17, 20}]}, PlotLabel \[Rule] "\"], Graphics3D[{\(toPolygons[potPoints, #] &\) /@ Take[potPatches, {21, 28}]}, PlotLabel \[Rule] "\"], Graphics3D[{\(toPolygons[potPoints, #] &\) /@ Take[potPatches, {29, 32}]}, PlotLabel \[Rule] "\"]}}]];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Rendering The Teapot", "Section"], Cell["\<\ To render the teapot, we are going to fit a Bezier surface to the dataset.\ \>", "Text", CellTags->{"S0.0.2", "1.3"}], Cell[TextData[{ "We first define the Bernstein polynomials ", Cell[BoxData[ FormBox[ RowBox[{\(\(B\_\(i, n\)\)(t)\), ":=", RowBox[{ TagBox[ RowBox[{"(", GridBox[{ { TagBox["n", Identity, Editable->True]}, { TagBox["i", Identity, Editable->True]} }], ")"}], InterpretTemplate[ Binomial[ #, #2]&], Editable->False], " ", \(t\^i\), " ", \(\((1 - t)\)\^\(n - i\)\)}]}], TraditionalForm]]], "." }], "Text", CellTags->{"S0.0.2", "1.3"}], Cell[BoxData[ \(Bernstein[i_Integer, n_Integer, t_Symbol]\ := \ Binomial[n, i]\ t\^i\ \((1 - t)\)\^\(n - i\)\)], "Input"], Cell[BoxData[ \(Bernstein[n_Integer, t_Symbol] := Map[Bernstein[#, n, t] &, Range[0, n]]\)], "Input"], Cell["\<\ It is now straightforward to write a routine to generate the parametric \ equations for the Bezier surface. (The dot product is used in the following \ implementation for efficiency.)\ \>", "Text", CellTags->{"S0.0.2", "1.3"}], Cell[BoxData[ \(BezierSurface[pts_, u_, v_] := Module[{dim = Dimensions[pts]}, Bernstein[dim[\([1]\)] - 1, u] . Map[Bernstein[dim[\([2]\)] - 1, v] . # &, pts]]\)], "Input"], Cell[TextData[{ "Using the ", StyleBox["BezierSurface[]", "Input"], " routine, we define ", StyleBox["UtahTeapot[]", "Input"], " which plots the teapot with ", StyleBox["u\[Times]v", "Input"], " points along each patch." }], "Text", CellTags->{"S0.0.2", "1.3"}], Cell[BoxData[ \(\(UtahTeapot[u_, v_] := Block[{$DisplayFunction = Identity}, ParametricPlot3D[ Evaluate[\(Chop[ BezierSurface[#, s, t]] &\) /@ \((\(Transpose[ Partition[Part[potPoints, #], 4]] &\) /@ potPatches)\)], {s, 0, 1}, {t, 0, 1}, Axes \[Rule] None, Boxed \[Rule] False, PlotPoints \[Rule] {u, v}]];\)\)], "Input"], Cell[BoxData[ \(\(Show[myTeapot = UtahTeapot[12, 12]];\)\)], "Input"], Cell["We can show the teapot along with the control points.", "Text", CellTags->{"S0.0.2", "1.3"}], Cell[BoxData[ \(\(Show[ roughTeapot /. Polygon[l_] \[RuleDelayed] {AbsoluteThickness[1/2], GrayLevel[1/2], Line[l]}, roughTeapot /. Polygon[l_] \[RuleDelayed] Map[{AbsolutePointSize[6], Point[#]} &, l], myTeapot];\)\)], "Input"] }, Closed]] }, Open ]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1280}, {0, 926}}, WindowSize->{1266, 899}, WindowMargins->{{0, Automatic}, {Automatic, 0}} ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{ "0.1"->{ Cell[1739, 51, 123, 5, 105, "Title", CellTags->"0.1"]}, "S0.0.1"->{ Cell[1865, 58, 219, 7, 71, "Subsubtitle", CellTags->{"S0.0.1", "1.2"}]}, "1.2"->{ Cell[1865, 58, 219, 7, 71, "Subsubtitle", CellTags->{"S0.0.1", "1.2"}]}, "S0.0.2"->{ Cell[2087, 67, 259, 7, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[2349, 76, 288, 8, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[2699, 90, 369, 9, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[14751, 274, 200, 9, 34, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[15038, 288, 271, 6, 34, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[15720, 308, 92, 1, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[16872, 335, 129, 3, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[17004, 340, 730, 22, 45, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[17988, 372, 238, 5, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[18435, 385, 277, 9, 34, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[19252, 410, 100, 1, 33, "Text", CellTags->{"S0.0.2", "1.3"}]}, "1.3"->{ Cell[2087, 67, 259, 7, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[2349, 76, 288, 8, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[2699, 90, 369, 9, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[14751, 274, 200, 9, 34, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[15038, 288, 271, 6, 34, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[15720, 308, 92, 1, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[16872, 335, 129, 3, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[17004, 340, 730, 22, 45, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[17988, 372, 238, 5, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[18435, 385, 277, 9, 34, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[19252, 410, 100, 1, 33, "Text", CellTags->{"S0.0.2", "1.3"}]} } *) (*CellTagsIndex CellTagsIndex->{ {"0.1", 20289, 441}, {"S0.0.1", 20369, 444}, {"1.2", 20463, 447}, {"S0.0.2", 20560, 450}, {"1.3", 21413, 473} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1739, 51, 123, 5, 105, "Title", CellTags->"0.1"], Cell[1865, 58, 219, 7, 71, "Subsubtitle", CellTags->{"S0.0.1", "1.2"}], Cell[2087, 67, 259, 7, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[2349, 76, 288, 8, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[CellGroupData[{ Cell[2662, 88, 34, 0, 53, "Section"], Cell[2699, 90, 369, 9, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[3071, 101, 8592, 124, 810, "Input"], Cell[11666, 227, 3000, 40, 330, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[14703, 272, 45, 0, 33, "Section"], Cell[14751, 274, 200, 9, 34, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[14954, 285, 81, 1, 30, "Input"], Cell[15038, 288, 271, 6, 34, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[15312, 296, 260, 5, 50, "Input"], Cell[15575, 303, 142, 3, 30, "Input"], Cell[15720, 308, 92, 1, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[15815, 311, 978, 17, 150, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[16830, 333, 39, 0, 33, "Section"], Cell[16872, 335, 129, 3, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[17004, 340, 730, 22, 45, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[17737, 364, 133, 2, 30, "Input"], Cell[17873, 368, 112, 2, 30, "Input"], Cell[17988, 372, 238, 5, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[18229, 379, 203, 4, 30, "Input"], Cell[18435, 385, 277, 9, 34, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[18715, 396, 458, 9, 70, "Input"], Cell[19176, 407, 73, 1, 30, "Input"], Cell[19252, 410, 100, 1, 33, "Text", CellTags->{"S0.0.2", "1.3"}], Cell[19355, 413, 308, 8, 30, "Input"] }, Closed]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)