├── .gitignore ├── LICENSE ├── Minecraft_Launcher.jar ├── README.md ├── example-import-3d-image ├── LICENSE ├── README.md ├── farmhouse.obj ├── script.py ├── shuttle.obj └── skyscraper.obj ├── example-import-image ├── mario.gif └── script.py ├── lesson_1.md ├── lesson_2.md ├── lesson_3.md ├── lesson_4.md ├── lesson_5.md ├── lesson_6.md ├── lesson_7.md ├── mcpi ├── __init__.py ├── block.py ├── connection.py ├── event.py ├── minecraft.py ├── util.py └── vec3.py ├── script.py └── setup.md /.gitignore: -------------------------------------------------------------------------------- 1 | worlds/* 2 | db/* 3 | *.pyc 4 | .DS_Store 5 | *.gz 6 | crash-reports/* 7 | logs/* 8 | world/* 9 | world_nether/* 10 | world_the_end/* 11 | logs/latest.log 12 | 13 | ops.json 14 | 15 | usercache.json 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2016 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Minecraft_Launcher.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teachthenet/TeachCraft-Challenges/ab5b8cc57c71e423be932897cd5200c231e494ec/Minecraft_Launcher.jar -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## TeachCraft 2 | 3 | A series of lessons used to teach middle school and high school kids the fundamentals of programming! 4 | 5 | Using Python, each of the lessons will teach the kids new concepts, going through while loops, if statements, for loops, algorithms, function calls, and the like. 6 | 7 | The entire process is collaborative - students are able to see each other's progress as they are all in the same multiplayer server together. Indeed, one of the later lessons constructs a magical system the students can use to battle each other, invoking spells they prepared in code! 8 | 9 | All that is needed to get started is downloading the code in this repo and installing java on your system (full instructions in the [setup guide](https://github.com/teachthenet/TeachCraft-Challenges/blob/master/setup.md)). 10 | 11 | I have a server up and running with the python api open - all the lessons default to pointing to my server's IP. If you'd like privacy, or if my server is down due to being DOS'ed (easily achievable through it's open python api), you may want to [setup your own server](https://github.com/teachthenet/TeachCraft-Server). If you note my server is down, feel free to open an issue here to inform me to restart it. 12 | 13 | My Minecraft server is located at 14 | ``` 15 | 199.96.85.3:25570 16 | ``` 17 | 18 | ### Lessons & Setup 19 | 20 | [Initial Setup](https://github.com/teachthenet/TeachCraft-Challenges/blob/master/setup.md): Get minecraft running, get connected to the server. 21 | 22 | [Lesson 1](https://github.com/teachthenet/TeachCraft-Challenges/blob/master/lesson_1.md): Teleport your character to a point you define in code. 23 | 24 | [Lesson 2](https://github.com/teachthenet/TeachCraft-Challenges/blob/master/lesson_2.md): Make a path of something (flowers, lava, fire) follow behind you while you walk. 25 | 26 | [Lesson 3](https://github.com/teachthenet/TeachCraft-Challenges/blob/master/lesson_3.md): Give your character the ability to walk on water (by turning water below your character into ice). 27 | 28 | [Lesson 4](https://github.com/teachthenet/TeachCraft-Challenges/blob/master/lesson_4.md): Create a building 29 | 30 | [Lesson 5](https://github.com/teachthenet/TeachCraft-Challenges/blob/master/lesson_5.md): Create a pyramid 31 | 32 | [Lesson 6](https://github.com/teachthenet/TeachCraft-Challenges/blob/master/lesson_6.md): Use an algorithm to construct the pyramid by analyzing the pattern you discovered in lesson 5! 33 | 34 | [Lesson 7](https://github.com/teachthenet/TeachCraft-Challenges/blob/master/lesson_7.md): Create a magic system that listens to Minecraft chat, and executes your pre-defined spells! 35 | 36 | ### Examples / Additional Follow-up 37 | 38 | [Import Image](https://github.com/teachthenet/TeachCraft-Challenges/blob/master/example-import-image/script.py): Learn how to import an image into minecraft pixel art using Python Imaging Library. 39 | 40 | [Import 3D Model](https://github.com/teachthenet/TeachCraft-Challenges/blob/master/example-import-3d-image/script.py): Learn how to import a 3d model (such as those used with 3d printers) into Minecraft! 41 | 42 | [Build a mini-game: Lavatrap](http://www.stuffaboutcode.com/2015/09/minecraft-game-tutorial-lavatrap-pycon.html) [Link 2](https://docs.google.com/document/d/19YVesJJFS6cg4Ndep7F-TS02CpS0qpN1hlSlv6mgISQ/edit) [Solution](https://github.com/martinohanlon/minecraft-lavatrap/blob/master/lavatrap.py) 43 | 44 | [Build An Moving Clock](https://github.com/martinohanlon/minecraft-clock/blob/master/minecraft-clock.py) 45 | 46 | [Star Wars Animated](https://github.com/martinohanlon/minecraft-starwars) 47 | 48 | [Auto-bridge](http://www.stuffaboutcode.com/2013/02/raspberry-pi-minecraft-auto-bridge.html) [Link 2](https://github.com/martinohanlon/minecraft-bridge) 49 | 50 | ### Want to host your own server / run a server locally? 51 | - You want to switch to [this repo](https://github.com/teachthenet/TeachCraft-Server) 52 | 53 | ### Minecraft Docs 54 | - [pi version](http://www.stuffaboutcode.com/p/minecraft-api-reference.html) Has most of the basics of the python api 55 | - [our version](https://github.com/zhuowei/RaspberryJuice) Has the additional things our python api supports, above and beyond the pi version 56 | - [Minecraft block ids](http://minecraft-ids.grahamedgecombe.com/) 57 | 58 | ### Notes 59 | - Player location from the python api will not match the same retrieved from the server. 60 | This is because raspberryjuice calculates it from the spawn point, while the server calculates it from 0,0,0. 61 | To fix, run this as an admin: 62 | setworldspawn 0 0 0 63 | 64 | -------------------------------------------------------------------------------- /example-import-3d-image/LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 2 | 3 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 6 | -------------------------------------------------------------------------------- /example-import-3d-image/README.md: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Minecraft - Render Obj 3D Model version 2 3 | Martin O'Hanlon (martin@ohanlonweb.com) 4 | http://www.stuffaboutcode.com 5 | ------------------------------------------------------------------------------- 6 | 7 | A program which takes a 3d model in an obj file and renders it into minecraft 8 | Version 2 creates full models, not just wireframes and support using different 9 | types of blocks for different materials in the model 10 | http://www.stuffaboutcode.com/2013/04/minecraft-pi-edition-3d-models-version-2.html 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | Version history 15 | 2.1 - first beta release 16 | 17 | ------------------------------------------------------------------------------- 18 | -------------------------------------------------------------------------------- /example-import-3d-image/farmhouse.obj: -------------------------------------------------------------------------------- 1 | # This file uses centimeters as units for non-parametric coordinates. 2 | 3 | mtllib Farmhouse OBJ.mtl 4 | g default 5 | v -2.023838 8.915440 -8.054992 6 | v 1.971210 8.917807 -8.054984 7 | v 1.971237 1.352654 -8.054985 8 | v -1.992085 1.352654 -8.054985 9 | v 1.821583 8.753086 29.128180 10 | v 7.079507 8.753086 29.128180 11 | v 1.821583 8.907376 29.172422 12 | v 7.079507 8.907376 29.172422 13 | v 1.821583 9.398357 27.460169 14 | v 7.079507 9.398357 27.460169 15 | v 1.821583 9.244067 27.415926 16 | v 7.079507 9.244067 27.415926 17 | v 2.041729 8.753086 29.128180 18 | v 2.041729 8.907376 29.172422 19 | v 2.041729 9.398357 27.460169 20 | v 2.041729 9.244067 27.415926 21 | v 6.864059 8.753086 29.128180 22 | v 6.864059 8.907376 29.172422 23 | v 6.864059 9.398357 27.460169 24 | v 6.864059 9.244067 27.415926 25 | v 1.821583 8.440932 27.439030 26 | v 2.041729 8.440932 27.439030 27 | v 2.041729 8.613385 28.897882 28 | v 1.821583 8.613385 28.897882 29 | v 6.864059 8.440932 27.439034 30 | v 6.864058 8.613384 28.897886 31 | v 7.079507 8.440932 27.439034 32 | v 7.079506 8.613384 28.897886 33 | v 6.757504 8.950987 27.234821 34 | v 2.229405 8.950924 27.234819 35 | v 2.209645 0.083778 27.234821 36 | v 6.801266 0.083778 27.234825 37 | v 9.584381 0.083779 27.468933 38 | v -9.562160 0.083779 27.468933 39 | v -9.562160 0.083778 -8.258186 40 | v 9.584381 0.083778 -8.258186 41 | v 9.584381 1.352654 -8.258186 42 | v -9.562160 1.352654 -8.258186 43 | v 9.584381 1.352654 -19.503151 44 | v -9.562160 1.352654 -19.503151 45 | v 9.584381 0.083778 -19.503151 46 | v -9.562160 0.083778 -19.503151 47 | v -1.992085 1.352654 -8.258186 48 | v 1.971237 1.352654 -8.258186 49 | v 2.209644 0.083779 27.468933 50 | v 6.801266 0.083779 27.468933 51 | v 1.806809 1.352654 -19.503151 52 | v 1.807727 0.083778 -19.503151 53 | v -1.833586 1.352654 -19.503151 54 | v -1.841699 0.083778 -19.503151 55 | v -1.837642 0.718216 -19.503151 56 | v 1.807268 0.718216 -19.503151 57 | v -1.837642 0.718216 -21.191490 58 | v 1.807268 0.718216 -21.191490 59 | v 1.807727 0.083778 -21.191490 60 | v -1.841699 0.083778 -21.191490 61 | v 1.806809 1.352654 -20.349506 62 | v -1.833586 1.352654 -20.349506 63 | v 1.807268 0.718216 -20.349506 64 | v -1.837642 0.718216 -20.349506 65 | v 0.011112 21.366768 -9.865997 66 | v -12.056731 10.675596 -9.865997 67 | v 12.222922 10.718573 -9.865997 68 | v 0.011112 21.366768 29.076740 69 | v -12.056731 10.675596 29.076740 70 | v 12.222922 10.718573 29.076740 71 | v -11.696275 10.437319 29.076740 72 | v 0.304019 21.104111 29.076740 73 | v -0.004865 20.825569 29.076740 74 | v 11.855354 10.426807 29.076740 75 | v 11.855874 10.427299 -9.865997 76 | v -0.287550 21.098951 -9.865997 77 | v -0.005755 20.844450 -9.865997 78 | v -11.697057 10.436284 -9.865997 79 | v -8.314565 1.178085 -14.690422 80 | v -8.113598 1.178085 -14.460913 81 | v -7.723187 1.178085 -14.383255 82 | v -7.370952 1.178085 -14.590198 83 | v -7.314556 1.178085 -14.994815 84 | v -7.524743 1.178085 -15.342196 85 | v -7.926116 1.178085 -15.403445 86 | v -8.292524 1.178085 -15.172796 87 | v -8.314565 11.530749 -14.690422 88 | v -8.113598 11.530749 -14.460913 89 | v -7.723187 11.530748 -14.383255 90 | v -7.370952 11.530749 -14.590198 91 | v -7.314556 11.530749 -14.994815 92 | v -7.524743 11.530749 -15.342196 93 | v -7.926116 11.530748 -15.403445 94 | v -8.292524 11.530749 -15.172796 95 | v 9.735872 10.919974 -18.191801 96 | v -9.593304 10.919974 -18.191801 97 | v 9.735872 11.318687 -18.241917 98 | v -9.593304 11.318687 -18.241917 99 | v 9.732642 12.788167 -8.232523 100 | v -9.596533 12.788167 -8.232523 101 | v 9.732642 12.389454 -8.182407 102 | v -9.596533 12.389454 -8.182407 103 | v 7.189742 1.178085 -14.690422 104 | v 7.390709 1.178085 -14.460913 105 | v 7.781119 1.178085 -14.383255 106 | v 8.133354 1.178085 -14.590198 107 | v 8.189751 1.178085 -14.994815 108 | v 7.979564 1.178085 -15.342196 109 | v 7.578191 1.178085 -15.403445 110 | v 7.211783 1.178085 -15.172796 111 | v 7.189742 11.530749 -14.690422 112 | v 7.390709 11.530749 -14.460913 113 | v 7.781119 11.530751 -14.383255 114 | v 8.133354 11.530749 -14.590198 115 | v 8.189751 11.530751 -14.994815 116 | v 7.979564 11.530751 -15.342196 117 | v 7.578191 11.530751 -15.403445 118 | v 7.211783 11.530751 -15.172796 119 | v 2.619709 18.727844 -8.258188 120 | v 4.744160 16.822790 -8.258188 121 | v 1.119221 16.805269 -8.258187 122 | v 1.143524 18.726208 -8.258187 123 | v -1.461399 18.724052 -8.258185 124 | v -1.462166 16.794991 -8.258185 125 | v -4.775525 16.774738 -8.258185 126 | v -2.603912 18.722082 -8.258185 127 | v 0.011108 21.067041 -8.258188 128 | v 2.619709 18.727844 -8.258188 129 | v 1.143524 18.726208 -8.258188 130 | v -1.461399 18.724052 -8.258188 131 | v -2.603913 18.722082 -8.258188 132 | v -1.992084 1.352655 -8.258186 133 | v -2.023838 8.915440 -8.258186 134 | v -2.023838 8.915440 -8.054993 135 | v -1.992084 1.352655 -8.054985 136 | v 1.971237 1.352654 -8.258186 137 | v -1.992085 1.352654 -8.258186 138 | v -1.992085 1.352654 -8.054985 139 | v 1.971237 1.352654 -8.054985 140 | v 1.971210 8.917807 -8.258186 141 | v 1.971237 1.352654 -8.258186 142 | v 1.971237 1.352654 -8.054985 143 | v 1.971210 8.917807 -8.054985 144 | v -2.023838 8.915439 -8.258186 145 | v 1.971210 8.917806 -8.258186 146 | v 1.971210 8.917806 -8.054985 147 | v -2.023838 8.915439 -8.054993 148 | v -9.562161 8.910973 -8.258187 149 | v -2.023839 8.915440 -8.258186 150 | v -1.992085 1.352655 -8.258186 151 | v -9.562161 1.352655 -8.258187 152 | v -9.562161 2.967356 -8.258187 153 | v -9.562160 12.482436 -8.258186 154 | v 9.584381 12.482436 -8.258186 155 | v 9.584381 8.922317 -8.258186 156 | v 1.971210 8.917807 -8.258186 157 | v -2.023838 8.915440 -8.258186 158 | v -9.562160 8.910972 -8.258186 159 | v 1.971211 8.917807 -8.258186 160 | v 9.584381 8.922317 -8.258186 161 | v 9.584381 2.967085 -8.258186 162 | v 9.584381 1.352654 -8.258186 163 | v 1.971238 1.352655 -8.258186 164 | v 4.744160 16.822790 -8.258186 165 | v 9.584381 12.482436 -8.258186 166 | v -9.562160 12.482436 -8.258186 167 | v -4.775524 16.774738 -8.258186 168 | v -1.462166 16.794991 -8.258186 169 | v 1.119221 16.805269 -8.258186 170 | v 1.191590 18.761831 -8.239181 171 | v 1.166390 16.770023 -8.239181 172 | v -1.510232 16.759363 -8.239181 173 | v -1.509437 18.759594 -8.239181 174 | v 0.011108 21.067041 27.468933 175 | v -2.577679 18.745605 27.468933 176 | v -1.464676 18.744141 27.468933 177 | v 1.113865 18.740747 27.468933 178 | v 2.607510 18.738783 27.468933 179 | v 9.584381 12.482435 27.468931 180 | v -9.562160 12.482435 27.468931 181 | v -9.562160 8.950749 27.468931 182 | v 2.229404 8.950924 27.468931 183 | v 6.757504 8.950987 27.468931 184 | v 9.584381 8.951014 27.468931 185 | v 9.584381 8.951015 27.468933 186 | v 6.757504 8.950988 27.468933 187 | v 6.801266 0.083779 27.468933 188 | v 9.584381 0.083779 27.468933 189 | v 9.584381 2.931374 27.468933 190 | v 2.229405 8.950925 27.468933 191 | v -9.562161 8.950750 27.468935 192 | v -9.562161 2.930227 27.468935 193 | v -9.562161 0.083780 27.468935 194 | v 2.209645 0.083779 27.468933 195 | v 6.757504 8.950987 27.468933 196 | v 2.229404 8.950925 27.468933 197 | v 2.229404 8.950925 27.234821 198 | v 6.757504 8.950987 27.234821 199 | v 2.229404 8.950925 27.468925 200 | v 2.209644 0.083779 27.468933 201 | v 2.209644 0.083779 27.234818 202 | v 2.229404 8.950925 27.234814 203 | v 6.801266 0.083779 27.468933 204 | v 6.757504 8.950988 27.468931 205 | v 6.757504 8.950988 27.234819 206 | v 6.801266 0.083778 27.234821 207 | v 1.113865 18.740747 27.468937 208 | v 1.128643 16.955921 27.468937 209 | v 4.593323 16.958052 27.468935 210 | v 2.607509 18.738783 27.468937 211 | v -4.577393 16.952412 27.468931 212 | v -9.562160 12.482436 27.468931 213 | v 9.584381 12.482436 27.468931 214 | v 4.593323 16.958052 27.468931 215 | v 1.128643 16.955921 27.468931 216 | v -1.479530 16.954317 27.468931 217 | v -2.577679 18.745607 27.468931 218 | v -4.577393 16.952414 27.468931 219 | v -1.479530 16.954319 27.468931 220 | v -1.464676 18.744143 27.468931 221 | v 2.209645 0.083779 28.635662 222 | v 6.801266 0.083779 28.635662 223 | v 6.801266 0.630622 28.635662 224 | v 2.209645 0.630622 28.635662 225 | v 2.209645 0.083779 27.468933 226 | v 6.801266 0.083779 27.468929 227 | v 6.801266 0.083779 28.635658 228 | v 2.209645 0.083779 28.635662 229 | v 6.801265 0.083779 27.468931 230 | v 6.801265 0.630622 27.468931 231 | v 6.801265 0.630621 28.635660 232 | v 6.801265 0.083779 28.635660 233 | v 6.801266 0.630621 27.468929 234 | v 2.209645 0.630622 27.468933 235 | v 2.209645 0.630622 28.635662 236 | v 6.801266 0.630621 28.635658 237 | v 2.209645 0.630622 27.468933 238 | v 2.209645 0.083779 27.468933 239 | v 2.209645 0.083779 28.635662 240 | v 2.209645 0.630622 28.635662 241 | v -1.519492 18.771900 27.427946 242 | v -1.534808 16.926554 27.427946 243 | v 1.154275 16.928207 27.427946 244 | v 1.139039 18.768402 27.427946 245 | v 9.584380 8.943011 17.507133 246 | v 9.584380 8.951015 27.468933 247 | v 9.584380 2.931374 27.468933 248 | v 9.584376 2.941292 17.546253 249 | v 9.584382 12.482435 -8.258186 250 | v 9.584384 12.482436 27.468933 251 | v 9.584384 8.951015 27.468933 252 | v 9.584383 8.943011 17.507133 253 | v 9.584383 8.939797 13.505859 254 | v 9.584379 8.933404 5.542252 255 | v 9.584382 8.930156 1.501781 256 | v 9.584382 8.922316 -8.258186 257 | v 9.584383 2.967085 -8.258185 258 | v 9.584382 2.957290 1.540962 259 | v 9.584378 2.953252 5.581184 260 | v 9.584376 2.945292 13.544765 261 | v 9.584376 2.941292 17.546251 262 | v 9.584379 2.931375 27.468931 263 | v 9.584379 0.083779 27.468931 264 | v 9.584383 0.083778 -8.258185 265 | v 9.584383 1.352654 -8.258185 266 | v 9.584380 8.922316 -8.258185 267 | v 9.584381 8.930156 1.501782 268 | v 9.584381 2.957291 1.540963 269 | v 9.584380 2.967084 -8.258186 270 | v 9.584377 8.933404 5.542251 271 | v 9.584381 8.939797 13.505858 272 | v 9.584377 2.945292 13.544765 273 | v 9.584377 2.953252 5.581184 274 | v 9.584381 8.930156 1.501781 275 | v 9.584377 8.933404 5.542252 276 | v 9.264278 8.933404 5.542252 277 | v 9.264278 8.930156 1.501781 278 | v 9.584377 8.933404 5.542253 279 | v 9.584377 2.953252 5.581185 280 | v 9.264278 2.953253 5.581185 281 | v 9.264278 8.933404 5.542253 282 | v 9.584377 2.953252 5.581185 283 | v 9.584381 2.957291 1.540963 284 | v 9.264278 2.957291 1.540963 285 | v 9.264278 2.953253 5.581185 286 | v 9.584381 2.957291 1.540962 287 | v 9.584381 8.930156 1.501782 288 | v 9.264278 8.930156 1.501782 289 | v 9.264278 2.957291 1.540962 290 | v 9.584380 8.939797 13.505860 291 | v 9.584380 8.943010 17.507133 292 | v 9.264277 8.943010 17.507133 293 | v 9.264277 8.939797 13.505860 294 | v 9.584381 8.943011 17.507135 295 | v 9.584377 2.941292 17.546255 296 | v 9.264278 2.941292 17.546255 297 | v 9.264278 8.943011 17.507135 298 | v 9.584376 2.941292 17.546253 299 | v 9.584376 2.945292 13.544766 300 | v 9.264277 2.945292 13.544766 301 | v 9.264277 2.941292 17.546253 302 | v 9.584376 2.945292 13.544764 303 | v 9.584380 8.939797 13.505857 304 | v 9.264277 8.939797 13.505857 305 | v 9.264277 2.945292 13.544764 306 | v 9.495608 8.930156 1.501783 307 | v 9.495607 8.933403 5.542251 308 | v 9.495606 2.953253 5.581186 309 | v 9.495606 2.957292 1.540963 310 | v 9.495607 8.939797 13.505859 311 | v 9.495606 8.943011 17.507132 312 | v 9.495606 2.941293 17.546253 313 | v 9.495606 2.945292 13.544765 314 | v -9.562159 12.482434 27.468931 315 | v -9.562160 12.482436 -8.258185 316 | v -9.562160 8.910972 -8.258185 317 | v -9.562160 8.921830 1.494385 318 | v -9.562160 8.926348 5.552868 319 | v -9.562160 8.935206 13.510811 320 | v -9.562160 8.939658 17.508865 321 | v -9.562159 8.950748 27.468931 322 | v -9.562160 2.930226 27.468933 323 | v -9.562160 2.940577 17.508739 324 | v -9.562160 2.944732 13.510971 325 | v -9.562160 2.952961 5.592434 326 | v -9.562160 2.957179 1.534298 327 | v -9.562160 2.967356 -8.258186 328 | v -9.562160 1.352654 -8.258186 329 | v -9.562160 0.083778 -8.258186 330 | v -9.562160 0.083779 27.468933 331 | v -9.562162 8.921831 1.494385 332 | v -9.562162 8.910971 -8.258186 333 | v -9.562162 2.967355 -8.258186 334 | v -9.562161 2.957179 1.534298 335 | v -9.562160 8.950750 27.468933 336 | v -9.562160 8.939660 17.508865 337 | v -9.562160 2.940577 17.508739 338 | v -9.562160 2.930226 27.468933 339 | v -9.562161 8.935208 13.510810 340 | v -9.562160 8.926349 5.552867 341 | v -9.562160 2.952961 5.592433 342 | v -9.562161 2.944732 13.510970 343 | v -9.562160 8.939660 17.508863 344 | v -9.562160 8.935207 13.510810 345 | v -9.205691 8.935208 13.510810 346 | v -9.205691 8.939660 17.508863 347 | v -9.562160 8.935208 13.510814 348 | v -9.562160 2.944733 13.510974 349 | v -9.205692 2.944733 13.510974 350 | v -9.205692 8.935208 13.510814 351 | v -9.562160 2.944732 13.510972 352 | v -9.562160 2.940577 17.508739 353 | v -9.205692 2.940577 17.508739 354 | v -9.205692 2.944732 13.510972 355 | v -9.562160 2.940577 17.508739 356 | v -9.562160 8.939660 17.508865 357 | v -9.205692 8.939660 17.508865 358 | v -9.205692 2.940577 17.508739 359 | v -9.562160 8.926348 5.552868 360 | v -9.562160 8.921830 1.494385 361 | v -9.205688 8.921831 1.494385 362 | v -9.205688 8.926349 5.552868 363 | v -9.562160 8.921832 1.494385 364 | v -9.562160 2.957179 1.534298 365 | v -9.205692 2.957179 1.534298 366 | v -9.205688 8.921832 1.494385 367 | v -9.562160 2.957179 1.534298 368 | v -9.562160 2.952961 5.592434 369 | v -9.205691 2.952960 5.592434 370 | v -9.205691 2.957178 1.534298 371 | v -9.562160 2.952962 5.592435 372 | v -9.562160 8.926350 5.552869 373 | v -9.205688 8.926350 5.552869 374 | v -9.205692 2.952961 5.592435 375 | v -9.525482 8.939660 17.508865 376 | v -9.525482 8.935208 13.510809 377 | v -9.525482 2.944733 13.510973 378 | v -9.525482 2.940578 17.508739 379 | v -9.525481 8.926349 5.552868 380 | v -9.525481 8.921831 1.494385 381 | v -9.525482 2.957179 1.534299 382 | v -9.525481 2.952961 5.592433 383 | vt 0.335384 0.116530 384 | vt 0.280210 0.116678 385 | vt 0.280210 0.016955 386 | vt 0.334945 0.016839 387 | vt 0.120697 0.922537 388 | vt 0.120697 0.931018 389 | vt 0.114753 0.931018 390 | vt 0.114753 0.922537 391 | vt 0.114753 0.736764 392 | vt 0.114753 0.728464 393 | vt 0.120697 0.728464 394 | vt 0.120697 0.736764 395 | vt 0.188456 0.922537 396 | vt 0.188456 0.931018 397 | vt 0.122494 0.931018 398 | vt 0.122494 0.922537 399 | vt 0.122494 0.736764 400 | vt 0.122494 0.728464 401 | vt 0.188456 0.728464 402 | vt 0.188456 0.736764 403 | vt 0.231976 0.921577 404 | vt 0.240457 0.921577 405 | vt 0.240457 0.977777 406 | vt 0.231976 0.977777 407 | vt 0.327238 0.903655 408 | vt 0.321144 0.904703 409 | vt 0.309517 0.837074 410 | vt 0.315611 0.836027 411 | vt 0.346270 0.840277 412 | vt 0.333553 0.895421 413 | vt 0.255941 0.914237 414 | vt 0.189979 0.914237 415 | vt 0.189979 0.728464 416 | vt 0.255941 0.728464 417 | vt 0.216639 0.978016 418 | vt 0.216639 0.921816 419 | vt 0.224939 0.921816 420 | vt 0.224939 0.978016 421 | vt 0.076840 0.736764 422 | vt 0.070896 0.728464 423 | vt 0.076840 0.728464 424 | vt 0.107779 0.728464 425 | vt 0.107779 0.736764 426 | vt 0.294892 0.984607 427 | vt 0.298500 0.916081 428 | vt 0.305737 0.923517 429 | vt 0.324841 0.976786 430 | vt 0.109372 0.931018 431 | vt 0.109372 0.922537 432 | vt 0.278520 0.916139 433 | vt 0.284888 0.984463 434 | vt 0.254649 0.977857 435 | vt 0.271588 0.923860 436 | vt 0.278919 0.901412 437 | vt 0.273537 0.892541 438 | vt 0.266894 0.836340 439 | vt 0.297833 0.835450 440 | vt 0.303777 0.837154 441 | vt 0.284863 0.903117 442 | vt 0.109372 0.736764 443 | vt 0.109372 0.728464 444 | vt 0.076840 0.922537 445 | vt 0.070896 0.931018 446 | vt 0.070896 0.922537 447 | vt 0.070896 0.736764 448 | vt 0.107779 0.922537 449 | vt 0.107779 0.931018 450 | vt 0.076840 0.931018 451 | vt 0.394524 0.116949 452 | vt 0.340113 0.116949 453 | vt 0.339876 0.017110 454 | vt 0.395050 0.017110 455 | vt 0.856066 0.899668 456 | vt 0.856066 0.850832 457 | vt 0.860075 0.850858 458 | vt 0.864084 0.850883 459 | vt 0.864084 0.899668 460 | vt 0.850650 0.849837 461 | vt 0.850650 0.802002 462 | vt 0.850650 0.776958 463 | vt 0.850650 0.728851 464 | vt 0.921706 0.728851 465 | vt 0.921706 0.777997 466 | vt 0.921706 0.801000 467 | vt 0.921706 0.849837 468 | vt 0.883179 0.921888 469 | vt 0.875161 0.921888 470 | vt 0.875161 0.850832 471 | vt 0.883179 0.850832 472 | vt 0.727676 0.728851 473 | vt 0.848662 0.728851 474 | vt 0.848662 0.954609 475 | vt 0.831076 0.954609 476 | vt 0.802062 0.954609 477 | vt 0.727676 0.954609 478 | vt 0.884708 0.850832 479 | vt 0.892726 0.850832 480 | vt 0.892726 0.921888 481 | vt 0.884708 0.921888 482 | vt 0.975981 0.971818 483 | vt 0.904924 0.971818 484 | vt 0.904924 0.923033 485 | vt 0.904924 0.899972 486 | vt 0.904924 0.850832 487 | vt 0.975981 0.850832 488 | vt 0.928875 0.849837 489 | vt 0.928875 0.728851 490 | vt 0.936893 0.728851 491 | vt 0.936893 0.849837 492 | vt 0.865614 0.899978 493 | vt 0.865614 0.850832 494 | vt 0.873632 0.850832 495 | vt 0.873632 0.899972 496 | vt 0.869623 0.899975 497 | vt 0.850528 0.873867 498 | vt 0.850528 0.850835 499 | vt 0.854537 0.850832 500 | vt 0.854537 0.873893 501 | vt 0.825914 0.978610 502 | vt 0.825914 0.955607 503 | vt 0.829923 0.955604 504 | vt 0.829923 0.978636 505 | vt 0.838330 0.978636 506 | vt 0.838330 0.955604 507 | vt 0.848998 0.955604 508 | vt 0.848998 0.978636 509 | vt 0.824384 0.966272 510 | vt 0.820375 0.966272 511 | vt 0.820375 0.955604 512 | vt 0.824384 0.955604 513 | vt 0.894256 0.923033 514 | vt 0.894256 0.899972 515 | vt 0.814837 0.955604 516 | vt 0.818846 0.955604 517 | vt 0.818846 0.966272 518 | vt 0.814837 0.966272 519 | vt 0.927054 0.777997 520 | vt 0.927054 0.801000 521 | vt 0.813307 0.960952 522 | vt 0.809298 0.960952 523 | vt 0.809298 0.955604 524 | vt 0.813307 0.955604 525 | vt 0.836800 0.955604 526 | vt 0.836800 0.978636 527 | vt 0.831452 0.978636 528 | vt 0.831452 0.955604 529 | vt 0.803760 0.955604 530 | vt 0.807769 0.955604 531 | vt 0.807769 0.960952 532 | vt 0.803760 0.960952 533 | vt 0.055985 0.613791 534 | vt 0.055990 0.609277 535 | vt 0.056184 0.433443 536 | vt 0.239914 0.433569 537 | vt 0.239715 0.613917 538 | vt 0.056178 0.429988 539 | vt 0.239908 0.430130 540 | vt 0.462643 0.435340 541 | vt 0.462844 0.613531 542 | vt 0.279116 0.613393 543 | vt 0.279111 0.608988 544 | vt 0.278915 0.435201 545 | vt 0.492235 0.139417 546 | vt 0.430423 0.019776 547 | vt 0.432281 0.016521 548 | vt 0.492321 0.133564 549 | vt 0.493747 0.136423 550 | vt 0.646759 0.138675 551 | vt 0.585676 0.018449 552 | vt 0.587501 0.015779 553 | vt 0.646678 0.132598 554 | vt 0.648242 0.135731 555 | vt 0.706711 0.016038 556 | vt 0.708571 0.019320 557 | vt 0.551498 0.017231 558 | vt 0.553318 0.019923 559 | vt 0.278921 0.429602 560 | vt 0.462649 0.429750 561 | vt 0.641858 0.626531 562 | vt 0.579517 0.626531 563 | vt 0.579512 0.421835 564 | vt 0.641861 0.421835 565 | vt 0.518063 0.626531 566 | vt 0.518059 0.421835 567 | vt 0.555138 0.729358 568 | vt 0.559289 0.729358 569 | vt 0.559289 0.943193 570 | vt 0.555138 0.943193 571 | vt 0.567352 0.729358 572 | vt 0.567352 0.943193 573 | vt 0.574628 0.729358 574 | vt 0.574628 0.943193 575 | vt 0.576168 0.729358 576 | vt 0.584525 0.729358 577 | vt 0.584525 0.943193 578 | vt 0.576168 0.943193 579 | vt 0.591700 0.729358 580 | vt 0.591700 0.943193 581 | vt 0.609130 0.943193 582 | vt 0.600840 0.943193 583 | vt 0.600840 0.729358 584 | vt 0.609130 0.729358 585 | vt 0.593271 0.943193 586 | vt 0.593271 0.729358 587 | vt 0.610375 0.729358 588 | vt 0.620339 0.729358 589 | vt 0.620339 0.943193 590 | vt 0.610375 0.943193 591 | vt 0.621648 0.744085 592 | vt 0.622103 0.734122 593 | vt 0.629672 0.729358 594 | vt 0.637962 0.730623 595 | vt 0.642304 0.737798 596 | vt 0.641139 0.746156 597 | vt 0.633863 0.750430 598 | vt 0.625799 0.748826 599 | vt 0.643806 0.735702 600 | vt 0.647956 0.730962 601 | vt 0.656020 0.729358 602 | vt 0.663296 0.733632 603 | vt 0.664461 0.741990 604 | vt 0.660119 0.749165 605 | vt 0.651829 0.750430 606 | vt 0.644261 0.745666 607 | vt 0.932359 0.417110 608 | vt 0.932359 0.622662 609 | vt 0.928119 0.622662 610 | vt 0.928119 0.417110 611 | vt 0.812371 0.417110 612 | vt 0.812371 0.622662 613 | vt 0.705929 0.622696 614 | vt 0.705929 0.417144 615 | vt 0.926487 0.417110 616 | vt 0.926487 0.622662 617 | vt 0.922247 0.622662 618 | vt 0.922247 0.417110 619 | vt 0.920555 0.417144 620 | vt 0.920555 0.622696 621 | vt 0.814112 0.622662 622 | vt 0.814112 0.417110 623 | vt 0.943500 0.521522 624 | vt 0.943710 0.413939 625 | vt 0.947982 0.413858 626 | vt 0.947773 0.521442 627 | vt 0.944013 0.632327 628 | vt 0.943818 0.524743 629 | vt 0.948091 0.524824 630 | vt 0.948286 0.632408 631 | vt 0.423509 0.729062 632 | vt 0.427660 0.729062 633 | vt 0.427660 0.942897 634 | vt 0.423509 0.942897 635 | vt 0.435724 0.729062 636 | vt 0.435724 0.942897 637 | vt 0.443000 0.729062 638 | vt 0.443000 0.942897 639 | vt 0.444539 0.729062 640 | vt 0.452896 0.729062 641 | vt 0.452896 0.942897 642 | vt 0.444539 0.942897 643 | vt 0.460072 0.729062 644 | vt 0.460072 0.942897 645 | vt 0.488774 0.942897 646 | vt 0.480484 0.942897 647 | vt 0.480484 0.729062 648 | vt 0.488774 0.729062 649 | vt 0.472916 0.942897 650 | vt 0.472916 0.729062 651 | vt 0.461643 0.729062 652 | vt 0.471606 0.729062 653 | vt 0.471606 0.942897 654 | vt 0.461643 0.942897 655 | vt 0.490020 0.743790 656 | vt 0.490475 0.733826 657 | vt 0.498043 0.729062 658 | vt 0.506334 0.730327 659 | vt 0.510675 0.737503 660 | vt 0.509510 0.745860 661 | vt 0.502235 0.750134 662 | vt 0.494171 0.748530 663 | vt 0.512177 0.735407 664 | vt 0.516328 0.730666 665 | vt 0.524392 0.729062 666 | vt 0.531667 0.733337 667 | vt 0.532832 0.741694 668 | vt 0.528491 0.748869 669 | vt 0.520200 0.750134 670 | vt 0.512632 0.745370 671 | vt 0.666231 0.368129 672 | vt 0.690919 0.346629 673 | vt 0.648795 0.346431 674 | vt 0.649077 0.368111 675 | vt 0.618806 0.368086 676 | vt 0.618797 0.346315 677 | vt 0.580293 0.346086 678 | vt 0.605529 0.368064 679 | vt 0.635917 0.394530 680 | vt 0.666231 0.368129 681 | vt 0.649077 0.368111 682 | vt 0.618806 0.368086 683 | vt 0.605529 0.368064 684 | vt 0.612639 0.172032 685 | vt 0.612270 0.257386 686 | vt 0.612270 0.257386 687 | vt 0.612639 0.172032 688 | vt 0.658696 0.172032 689 | vt 0.612639 0.172032 690 | vt 0.612639 0.172032 691 | vt 0.658696 0.172032 692 | vt 0.658695 0.257413 693 | vt 0.658696 0.172032 694 | vt 0.658696 0.172032 695 | vt 0.658695 0.257413 696 | vt 0.612270 0.257386 697 | vt 0.658695 0.257413 698 | vt 0.658695 0.257413 699 | vt 0.612270 0.257386 700 | vt 0.524669 0.257336 701 | vt 0.612270 0.257386 702 | vt 0.612639 0.172032 703 | vt 0.524669 0.172032 704 | vt 0.524669 0.190256 705 | vt 0.524669 0.297643 706 | vt 0.747166 0.297643 707 | vt 0.747166 0.257464 708 | vt 0.658695 0.257413 709 | vt 0.612270 0.257386 710 | vt 0.524669 0.257336 711 | vt 0.658695 0.257413 712 | vt 0.747166 0.257464 713 | vt 0.747166 0.190253 714 | vt 0.747166 0.172032 715 | vt 0.658696 0.172032 716 | vt 0.690919 0.346629 717 | vt 0.747166 0.297643 718 | vt 0.524669 0.297643 719 | vt 0.580293 0.346086 720 | vt 0.618797 0.346315 721 | vt 0.648795 0.346431 722 | vt 0.649077 0.368111 723 | vt 0.648795 0.346431 724 | vt 0.618797 0.346315 725 | vt 0.618806 0.368086 726 | vt 0.867823 0.390611 727 | vt 0.837739 0.365995 728 | vt 0.850673 0.365980 729 | vt 0.880638 0.365944 730 | vt 0.897995 0.365923 731 | vt 0.979072 0.299583 732 | vt 0.756574 0.299583 733 | vt 0.756574 0.262135 734 | vt 0.893601 0.262137 735 | vt 0.946221 0.262137 736 | vt 0.979072 0.262138 737 | vt 0.979072 0.262138 738 | vt 0.946221 0.262137 739 | vt 0.946729 0.168113 740 | vt 0.979072 0.168113 741 | vt 0.979072 0.198308 742 | vt 0.893601 0.262137 743 | vt 0.756574 0.262135 744 | vt 0.756574 0.198296 745 | vt 0.756574 0.168113 746 | vt 0.893372 0.168113 747 | vt 0.946221 0.262137 748 | vt 0.893601 0.262137 749 | vt 0.893601 0.262137 750 | vt 0.946221 0.262137 751 | vt 0.893601 0.262137 752 | vt 0.893372 0.168113 753 | vt 0.893372 0.168113 754 | vt 0.893601 0.262137 755 | vt 0.946729 0.168113 756 | vt 0.946221 0.262137 757 | vt 0.946221 0.262137 758 | vt 0.946729 0.168113 759 | vt 0.880638 0.365944 760 | vt 0.880809 0.347018 761 | vt 0.921072 0.347041 762 | vt 0.897995 0.365923 763 | vt 0.814501 0.346981 764 | vt 0.756574 0.299583 765 | vt 0.979072 0.299583 766 | vt 0.921072 0.347041 767 | vt 0.880809 0.347018 768 | vt 0.850500 0.347001 769 | vt 0.837739 0.365995 770 | vt 0.814501 0.346981 771 | vt 0.850500 0.347001 772 | vt 0.850673 0.365980 773 | vt 0.893372 0.168113 774 | vt 0.946729 0.168113 775 | vt 0.946729 0.173912 776 | vt 0.893372 0.173912 777 | vt 0.893372 0.168113 778 | vt 0.946729 0.168113 779 | vt 0.946729 0.168113 780 | vt 0.893372 0.168113 781 | vt 0.946729 0.168113 782 | vt 0.946729 0.173912 783 | vt 0.946729 0.173912 784 | vt 0.946729 0.168113 785 | vt 0.946729 0.173912 786 | vt 0.893372 0.173912 787 | vt 0.893372 0.173912 788 | vt 0.946729 0.173912 789 | vt 0.893372 0.173912 790 | vt 0.893372 0.168113 791 | vt 0.893372 0.168113 792 | vt 0.893372 0.173912 793 | vt 0.850141 0.365980 794 | vt 0.849968 0.347001 795 | vt 0.880278 0.347018 796 | vt 0.880106 0.365944 797 | vt 0.333012 0.286816 798 | vt 0.267217 0.286922 799 | vt 0.267217 0.206526 800 | vt 0.332754 0.206658 801 | vt 0.503187 0.334087 802 | vt 0.267217 0.334087 803 | vt 0.267217 0.286922 804 | vt 0.333012 0.286816 805 | vt 0.359440 0.286773 806 | vt 0.412038 0.286687 807 | vt 0.438724 0.286644 808 | vt 0.503187 0.286539 809 | vt 0.503187 0.207003 810 | vt 0.438465 0.206872 811 | vt 0.411781 0.206818 812 | vt 0.359183 0.206712 813 | vt 0.332754 0.206658 814 | vt 0.267217 0.206526 815 | vt 0.267217 0.168494 816 | vt 0.503187 0.168494 817 | vt 0.503187 0.185441 818 | vt 0.503187 0.286539 819 | vt 0.438724 0.286644 820 | vt 0.438465 0.206872 821 | vt 0.503187 0.207003 822 | vt 0.412038 0.286687 823 | vt 0.359440 0.286773 824 | vt 0.359183 0.206712 825 | vt 0.411781 0.206818 826 | vt 0.438724 0.286644 827 | vt 0.412038 0.286687 828 | vt 0.412038 0.286687 829 | vt 0.438724 0.286644 830 | vt 0.412038 0.286687 831 | vt 0.411781 0.206818 832 | vt 0.411781 0.206818 833 | vt 0.412038 0.286687 834 | vt 0.411781 0.206818 835 | vt 0.438465 0.206872 836 | vt 0.438465 0.206872 837 | vt 0.411781 0.206818 838 | vt 0.438465 0.206872 839 | vt 0.438724 0.286644 840 | vt 0.438724 0.286644 841 | vt 0.438465 0.206872 842 | vt 0.359440 0.286773 843 | vt 0.333012 0.286816 844 | vt 0.333012 0.286816 845 | vt 0.359440 0.286773 846 | vt 0.333012 0.286816 847 | vt 0.332754 0.206658 848 | vt 0.332754 0.206658 849 | vt 0.333012 0.286816 850 | vt 0.332754 0.206658 851 | vt 0.359183 0.206712 852 | vt 0.359183 0.206712 853 | vt 0.332754 0.206658 854 | vt 0.359183 0.206712 855 | vt 0.359440 0.286773 856 | vt 0.359440 0.286773 857 | vt 0.359183 0.206712 858 | vt 0.438724 0.286644 859 | vt 0.412038 0.286687 860 | vt 0.411781 0.206818 861 | vt 0.438465 0.206872 862 | vt 0.359440 0.286773 863 | vt 0.333012 0.286816 864 | vt 0.332754 0.206658 865 | vt 0.359183 0.206712 866 | vt 0.014362 0.335299 867 | vt 0.250332 0.335299 868 | vt 0.250332 0.287600 869 | vt 0.185919 0.287745 870 | vt 0.159113 0.287805 871 | vt 0.106553 0.287923 872 | vt 0.080146 0.287983 873 | vt 0.014362 0.288131 874 | vt 0.014362 0.207723 875 | vt 0.080147 0.207861 876 | vt 0.106552 0.207916 877 | vt 0.158852 0.208026 878 | vt 0.185655 0.208082 879 | vt 0.250332 0.208218 880 | vt 0.250332 0.186653 881 | vt 0.250332 0.169706 882 | vt 0.014362 0.169706 883 | vt 0.185919 0.287745 884 | vt 0.250332 0.287600 885 | vt 0.250332 0.208218 886 | vt 0.185655 0.208082 887 | vt 0.014362 0.288131 888 | vt 0.080146 0.287983 889 | vt 0.080147 0.207861 890 | vt 0.014362 0.207723 891 | vt 0.106553 0.287923 892 | vt 0.159113 0.287805 893 | vt 0.158852 0.208026 894 | vt 0.106552 0.207916 895 | vt 0.080146 0.287983 896 | vt 0.106553 0.287923 897 | vt 0.106553 0.287923 898 | vt 0.080146 0.287983 899 | vt 0.106552 0.287923 900 | vt 0.106552 0.207916 901 | vt 0.106552 0.207916 902 | vt 0.106552 0.287923 903 | vt 0.106552 0.207916 904 | vt 0.080147 0.207861 905 | vt 0.080147 0.207861 906 | vt 0.106552 0.207916 907 | vt 0.080147 0.207861 908 | vt 0.080146 0.287983 909 | vt 0.080146 0.287983 910 | vt 0.080147 0.207861 911 | vt 0.159113 0.287805 912 | vt 0.185919 0.287745 913 | vt 0.185919 0.287745 914 | vt 0.159113 0.287805 915 | vt 0.185919 0.287745 916 | vt 0.185655 0.208082 917 | vt 0.185655 0.208082 918 | vt 0.185919 0.287745 919 | vt 0.185655 0.208082 920 | vt 0.158852 0.208026 921 | vt 0.158852 0.208026 922 | vt 0.185655 0.208082 923 | vt 0.158852 0.208026 924 | vt 0.159113 0.287805 925 | vt 0.159113 0.287805 926 | vt 0.158852 0.208026 927 | vt 0.080146 0.287983 928 | vt 0.106553 0.287923 929 | vt 0.106552 0.207916 930 | vt 0.080147 0.207861 931 | vt 0.159113 0.287805 932 | vt 0.185919 0.287745 933 | vt 0.185655 0.208082 934 | vt 0.158852 0.208026 935 | vn 0.000001 -0.000000 -1.000000 936 | vn 0.000001 -0.000000 -1.000000 937 | vn 0.000001 -0.000000 -1.000000 938 | vn 0.000001 -0.000000 -1.000000 939 | vn 0.000000 -0.275643 0.961260 940 | vn 0.000000 -0.275643 0.961260 941 | vn 0.000000 -0.607091 0.794632 942 | vn 0.000000 -0.607091 0.794632 943 | vn 0.000000 -0.607086 0.794636 944 | vn 0.000000 -0.607086 0.794636 945 | vn 0.000000 -0.275643 0.961260 946 | vn 0.000000 -0.275643 0.961260 947 | vn 0.000000 0.961262 0.275638 948 | vn 0.000000 0.961262 0.275638 949 | vn 0.000000 0.961262 0.275638 950 | vn 0.000000 0.961262 0.275638 951 | vn 0.000000 0.961262 0.275638 952 | vn 0.000000 0.961262 0.275638 953 | vn 0.000000 0.961262 0.275638 954 | vn 0.000000 0.961262 0.275638 955 | vn 0.000000 -0.993085 0.117394 956 | vn 0.000000 -0.993085 0.117394 957 | vn 0.000000 -0.993085 0.117394 958 | vn 0.000000 -0.993085 0.117394 959 | vn -1.000000 0.000000 0.000000 960 | vn -1.000000 0.000000 0.000000 961 | vn -1.000000 0.000000 0.000000 962 | vn -1.000000 0.000000 0.000000 963 | vn -1.000000 0.000000 0.000000 964 | vn -1.000000 0.000000 0.000000 965 | vn 0.000000 -0.961262 -0.275637 966 | vn 0.000000 -0.961262 -0.275637 967 | vn 0.000000 -0.961262 -0.275637 968 | vn 0.000000 -0.961262 -0.275637 969 | vn 0.000000 -0.993086 0.117394 970 | vn 0.000000 -0.993086 0.117394 971 | vn 0.000000 -0.993086 0.117394 972 | vn 0.000000 -0.993086 0.117394 973 | vn 0.000000 -0.001120 -0.999999 974 | vn 0.000000 -0.001120 -0.999999 975 | vn 0.000000 -0.001120 -0.999999 976 | vn 0.000000 -0.001120 -0.999999 977 | vn 0.000000 -0.001120 -0.999999 978 | vn 1.000000 -0.000000 0.000000 979 | vn 1.000000 -0.000000 0.000000 980 | vn 1.000000 -0.000000 0.000000 981 | vn 1.000000 -0.000000 0.000000 982 | vn 0.000000 -0.854990 0.518645 983 | vn 0.000000 -0.854990 0.518645 984 | vn -1.000000 0.000001 -0.000000 985 | vn -1.000000 0.000001 -0.000000 986 | vn -1.000000 0.000001 -0.000000 987 | vn -1.000000 0.000001 -0.000000 988 | vn 1.000000 -0.000001 0.000000 989 | vn 1.000000 -0.000001 0.000000 990 | vn 1.000000 -0.000001 0.000000 991 | vn 1.000000 -0.000001 0.000000 992 | vn 1.000000 -0.000001 0.000000 993 | vn 1.000000 -0.000001 0.000000 994 | vn 0.000000 -0.854983 0.518655 995 | vn 0.000000 -0.854983 0.518655 996 | vn 0.000000 0.275643 -0.961260 997 | vn 0.000000 0.275643 -0.961260 998 | vn 0.000000 0.275643 -0.961260 999 | vn 0.000000 0.275643 -0.961260 1000 | vn 0.000000 0.275643 -0.961260 1001 | vn 0.000000 0.275643 -0.961260 1002 | vn 0.000000 -0.001116 -0.999999 1003 | vn 0.000000 -0.001116 -0.999999 1004 | vn 0.000000 -0.001116 -0.999999 1005 | vn 0.000000 -0.001116 -0.999999 1006 | vn 0.000000 -0.001116 -0.999999 1007 | vn -0.000001 0.000000 1.000000 1008 | vn -0.000001 0.000000 1.000000 1009 | vn -0.000001 0.000000 1.000000 1010 | vn -0.000001 0.000000 1.000000 1011 | vn 0.000000 0.000000 -1.000000 1012 | vn 0.000000 0.000000 -1.000000 1013 | vn 0.000000 0.000000 -1.000000 1014 | vn 0.000000 0.000000 -1.000000 1015 | vn 0.000000 0.000000 -1.000000 1016 | vn -0.000000 1.000000 -0.000000 1017 | vn -0.000000 1.000000 -0.000000 1018 | vn -0.000000 1.000000 -0.000000 1019 | vn -0.000000 1.000000 -0.000000 1020 | vn -0.000000 1.000000 -0.000000 1021 | vn -0.000000 1.000000 -0.000000 1022 | vn -0.000000 1.000000 -0.000000 1023 | vn -0.000000 1.000000 -0.000000 1024 | vn 1.000000 0.000000 0.000000 1025 | vn 1.000000 0.000000 0.000000 1026 | vn 1.000000 0.000000 0.000000 1027 | vn 1.000000 0.000000 0.000000 1028 | vn 0.000000 -1.000000 0.000000 1029 | vn 0.000000 -1.000000 0.000000 1030 | vn 0.000000 -1.000000 0.000000 1031 | vn 0.000000 -1.000000 0.000000 1032 | vn 0.000000 -1.000000 0.000000 1033 | vn 0.000000 -1.000000 0.000000 1034 | vn -0.707107 0.000000 0.707107 1035 | vn -0.707107 0.000000 0.707107 1036 | vn -1.000000 0.000000 0.000000 1037 | vn -1.000000 0.000000 0.000000 1038 | vn 0.000000 -1.000000 -0.000000 1039 | vn 0.000000 -1.000000 -0.000000 1040 | vn 0.000000 -1.000000 -0.000000 1041 | vn 0.000000 -1.000000 -0.000000 1042 | vn 0.000000 -1.000000 -0.000000 1043 | vn 0.000000 -1.000000 -0.000000 1044 | vn 0.000000 0.000000 1.000000 1045 | vn 0.000000 0.000000 1.000000 1046 | vn 0.000000 0.000000 -1.000000 1047 | vn 0.000000 0.000000 -1.000000 1048 | vn 0.000000 0.000000 -1.000000 1049 | vn 0.000000 0.000000 -1.000000 1050 | vn 0.000000 0.000000 -1.000000 1051 | vn 0.000000 0.000000 -1.000000 1052 | vn 0.000000 0.000000 -1.000000 1053 | vn 0.000000 0.000000 -1.000000 1054 | vn 0.000000 0.000000 -1.000000 1055 | vn 0.000000 0.000000 -1.000000 1056 | vn 0.000000 0.000000 -1.000000 1057 | vn 0.000000 0.000000 -1.000000 1058 | vn 0.000000 0.000000 -1.000000 1059 | vn 0.000000 1.000000 0.000000 1060 | vn 0.000000 1.000000 0.000000 1061 | vn 0.000000 1.000000 0.000000 1062 | vn 0.000000 1.000000 0.000000 1063 | vn 1.000000 0.000723 0.000000 1064 | vn 1.000000 0.000723 0.000000 1065 | vn 1.000000 0.000723 0.000000 1066 | vn 1.000000 0.000723 0.000000 1067 | vn 0.000000 -1.000000 0.000000 1068 | vn 0.000000 -1.000000 0.000000 1069 | vn -0.999980 0.006393 0.000000 1070 | vn -0.999980 0.006393 0.000000 1071 | vn -0.999980 0.006393 0.000000 1072 | vn -0.999980 0.006393 0.000000 1073 | vn 0.000000 1.000000 0.000000 1074 | vn 0.000000 1.000000 0.000000 1075 | vn 1.000000 0.000723 0.000000 1076 | vn 1.000000 0.000723 0.000000 1077 | vn 1.000000 0.000723 0.000000 1078 | vn 1.000000 0.000723 0.000000 1079 | vn 0.000000 -1.000000 0.000000 1080 | vn 0.000000 -1.000000 0.000000 1081 | vn 0.000000 -1.000000 0.000000 1082 | vn 0.000000 -1.000000 0.000000 1083 | vn -0.999980 0.006394 0.000000 1084 | vn -0.999980 0.006394 0.000000 1085 | vn -0.999980 0.006394 0.000000 1086 | vn -0.999980 0.006394 0.000000 1087 | vn -0.663122 0.748511 -0.000031 1088 | vn -0.663122 0.748511 -0.000031 1089 | vn -0.663122 0.748511 -0.000031 1090 | vn -0.663122 0.748511 -0.000031 1091 | vn -0.663122 0.748511 -0.000031 1092 | vn -0.552697 -0.833382 0.000017 1093 | vn -0.552697 -0.833382 0.000017 1094 | vn -0.552697 -0.833382 0.000017 1095 | vn -0.552697 -0.833382 0.000017 1096 | vn 0.657205 0.753712 0.000070 1097 | vn 0.657205 0.753712 0.000070 1098 | vn 0.657205 0.753712 0.000070 1099 | vn 0.657205 0.753712 0.000070 1100 | vn 0.657205 0.753712 0.000070 1101 | vn -0.000001 0.000000 -1.000000 1102 | vn -0.000001 0.000000 -1.000000 1103 | vn -0.000001 0.000000 -1.000000 1104 | vn -0.000001 0.000000 -1.000000 1105 | vn -0.000001 0.000000 -1.000000 1106 | vn 0.000000 0.000000 1.000000 1107 | vn 0.000000 0.000000 1.000000 1108 | vn 0.000000 0.000000 1.000000 1109 | vn 0.000000 0.000000 1.000000 1110 | vn 0.000000 0.000000 1.000000 1111 | vn 0.000000 0.000000 1.000000 1112 | vn 0.000000 0.000000 1.000000 1113 | vn 0.000000 0.000000 1.000000 1114 | vn 0.000000 0.000000 1.000000 1115 | vn 0.000000 0.000000 -1.000000 1116 | vn 0.000000 0.000000 -1.000000 1117 | vn 0.000000 0.000000 -1.000000 1118 | vn 0.000000 0.000000 -1.000000 1119 | vn 0.621665 -0.783284 -0.000001 1120 | vn 0.621665 -0.783284 -0.000001 1121 | vn 0.621665 -0.783284 -0.000001 1122 | vn 0.621665 -0.783284 -0.000001 1123 | vn -0.659568 -0.751645 -0.000184 1124 | vn -0.659568 -0.751645 -0.000184 1125 | vn -0.659568 -0.751645 -0.000184 1126 | vn -0.659568 -0.751645 -0.000184 1127 | vn 0.664574 -0.747222 -0.000186 1128 | vn 0.664574 -0.747222 -0.000186 1129 | vn 0.664574 -0.747222 -0.000186 1130 | vn 0.664574 -0.747222 -0.000186 1131 | vn -0.943829 0.000000 0.330435 1132 | vn -0.500328 0.000000 0.865836 1133 | vn -0.500328 0.000000 0.865836 1134 | vn -0.943829 0.000000 0.330435 1135 | vn 0.166637 0.000000 0.986018 1136 | vn 0.166637 0.000000 0.986018 1137 | vn 0.831469 0.000000 0.555572 1138 | vn 0.831469 0.000000 0.555572 1139 | vn 0.979502 0.000000 -0.201434 1140 | vn 0.979502 0.000000 -0.201434 1141 | vn 0.555569 0.000000 -0.831470 1142 | vn 0.555569 0.000000 -0.831470 1143 | vn -0.203757 0.000000 -0.979022 1144 | vn -0.203757 0.000000 -0.979022 1145 | vn -0.864160 0.000000 -0.503218 1146 | vn -0.864160 0.000000 -0.503218 1147 | vn 0.000000 -1.000000 -0.000000 1148 | vn 0.000000 -1.000000 -0.000000 1149 | vn 0.000000 -1.000000 -0.000000 1150 | vn 0.000000 -1.000000 -0.000000 1151 | vn 0.000000 -1.000000 -0.000000 1152 | vn 0.000000 -1.000000 -0.000000 1153 | vn 0.000000 -1.000000 -0.000000 1154 | vn 0.000000 -1.000000 -0.000000 1155 | vn -0.000000 1.000000 0.000000 1156 | vn -0.000000 1.000000 0.000000 1157 | vn -0.000000 1.000000 0.000000 1158 | vn -0.000000 1.000000 0.000000 1159 | vn -0.000000 1.000000 0.000000 1160 | vn -0.000000 1.000000 0.000000 1161 | vn -0.000000 1.000000 0.000000 1162 | vn -0.000000 1.000000 0.000000 1163 | vn 0.000000 -0.124712 -0.992193 1164 | vn 0.000000 -0.124712 -0.992193 1165 | vn 0.000000 -0.124712 -0.992193 1166 | vn 0.000000 -0.124712 -0.992193 1167 | vn 0.000000 0.989395 -0.145253 1168 | vn 0.000000 0.989395 -0.145253 1169 | vn 0.000000 0.989395 -0.145253 1170 | vn 0.000000 0.989395 -0.145253 1171 | vn 0.000000 0.124712 0.992193 1172 | vn 0.000000 0.124712 0.992193 1173 | vn 0.000000 0.124712 0.992193 1174 | vn 0.000000 0.124712 0.992193 1175 | vn 0.000000 -0.989395 0.145253 1176 | vn 0.000000 -0.989395 0.145253 1177 | vn 0.000000 -0.989395 0.145253 1178 | vn 0.000000 -0.989395 0.145253 1179 | vn -1.000000 -0.000039 -0.000317 1180 | vn -1.000000 -0.000039 -0.000317 1181 | vn -1.000000 -0.000039 -0.000317 1182 | vn -1.000000 -0.000039 -0.000317 1183 | vn 1.000000 0.000041 0.000317 1184 | vn 1.000000 0.000041 0.000317 1185 | vn 1.000000 0.000041 0.000317 1186 | vn 1.000000 0.000041 0.000317 1187 | vn -0.943829 0.000000 0.330436 1188 | vn -0.500329 0.000000 0.865835 1189 | vn -0.500329 0.000000 0.865835 1190 | vn -0.943829 0.000000 0.330436 1191 | vn 0.166637 0.000000 0.986018 1192 | vn 0.166637 0.000000 0.986018 1193 | vn 0.831469 0.000000 0.555571 1194 | vn 0.831469 0.000000 0.555571 1195 | vn 0.979502 0.000000 -0.201434 1196 | vn 0.979502 0.000000 -0.201434 1197 | vn 0.555569 0.000000 -0.831470 1198 | vn 0.555569 0.000000 -0.831470 1199 | vn -0.203757 0.000000 -0.979021 1200 | vn -0.203757 0.000000 -0.979021 1201 | vn -0.864159 0.000000 -0.503218 1202 | vn -0.864159 0.000000 -0.503218 1203 | vn 0.000000 -1.000000 -0.000000 1204 | vn 0.000000 -1.000000 -0.000000 1205 | vn 0.000000 -1.000000 -0.000000 1206 | vn 0.000000 -1.000000 -0.000000 1207 | vn 0.000000 -1.000000 -0.000000 1208 | vn 0.000000 -1.000000 -0.000000 1209 | vn 0.000000 -1.000000 -0.000000 1210 | vn 0.000000 -1.000000 -0.000000 1211 | vn -0.000000 1.000000 0.000002 1212 | vn -0.000000 1.000000 0.000002 1213 | vn -0.000000 1.000000 0.000002 1214 | vn -0.000000 1.000000 0.000002 1215 | vn -0.000000 1.000000 0.000002 1216 | vn -0.000000 1.000000 0.000002 1217 | vn -0.000000 1.000000 0.000002 1218 | vn -0.000000 1.000000 0.000002 1219 | vn -0.000000 -0.000000 -1.000000 1220 | vn -0.000000 -0.000000 -1.000000 1221 | vn -0.000000 -0.000000 -1.000000 1222 | vn -0.000000 -0.000000 -1.000000 1223 | vn -0.000000 0.000000 -1.000000 1224 | vn -0.000000 0.000000 -1.000000 1225 | vn -0.000000 0.000000 -1.000000 1226 | vn -0.000000 0.000000 -1.000000 1227 | vn -0.000000 0.000000 -1.000000 1228 | vn -0.000000 0.000000 -1.000000 1229 | vn -0.000000 0.000000 -1.000000 1230 | vn -0.000000 0.000000 -1.000000 1231 | vn -0.000000 0.000000 -1.000000 1232 | vn 0.999991 0.004199 0.000000 1233 | vn 0.999991 0.004199 0.000000 1234 | vn 0.999991 0.004199 0.000000 1235 | vn 0.999991 0.004199 0.000000 1236 | vn 0.000000 1.000000 0.000000 1237 | vn 0.000000 1.000000 0.000000 1238 | vn 0.000000 1.000000 0.000000 1239 | vn 0.000000 1.000000 0.000000 1240 | vn -1.000000 -0.000004 0.000000 1241 | vn -1.000000 -0.000004 0.000000 1242 | vn -1.000000 -0.000004 0.000000 1243 | vn -1.000000 -0.000004 0.000000 1244 | vn 0.000592 -1.000000 0.000000 1245 | vn 0.000592 -1.000000 0.000000 1246 | vn 0.000592 -1.000000 0.000000 1247 | vn 0.000592 -1.000000 0.000000 1248 | vn 0.000000 0.000000 -1.000000 1249 | vn 0.000000 0.000000 -1.000000 1250 | vn 0.000000 0.000000 -1.000000 1251 | vn 0.000000 0.000000 -1.000000 1252 | vn 0.000000 0.000000 -1.000000 1253 | vn 0.000000 0.000000 -1.000000 1254 | vn 0.000000 0.000000 -1.000000 1255 | vn 0.000000 0.000000 -1.000000 1256 | vn 0.000000 0.000000 -1.000000 1257 | vn 0.000000 0.000000 -1.000000 1258 | vn 0.000000 0.000000 -1.000000 1259 | vn 0.000000 0.000000 -1.000000 1260 | vn 0.000000 0.000000 -1.000000 1261 | vn 0.000000 0.000000 -1.000000 1262 | vn 0.000000 0.000000 -1.000000 1263 | vn 0.000000 0.000000 -1.000000 1264 | vn 0.000000 0.000000 -1.000000 1265 | vn 0.000000 0.000000 -1.000000 1266 | vn 0.000000 0.000000 -1.000000 1267 | vn 0.000000 0.000000 -1.000000 1268 | vn 0.000000 0.000000 -1.000000 1269 | vn 0.000000 0.000000 -1.000000 1270 | vn -0.000000 0.000000 -1.000000 1271 | vn -0.000000 0.000000 -1.000000 1272 | vn -0.000000 0.000000 -1.000000 1273 | vn -0.000000 0.000000 -1.000000 1274 | vn 0.000001 0.000000 1.000000 1275 | vn 0.000001 0.000000 1.000000 1276 | vn 0.000001 0.000000 1.000000 1277 | vn 0.000001 0.000000 1.000000 1278 | vn 0.000001 0.000000 1.000000 1279 | vn 0.000000 0.000000 1.000000 1280 | vn 0.000000 0.000000 1.000000 1281 | vn 0.000000 0.000000 1.000000 1282 | vn 0.000000 0.000000 1.000000 1283 | vn 0.000000 0.000000 1.000000 1284 | vn 0.000000 0.000000 1.000000 1285 | vn 0.000001 0.000000 1.000000 1286 | vn 0.000001 0.000000 1.000000 1287 | vn 0.000001 0.000000 1.000000 1288 | vn 0.000001 0.000000 1.000000 1289 | vn 0.000001 0.000000 1.000000 1290 | vn 0.000000 -0.000000 1.000000 1291 | vn 0.000000 -0.000000 1.000000 1292 | vn 0.000000 -0.000000 1.000000 1293 | vn 0.000000 -0.000000 1.000000 1294 | vn 0.000000 -0.000000 1.000000 1295 | vn 0.000014 -1.000000 0.000000 1296 | vn 0.000014 -1.000000 0.000000 1297 | vn 0.000014 -1.000000 0.000000 1298 | vn 0.000014 -1.000000 0.000000 1299 | vn 0.999998 -0.002228 0.000000 1300 | vn 0.999998 -0.002228 0.000000 1301 | vn 0.999998 -0.002228 0.000000 1302 | vn 0.999998 -0.002228 0.000000 1303 | vn -0.999988 -0.004935 0.000000 1304 | vn -0.999988 -0.004935 0.000000 1305 | vn -0.999988 -0.004935 0.000000 1306 | vn -0.999988 -0.004935 0.000000 1307 | vn -0.000000 -0.000000 1.000000 1308 | vn -0.000000 -0.000000 1.000000 1309 | vn -0.000000 -0.000000 1.000000 1310 | vn -0.000000 -0.000000 1.000000 1311 | vn -0.000000 0.000000 1.000000 1312 | vn -0.000000 0.000000 1.000000 1313 | vn -0.000000 0.000000 1.000000 1314 | vn -0.000000 0.000000 1.000000 1315 | vn -0.000000 0.000000 1.000000 1316 | vn -0.000000 0.000000 1.000000 1317 | vn -0.000000 0.000000 1.000000 1318 | vn -0.000000 0.000000 1.000000 1319 | vn -0.000000 0.000000 1.000000 1320 | vn -0.000000 0.000000 1.000000 1321 | vn 0.000000 0.000000 1.000000 1322 | vn 0.000000 0.000000 1.000000 1323 | vn 0.000000 0.000000 1.000000 1324 | vn 0.000000 0.000000 1.000000 1325 | vn -0.000000 -1.000000 -0.000000 1326 | vn -0.000000 -1.000000 -0.000000 1327 | vn -0.000000 -1.000000 -0.000000 1328 | vn -0.000000 -1.000000 -0.000000 1329 | vn 1.000000 0.000000 0.000000 1330 | vn 1.000000 0.000000 0.000000 1331 | vn 1.000000 0.000000 0.000000 1332 | vn 1.000000 0.000000 0.000000 1333 | vn 0.000000 1.000000 0.000000 1334 | vn 0.000000 1.000000 0.000000 1335 | vn 0.000000 1.000000 0.000000 1336 | vn 0.000000 1.000000 0.000000 1337 | vn -1.000000 0.000000 0.000000 1338 | vn -1.000000 0.000000 0.000000 1339 | vn -1.000000 0.000000 0.000000 1340 | vn -1.000000 0.000000 0.000000 1341 | vn 0.000000 0.000000 1.000000 1342 | vn 0.000000 0.000000 1.000000 1343 | vn 0.000000 0.000000 1.000000 1344 | vn 0.000000 0.000000 1.000000 1345 | vn 1.000000 -0.000000 -0.000000 1346 | vn 1.000000 -0.000000 -0.000000 1347 | vn 1.000000 -0.000000 -0.000000 1348 | vn 1.000000 -0.000000 -0.000000 1349 | vn 1.000000 -0.000000 -0.000000 1350 | vn 1.000000 -0.000000 -0.000000 1351 | vn 1.000000 -0.000000 -0.000000 1352 | vn 1.000000 -0.000000 -0.000000 1353 | vn 1.000000 -0.000000 -0.000000 1354 | vn 1.000000 -0.000000 -0.000000 1355 | vn 1.000000 -0.000000 -0.000000 1356 | vn 1.000000 -0.000000 -0.000000 1357 | vn 1.000000 0.000001 0.000000 1358 | vn 1.000000 0.000001 0.000000 1359 | vn 1.000000 0.000001 0.000000 1360 | vn 1.000000 0.000001 0.000000 1361 | vn 1.000000 0.000001 0.000000 1362 | vn 1.000000 0.000001 0.000000 1363 | vn 1.000000 0.000001 0.000000 1364 | vn 1.000000 0.000001 0.000000 1365 | vn 1.000000 0.000001 0.000000 1366 | vn 1.000000 -0.000000 -0.000000 1367 | vn 1.000000 -0.000000 -0.000000 1368 | vn 1.000000 -0.000000 -0.000000 1369 | vn 1.000000 -0.000000 -0.000000 1370 | vn 1.000000 -0.000000 -0.000000 1371 | vn 1.000000 -0.000000 -0.000000 1372 | vn 1.000000 -0.000000 -0.000000 1373 | vn 1.000000 -0.000000 -0.000000 1374 | vn 0.000000 -1.000000 0.000804 1375 | vn 0.000000 -1.000000 0.000804 1376 | vn 0.000000 -1.000000 0.000804 1377 | vn 0.000000 -1.000000 0.000804 1378 | vn 0.000000 -0.006510 -0.999979 1379 | vn 0.000000 -0.006510 -0.999979 1380 | vn 0.000000 -0.006510 -0.999979 1381 | vn 0.000000 -0.006510 -0.999979 1382 | vn 0.000001 1.000000 0.001000 1383 | vn 0.000001 1.000000 0.001000 1384 | vn 0.000001 1.000000 0.001000 1385 | vn 0.000001 1.000000 0.001000 1386 | vn -0.000000 0.006560 0.999979 1387 | vn -0.000000 0.006560 0.999979 1388 | vn -0.000000 0.006560 0.999979 1389 | vn -0.000000 0.006560 0.999979 1390 | vn 0.000000 -1.000000 0.000803 1391 | vn 0.000000 -1.000000 0.000803 1392 | vn 0.000000 -1.000000 0.000803 1393 | vn 0.000000 -1.000000 0.000803 1394 | vn 0.000000 -0.006518 -0.999979 1395 | vn 0.000000 -0.006518 -0.999979 1396 | vn 0.000000 -0.006518 -0.999979 1397 | vn 0.000000 -0.006518 -0.999979 1398 | vn 0.000000 1.000000 0.001000 1399 | vn 0.000000 1.000000 0.001000 1400 | vn 0.000000 1.000000 0.001000 1401 | vn 0.000000 1.000000 0.001000 1402 | vn 0.000000 0.006490 0.999979 1403 | vn 0.000000 0.006490 0.999979 1404 | vn 0.000000 0.006490 0.999979 1405 | vn 0.000000 0.006490 0.999979 1406 | vn 1.000000 -0.000000 0.000000 1407 | vn 1.000000 -0.000000 0.000000 1408 | vn 1.000000 -0.000000 0.000000 1409 | vn 1.000000 -0.000000 0.000000 1410 | vn 1.000000 -0.000000 0.000000 1411 | vn 1.000000 -0.000000 0.000000 1412 | vn 1.000000 -0.000000 0.000000 1413 | vn 1.000000 -0.000000 0.000000 1414 | vn -1.000000 0.000000 0.000000 1415 | vn -1.000000 0.000000 0.000000 1416 | vn -1.000000 0.000000 0.000000 1417 | vn -1.000000 0.000000 0.000000 1418 | vn -1.000000 0.000000 0.000000 1419 | vn -1.000000 0.000000 0.000000 1420 | vn -1.000000 0.000000 0.000000 1421 | vn -1.000000 0.000000 0.000000 1422 | vn -1.000000 0.000000 0.000000 1423 | vn -1.000000 0.000000 0.000000 1424 | vn -1.000000 0.000000 0.000000 1425 | vn -1.000000 0.000000 0.000000 1426 | vn -1.000000 0.000000 0.000000 1427 | vn -1.000000 0.000000 0.000000 1428 | vn -1.000000 0.000000 0.000000 1429 | vn -1.000000 0.000000 0.000000 1430 | vn -1.000000 0.000000 0.000000 1431 | vn -1.000000 -0.000000 0.000000 1432 | vn -1.000000 -0.000000 0.000000 1433 | vn -1.000000 -0.000000 0.000000 1434 | vn -1.000000 -0.000000 0.000000 1435 | vn -1.000000 -0.000000 0.000000 1436 | vn -1.000000 -0.000000 0.000000 1437 | vn -1.000000 -0.000000 0.000000 1438 | vn -1.000000 -0.000000 0.000000 1439 | vn -1.000000 -0.000000 -0.000000 1440 | vn -1.000000 -0.000000 -0.000000 1441 | vn -1.000000 -0.000000 -0.000000 1442 | vn -1.000000 -0.000000 -0.000000 1443 | vn 0.000001 -0.999999 0.001114 1444 | vn 0.000001 -0.999999 0.001114 1445 | vn 0.000001 -0.999999 0.001114 1446 | vn 0.000001 -0.999999 0.001114 1447 | vn 0.000000 0.000027 1.000000 1448 | vn 0.000000 0.000027 1.000000 1449 | vn 0.000000 0.000027 1.000000 1450 | vn 0.000000 0.000027 1.000000 1451 | vn 0.000000 0.999999 0.001039 1452 | vn 0.000000 0.999999 0.001039 1453 | vn 0.000000 0.999999 0.001039 1454 | vn 0.000000 0.999999 0.001039 1455 | vn 0.000000 0.000021 -1.000000 1456 | vn 0.000000 0.000021 -1.000000 1457 | vn 0.000000 0.000021 -1.000000 1458 | vn 0.000000 0.000021 -1.000000 1459 | vn 0.000003 -0.999999 0.001113 1460 | vn 0.000003 -0.999999 0.001113 1461 | vn 0.000003 -0.999999 0.001113 1462 | vn 0.000003 -0.999999 0.001113 1463 | vn 0.000000 0.006691 0.999978 1464 | vn 0.000000 0.006691 0.999978 1465 | vn 0.000000 0.006691 0.999978 1466 | vn 0.000000 0.006691 0.999978 1467 | vn 0.000001 0.999999 0.001039 1468 | vn 0.000001 0.999999 0.001039 1469 | vn 0.000001 0.999999 0.001039 1470 | vn 0.000001 0.999999 0.001039 1471 | vn 0.000001 -0.006624 -0.999978 1472 | vn 0.000001 -0.006624 -0.999978 1473 | vn 0.000001 -0.006624 -0.999978 1474 | vn 0.000001 -0.006624 -0.999978 1475 | vn -1.000000 0.000000 0.000000 1476 | vn -1.000000 0.000000 0.000000 1477 | vn -1.000000 0.000000 0.000000 1478 | vn -1.000000 0.000000 0.000000 1479 | vn -1.000000 0.000000 0.000000 1480 | vn -1.000000 0.000000 0.000000 1481 | vn -1.000000 0.000000 0.000000 1482 | vn -1.000000 0.000000 0.000000 1483 | s off 1484 | g polySurface73 1485 | usemtl lambert13SG 1486 | f 1/1/1 2/2/2 3/3/3 4/4/4 1487 | s 1 1488 | f 14/5/5 7/6/6 5/7/7 13/8/8 17/9/9 6/10/10 8/11/11 18/12/12 1489 | s off 1490 | f 15/13/13 9/14/14 7/15/15 14/16/16 18/17/17 8/18/18 10/19/19 19/20/20 1491 | f 21/21/21 22/22/22 23/23/23 24/24/24 1492 | f 5/25/25 7/26/26 9/27/27 11/28/28 21/29/29 24/30/30 1493 | f 13/31/31 16/32/32 20/33/33 17/34/34 1494 | f 26/35/35 25/36/36 27/37/37 28/38/38 1495 | f 20/39/39 10/40/40 12/41/41 27/42/42 25/43/43 1496 | f 16/44/44 13/45/45 23/46/46 22/47/47 1497 | s 1 1498 | f 13/8/8 5/7/7 24/48/48 23/49/49 1499 | s off 1500 | f 17/50/50 20/51/51 25/52/52 26/53/53 1501 | f 6/54/54 28/55/55 27/56/56 12/57/57 10/58/58 8/59/59 1502 | s 1 1503 | f 6/10/10 17/9/9 26/60/60 28/61/61 1504 | s off 1505 | f 16/62/62 9/63/63 15/64/64 19/65/65 10/40/66 20/39/67 1506 | f 16/62/68 22/66/69 21/67/70 11/68/71 9/63/72 1507 | f 29/69/73 30/70/74 31/71/75 32/72/76 1508 | f 40/73/77 49/74/78 51/75/79 50/76/80 42/77/81 1509 | s 14 1510 | f 38/78/82 43/79/83 44/80/84 37/81/85 39/82/86 47/83/87 49/84/88 40/85/89 1511 | s off 1512 | f 37/86/90 36/87/91 41/88/92 39/89/93 1513 | f 35/90/94 36/91/95 33/92/96 46/93/97 45/94/98 34/95/99 1514 | s 17 1515 | f 35/96/100 38/97/101 40/98/102 42/99/103 1516 | s 18 1517 | f 35/100/104 42/101/105 50/102/106 48/103/107 41/104/108 36/105/109 1518 | s 17 1519 | f 35/106/100 36/107/110 37/108/111 38/109/101 1520 | s off 1521 | f 47/110/112 39/111/113 41/112/114 48/113/115 52/114/116 1522 | f 53/115/117 54/116/118 55/117/119 56/118/120 1523 | f 58/119/121 57/120/122 59/121/123 60/122/124 1524 | f 51/123/125 52/124/126 54/125/127 53/126/128 1525 | f 52/127/129 48/128/130 55/129/131 54/130/132 1526 | s 18 1527 | f 48/103/107 50/102/106 56/131/133 55/132/134 1528 | s off 1529 | f 50/133/135 51/134/136 53/135/137 56/136/138 1530 | s 14 1531 | f 49/84/88 47/83/87 57/137/139 58/138/140 1532 | s off 1533 | f 47/139/141 52/140/142 59/141/143 57/142/144 1534 | f 52/143/145 51/144/146 60/145/147 59/146/148 1535 | f 51/147/149 49/148/150 58/149/151 60/150/152 1536 | f 61/151/153 72/152/154 62/153/155 65/154/156 64/155/157 1537 | f 62/153/158 74/156/159 67/157/160 65/154/161 1538 | f 63/158/162 61/159/163 64/160/164 68/161/165 66/162/166 1539 | f 61/163/167 63/164/168 71/165/169 73/166/170 72/167/171 1540 | f 64/168/172 65/169/173 67/170/174 69/171/175 68/172/176 1541 | f 68/172/177 69/171/178 70/173/179 66/174/180 1542 | f 72/167/181 73/166/182 74/175/183 62/176/184 1543 | f 70/177/185 71/178/186 63/158/187 66/162/188 1544 | f 70/179/189 69/180/190 73/181/191 71/182/192 1545 | f 73/181/193 69/180/194 67/183/195 74/184/196 1546 | s 38 1547 | f 75/185/197 76/186/198 84/187/199 83/188/200 1548 | f 76/186/198 77/189/201 85/190/202 84/187/199 1549 | f 77/189/201 78/191/203 86/192/204 85/190/202 1550 | f 78/193/203 79/194/205 87/195/206 86/196/204 1551 | f 79/194/205 80/197/207 88/198/208 87/195/206 1552 | f 80/199/207 81/200/209 89/201/210 88/202/208 1553 | f 81/200/209 82/203/211 90/204/212 89/201/210 1554 | f 82/205/211 75/206/197 83/207/200 90/208/212 1555 | s off 1556 | f 75/209/213 82/210/214 81/211/215 80/212/216 79/213/217 78/214/218 77/215/219 76/216/220 1557 | f 83/217/221 84/218/222 85/219/223 86/220/224 87/221/225 88/222/226 89/223/227 90/224/228 1558 | f 91/225/229 92/226/230 94/227/231 93/228/232 1559 | f 93/229/233 94/230/234 96/231/235 95/232/236 1560 | f 95/233/237 96/234/238 98/235/239 97/236/240 1561 | f 97/237/241 98/238/242 92/239/243 91/240/244 1562 | f 92/241/245 98/242/246 96/243/247 94/244/248 1563 | f 97/245/249 91/246/250 93/247/251 95/248/252 1564 | s 47 1565 | f 99/249/253 100/250/254 108/251/255 107/252/256 1566 | f 100/250/254 101/253/257 109/254/258 108/251/255 1567 | f 101/253/257 102/255/259 110/256/260 109/254/258 1568 | f 102/257/259 103/258/261 111/259/262 110/260/260 1569 | f 103/258/261 104/261/263 112/262/264 111/259/262 1570 | f 104/263/263 105/264/265 113/265/266 112/266/264 1571 | f 105/264/265 106/267/267 114/268/268 113/265/266 1572 | f 106/269/267 99/270/253 107/271/256 114/272/268 1573 | s off 1574 | f 99/273/269 106/274/270 105/275/271 104/276/272 103/277/273 102/278/274 101/279/275 100/280/276 1575 | f 107/281/277 108/282/278 109/283/279 110/284/280 111/285/281 112/286/282 113/287/283 114/288/284 1576 | f 115/289/285 116/290/286 117/291/287 118/292/288 1577 | f 119/293/289 120/294/290 121/295/291 122/296/292 1578 | f 123/297/293 124/298/294 125/299/295 126/300/296 127/301/297 1579 | f 128/302/298 129/303/299 130/304/300 131/305/301 1580 | f 132/306/302 133/307/303 134/308/304 135/309/305 1581 | f 136/310/306 137/311/307 138/312/308 139/313/309 1582 | f 140/314/310 141/315/311 142/316/312 143/317/313 1583 | f 144/318/314 145/319/315 146/320/316 147/321/317 148/322/318 1584 | f 149/323/319 150/324/320 151/325/321 152/326/322 153/327/323 154/328/324 1585 | f 155/329/325 156/330/326 157/331/327 158/332/328 159/333/329 1586 | f 160/334/330 161/335/331 162/336/332 163/337/333 164/338/334 165/339/335 1587 | f 166/340/336 167/341/337 168/342/338 169/343/339 1588 | f 170/344/340 171/345/341 172/346/342 173/347/343 174/348/344 1589 | f 175/349/345 176/350/346 177/351/347 178/352/348 179/353/349 180/354/350 1590 | f 181/355/351 182/356/352 183/357/353 184/358/354 185/359/355 1591 | f 186/360/356 187/361/357 188/362/358 189/363/359 190/364/360 1592 | f 191/365/361 192/366/362 193/367/363 194/368/364 1593 | f 195/369/365 196/370/366 197/371/367 198/372/368 1594 | f 199/373/369 200/374/370 201/375/371 202/376/372 1595 | f 203/377/373 204/378/374 205/379/375 206/380/376 1596 | f 207/381/377 208/382/378 209/383/379 210/384/380 211/385/381 212/386/382 1597 | f 213/387/383 214/388/384 215/389/385 216/390/386 1598 | f 217/391/387 218/392/388 219/393/389 220/394/390 1599 | f 221/395/391 222/396/392 223/397/393 224/398/394 1600 | f 225/399/395 226/400/396 227/401/397 228/402/398 1601 | f 229/403/399 230/404/400 231/405/401 232/406/402 1602 | f 233/407/403 234/408/404 235/409/405 236/410/406 1603 | f 237/411/407 238/412/408 239/413/409 240/414/410 1604 | f 241/415/411 242/416/412 243/417/413 244/418/414 1605 | f 245/419/415 246/420/416 247/421/417 248/422/418 249/423/419 250/424/420 251/425/421 252/426/422 1606 | f 253/427/423 254/428/424 255/429/425 256/430/426 257/431/427 258/432/428 259/433/429 260/434/430 261/435/431 1607 | f 262/436/432 263/437/433 264/438/434 265/439/435 1608 | f 266/440/436 267/441/437 268/442/438 269/443/439 1609 | f 270/444/440 271/445/441 272/446/442 273/447/443 1610 | f 274/448/444 275/449/445 276/450/446 277/451/447 1611 | f 278/452/448 279/453/449 280/454/450 281/455/451 1612 | f 282/456/452 283/457/453 284/458/454 285/459/455 1613 | f 286/460/456 287/461/457 288/462/458 289/463/459 1614 | f 290/464/460 291/465/461 292/466/462 293/467/463 1615 | f 294/468/464 295/469/465 296/470/466 297/471/467 1616 | f 298/472/468 299/473/469 300/474/470 301/475/471 1617 | f 302/476/472 303/477/473 304/478/474 305/479/475 1618 | f 306/480/476 307/481/477 308/482/478 309/483/479 1619 | f 310/484/480 311/485/481 312/486/482 313/487/483 314/488/484 315/489/485 316/490/486 317/491/487 1620 | f 318/492/488 319/493/489 320/494/490 321/495/491 322/496/492 323/497/493 324/498/494 325/499/495 326/500/496 1621 | f 327/501/497 328/502/498 329/503/499 330/504/500 1622 | f 331/505/501 332/506/502 333/507/503 334/508/504 1623 | f 335/509/505 336/510/506 337/511/507 338/512/508 1624 | f 339/513/509 340/514/510 341/515/511 342/516/512 1625 | f 343/517/513 344/518/514 345/519/515 346/520/516 1626 | f 347/521/517 348/522/518 349/523/519 350/524/520 1627 | f 351/525/521 352/526/522 353/527/523 354/528/524 1628 | f 355/529/525 356/530/526 357/531/527 358/532/528 1629 | f 359/533/529 360/534/530 361/535/531 362/536/532 1630 | f 363/537/533 364/538/534 365/539/535 366/540/536 1631 | f 367/541/537 368/542/538 369/543/539 370/544/540 1632 | f 371/545/541 372/546/542 373/547/543 374/548/544 1633 | f 375/549/545 376/550/546 377/551/547 378/552/548 1634 | -------------------------------------------------------------------------------- /example-import-3d-image/script.py: -------------------------------------------------------------------------------- 1 | #www.stuffaboutcode.com 2 | #Raspberry Pi, Minecraft - Create 3D Model from Obj file 3 | # Version 2 - draws complete faces rather than wireframes and uses materials 4 | 5 | #import the minecraft.py module from the minecraft directory 6 | import sys 7 | sys.path.append("../") 8 | 9 | import mcpi.minecraft as minecraft 10 | #import minecraft block module 11 | import mcpi.block as block 12 | #import time, so delays can be used 13 | import time 14 | #import datetime, to get the time! 15 | import datetime 16 | 17 | # class to create 3d filled polygons 18 | class MinecraftDrawing: 19 | def __init__(self, mc): 20 | self.mc = mc 21 | 22 | # draw point 23 | def drawPoint3d(self, x, y, z, blockType, blockData=None): 24 | self.mc.setBlock(x,y,z,blockType,blockData) 25 | #print "x = " + str(x) + ", y = " + str(y) + ", z = " + str(z) 26 | 27 | # draws a face, when passed a collection of vertices which make up a polyhedron 28 | def drawFace(self, vertices, blockType, blockData=None): 29 | 30 | # get the edges of the face 31 | edgesVertices = [] 32 | # persist first vertex 33 | firstVertex = vertices[0] 34 | # loop through vertices and get edges 35 | vertexCount = 0 36 | for vertex in vertices: 37 | vertexCount+=1 38 | if vertexCount > 1: 39 | # got 2 vertices, get the points for the edge 40 | edgesVertices = edgesVertices + self.getLine(lastVertex.x, lastVertex.y, lastVertex.z, vertex.x, vertex.y, vertex.z) 41 | #print "x = " + str(lastVertex.x) + ", y = " + str(lastVertex.y) + ", z = " + str(lastVertex.z) + " x2 = " + str(vertex.x) + ", y2 = " + str(vertex.y) + ", z2 = " + str(vertex.z) 42 | # persist the last vertex found 43 | lastVertex = vertex 44 | # get edge between the last and first vertices 45 | edgesVertices = edgesVertices + self.getLine(lastVertex.x, lastVertex.y, lastVertex.z, firstVertex.x, firstVertex.y, firstVertex.z) 46 | 47 | # sort edges vertices 48 | def keyX( point ): return point.x 49 | def keyY( point ): return point.y 50 | def keyZ( point ): return point.z 51 | edgesVertices.sort( key=keyZ ) 52 | edgesVertices.sort( key=keyY ) 53 | edgesVertices.sort( key=keyX ) 54 | 55 | # not very performant but wont have gaps between in complex models 56 | for vertex in edgesVertices: 57 | vertexCount+=1 58 | # got 2 vertices, draw lines between them 59 | if (vertexCount > 1): 60 | self.drawLine(lastVertex.x, lastVertex.y, lastVertex.z, vertex.x, vertex.y, vertex.z, blockType, blockData) 61 | #print "x = " + str(lastVertex.x) + ", y = " + str(lastVertex.y) + ", z = " + str(lastVertex.z) + " x2 = " + str(vertex.x) + ", y2 = " + str(vertex.y) + ", z2 = " + str(vertex.z) 62 | # persist the last vertex found 63 | lastVertex = vertex 64 | 65 | # draw's all the points in a collection of vertices with a block 66 | def drawVertices(self, vertices, blockType, blockData=None): 67 | for vertex in vertices: 68 | self.drawPoint3d(vertex.x, vertex.y, vertex.z, blockType, blockData) 69 | 70 | # draw line 71 | def drawLine(self, x1, y1, z1, x2, y2, z2, blockType, blockData): 72 | self.drawVertices(self.getLine(x1, y1, z1, x2, y2, z2), blockType, blockData) 73 | 74 | # returns points on a line 75 | def getLine(self, x1, y1, z1, x2, y2, z2): 76 | 77 | # return maximum of 2 values 78 | def MAX(a,b): 79 | if a > b: return a 80 | else: return b 81 | 82 | # return step 83 | def ZSGN(a): 84 | if a < 0: return -1 85 | elif a > 0: return 1 86 | elif a == 0: return 0 87 | 88 | # list for vertices 89 | vertices = [] 90 | 91 | # if the 2 points are the same, return single vertice 92 | if (x1 == x2 and y1 == y2 and z1 == z2): 93 | vertices.append(minecraft.Vec3(x1, y1, z1)) 94 | 95 | # else get all points in edge 96 | else: 97 | 98 | dx = x2 - x1 99 | dy = y2 - y1 100 | dz = z2 - z1 101 | 102 | ax = abs(dx) << 1 103 | ay = abs(dy) << 1 104 | az = abs(dz) << 1 105 | 106 | sx = ZSGN(dx) 107 | sy = ZSGN(dy) 108 | sz = ZSGN(dz) 109 | 110 | x = x1 111 | y = y1 112 | z = z1 113 | 114 | # x dominant 115 | if (ax >= MAX(ay, az)): 116 | yd = ay - (ax >> 1) 117 | zd = az - (ax >> 1) 118 | loop = True 119 | while(loop): 120 | vertices.append(minecraft.Vec3(x, y, z)) 121 | if (x == x2): 122 | loop = False 123 | if (yd >= 0): 124 | y += sy 125 | yd -= ax 126 | if (zd >= 0): 127 | z += sz 128 | zd -= ax 129 | x += sx 130 | yd += ay 131 | zd += az 132 | # y dominant 133 | elif (ay >= MAX(ax, az)): 134 | xd = ax - (ay >> 1) 135 | zd = az - (ay >> 1) 136 | loop = True 137 | while(loop): 138 | vertices.append(minecraft.Vec3(x, y, z)) 139 | if (y == y2): 140 | loop=False 141 | if (xd >= 0): 142 | x += sx 143 | xd -= ay 144 | if (zd >= 0): 145 | z += sz 146 | zd -= ay 147 | y += sy 148 | xd += ax 149 | zd += az 150 | # z dominant 151 | elif(az >= MAX(ax, ay)): 152 | xd = ax - (az >> 1) 153 | yd = ay - (az >> 1) 154 | loop = True 155 | while(loop): 156 | vertices.append(minecraft.Vec3(x, y, z)) 157 | if (z == z2): 158 | loop=False 159 | if (xd >= 0): 160 | x += sx 161 | xd -= az 162 | if (yd >= 0): 163 | y += sy 164 | yd -= az 165 | z += sz 166 | xd += ax 167 | yd += ay 168 | 169 | return vertices 170 | 171 | def load_obj(filename, defaultBlock, materials) : 172 | V = [] #vertex 173 | T = [] #texcoords 174 | N = [] #normals 175 | F = [] #face indexies 176 | MF = [] #materials to faces 177 | 178 | currentMaterial = defaultBlock 179 | 180 | fh = open(filename) 181 | for line in fh : 182 | if line[0] == '#' : continue 183 | line = line.strip().split(' ') 184 | if line[0] == 'v' : #vertex 185 | V.append(line[1:]) 186 | elif line[0] == 'vt' : #tex-coord 187 | T.append(line[1:]) 188 | elif line[0] == 'vn' : #normal vector 189 | N.append(line[1:]) 190 | elif line[0] == 'f' : #face 191 | face = line[1:] 192 | for i in range(0, len(face)) : 193 | face[i] = face[i].split('/') 194 | # OBJ indexies are 1 based not 0 based hence the -1 195 | # convert indexies to integer 196 | for j in range(0, len(face[i])) : 197 | if face[i][j] != "": 198 | face[i][j] = int(face[i][j]) - 1 199 | #append the material currently in use to the face 200 | F.append(face) 201 | MF.append(currentMaterial) 202 | 203 | elif line[0] == 'usemtl': # material 204 | 205 | usemtl = line[1] 206 | if (usemtl in materials.keys()): 207 | currentMaterial = materials[usemtl] 208 | else: 209 | currentMaterial = defaultBlock 210 | print "Warning: Couldn't find '" + str(usemtl) + "' in materials using default" 211 | 212 | return V, T, N, F, MF 213 | 214 | # strips the x,y,z co-ords from a vertex line, scales appropriately, rounds and converts to int 215 | def getVertexXYZ(vertexLine, scale, startCoord, swapYZ): 216 | # convert, round and scale 217 | x = int((float(vertexLine[0]) * scale) + 0.5) 218 | y = int((float(vertexLine[1]) * scale) + 0.5) 219 | z = int((float(vertexLine[2]) * scale) + 0.5) 220 | # add startCoord to x,y,z 221 | x = x + startCoord.x 222 | y = y + startCoord.y 223 | z = z + startCoord.z 224 | # swap y and z coord if needed 225 | if swapYZ == True: 226 | swap = y 227 | y = z 228 | z = swap 229 | return x, y, z 230 | 231 | # main program 232 | if __name__ == "__main__": 233 | 234 | print datetime.datetime.now() 235 | 236 | #Connect to minecraft by creating the minecraft object 237 | # - minecraft needs to be running and in a game 238 | mc = minecraft.Minecraft.create(address="199.96.85.3") 239 | 240 | #Create minecraft drawing class 241 | mcDrawing = MinecraftDrawing(mc) 242 | 243 | """ 244 | Load objfile and set constants 245 | 246 | COORDSSCALE = factor to scale the co-ords by 247 | STARTCOORD = where to start the model, the relative position 0 248 | CLEARAREA1/2 = 2 points the program should clear an area in between to put the model in 249 | SWAPYZ = True to sway the Y and Z dimension 250 | MATERIALS = a dictionary object which maps materials in the obj file to blocks in minecraft 251 | DEFAULTBLOCK = the default type of block to build the model in, used if a material cant be found 252 | """ 253 | 254 | # Shuttle 255 | COORDSSCALE = 6 256 | STARTCOORD = minecraft.Vec3(-60,0,20) 257 | CLEARAREA1 = minecraft.Vec3(-30, 5, -30) 258 | CLEARAREA2 = minecraft.Vec3(-90, 50, 30) 259 | DEFAULTBLOCK = [block.WOOL.id,0] 260 | MATERIALS = {"glass": [block.GLASS.id, 0], 261 | "bone": [block.WOOL.id, 0], 262 | "fldkdkgrey": [block.WOOL.id, 7], 263 | "redbrick": [block.WOOL.id, 14], 264 | "black": [block.WOOL.id, 15], 265 | "brass": [block.WOOL.id, 1], 266 | "dkdkgrey": [block.WOOL.id, 7]} 267 | SWAPYZ = True 268 | vertices,textures,normals,faces,materials = load_obj("shuttle.obj", DEFAULTBLOCK, MATERIALS) 269 | 270 | # Shyscraper 271 | #COORDSSCALE = 1.4 272 | #STARTCOORD = minecraft.Vec3(0,10,15) 273 | #CLEARAREA1 = minecraft.Vec3(-30, -3, -15) 274 | #CLEARAREA2 = minecraft.Vec3(30, 65, 35) 275 | #DEFAULTBLOCK = [block.IRON_BLOCK, 0] 276 | #MATERIALS = {} 277 | #SWAPYZ = False 278 | #vertices,textures,normals,faces,materials = load_obj("skyscraper.obj", DEFAULTBLOCK, MATERIALS) 279 | 280 | # Farmhouse 281 | #COORDSSCALE = 1 282 | #STARTCOORD = minecraft.Vec3(10,0,15) 283 | #CLEARAREA1 = minecraft.Vec3(-30, -3, -15) 284 | #CLEARAREA2 = minecraft.Vec3(30, 65, 35) 285 | #DEFAULTBLOCK = [block.IRON_BLOCK, 0] 286 | #MATERIALS = {} 287 | #SWAPYZ = False 288 | #vertices,textures,normals,faces,materials = load_obj("farmhouse.obj", DEFAULTBLOCK, MATERIALS) 289 | 290 | print "obj file loaded" 291 | 292 | #Post a message to the minecraft chat window 293 | mc.postToChat("Started 3d render...") 294 | 295 | # clear a suitably large area 296 | mc.setBlocks(CLEARAREA1.x, CLEARAREA1.y, CLEARAREA1.z, CLEARAREA2.x, CLEARAREA2.y, CLEARAREA2.z, block.AIR) 297 | time.sleep(10) 298 | 299 | faceCount = 0 300 | # loop through faces 301 | for face in faces: 302 | faceVertices = [] 303 | 304 | # loop through vertex's in face and call drawFace function 305 | for vertex in face: 306 | #strip co-ords from vertex line 307 | vertexX, vertexY, vertexZ = getVertexXYZ(vertices[vertex[0]], COORDSSCALE, STARTCOORD, SWAPYZ) 308 | 309 | faceVertices.append(minecraft.Vec3(vertexX,vertexY,vertexZ)) 310 | 311 | # draw the face 312 | mcDrawing.drawFace(faceVertices, materials[faceCount][0], materials[faceCount][1]) 313 | faceCount = faceCount + 1 314 | 315 | mc.postToChat("Model complete.") 316 | 317 | mc.player.setPos(STARTCOORD.x+20, STARTCOORD.y+30, STARTCOORD.z) 318 | 319 | print datetime.datetime.now() 320 | -------------------------------------------------------------------------------- /example-import-3d-image/shuttle.obj: -------------------------------------------------------------------------------- 1 | # Viewpoint Datalabs International, Inc. Copyright 1996 2 | 3 | 4 | mtllib ./vp.mtl 5 | 6 | g 7 | v 3.070224 -0.119728 0.996443 8 | v 5.942016 -0.012019 4.157199 9 | v 6.614015 -0.063428 4.157199 10 | v 5.759114 0.000000 1.664500 11 | v 3.070224 -0.449143 0.929434 12 | v 5.000295 -0.539011 1.315104 13 | v 3.070224 -0.604752 0.872464 14 | v 3.070224 -0.866525 0.730690 15 | v 3.070224 -0.959007 0.650256 16 | v 3.070224 -1.053631 0.163277 17 | v 2.983248 -1.080021 -0.880639 18 | v 6.130317 -1.100022 -1.106943 19 | v 3.739287 -4.334102 -0.876958 20 | v 4.400283 -4.682100 -0.952940 21 | v 3.038248 -4.334102 -0.811319 22 | v 3.180259 -4.550090 -0.921939 23 | v 2.700250 -4.334102 -0.947940 24 | v 0.840214 -2.480049 -1.050312 25 | v 1.208789 -1.060728 0.203820 26 | v 1.208789 -1.054148 0.411073 27 | v 1.208789 -0.958092 0.610367 28 | v 1.208789 -0.875165 0.685964 29 | v 1.208789 -0.621528 0.854704 30 | v 1.208789 -0.467365 0.922276 31 | v -4.649089 -1.039587 0.209476 32 | v -4.649345 -0.922345 0.432259 33 | v -4.649708 -0.652575 0.753550 34 | v -4.999902 -1.012545 0.094530 35 | v -4.999240 -0.870266 0.347384 36 | v -4.999321 -0.802315 0.416133 37 | v -4.906714 -0.620194 0.686502 38 | v -4.999759 -0.491153 0.805206 39 | v -5.568033 -0.119200 0.568687 40 | v -5.349121 -0.814175 0.247113 41 | v -5.348800 -0.938377 -0.030175 42 | v -6.499984 -0.676000 -0.433500 43 | v -6.499984 -0.610000 -0.164800 44 | v -6.499984 -0.240000 0.109600 45 | v -7.649984 0.000000 -0.620000 46 | v 1.209237 -1.080021 -1.321617 47 | v 3.070224 0.119728 0.996443 48 | v 3.093016 0.040804 1.276300 49 | v 6.614015 0.063428 4.157199 50 | v 3.070224 0.449143 0.929434 51 | v 5.000295 0.539011 1.315104 52 | v 3.070224 0.604752 0.872464 53 | v 3.070224 0.866525 0.730690 54 | v 5.000295 1.149023 1.260104 55 | v 3.070224 0.959007 0.650256 56 | v 3.070224 1.053627 0.449897 57 | v 5.000295 1.428028 0.442095 58 | v 3.070224 1.053631 0.163277 59 | v 2.983248 1.080021 -0.880639 60 | v 5.000295 1.302926 -1.259946 61 | v 3.739287 4.334102 -0.876958 62 | v 4.400283 4.682100 -0.952940 63 | v 3.038248 4.334102 -0.811319 64 | v 3.180259 4.550090 -0.921939 65 | v 1.209237 1.080021 -0.636414 66 | v 2.700250 4.334102 -0.947940 67 | v 0.169216 1.990039 -1.063281 68 | v 1.208789 1.060728 0.203820 69 | v 1.208789 1.054148 0.411073 70 | v 1.208789 0.958092 0.610367 71 | v 1.208789 0.875165 0.685964 72 | v 1.208789 0.621528 0.854704 73 | v 1.208789 0.467365 0.922276 74 | v -4.649089 1.039587 0.209476 75 | v -4.649345 0.922345 0.432259 76 | v -4.649708 0.652575 0.753550 77 | v -4.649856 0.514670 0.885149 78 | v -4.649964 0.160748 0.994500 79 | v -4.999902 1.012545 0.094530 80 | v -4.999240 0.870266 0.347384 81 | v -4.999321 0.802315 0.416133 82 | v -4.999759 0.491153 0.805206 83 | v -4.999948 0.160720 0.980689 84 | v -5.299752 0.147914 0.811038 85 | v -5.349121 0.814175 0.247113 86 | v -5.348800 0.938377 -0.030175 87 | v -6.499984 0.676000 -0.433500 88 | v -6.499931 0.693962 -0.748535 89 | v -6.499984 0.610000 -0.164800 90 | v -6.499984 0.523000 -0.048800 91 | v -6.499984 0.240000 0.109600 92 | v 1.209237 1.080021 -1.321617 93 | v -5.568033 0.119200 0.568687 94 | v -5.299752 -0.147914 0.811038 95 | v -4.999948 -0.160720 0.980689 96 | v -4.649964 -0.160748 0.994500 97 | v 1.208789 -0.130179 0.996071 98 | v 1.208789 0.130179 0.996071 99 | v 3.093016 -0.040804 1.276300 100 | v 5.942016 0.012019 4.157199 101 | v 7.043714 0.000000 4.157199 102 | v 4.998233 -0.130896 1.193100 103 | v 5.171283 -1.310384 -1.055942 104 | v 6.130317 1.100022 -1.106943 105 | v 2.983248 -1.080021 -1.351649 106 | v 2.983248 1.080021 -1.351649 107 | v -6.499931 -0.693962 -0.748535 108 | v -4.999902 -1.000020 -0.943979 109 | v 0.169216 -1.990039 -1.063281 110 | v 5.000295 -1.510030 0.750093 111 | v 5.000295 -0.874017 1.399122 112 | v 5.000295 -1.149023 1.260104 113 | v 5.000295 0.874017 1.399122 114 | v -7.074984 -0.304058 -0.264426 115 | v -7.074984 0.139529 -0.169387 116 | v -7.074984 0.304058 -0.264426 117 | v -7.074957 0.403450 -0.684268 118 | v -7.074984 0.393008 -0.495246 119 | v -7.074984 0.354637 -0.334026 120 | v -7.074984 0.057454 -0.155083 121 | v -7.074984 -0.354637 -0.334026 122 | v -7.074984 -0.393008 -0.495246 123 | v -7.074957 -0.403450 -0.684268 124 | v -7.074984 -0.139529 -0.169387 125 | v -7.074984 -0.057454 -0.155083 126 | v 5.257180 -0.244260 -0.448877 127 | v 5.275361 -0.389797 -0.446328 128 | v 5.534085 -0.255527 -0.410058 129 | v 5.858724 -0.171973 -0.364548 130 | v 6.246687 -0.127423 -0.310161 131 | v 6.245811 -0.209802 -0.310283 132 | v 5.957494 -0.242908 -0.350702 133 | v 5.684797 -0.367023 -0.388930 134 | v 5.030259 -0.310424 -0.039389 135 | v 5.218888 -0.403501 -0.175729 136 | v 5.254566 -0.476272 -0.297997 137 | v 5.497149 -0.409135 -0.146573 138 | v 5.811742 -0.367356 -0.029404 139 | v 6.194348 -0.345081 0.063191 140 | v 6.203377 -0.386271 -0.007583 141 | v 5.919040 -0.402825 -0.076394 142 | v 5.661265 -0.464884 -0.221067 143 | v 5.030257 -0.815056 -0.039376 144 | v 5.218887 -0.721987 -0.175721 145 | v 5.254566 -0.649223 -0.297993 146 | v 5.497147 -0.716354 -0.146565 147 | v 5.811740 -0.758129 -0.029394 148 | v 6.194347 -0.780403 0.063202 149 | v 6.203376 -0.739216 -0.007574 150 | v 5.919039 -0.722663 -0.076386 151 | v 5.661264 -0.660610 -0.221062 152 | v 5.533661 -0.562752 -0.410117 153 | v 5.257178 -0.881243 -0.448860 154 | v 5.275359 -0.735706 -0.446319 155 | v 5.534083 -0.869976 -0.410042 156 | v 5.858722 -0.953530 -0.364528 157 | v 6.246684 -0.998080 -0.310138 158 | v 6.245809 -0.915701 -0.310265 159 | v 5.957492 -0.882595 -0.350685 160 | v 5.684796 -0.758480 -0.388920 161 | v 5.151601 -0.815102 -0.904963 162 | v 5.295470 -0.722016 -0.722016 163 | v 5.296154 -0.649239 -0.594654 164 | v 5.571022 -0.716382 -0.673535 165 | v 5.905705 -0.758165 -0.699682 166 | v 6.299025 -0.780442 -0.683500 167 | v 6.288245 -0.739248 -0.612975 168 | v 5.995947 -0.722692 -0.625000 169 | v 5.708329 -0.660628 -0.556788 170 | v 5.295474 -0.403530 -0.722041 171 | v 5.296155 -0.476288 -0.594668 172 | v 5.571025 -0.409163 -0.673559 173 | v 5.905710 -0.367392 -0.699712 174 | v 6.299029 -0.345120 -0.683534 175 | v 6.288249 -0.386303 -0.613002 176 | v 5.995951 -0.402854 -0.625025 177 | v 5.708331 -0.464902 -0.556803 178 | v 5.218888 0.403501 -0.175729 179 | v 5.257180 0.244260 -0.448877 180 | v 5.254566 0.476272 -0.297997 181 | v 5.275361 0.389797 -0.446328 182 | v 5.497149 0.409135 -0.146573 183 | v 5.534085 0.255527 -0.410058 184 | v 5.811742 0.367356 -0.029404 185 | v 5.858724 0.171973 -0.364548 186 | v 6.194348 0.345081 0.063191 187 | v 6.246687 0.127423 -0.310161 188 | v 6.203377 0.386271 -0.007583 189 | v 6.245811 0.209802 -0.310283 190 | v 5.919040 0.402825 -0.076394 191 | v 5.957494 0.242908 -0.350702 192 | v 5.661265 0.464884 -0.221067 193 | v 5.684797 0.367023 -0.388930 194 | v 5.218887 0.721987 -0.175721 195 | v 5.254566 0.649223 -0.297993 196 | v 5.497147 0.716354 -0.146565 197 | v 5.811740 0.758129 -0.029394 198 | v 6.194347 0.780403 0.063202 199 | v 6.203376 0.739216 -0.007574 200 | v 5.919039 0.722663 -0.076386 201 | v 5.661264 0.660610 -0.221062 202 | v 5.257178 0.881243 -0.448860 203 | v 5.275359 0.735706 -0.446319 204 | v 5.534083 0.869976 -0.410042 205 | v 5.858722 0.953530 -0.364528 206 | v 6.246684 0.998080 -0.310138 207 | v 6.245809 0.915701 -0.310265 208 | v 5.957492 0.882595 -0.350685 209 | v 5.684796 0.758480 -0.388920 210 | v 5.533661 0.562752 -0.410117 211 | v 5.295470 0.722016 -0.722016 212 | v 5.296154 0.649239 -0.594654 213 | v 5.571022 0.716382 -0.673535 214 | v 5.905705 0.758165 -0.699682 215 | v 6.299025 0.780442 -0.683500 216 | v 6.288245 0.739248 -0.612975 217 | v 5.995947 0.722692 -0.625000 218 | v 5.708329 0.660628 -0.556788 219 | v 5.295474 0.403530 -0.722041 220 | v 5.296155 0.476288 -0.594668 221 | v 5.571025 0.409163 -0.673559 222 | v 5.905710 0.367392 -0.699712 223 | v 6.299029 0.345120 -0.683534 224 | v 6.288249 0.386303 -0.613002 225 | v 5.995951 0.402854 -0.625025 226 | v 5.708331 0.464902 -0.556803 227 | v 5.165639 -0.318491 0.637328 228 | v 5.166101 -0.159250 0.913146 229 | v 4.998497 -0.252327 1.074635 230 | v 5.183997 -0.172954 0.637297 231 | v 5.184248 -0.086480 0.787078 232 | v 5.445252 -0.307224 0.636859 233 | v 5.445698 -0.153617 0.902920 234 | v 5.773065 -0.390779 0.636310 235 | v 5.773632 -0.195395 0.974730 236 | v 6.164821 -0.435329 0.635652 237 | v 6.165453 -0.217671 1.012654 238 | v 6.163937 -0.352950 0.635654 239 | v 6.164450 -0.176480 0.941314 240 | v 5.872800 -0.319843 0.636142 241 | v 5.873264 -0.159926 0.913131 242 | v 5.597437 -0.195729 0.636604 243 | v 5.597722 -0.097867 0.806108 244 | v 5.444824 0.000000 0.636860 245 | v 5.166102 0.159236 0.913155 246 | v 5.184248 0.086472 0.787083 247 | v 5.445698 0.153603 0.902928 248 | v 5.773632 0.195378 0.974740 249 | v 6.165453 0.217651 1.012665 250 | v 6.164450 0.176464 0.941323 251 | v 5.873265 0.159912 0.913140 252 | v 5.597722 0.097858 0.806113 253 | v 5.165639 0.318491 0.637345 254 | v 4.997765 0.504639 0.637636 255 | v 5.183997 0.172954 0.637307 256 | v 5.445252 0.307224 0.636875 257 | v 5.773065 0.390779 0.636330 258 | v 6.164821 0.435329 0.635675 259 | v 6.163937 0.352950 0.635673 260 | v 5.872800 0.319843 0.636159 261 | v 5.597437 0.195729 0.636614 262 | v 5.165176 0.159265 0.361518 263 | v 4.997031 0.252350 0.200598 264 | v 5.183746 0.086488 0.487521 265 | v 5.444806 0.153631 0.370806 266 | v 5.772497 0.195413 0.297899 267 | v 6.164188 0.217691 0.258662 268 | v 6.163424 0.176496 0.330003 269 | v 5.872335 0.159941 0.359162 270 | v 5.597153 0.097876 0.467105 271 | v 5.165176 -0.159221 0.361493 272 | v 4.997031 -0.252281 0.200558 273 | v 5.183746 -0.086464 0.487507 274 | v 5.444806 -0.153589 0.370782 275 | v 5.772497 -0.195360 0.297868 276 | v 6.164188 -0.217631 0.258628 277 | v 6.163424 -0.176448 0.329975 278 | v 5.872335 -0.159897 0.359136 279 | v 5.597153 -0.097850 0.467090 280 | v 5.090927 -1.067391 -0.472156 281 | v 5.171283 1.310384 -1.055942 282 | v 5.151606 0.310470 -0.905003 283 | v 5.151606 -0.310470 -0.905003 284 | v 5.030257 0.815056 -0.039376 285 | v 5.030259 0.310424 -0.039389 286 | v 5.090930 -0.058113 -0.472183 287 | v 5.090930 0.058113 -0.472183 288 | v 5.000295 -1.210004 0.173074 289 | v 5.000295 1.210004 0.173074 290 | v 5.000295 -1.428028 0.442095 291 | v 4.997764 -0.504639 0.637610 292 | v 4.998497 0.252304 1.074648 293 | v 4.998233 0.130896 1.193100 294 | v 5.000295 1.510030 0.750093 295 | v 5.151601 0.815102 -0.904963 296 | v 5.090927 1.067391 -0.472156 297 | v 3.070224 -1.053627 0.449897 298 | v -5.349205 0.737229 0.323968 299 | v -5.349205 -0.737229 0.323968 300 | v -5.349476 -0.470935 0.566062 301 | v -6.499984 -0.098825 0.133439 302 | v -6.499984 0.098825 0.133439 303 | v -6.499984 -0.523000 -0.048800 304 | v -5.349476 0.470935 0.566062 305 | v -4.999902 1.000020 -0.943979 306 | v 0.840214 2.480049 -1.050312 307 | v 1.209237 -1.080021 -0.636414 308 | v 3.804262 4.682100 -0.938960 309 | v 5.000295 -1.302926 -1.259946 310 | v 3.804262 -4.682100 -0.938960 311 | v -4.649856 -0.514670 0.885149 312 | v -4.999492 0.681710 0.569242 313 | v -4.649417 0.860391 0.497003 314 | v -4.906714 0.620194 0.686502 315 | v -4.649417 -0.860391 0.497003 316 | v -4.999492 -0.681710 0.569242 317 | # 310 vertices 318 | 319 | # 0 vertex parms 320 | 321 | # 0 texture vertices 322 | 323 | # 0 normals 324 | 325 | g windows 326 | usemtl glass 327 | s 1 328 | f 310 32 294 329 | f 76 308 306 330 | f 294 88 33 331 | f 310 31 32 332 | f 88 294 32 333 | f 87 33 88 78 334 | f 87 78 298 335 | f 298 76 306 336 | f 298 78 76 337 | g tail 338 | usemtl bone 339 | s 4 340 | f 95 3 96 4 341 | f 4 287 43 95 342 | f 94 2 3 43 343 | f 3 2 93 96 344 | f 41 1 93 42 345 | f 41 42 287 346 | f 43 3 95 347 | f 287 42 94 43 348 | f 42 93 2 94 349 | f 96 93 1 350 | g rearbody 351 | s 6 352 | f 275 98 54 353 | f 96 223 286 287 354 | f 97 277 155 355 | f 276 281 280 277 356 | f 276 275 289 357 | f 283 282 128 279 358 | f 283 290 275 359 | f 257 51 248 360 | f 282 303 97 361 | f 96 6 106 362 | f 303 12 97 363 | f 104 285 223 364 | f 97 155 274 365 | f 284 282 266 366 | f 286 288 287 367 | f 137 128 282 368 | f 283 279 278 369 | f 248 288 286 370 | f 6 105 106 371 | f 275 54 283 372 | f 284 266 285 373 | f 96 287 4 374 | f 284 285 104 375 | f 248 51 288 376 | f 283 278 290 377 | f 274 137 282 378 | f 289 275 290 379 | f 97 12 98 275 380 | f 48 107 45 381 | f 96 106 104 382 | f 282 283 257 266 383 | f 97 275 276 277 384 | f 104 223 96 385 | f 257 283 51 386 | f 97 274 282 387 | f 128 280 281 279 388 | f 287 288 48 389 | f 287 48 45 390 | g body 391 | s 7 392 | f 309 31 310 393 | f 294 33 295 394 | f 108 118 39 395 | f 80 79 74 73 396 | f 49 47 48 397 | f 5 1 91 24 398 | f 10 291 20 19 399 | f 294 295 38 400 | f 78 77 76 401 | f 81 82 111 112 402 | f 65 66 46 47 403 | f 30 309 310 404 | f 5 105 6 405 | f 30 29 26 309 406 | f 68 62 59 299 407 | f 78 88 89 77 408 | f 118 38 295 119 409 | f 83 81 112 113 410 | f 64 65 47 49 411 | f 35 37 36 412 | f 23 8 7 413 | f 24 91 90 305 414 | f 62 52 53 59 415 | f 296 85 109 114 416 | f 79 292 75 74 417 | f 50 49 288 418 | f 22 23 27 419 | f 282 10 11 303 420 | f 293 294 297 421 | f 71 72 92 67 422 | f 112 39 113 423 | f 310 294 293 424 | f 305 90 89 425 | f 308 70 307 426 | f 296 87 298 427 | f 114 39 119 428 | f 71 77 72 429 | f 45 107 44 430 | f 8 23 22 431 | f 7 5 24 23 432 | f 287 44 41 433 | f 307 69 74 75 434 | f 92 91 1 41 435 | f 63 62 68 436 | f 28 29 34 35 437 | f 105 7 8 106 438 | f 32 89 88 439 | f 49 48 288 440 | f 82 81 299 441 | f 115 37 297 108 442 | f 113 39 110 443 | f 73 74 69 68 444 | f 29 30 293 34 445 | f 291 104 9 446 | f 22 27 309 447 | f 54 53 52 283 448 | f 83 79 80 449 | f 83 80 81 450 | f 48 47 46 107 451 | f 25 20 21 26 452 | f 301 11 10 19 453 | f 39 115 108 454 | f 306 307 75 455 | f 110 39 109 456 | f 292 298 306 457 | f 306 308 307 458 | f 70 66 65 459 | f 294 38 297 460 | f 5 6 96 461 | f 85 84 110 109 462 | f 62 63 50 52 463 | f 102 25 28 464 | f 9 106 8 465 | f 310 293 30 466 | f 70 71 66 467 | f 77 89 90 72 468 | f 66 71 67 469 | f 297 37 34 293 470 | f 106 9 104 471 | f 25 19 20 472 | f 44 107 46 473 | f 85 296 298 474 | f 117 101 36 116 475 | f 111 39 112 476 | f 307 70 65 477 | f 35 34 37 478 | f 23 305 27 479 | f 102 301 19 25 480 | f 50 288 51 481 | f 80 73 299 482 | f 84 298 292 483 | f 49 50 63 64 484 | f 32 305 89 485 | f 1 5 96 486 | f 32 31 27 305 487 | f 66 67 44 46 488 | f 296 295 33 87 489 | f 291 10 282 490 | f 81 80 299 491 | f 309 27 31 492 | f 84 85 298 493 | f 116 36 37 115 494 | f 292 79 83 84 495 | f 283 52 51 496 | f 309 26 21 22 497 | f 284 291 282 498 | f 102 36 101 499 | f 65 64 69 307 500 | f 295 296 114 119 501 | f 73 68 299 502 | f 39 116 115 503 | f 105 5 7 504 | f 23 24 305 505 | f 39 117 116 506 | f 77 71 76 507 | f 109 39 114 508 | f 297 38 118 108 509 | f 75 292 306 510 | f 39 118 119 511 | f 21 20 291 9 512 | f 9 8 22 21 513 | f 287 45 44 514 | f 71 70 308 76 515 | f 84 83 113 110 516 | f 67 92 41 44 517 | f 25 26 29 28 518 | f 104 291 284 519 | f 102 28 35 520 | f 69 64 63 68 521 | f 72 90 91 92 522 | f 52 50 51 523 | f 102 35 36 524 | g wings 525 | s 5 526 | f 16 15 17 527 | f 304 15 16 528 | f 300 57 60 529 | f 14 13 304 530 | f 59 53 55 57 531 | f 60 57 58 532 | f 18 301 103 533 | f 300 59 57 534 | f 304 13 15 535 | f 56 55 53 54 536 | f 15 13 11 301 537 | f 61 59 300 538 | f 57 55 302 539 | f 103 301 102 540 | f 17 15 301 541 | f 303 11 13 14 542 | f 58 57 302 543 | f 302 55 56 544 | f 17 301 18 545 | f 299 59 61 546 | g tiles 547 | usemtl fldkdkgrey 548 | s 3 549 | f 302 56 54 550 | f 18 103 40 551 | f 16 17 99 552 | f 86 61 300 553 | f 99 304 16 554 | f 303 14 304 555 | f 99 303 304 556 | f 17 18 99 557 | f 302 54 100 558 | f 58 302 100 559 | f 100 86 300 560 | f 18 40 99 561 | f 100 60 58 562 | f 100 300 60 563 | f 101 117 111 82 564 | f 102 101 82 299 565 | f 117 39 111 566 | f 99 100 54 303 567 | f 303 54 98 12 568 | f 86 100 99 40 569 | f 40 103 61 86 570 | f 299 61 103 102 571 | g enginside 572 | usemtl redbrick 573 | s 9 574 | f 238 255 246 575 | f 194 202 201 193 576 | f 153 162 163 154 577 | f 144 153 154 145 578 | f 184 194 193 182 579 | f 238 246 237 580 | f 272 234 232 271 581 | f 236 237 235 234 582 | f 204 195 186 583 | f 134 143 144 135 584 | f 143 152 153 144 585 | f 204 203 195 586 | f 237 246 245 235 587 | f 273 236 234 272 588 | f 238 237 236 589 | f 185 184 182 183 590 | f 135 144 145 136 591 | f 154 163 146 592 | f 195 203 202 194 593 | f 235 245 244 233 594 | f 264 273 272 263 595 | f 219 185 183 218 596 | f 187 186 184 185 597 | f 136 145 146 598 | f 161 169 170 162 599 | f 204 220 212 600 | f 255 264 263 254 601 | f 234 235 233 232 602 | f 186 195 194 184 603 | f 145 154 146 604 | f 152 161 162 153 605 | f 204 212 203 606 | f 246 255 254 245 607 | f 238 236 273 608 | f 204 187 220 609 | f 169 125 126 170 610 | f 126 135 136 127 611 | f 163 171 146 612 | f 203 212 211 202 613 | f 245 254 253 244 614 | f 238 273 264 615 | f 211 219 218 210 616 | f 170 126 127 171 617 | f 127 136 146 618 | f 162 170 171 163 619 | f 202 211 210 201 620 | f 238 264 255 621 | f 254 263 262 253 622 | f 212 220 219 211 623 | f 171 127 146 624 | f 125 134 135 126 625 | f 204 186 187 626 | f 220 187 185 219 627 | f 263 272 271 262 628 | g engout 629 | usemtl black 630 | f 251 260 259 250 631 | f 209 217 216 208 632 | f 157 165 166 158 633 | f 132 141 142 133 634 | f 179 178 176 177 635 | f 215 177 175 214 636 | f 270 230 228 269 637 | f 227 241 240 225 638 | f 191 199 198 190 639 | f 150 159 160 151 640 | f 131 140 141 132 641 | f 177 176 174 175 642 | f 230 231 229 228 643 | f 269 228 226 268 644 | f 229 242 241 227 645 | f 192 200 199 191 646 | f 139 148 149 140 647 | f 130 139 140 131 648 | f 180 192 191 178 649 | f 228 229 227 226 650 | f 268 226 224 267 651 | f 231 243 242 229 652 | f 176 190 189 174 653 | f 140 149 150 141 654 | f 149 158 159 150 655 | f 190 198 197 189 656 | f 243 252 251 242 657 | f 259 268 267 258 658 | f 216 179 177 215 659 | f 181 180 178 179 660 | f 121 130 131 122 661 | f 167 123 124 168 662 | f 208 216 215 207 663 | f 250 259 258 249 664 | f 252 261 260 251 665 | f 198 207 206 197 666 | f 158 166 167 159 667 | f 123 132 133 124 668 | f 166 122 123 167 669 | f 207 215 214 206 670 | f 261 270 269 260 671 | f 241 250 249 240 672 | f 199 208 207 198 673 | f 159 167 168 160 674 | f 122 131 132 123 675 | f 165 121 122 166 676 | f 217 181 179 216 677 | f 260 269 268 259 678 | f 242 251 250 241 679 | f 200 209 208 199 680 | f 148 157 158 149 681 | f 141 150 151 142 682 | f 178 191 190 176 683 | f 226 227 225 224 684 | g engmount 685 | usemtl brass 686 | s 11 687 | f 225 240 239 222 688 | f 164 120 121 165 689 | f 128 137 138 129 690 | f 196 205 289 290 691 | f 265 221 285 266 692 | f 206 214 213 205 693 | f 138 147 148 139 694 | f 174 189 188 172 695 | f 249 258 256 247 696 | f 221 222 223 285 697 | f 155 277 164 156 698 | f 274 155 156 147 699 | f 213 173 281 276 700 | f 258 267 265 256 701 | f 189 197 196 188 702 | f 120 129 130 121 703 | f 173 172 279 281 704 | f 239 247 248 286 705 | f 205 213 276 289 706 | f 137 274 147 138 707 | f 156 164 165 157 708 | f 224 225 222 221 709 | f 247 256 257 248 710 | f 172 188 278 279 711 | f 280 128 129 120 712 | f 188 196 290 278 713 | f 256 265 266 257 714 | f 214 175 173 213 715 | f 147 156 157 148 716 | f 175 174 172 173 717 | f 240 249 247 239 718 | f 222 239 286 223 719 | f 277 280 120 164 720 | f 129 138 139 130 721 | f 197 206 205 196 722 | f 267 224 221 265 723 | g engrim 724 | usemtl dkdkgrey 725 | s off 726 | f 233 244 243 231 727 | f 124 133 134 125 728 | f 262 271 270 261 729 | f 142 151 152 143 730 | f 253 262 261 252 731 | f 151 160 161 152 732 | f 244 253 252 243 733 | f 160 168 169 161 734 | f 201 210 209 200 735 | f 271 232 230 270 736 | f 133 142 143 134 737 | f 232 233 231 230 738 | f 183 182 180 181 739 | f 218 183 181 217 740 | f 182 193 192 180 741 | f 210 218 217 209 742 | f 193 201 200 192 743 | f 168 124 125 169 744 | # 393 elements -------------------------------------------------------------------------------- /example-import-image/mario.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teachthenet/TeachCraft-Challenges/ab5b8cc57c71e423be932897cd5200c231e494ec/example-import-image/mario.gif -------------------------------------------------------------------------------- /example-import-image/script.py: -------------------------------------------------------------------------------- 1 | """ 2 | This script does the following: 3 | - Take an image as input, and read it pixel by pixel. 4 | - For each pixel in the image, set a block in the minecraft world closest to the color of that pixel. 5 | - End result should be pixel art in minecraft world. 6 | - Use mario.gif in this directory to start with. 7 | 8 | Try to understand how this script works - it uses various data structures and functions. 9 | 10 | Try to figure out how it takes an image as input, and change the image to something else you'd like to insert into the minecraft world. 11 | 12 | NOTE! This script requires installing the Python library 'pillow' - instructions located here: 13 | https://pillow.readthedocs.org/en/latest/installation.html 14 | """ 15 | 16 | import sys 17 | sys.path.append("../") 18 | 19 | import mcpi.minecraft as minecraft 20 | mc = minecraft.Minecraft.create(address="199.96.85.3", name="seanybob") #NOTE - replace "seanybob" with your name 21 | 22 | from math import sqrt 23 | 24 | from PIL import Image 25 | 26 | # Possible blocks in (Name, ID, (RGB1,RGB2,..),Data) 27 | #RGBs are used to color match. 28 | possibleBlocks = ( 29 | ("Air", 0, ( (0, 136, 255) ,),0), 30 | ("Smooth Stone", 1, ( (125,125, 125) ,),0), 31 | ("Dirt", 3, ( (133,96,66),),0), 32 | ("Cobblestone", 4, ( (117,117,117),),0), 33 | ("Wooden Plank", 5, ( (156,127,78),),0), 34 | ("Bedrock", 7, ( (83,83,83),),0), 35 | ("Sand", 12, ( (217,210,158),),0), 36 | ("Gravel", 13, ( (136, 126, 125),),0), 37 | ("Gold Ore", 14, ( (143,139,124),),0), 38 | ("Iron Ore", 15, ( (135,130,126),),0), 39 | ("Coal Ore", 16, ( (115,115,115),),0), 40 | ("Wood", 17, ( (154,125,77),),0), 41 | ("Sponge", 19, ( (182,182,57),),0), 42 | ("White Wool", 35, ( (221,221,221),),0), 43 | ("Orange Wool", 35, ( (233,126,55),),1), 44 | ("Magenta Wool", 35, ( (179,75,200),),2), 45 | ("Light Blue Wool", 35, ( (103,137,211),),3), 46 | ("Yellow Wool", 35, ( (192,179,28),),4), 47 | ("Light Green Wool", 35, ( (59,187,47),),5), 48 | ("Pink Wool", 35, ( (217,132,153),),6), 49 | ("Dark Gray Wool", 35, ( (66,67,67),),7), 50 | ("Gray Wool", 35, ( (157,164,165),),8), 51 | ("Cyan Wool", 35, ( (39,116,148),),9), 52 | ("Purple Wool", 35, ( (128,53,195),),10), 53 | ("Blue Wool", 35, ( (39,51,153),),11), 54 | ("Brown Wool", 35, ( (85,51,27),),12), 55 | ("Dark Green Wool", 35, ( (55,76,24),),13), 56 | ("Red Wool", 35, ( (162,44,42),),14), 57 | ("Black Wool", 35, ( (26,23,23),),15), 58 | ("Gold", 41, ( (249,236,77),),0), 59 | ("Iron", 42, ( (230,230,230),),0), 60 | ("TwoHalves", 43, ( (159,159,159),),0), 61 | ("Brick", 45, ( (155,110,97),),0), 62 | ("Mossy Cobblestone", 48, ( (90,108,90),),0), 63 | ("Obsidian", 49, ( (20,18,29),),0), 64 | ("Diamond Ore", 56, ( (129,140,143),),0), 65 | ("Diamond Block", 57, ( (99,219,213),),0), 66 | ("Workbench", 58, ( (107,71,42),),0), 67 | ("Redstone Ore", 73, ( (132,107,107),),0), 68 | ("Snow Block", 80, ( (239,251,251),),0), 69 | ("Clay", 82, ( (158,164,176),),0), 70 | ("Jukebox", 84, ( (107,73,55),),0), 71 | ("Pumpkin", 86, ( (192,118,21),),0), 72 | ("Netherrack", 87, ( (110,53,51),),0), 73 | ("Soul Sand", 88, ( (84,64,51),),0), 74 | ("Glowstone", 89, ( (137,112,64),),0) 75 | ) 76 | 77 | def getBlockFromColor(RGB): 78 | smallestDistIndex = -1 79 | smallestDist = 300000 80 | curIndex = 0 81 | for block in possibleBlocks: 82 | for blockRGB in block[2]: 83 | curDist = getColorDist(RGB, blockRGB) 84 | 85 | if (curDist < smallestDist): 86 | smallestDist = curDist 87 | smallestDistIndex = curIndex 88 | 89 | curIndex = curIndex + 1 90 | 91 | if (smallestDistIndex == -1): 92 | return -1 93 | 94 | return possibleBlocks[smallestDistIndex] 95 | 96 | def getColorDist(colorRGB, blockRGB): 97 | return sqrt( pow(colorRGB[0]-blockRGB[0],2) + pow(colorRGB[1]-blockRGB[1],2) + pow(colorRGB[2]-blockRGB[2],2)) 98 | 99 | pos = mc.player.getPos() 100 | 101 | maxsize = (100, 100) 102 | 103 | im = Image.open('mario.gif') 104 | im.thumbnail(maxsize, Image.ANTIALIAS) 105 | rgb_im = im.convert('RGB') 106 | rows, columns = rgb_im.size 107 | print rows, columns 108 | for r in range(rows): 109 | for c in range(columns): 110 | rgb = rgb_im.getpixel((r, c)) 111 | mc_block = getBlockFromColor(rgb) 112 | mc.setBlock(pos.x+r, pos.y, pos.z+c, mc_block[1]) 113 | -------------------------------------------------------------------------------- /lesson_1.md: -------------------------------------------------------------------------------- 1 | # Lesson 1 2 | 3 | #### Goal 4 | Teleport your character to a point you define in code. 5 | 6 | #### New Concepts 7 | 8 | Variables are basically nametags used to refer to something, and are set using a single equals sign. 9 | 10 | ```python 11 | x = 5 12 | ``` 13 | 14 | You can set numbers into variables to "remember" them for later use. 15 | 16 | ```python 17 | player_position = mc.player.getPos() 18 | ``` 19 | 20 | You can also save important information, such as a player's position, into variables. 21 | 22 | 23 | #### Code 24 | Open up script.py in a code editor. We'll be going through this file line-by-line to start with. 25 | 26 | ```python 27 | import mcpi.minecraft as minecraft 28 | ``` 29 | This first line imports the mcpi.minecraft library, making it available under the name 'minecraft' 30 | 31 | ----------------- 32 | 33 | ```python 34 | #NOTE - replace "seanybob" below with your name 35 | mc = minecraft.Minecraft.create(address="199.96.85.3", name="seanybob") 36 | ``` 37 | 38 | - Anything prefixed by the '#' symbol is a comment for humans, and is ignored by the computer. 39 | - Here we see we are creating a connection to the minecraft server and storing it in a variable named "mc". 40 | - The server we are connecting to is located at IP address 127.0.0.1 and linking to the login name "seanybob". 41 | - As mentioned in the comment above it, you need to change "seanybob" to your minecraft name that you chose. 42 | 43 | ----------------- 44 | 45 | ```python 46 | x = 10 47 | y = 110 48 | z = 12 49 | ``` 50 | 51 | - Here we are creating 3 variables for later use. 52 | - In the variable named 'x', we are storing the number 10. 53 | - In the variable named 'y', we are storing the number 110. 54 | - In the variable named 'z', we are storing the number 12. 55 | 56 | ----------------- 57 | 58 | ```python 59 | mc.player.setPos(x, y, z) 60 | ``` 61 | 62 | - Using our connection to our minecraft server (we previously saved the connection to the mc variable)... 63 | - We will access our player object inside that minecraft server... 64 | - And then set our position in the minecraft server to the x/y/z coordinates indicated by the variables we just set earlier. 65 | 66 | The variables in the call get replaced, essentially turning into the values we stored in them earlier: 67 | 68 | mc.player.setPos(10, 110, 12) 69 | 70 | 71 | #### Terminal 72 | 73 | To execute the script, in your terminal cd to the directory the script is located: 74 | ```shell 75 | cd ~/TeachCraft-Challenges 76 | ``` 77 | 78 | Then run the script like so: 79 | ```shell 80 | python script.py 81 | ``` 82 | 83 | Each time you edit the code, you will need to re-run the script using the above command. 84 | 85 | ---------------------- 86 | 87 | # CHALLENGES 88 | 89 | - Modify the script to go to a different x/y/z location. 90 | - Figure out which of the three coordinates (x, y, or z) controls how high up you are in the air. 91 | -------------------------------------------------------------------------------- /lesson_2.md: -------------------------------------------------------------------------------- 1 | # Lesson 2 2 | 3 | #### Goal 4 | Make a path of flowers spawn behind you while you walk. (Can replace flowers with any block id, such as lava) 5 | 6 | #### New Concepts 7 | 8 | ```python 9 | print "Hi!" 10 | my_variable = 5 11 | print my_variable 12 | ``` 13 | 14 | - The print command will print things to the terminal. 15 | - This is useful for debugging, both to see when code got executed, and to see the contents of variables 16 | 17 | ----------------- 18 | 19 | Now for a new construct, an infinite while loop! 20 | 21 | Infinite while loops are used to make a set of code execute repeatedly, over and over, until the user decides to stop it. 22 | 23 | An infinite while loop's structure looks like this: 24 | 25 | ```python 26 | while True: 27 | 28 | 29 | ``` 30 | 31 | For example, will constantly print the pattern "1 2 3 1 2 3 1 2 3 1 2 3..." over and over. 32 | 33 | ```python 34 | while True: 35 | print "1" 36 | print "2" 37 | print "3" 38 | ``` 39 | 40 | In summary, an infinite while loop will keep executing the same code over and over until its it's forced to stop by the user by pressing control+c. 41 | 42 | #### Code 43 | Open up script.py in a code editor. Delete everything in it, we'll be starting from scratch! 44 | 45 | ```python 46 | import mcpi.minecraft as minecraft 47 | mc = minecraft.Minecraft.create(address="199.96.85.3", name="seanybob") 48 | ``` 49 | The first 2 lines are the same as they were in the previous lesson. Be sure to replace "seanybob" with your name! 50 | 51 | ----------------- 52 | 53 | ```python 54 | import time 55 | ``` 56 | This line will import an additional python library we will be using called time - allowing us to "pause" the script for several seconds as needed. 57 | 58 | ----------------- 59 | 60 | ```python 61 | print "Before loop." 62 | ``` 63 | This line just prints text to the terminal. We'll be using it as a method of debugging, so we can see when this line of code got executed. 64 | 65 | ----------------- 66 | 67 | ```python 68 | while True: 69 | ``` 70 | Next, we open a while loop. Note that this loop's condition is simply 'True'. This means it will continue executing, forever, until you manually kill it with control+C. You can also close the terminal to kill it. This is also called an infinite loop. 71 | 72 | ----------------- 73 | 74 | ```python 75 | #Retrieve the current player's X, Y, and Z coordinates 76 | pos = mc.player.getPos() 77 | ``` 78 | Inside the while loop, the first thing we do is get the player's x/y/z coordinates. You'll note this is similar to the setPos function from lesson 1, though it's retrieving them instead of setting them! 79 | 80 | IMPORTANT NOTE - you'll observe this line of code (and several lines underneath) are indented! This is how python tells which code belongs to the while loop, and needs to be executed in a loop. Indention is important in python! 81 | 82 | ----------------- 83 | 84 | ```python 85 | #Store the current player's coordinates in our variables x/y/z 86 | x = pos.x 87 | y = pos.y 88 | z = pos.z 89 | ``` 90 | Still inside the while loop, we store the player's position into x/y/z variables for later use. 91 | 92 | ----------------- 93 | 94 | ```python 95 | #This is the minecraft block ID of the flower block. 96 | block = 38 97 | ``` 98 | Still inside the while loop, we set Minecraft's block id for a flower to a variable called 'block' that we'll use later. You could put any block ID you want here. To see a list of block ids, check out [this website](http://minecraft-ids.grahamedgecombe.com/). 99 | 100 | ----------------- 101 | 102 | ```python 103 | #Set the block at the x/y/z coordinates of the current player to the block id we chose above. 104 | mc.setBlock(x, y, z, block) 105 | ``` 106 | Still inside the while loop, here we use our connection to the minecraft instance to set the block located at our x/y/z coordinates we stored earlier to the block id we stored earlier. 107 | 108 | Since the x/y/z coordinates we stored earlier were our position, and the block id we stored earlier was a flower, what we are doing is putting a flower in the spot we are standing! 109 | 110 | Moreover, since this is a loop, it means we should make a trail of flowers behind us while we walk! Let's finish this off so we can test it. 111 | 112 | ----------------- 113 | 114 | ```python 115 | #Wait for two tenths of a second, then jump back to the top of the while loop. 116 | print "LOOPING, waiting 0.2 seconds" 117 | time.sleep(0.2) 118 | ``` 119 | Still inside the while loop, here we print a statement letting us know the loop executed, then we tell the program to pause and wait for 0.2 seconds. This is important, because computers are lightning fast. If you don't do that pause, the computer will set the current block you are standing on to a flower thousands and thousands of times a second, and probably crash the minecraft server. 120 | 121 | ----------------- 122 | 123 | ```python 124 | print "End of loop." 125 | ``` 126 | Finally the last line, which is OUTSIDE the while loop. We know that because it's not indented - that's how the computer knows the while loop has ended. 127 | 128 | 129 | #### Terminal 130 | 131 | Run the script like so: 132 | ```shell 133 | python script.py 134 | ``` 135 | 136 | Note that it will run in an infinite loop. To end it you can hit control+C, or just close the terminal. 137 | 138 | 139 | # CHALLENGES 140 | 141 | - Modify the script above to put lava down instead of a flower ([block id explorer](http://minecraft-ids.grahamedgecombe.com/)) 142 | - Instead of putting the lava under the player, can you put it one block behind them (or to the side?) 143 | - Try experimenting with a few other block IDs! Some ideas: 144 | - You could make a yellow brick road out of gold blocks. 145 | - You could lay minecraft track underneath where you walk, creating a roller coaster rapidly! 146 | 147 | 148 | -------------------------------------------------------------------------------- /lesson_3.md: -------------------------------------------------------------------------------- 1 | # Lesson 3 2 | 3 | #### Goal 4 | Grant your character the ability to walk on water (by turning water blocks underneath the player into ice blocks) 5 | 6 | #### New Concepts 7 | 8 | ```python 9 | if : 10 | 11 | ``` 12 | 13 | - We have another construct called an if statement. 14 | - An If statement has a condition it checks. 15 | - If the condition passes (is true), it executes the indented code underneath it ONCE. 16 | - If the condition fails (it is not true), it skips the indented code underneath it. 17 | - So an IF statement executes its code once, while a While loop executes it repeatedly! 18 | 19 | ```python 20 | x = 4 21 | if x == 3: 22 | print "x is 3" 23 | ``` 24 | 25 | This only runs the print statement if x is 3. Note the double equals sign in the if statement! It's super important. Double equals checks if something is equivalent (compared to a single equals which assigns something to a variable). 26 | 27 | ```python 28 | if y > 10: 29 | if x > 10: 30 | print "y is at least 10 blocks high and x is at least 10 blocks distant" 31 | ``` 32 | 33 | Note that you can stack if statements, so long as you stack the indentation. 34 | 35 | ```python 36 | if y >= 10 and y <= 20: 37 | print "y between 10 and 20 blocks high" 38 | ``` 39 | 40 | You can also combine if statements using "and" / "or" operators. 41 | 42 | 43 | #### Code 44 | Open up script.py in a code editor. Delete everything in it, we'll be starting from scratch! 45 | 46 | ```python 47 | import time 48 | import mcpi.minecraft as minecraft 49 | mc = minecraft.Minecraft.create(address="199.96.85.3", name="seanybob") 50 | ``` 51 | The first 3 lines are the same as they were in the previous lesson. Be sure to replace "seanybob" with your name! 52 | 53 | ```python 54 | water_block = 9 55 | ice_block = 79 56 | ``` 57 | 58 | Next we store the block IDs for water and ice in variables for us to use later. 59 | 60 | ```python 61 | while True: 62 | ``` 63 | 64 | Next we want an infinite loop that keeps running our next chunk of code until we tell it to stop. 65 | 66 | ```python 67 | pos = mc.player.getPos() 68 | x = pos.x 69 | y = pos.y 70 | z = pos.z 71 | ``` 72 | Inside the while loop, we want to get the player's current position, and stick it in variables for us to refer to later. 73 | 74 | ```python 75 | block_below_player = mc.getBlock(x, y - 1, z) 76 | ``` 77 | Inside the while loop, we want to get the block beneath the player. To do this, we execute the getBlock function, passing it the x/y/z coordinate right below the player! Note the y-1. Since the player's location is x/y/z, by subtracting 1 from y we get the block immediately underneath the player. 78 | 79 | ```python 80 | #If the block below the player is water, turn it into ice. 81 | if block_below_player == water_block: 82 | mc.setBlock(x, y - 1, z, ice_block) 83 | ``` 84 | Inside the while loop, Check and see if the block underneath the player is water. If so, turn it into ice! 85 | 86 | ```python 87 | time.sleep(0.2) 88 | ``` 89 | Inside the while loop, Pause for 0.2 seconds 90 | 91 | 92 | #### Terminal 93 | 94 | Run the script like so: 95 | ```shell 96 | python script.py 97 | ``` 98 | 99 | Note that it will run in an infinite loop. To end it you can hit control+C, or just close the terminal. 100 | 101 | 102 | # CHALLENGES 103 | 104 | You may have noticed that the walk on water script isn't perfect, because there's a slight delay before your script detects you are above water, and you sometimes fall in. 105 | 106 | To fix that, instead of just checking the block underneath the player, modify the script to also check the blocks directly underneath and in front, behind, and to the sides of the player. 107 | 108 | This way, we can turn blocks into ice right before the player walks on them! 109 | 110 | 111 | -------------------------------------------------------------------------------- /lesson_4.md: -------------------------------------------------------------------------------- 1 | # Lesson 4 2 | 3 | #### Goal 4 | Create a building programmatically 5 | 6 | #### New Concepts 7 | 8 | Variables can refer to each other, similar to algebra 9 | ```python 10 | x = 10 11 | x2 = x + 5 12 | ``` 13 | x2 now is 15 14 | 15 | ```python 16 | mc.setBlocks(x, y, z, x2, y2, z2, block_id) 17 | ``` 18 | 19 | - There is a new function we can use called setBlocks. 20 | - The setBlocks function takes as input the x/y/z coordinates of two opposite corners of a building. 21 | - For example, if you were to imagine looking at your house from the street, the function would take as input the location of the bottom front right of your house AND the top back left. 22 | - The function then sets every block inside the cuboid you defined as the block_id you passed in 23 | 24 | #### Code 25 | Open up script.py in a code editor. Delete everything in it, we'll be starting from scratch! 26 | 27 | ```python 28 | import mcpi.minecraft as minecraft 29 | mc = minecraft.Minecraft.create(address="199.96.85.3", name="seanybob") 30 | ``` 31 | The first 2 lines are similar to the previous lesson. Be sure to replace "seanybob" with your name! 32 | 33 | ```python 34 | #Get the player's current position so we can build the pyramid there. 35 | pos = mc.player.getPos() 36 | x = pos.x 37 | y = pos.y 38 | z = pos.z 39 | ``` 40 | 41 | This position is the bottom front right of our building - let's put it where our user is standing, so we can find it easy! 42 | 43 | ```python 44 | x2 = x + 10 45 | y2 = y + 5 46 | z2 = z + 8 47 | ``` 48 | 49 | - This position is the top back left of our building. 50 | - Note that we are defining it in relationship to the x/y/z (bottom right front) of our building 51 | - That is to say, the top back left's x value is the bottom right front's x value + 10. 52 | 53 | ```python 54 | block_id = 4 55 | ``` 56 | This is the block id for cobbestone. Swap it to a different block ID if you'd like from [here](http://minecraft-ids.grahamedgecombe.com/). 57 | 58 | ```python 59 | mc.setBlocks(x, y, z, x2, y2, z2, block_id) 60 | ``` 61 | The result of the above should give us a building that is 10 blocks by 5 blocks by 8 blocks 62 | 63 | #### Terminal 64 | 65 | Run the script like so: 66 | ```shell 67 | python script.py 68 | ``` 69 | 70 | # CHALLENGES 71 | 72 | - Modify the script above, and change the block used to build the building 73 | - Make the building twice as tall. 74 | - Add the code below to the bottom of your script (don't delete anything, just add it) and determine what it does. 75 | ```python 76 | mystery_block_id = 0 77 | mc.setBlocks(x+1, y+1, z+1, x2-1, y2-1, z2-1, mystery_block_id) 78 | ``` 79 | 80 | -------------------------------------------------------------------------------- /lesson_5.md: -------------------------------------------------------------------------------- 1 | # Lesson 5 2 | 3 | #### Goal 4 | Using the concepts you learned in lesson4, make a pyramid programmatically. 5 | ``` 6 | _ 7 | ___ 8 | _____ 9 | _______ 10 | ``` 11 | 12 | Hint: Instead of thinking of the pyramid as one building, think of every layer of the pyramid as a separate building that is only 1 block high. 13 | 14 | #### New Concepts 15 | 16 | - Copying and Pasting is one of the most important tools for a developer! 17 | - If you are writing similar code repeatedly, consider copying and pasting it, then editing the resulting code. 18 | - The shortcut for copying is cmd+C on a mac, or control+C on a windows machine. 19 | - The shortcut for pasting is cmd+V on a mac, or control+V on a windows machine. 20 | 21 | #### Code 22 | Open up script.py in a code editor. Delete everything in it, we'll be starting from scratch! 23 | 24 | ```python 25 | import mcpi.minecraft as minecraft 26 | mc = minecraft.Minecraft.create(address="199.96.85.3", name="seanybob") 27 | ``` 28 | The first 2 lines are the same as the previous lesson. Be sure to replace "seanybob" with your name! 29 | 30 | ```python 31 | block_id = 24 32 | ``` 33 | This is the block id for sandstone, which is good for a pyramid. Swap it to a different block ID if you'd like from [here](http://minecraft-ids.grahamedgecombe.com/). 34 | 35 | ```python 36 | pos = mc.player.getPos() 37 | x = pos.x 38 | y = pos.y 39 | z = pos.z 40 | ``` 41 | Get the player's current position so we can build the pyramid there. 42 | 43 | 44 | 45 | ```python 46 | x2 = x + 8 #Make it 8 blocks wide. 47 | y2 = y #Make it only one block high, so don't add anything here. 48 | z2 = z + 8 #Make it 8 blocks long. 49 | 50 | mc.setBlocks(x, y, z, x2, y2, z2, block_id) 51 | ``` 52 | 53 | Craft the bottom layer of the pyramid. This is the chunk of code you will need to copy and paste to create the additional layers. Create 3 more layers after this one to complete the pyramid on your own. 54 | 55 | #### Terminal 56 | 57 | Run the script like so: 58 | ```shell 59 | python script.py 60 | ``` 61 | 62 | # CHALLENGES 63 | 64 | - Complete the remaining 3 layers of the pyramid (missing from the code above) 65 | 66 | -------------------------------------------------------------------------------- /lesson_6.md: -------------------------------------------------------------------------------- 1 | # Lesson 6 2 | 3 | #### Goal 4 | In this lesson, we're going to take the pyramid we created in lesson 5, 5 | and write an algorithm that will let us dynamically create it any size! 6 | To do this, look back at lesson 4, and see if you can detect a pattern in the numbers 7 | and how they change between each layer. 8 | 9 | #### New Concepts 10 | 11 | We have another new construct, a for loop! 12 | 13 | For loops are used to repeat some code a set number of times. 14 | 15 | A for loop looks similar to a while loop. Observe the example below, where we print the numbers 0 through 4. 16 | 17 | ```python 18 | for i in range(5): 19 | print i 20 | ``` 21 | 22 | Note three things. 23 | 24 | - First, you can change the number 5 to make it loop a different number of times. 25 | - Second, the current # of the loop is saved in a variable called "i", which you can access in the loop - observe how we are printing that variable out! 26 | - Third, note that it printed the numbers 0-4 (instead of 1-5)! This is because computers start counting from the number 0, instead of the number 1 like humans tend to. So by telling it you want a for loop with range(5), you are saying give me 5 iterations or numbers - which is 0 through 4! 27 | 28 | #### Code 29 | Open up script.py in a code editor. Delete everything in it, we'll be starting from scratch! 30 | 31 | ```python 32 | import mcpi.minecraft as minecraft 33 | mc = minecraft.Minecraft.create(address="199.96.85.3", name="seanybob") 34 | ``` 35 | The first 2 lines are the same as the previous lesson. Be sure to replace "seanybob" with your name! 36 | 37 | ```python 38 | block_id = 24 39 | ``` 40 | This is the block id for sandstone, which is good for a pyramid. Swap it to a different block ID if you'd like from [here](http://minecraft-ids.grahamedgecombe.com/). 41 | 42 | ```python 43 | pos = mc.player.getPos() 44 | ``` 45 | Get the player's current position so we can build the pyramid there. 46 | 47 | 48 | 49 | ```python 50 | for i in range(5): 51 | x = pos.x + i 52 | y = pos.y + i 53 | z = pos.z + i 54 | 55 | x2 = x + ? 56 | y2 = y 57 | z2 = z + ? 58 | mc.setBlocks(x, y, z, x2, y2, z2, block) 59 | ``` 60 | This is the foundation of your algorithm! We are going to create 5 layers in our pyramid, and thus loop through this code 5 times. 61 | 62 | Note that the variable "i" will be replaced with the current iteration of our while loop (starting with 0 and going up to 4). 63 | 64 | Note that the algorithm is not complete! Check the challenges below to see what you need to fix. 65 | 66 | #### Terminal 67 | 68 | Run the script like so: 69 | ```shell 70 | python script.py 71 | ``` 72 | 73 | # CHALLENGES 74 | 75 | - Did you notice a pattern in lesson 5? Make that pattern an algorithm above! Figure out what you need to replace the question marks with in the code supplied. 76 | 77 | - Change the "5" in range(5) to a slightly larger number, like 10. CAREFUL! If you go too high, you'll crash the server! Keep it under 15 to be kind to your neighbors. 78 | 79 | -------------------------------------------------------------------------------- /lesson_7.md: -------------------------------------------------------------------------------- 1 | # Lesson 7 2 | 3 | #### Goal 4 | 5 | In this lesson, we'll be setting up a magic system! We'll create a listener that waits for us to type a spell into minecraft chat, and once a spell is typed, the script executes the python code corresponding to that spell! 6 | 7 | #### New Concepts 8 | 9 | In this lesson, we'll look at another for loop! 10 | 11 | ```python 12 | for chatpost in mc.events.pollChatPosts(): 13 | print chatpost 14 | ``` 15 | 16 | This code will execute the code inside the while loop once for every chat message found in the minecraft chat post since the last time we looked. By sticking this in an infinite while loop, we can actually watch all messages posted in chat, forever! 17 | 18 | ```python 19 | if chatpost.message.lower() == "explode": 20 | print "explode was the message!" 21 | ``` 22 | You can use an if statement like this to test if the word explode IS the entire message. 23 | 24 | ```python 25 | if "explode" in chatpost.message.lower(): 26 | print "frank is inside the message!" 27 | ``` 28 | You can use an if statement like this to test if the word "explode" is anywhere in the message. 29 | 30 | ```python 31 | who = chatpost.message.lower().split(' ')[1] 32 | ``` 33 | If you have a message where you are typing in a command AND a name (e.g. "explode joe"), this is how you extract the name joe and stick it in a variable. The code above will always extract the second word typed in a string (that what the 1 index is specifying). 34 | 35 | #### Code 36 | Open up script.py in a code editor. Delete everything in it, we'll be starting from scratch! 37 | 38 | ```python 39 | from mcpi import minecraft 40 | import time 41 | 42 | server_address = "199.96.85.3" 43 | my_player_name = "seanybob" 44 | 45 | mc = minecraft.Minecraft.create(address=server_address, name=my_player_name) 46 | ``` 47 | These first few lines are similar to the previous lesson. Be sure to replace "seanybob" with your name! 48 | 49 | ```python 50 | my_id = mc.getPlayerEntityId(my_player_name) 51 | ``` 52 | We first need to get our player ID, so we can focus on just listening to messages posted by us in chat 53 | 54 | ```python 55 | print "Script started! Type in 'hi' or 'testing' in minecraft chat to activate. Hit command (or control) + C in your terminal to stop." 56 | ``` 57 | Let's add a print message to tell us when the script started. 58 | 59 | ```python 60 | #Watch for chat messages 61 | while True: 62 | 63 | #For each chat message since the last time we checked... 64 | for chatpost in mc.events.pollChatPosts(): 65 | 66 | #Was the chat message sent by me? 67 | if chatpost.entityId == my_id: 68 | 69 | #if so, let's do something! 70 | if chatpost.message.lower() == "hi": 71 | mc.postToChat("Hello right back at you!") 72 | 73 | elif chatpost.message.lower() == "testing": 74 | mc.postToChat("123") 75 | 76 | time.sleep(.1) 77 | ``` 78 | This is the foundation of our script! In an infinite while loop, we listen for chatposts. Whenever a chatpost is detected, we check if it was sent by us. If so, we check the contents of the message. If it matches one of the messages we are looking for, we execute python code! 79 | 80 | #### Terminal 81 | 82 | Run the script like so: 83 | ```shell 84 | python script.py 85 | ``` 86 | 87 | # CHALLENGE 1 88 | 89 | Add a new spell called "shield" that builds a glass shield "building" all around you, making it so nothing can attack you but you can still see. Hint: Refer to lesson 4 90 | 91 | # CHALLENGE 2 92 | 93 | Add a new spell called "nuke" that spawns several TNT around you. Spawn Fire (item ID 51) on or below the TNT to activate it. Make sure you spawn the TNT far enough away from you it doesn't kill you, but close enough it can take out your enemies! 94 | 95 | # CHALLENGE 3 96 | 97 | Add a new spell called "bird". This spell should create a block 99 blocks above your current position, then teleport you 100 blocks above your current position (onto that newly created block/platform). It should wait 3 seconds, then teleport you back to your original position and destroy the temporary block/platform. Thus, this spell gives you a bird's eye view of your current location. 98 | 99 | # CHALLENGE 4 100 | 101 | Using the player .getPos() and .getDirection() functions, craft a new spell called "jumper" that teleports forward in the direction you are looking. Allow the user to specify a multiplier for how far forward they want to go (e.g. jumper 20). After calculating the location you will be teleporting the user to, but before you teleport the user, check and see if the block below the position is air. If so, spawn a block first for the user to land on in the new position. Also consider how to stop the user from jumping into mountains! 102 | 103 | # CHALLENGE 5 104 | 105 | Craft a new spell called "py" that takes as input a string of python code, which it then evals. Now that you don't want to .lower() user input in this case. Bonus points for catching errors and printing them to the minecraft console. 106 | -------------------------------------------------------------------------------- /mcpi/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teachthenet/TeachCraft-Challenges/ab5b8cc57c71e423be932897cd5200c231e494ec/mcpi/__init__.py -------------------------------------------------------------------------------- /mcpi/block.py: -------------------------------------------------------------------------------- 1 | class Block: 2 | """Minecraft PI block description. Can be sent to Minecraft.setBlock/s""" 3 | def __init__(self, id, data=0): 4 | self.id = id 5 | self.data = data 6 | 7 | def __cmp__(self, rhs): 8 | return hash(self) - hash(rhs) 9 | 10 | def __hash__(self): 11 | return (self.id << 8) + self.data 12 | 13 | def withData(self, data): 14 | return Block(self.id, data) 15 | 16 | def __iter__(self): 17 | """Allows a Block to be sent whenever id [and data] is needed""" 18 | return iter((self.id, self.data)) 19 | 20 | def __repr__(self): 21 | return "Block(%d, %d)"%(self.id, self.data) 22 | 23 | AIR = Block(0) 24 | STONE = Block(1) 25 | GRASS = Block(2) 26 | DIRT = Block(3) 27 | COBBLESTONE = Block(4) 28 | WOOD_PLANKS = Block(5) 29 | SAPLING = Block(6) 30 | BEDROCK = Block(7) 31 | WATER_FLOWING = Block(8) 32 | WATER = WATER_FLOWING 33 | WATER_STATIONARY = Block(9) 34 | LAVA_FLOWING = Block(10) 35 | LAVA = LAVA_FLOWING 36 | LAVA_STATIONARY = Block(11) 37 | SAND = Block(12) 38 | GRAVEL = Block(13) 39 | GOLD_ORE = Block(14) 40 | IRON_ORE = Block(15) 41 | COAL_ORE = Block(16) 42 | WOOD = Block(17) 43 | LEAVES = Block(18) 44 | GLASS = Block(20) 45 | LAPIS_LAZULI_ORE = Block(21) 46 | LAPIS_LAZULI_BLOCK = Block(22) 47 | SANDSTONE = Block(24) 48 | BED = Block(26) 49 | COBWEB = Block(30) 50 | GRASS_TALL = Block(31) 51 | WOOL = Block(35) 52 | FLOWER_YELLOW = Block(37) 53 | FLOWER_CYAN = Block(38) 54 | MUSHROOM_BROWN = Block(39) 55 | MUSHROOM_RED = Block(40) 56 | GOLD_BLOCK = Block(41) 57 | IRON_BLOCK = Block(42) 58 | STONE_SLAB_DOUBLE = Block(43) 59 | STONE_SLAB = Block(44) 60 | BRICK_BLOCK = Block(45) 61 | TNT = Block(46) 62 | BOOKSHELF = Block(47) 63 | MOSS_STONE = Block(48) 64 | OBSIDIAN = Block(49) 65 | TORCH = Block(50) 66 | FIRE = Block(51) 67 | STAIRS_WOOD = Block(53) 68 | CHEST = Block(54) 69 | DIAMOND_ORE = Block(56) 70 | DIAMOND_BLOCK = Block(57) 71 | CRAFTING_TABLE = Block(58) 72 | FARMLAND = Block(60) 73 | FURNACE_INACTIVE = Block(61) 74 | FURNACE_ACTIVE = Block(62) 75 | DOOR_WOOD = Block(64) 76 | LADDER = Block(65) 77 | STAIRS_COBBLESTONE = Block(67) 78 | DOOR_IRON = Block(71) 79 | REDSTONE_ORE = Block(73) 80 | SNOW = Block(78) 81 | ICE = Block(79) 82 | SNOW_BLOCK = Block(80) 83 | CACTUS = Block(81) 84 | CLAY = Block(82) 85 | SUGAR_CANE = Block(83) 86 | FENCE = Block(85) 87 | GLOWSTONE_BLOCK = Block(89) 88 | BEDROCK_INVISIBLE = Block(95) 89 | STONE_BRICK = Block(98) 90 | GLASS_PANE = Block(102) 91 | MELON = Block(103) 92 | FENCE_GATE = Block(107) 93 | GLOWING_OBSIDIAN = Block(246) 94 | NETHER_REACTOR_CORE = Block(247) 95 | -------------------------------------------------------------------------------- /mcpi/connection.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import select 3 | import sys 4 | from util import flatten_parameters_to_string 5 | 6 | """ @author: Aron Nieminen, Mojang AB""" 7 | 8 | class RequestError(Exception): 9 | pass 10 | 11 | class Connection: 12 | """Connection to a Minecraft Pi game""" 13 | RequestFailed = "Fail" 14 | 15 | def __init__(self, address, port): 16 | self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 17 | self.socket.connect((address, port)) 18 | self.lastSent = "" 19 | 20 | def drain(self): 21 | """Drains the socket of incoming data""" 22 | while True: 23 | readable, _, _ = select.select([self.socket], [], [], 0.0) 24 | if not readable: 25 | break 26 | data = self.socket.recv(1500) 27 | e = "Drained Data: <%s>\n"%data.strip() 28 | e += "Last Message: <%s>\n"%self.lastSent.strip() 29 | sys.stderr.write(e) 30 | 31 | def send(self, f, *data): 32 | """Sends data. Note that a trailing newline '\n' is added here""" 33 | s = "%s(%s)\n"%(f, flatten_parameters_to_string(data)) 34 | #print "f,data:",f,data 35 | #print "s",s 36 | self.drain() 37 | self.lastSent = s 38 | self.socket.sendall(s) 39 | 40 | def receive(self): 41 | """Receives data. Note that the trailing newline '\n' is trimmed""" 42 | s = self.socket.makefile("r").readline().rstrip("\n") 43 | if s == Connection.RequestFailed: 44 | raise RequestError("%s failed"%self.lastSent.strip()) 45 | return s 46 | 47 | def sendReceive(self, *data): 48 | """Sends and receive data""" 49 | self.send(*data) 50 | return self.receive() 51 | -------------------------------------------------------------------------------- /mcpi/event.py: -------------------------------------------------------------------------------- 1 | from vec3 import Vec3 2 | 3 | class BlockEvent: 4 | """An Event related to blocks (e.g. placed, removed, hit)""" 5 | HIT = 0 6 | 7 | def __init__(self, type, x, y, z, face, entityId): 8 | self.type = type 9 | self.pos = Vec3(x, y, z) 10 | self.face = face 11 | self.entityId = entityId 12 | 13 | def __repr__(self): 14 | sType = { 15 | BlockEvent.HIT: "BlockEvent.HIT" 16 | }.get(self.type, "???") 17 | 18 | return "BlockEvent(%s, %d, %d, %d, %d, %d)"%( 19 | sType,self.pos.x,self.pos.y,self.pos.z,self.face,self.entityId); 20 | 21 | @staticmethod 22 | def Hit(x, y, z, face, entityId): 23 | return BlockEvent(BlockEvent.HIT, x, y, z, face, entityId) 24 | 25 | class ChatEvent: 26 | """An Event related to chat (e.g. posts)""" 27 | POST = 0 28 | 29 | def __init__(self, type, entityId, message): 30 | self.type = type 31 | self.entityId = entityId 32 | self.message = message 33 | 34 | def __repr__(self): 35 | sType = { 36 | ChatEvent.POST: "ChatEvent.POST" 37 | }.get(self.type, "???") 38 | 39 | return "ChatEvent(%s, %d, %s)"%( 40 | sType,self.entityId,self.message); 41 | 42 | @staticmethod 43 | def Post(entityId, message): 44 | return ChatEvent(ChatEvent.POST, entityId, message) 45 | 46 | -------------------------------------------------------------------------------- /mcpi/minecraft.py: -------------------------------------------------------------------------------- 1 | from connection import Connection 2 | from vec3 import Vec3 3 | from event import BlockEvent, ChatEvent 4 | from block import Block 5 | import math 6 | from util import flatten 7 | 8 | """ Minecraft PI low level api v0.1_1 9 | 10 | Note: many methods have the parameter *arg. This solution makes it 11 | simple to allow different types, and variable number of arguments. 12 | The actual magic is a mix of flatten_parameters() and __iter__. Example: 13 | A Cube class could implement __iter__ to work in Minecraft.setBlocks(c, id). 14 | 15 | (Because of this, it's possible to "erase" arguments. CmdPlayer removes 16 | entityId, by injecting [] that flattens to nothing) 17 | 18 | @author: Aron Nieminen, Mojang AB 19 | 20 | Updated to included additional functionality provided by RaspberryJuice: 21 | - getBlocks() : implemented 22 | - .create() : can now accept "name" (player name) for use in multiplayer 23 | - CmdPositioner.getDirection 24 | - CmdPositioner.getPitch 25 | - CmdPositioner.getRotation 26 | - getPlayerEntityId 27 | - CmdEvents.pollChatPosts 28 | """ 29 | 30 | 31 | def intFloor(*args): 32 | return [int(math.floor(x)) for x in flatten(args)] 33 | 34 | class CmdPositioner: 35 | """Methods for setting and getting positions""" 36 | def __init__(self, connection, packagePrefix): 37 | self.conn = connection 38 | self.pkg = packagePrefix 39 | 40 | def getPos(self, id): 41 | """Get entity position (entityId:int) => Vec3""" 42 | s = self.conn.sendReceive(self.pkg + ".getPos", id) 43 | return Vec3(*map(float, s.split(","))) 44 | 45 | def setPos(self, id, *args): 46 | """Set entity position (entityId:int, x,y,z)""" 47 | self.conn.send(self.pkg + ".setPos", id, args) 48 | 49 | def getTilePos(self, id): 50 | """Get entity tile position (entityId:int) => Vec3""" 51 | s = self.conn.sendReceive(self.pkg + ".getTile", id) 52 | return Vec3(*map(int, s.split(","))) 53 | 54 | def setTilePos(self, id, *args): 55 | """Set entity tile position (entityId:int) => Vec3""" 56 | self.conn.send(self.pkg + ".setTile", id, intFloor(*args)) 57 | 58 | def getDirection(self, id): 59 | """Get entity direction (entityId:int) => Vec3""" 60 | s = self.conn.sendReceive(self.pkg + ".getDirection", id) 61 | return Vec3(*map(float, s.split(","))) 62 | 63 | def getRotation(self, id): 64 | """get entity rotation (entityId:int) => float""" 65 | return float(self.conn.sendReceive(self.pkg + ".getRotation", id)) 66 | 67 | def getPitch(self, id): 68 | """get entity pitch (entityId:int) => float""" 69 | return float(self.conn.sendReceive(self.pkg + ".getPitch", id)) 70 | 71 | def setting(self, setting, status): 72 | """Set a player setting (setting, status). keys: autojump""" 73 | self.conn.send(self.pkg + ".setting", setting, 1 if bool(status) else 0) 74 | 75 | 76 | class CmdEntity(CmdPositioner): 77 | """Methods for entities""" 78 | def __init__(self, connection): 79 | CmdPositioner.__init__(self, connection, "entity") 80 | 81 | 82 | class CmdPlayer(CmdPositioner): 83 | """Methods for the host (Raspberry Pi) player""" 84 | def __init__(self, connection, name=None): 85 | CmdPositioner.__init__(self, connection, "player") 86 | self.conn = connection 87 | self.name = name 88 | 89 | def getPos(self): 90 | return CmdPositioner.getPos(self, self.name) 91 | def setPos(self, *args): 92 | return CmdPositioner.setPos(self, self.name, args) 93 | def getTilePos(self): 94 | return CmdPositioner.getTilePos(self, self.name) 95 | def setTilePos(self, *args): 96 | return CmdPositioner.setTilePos(self, self.name, args) 97 | def getDirection(self): 98 | return CmdPositioner.getDirection(self, self.name) 99 | def getRotation(self): 100 | return CmdPositioner.getRotation(self, self.name) 101 | def getPitch(self): 102 | return CmdPositioner.getPitch(self, self.name) 103 | 104 | class CmdCamera: 105 | def __init__(self, connection): 106 | self.conn = connection 107 | 108 | def setNormal(self, *args): 109 | """Set camera mode to normal Minecraft view ([entityId])""" 110 | self.conn.send("camera.mode.setNormal", args) 111 | 112 | def setFixed(self): 113 | """Set camera mode to fixed view""" 114 | self.conn.send("camera.mode.setFixed") 115 | 116 | def setFollow(self, *args): 117 | """Set camera mode to follow an entity ([entityId])""" 118 | self.conn.send("camera.mode.setFollow", args) 119 | 120 | def setPos(self, *args): 121 | """Set camera entity position (x,y,z)""" 122 | self.conn.send("camera.setPos", args) 123 | 124 | 125 | class CmdEvents: 126 | """Events""" 127 | def __init__(self, connection): 128 | self.conn = connection 129 | 130 | def clearAll(self): 131 | """Clear all old events""" 132 | self.conn.send("events.clear") 133 | 134 | def pollBlockHits(self): 135 | """Only triggered by sword => [BlockEvent]""" 136 | s = self.conn.sendReceive("events.block.hits") 137 | events = [e for e in s.split("|") if e] 138 | return [BlockEvent.Hit(*map(int, e.split(","))) for e in events] 139 | 140 | def pollChatPosts(self): 141 | """Triggered by posts to chat => [ChatEvent]""" 142 | s = self.conn.sendReceive("events.chat.posts") 143 | events = [e for e in s.split("|") if e] 144 | return [ChatEvent.Post(int(e[:e.find(",")]), e[e.find(",") + 1:]) for e in events] 145 | 146 | class Minecraft: 147 | """The main class to interact with a running instance of Minecraft Pi.""" 148 | def __init__(self, connection, name=None): 149 | self.conn = connection 150 | 151 | self.camera = CmdCamera(connection) 152 | self.entity = CmdEntity(connection) 153 | self.player = CmdPlayer(connection, name) 154 | self.events = CmdEvents(connection) 155 | 156 | def getBlock(self, *args): 157 | """Get block (x,y,z) => id:int""" 158 | return int(self.conn.sendReceive("world.getBlock", intFloor(args))) 159 | 160 | def getBlockWithData(self, *args): 161 | """Get block with data (x,y,z) => Block""" 162 | ans = self.conn.sendReceive("world.getBlockWithData", intFloor(args)) 163 | return Block(*map(int, ans.split(","))) 164 | """ 165 | @TODO 166 | """ 167 | def getBlocks(self, *args): 168 | """Get a cuboid of blocks (x0,y0,z0,x1,y1,z1) => [id:int]""" 169 | s = self.conn.sendReceive("world.getBlocks", intFloor(args)) 170 | return map(int, s.split(",")) 171 | 172 | def setBlock(self, *args): 173 | """Set block (x,y,z,id,[data])""" 174 | self.conn.send("world.setBlock", intFloor(args)) 175 | 176 | def setBlocks(self, *args): 177 | """Set a cuboid of blocks (x0,y0,z0,x1,y1,z1,id,[data])""" 178 | self.conn.send("world.setBlocks", intFloor(args)) 179 | 180 | def getHeight(self, *args): 181 | """Get the height of the world (x,z) => int""" 182 | return int(self.conn.sendReceive("world.getHeight", intFloor(args))) 183 | 184 | def getPlayerEntityIds(self): 185 | """Get the entity ids of the connected players => [id:int]""" 186 | ids = self.conn.sendReceive("world.getPlayerIds") 187 | return map(int, ids.split("|")) 188 | 189 | def getPlayerEntityId(self, name): 190 | """Get the entity id of the named player => [id:int]""" 191 | return int(self.conn.sendReceive("world.getPlayerId", name)) 192 | 193 | def saveCheckpoint(self): 194 | """Save a checkpoint that can be used for restoring the world""" 195 | self.conn.send("world.checkpoint.save") 196 | 197 | def restoreCheckpoint(self): 198 | """Restore the world state to the checkpoint""" 199 | self.conn.send("world.checkpoint.restore") 200 | 201 | def postToChat(self, msg): 202 | """Post a message to the game chat""" 203 | self.conn.send("chat.post", msg) 204 | 205 | def setting(self, setting, status): 206 | """Set a world setting (setting, status). keys: world_immutable, nametags_visible""" 207 | self.conn.send("world.setting", setting, 1 if bool(status) else 0) 208 | 209 | @staticmethod 210 | def create(address = "localhost", port = 4711, name = None): 211 | return Minecraft(Connection(address, port), name) 212 | 213 | 214 | if __name__ == "__main__": 215 | mc = Minecraft.create() 216 | mc.postToChat("Hello, Minecraft!") 217 | -------------------------------------------------------------------------------- /mcpi/util.py: -------------------------------------------------------------------------------- 1 | import collections 2 | 3 | def flatten(l): 4 | for e in l: 5 | if isinstance(e, collections.Iterable) and not isinstance(e, basestring): 6 | for ee in flatten(e): yield ee 7 | else: yield e 8 | 9 | def flatten_parameters_to_string(l): 10 | return ",".join(map(str, flatten(l))) 11 | -------------------------------------------------------------------------------- /mcpi/vec3.py: -------------------------------------------------------------------------------- 1 | class Vec3: 2 | def __init__(self, x=0, y=0, z=0): 3 | self.x = x 4 | self.y = y 5 | self.z = z 6 | 7 | def __add__(self, rhs): 8 | c = self.clone() 9 | c += rhs 10 | return c 11 | 12 | def __iadd__(self, rhs): 13 | self.x += rhs.x 14 | self.y += rhs.y 15 | self.z += rhs.z 16 | return self 17 | 18 | def length(self): 19 | return self.lengthSqr ** .5 20 | 21 | def lengthSqr(self): 22 | return self.x * self.x + self.y * self.y + self.z * self.z 23 | 24 | def __mul__(self, k): 25 | c = self.clone() 26 | c *= k 27 | return c 28 | 29 | def __imul__(self, k): 30 | self.x *= k 31 | self.y *= k 32 | self.z *= k 33 | return self 34 | 35 | def clone(self): 36 | return Vec3(self.x, self.y, self.z) 37 | 38 | def __neg__(self): 39 | return Vec3(-self.x, -self.y, -self.z) 40 | 41 | def __sub__(self, rhs): 42 | return self.__add__(-rhs) 43 | 44 | def __isub__(self, rhs): 45 | return self.__iadd__(-rhs) 46 | 47 | def __repr__(self): 48 | return "Vec3(%s,%s,%s)"%(self.x,self.y,self.z) 49 | 50 | def __iter__(self): 51 | return iter((self.x, self.y, self.z)) 52 | 53 | def _map(self, func): 54 | self.x = func(self.x) 55 | self.y = func(self.y) 56 | self.z = func(self.z) 57 | 58 | def __cmp__(self, rhs): 59 | dx = self.x - rhs.x 60 | if dx != 0: return dx 61 | dy = self.y - rhs.y 62 | if dy != 0: return dy 63 | dz = self.z - rhs.z 64 | if dz != 0: return dz 65 | return 0 66 | 67 | def iround(self): self._map(lambda v:int(v+0.5)) 68 | def ifloor(self): self._map(int) 69 | 70 | def rotateLeft(self): self.x, self.z = self.z, -self.x 71 | def rotateRight(self): self.x, self.z = -self.z, self.x 72 | 73 | def testVec3(): 74 | # Note: It's not testing everything 75 | 76 | # 1.1 Test initialization 77 | it = Vec3(1, -2, 3) 78 | assert it.x == 1 79 | assert it.y == -2 80 | assert it.z == 3 81 | 82 | assert it.x != -1 83 | assert it.y != +2 84 | assert it.z != -3 85 | 86 | # 2.1 Test cloning and equality 87 | clone = it.clone() 88 | assert it == clone 89 | it.x += 1 90 | assert it != clone 91 | 92 | # 3.1 Arithmetic 93 | a = Vec3(10, -3, 4) 94 | b = Vec3(-7, 1, 2) 95 | c = a + b 96 | assert c - a == b 97 | assert c - b == a 98 | assert a + a == a * 2 99 | 100 | assert a - a == Vec3(0,0,0) 101 | assert a + (-a) == Vec3(0,0,0) 102 | 103 | # Test repr 104 | e = eval(repr(it)) 105 | assert e == it 106 | 107 | if __name__ == "__main__": 108 | testVec3() 109 | -------------------------------------------------------------------------------- /script.py: -------------------------------------------------------------------------------- 1 | import mcpi.minecraft as minecraft 2 | 3 | #NOTE - replace "seanybob" below with your name 4 | mc = minecraft.Minecraft.create(address="199.96.85.3", name="seanybob") 5 | 6 | x = 10 7 | y = 110 8 | z = 12 9 | 10 | mc.player.setPos(x, y, z) 11 | -------------------------------------------------------------------------------- /setup.md: -------------------------------------------------------------------------------- 1 | ##### To Run 2 | 3 | In a file browser, double click Minecraft Launcher.jar 4 | 5 | ![](http://teachthe.net/topclipbox/2016-03-03_14-23-00KXC3CT.png) 6 | 7 | In the bottom left, decide upon and enter a username for yourself 8 | 9 | ![](http://teachthe.net/topclipbox/2016-03-03_14-23-20PLF8N2.png) 10 | 11 | Also in the bottom left, select Release 1.8.8 12 | 13 | ![](http://teachthe.net/topclipbox/2016-03-03_14-21-47BAP7OT.png) 14 | 15 | Click Install 16 | 17 | ![](http://teachthe.net/topclipbox/2016-03-03_14-24-41Z42XWT.png) 18 | 19 | Once the game launches, select Multiplayer 20 | 21 | ![](http://teachthe.net/topclipbox/2016-03-03_14-25-17IJ9FWJ.png) 22 | 23 | Then select Direct Connect 24 | 25 | ![](http://teachthe.net/topclipbox/2016-03-03_14-25-36Z7C2ZV.png) 26 | 27 | Now you will need to enter the IP of the server. 28 | - If you are using my server, type in 199.96.85.3:25570 29 | - If you are running the server locally, type in 127.0.0.1 30 | - If your instructor is running a server somewhere, they will provide you with the IP to type in. 31 | 32 | ![](http://teachthe.net/topclipbox/2016-03-03_14-25-53XIX7K9.png) 33 | 34 | Now click Join Server! 35 | 36 | ![](http://teachthe.net/topclipbox/2016-03-03_14-27-3797QL8G.png) 37 | 38 | Now open lesson1.py in your code editor and follow the comments in there to get started! 39 | 40 | 41 | ##### Troubleshooting 42 | - "Error - need to install JDK". To resolve this error, google "java se development kit". You'll then find something that looks like [this](http://teachthe.net/topclipbox/2016-02-28_01-29-305W6BTE.png) - download and run the appropriate one for your system. 43 | - "Error - unidentified developer". To resolve this error on OSX, you need to click the apple in the top left of your screen, then System Preferences..., then Security & Privacy, then unlock in the bottom left, then (make sure the General tab is selected) under Allow apps downloaded from select Anywhere. It should look like [this](http://teachthe.net/topclipbox/2016-02-28_01-31-41VO1QVS.png). 44 | 45 | 46 | --------------------------------------------------------------------------------