Docs built at 4d17df6
This commit is contained in:
commit
ddb979c47c
19 changed files with 3835 additions and 0 deletions
0
.nojekyll
Normal file
0
.nojekyll
Normal file
249
LICENSE.html
Normal file
249
LICENSE.html
Normal file
|
|
@ -0,0 +1,249 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="My STL">
|
||||
<meta name="author" content="Jeff Epler">
|
||||
|
||||
|
||||
|
||||
<link href='http://fonts.googleapis.com/css?family=Arvo:400,700|PT+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
|
||||
<link href="resources/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="resources/css/style.css" rel="stylesheet">
|
||||
<link href="resources/css/lightbox.css" rel="stylesheet">
|
||||
<script src="resources/js/three.min.js"></script>
|
||||
<script src="resources/js/STLLoader.js"></script>
|
||||
<script src="resources/js/OrbitControls.js"></script>
|
||||
<script src="resources/js/stlviewer.js"></script>
|
||||
<script src="resources/js/lightbox.js"></script>
|
||||
<title>License</title>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<div id="header">
|
||||
<div class="container">
|
||||
<h1>License</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<div class="container">
|
||||
<p>Copyright © 2020 Jeff Epler
|
||||
All rights reserved</p>
|
||||
|
||||
<p>License: CC-BY</p>
|
||||
|
||||
<h2 id="creative-commons">creative commons</h2>
|
||||
|
||||
<h1 id="attribution-40-international">Attribution 4.0 International</h1>
|
||||
|
||||
<p>Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.</p>
|
||||
|
||||
<h3 id="using-creative-commons-public-licenses">Using Creative Commons Public Licenses</h3>
|
||||
|
||||
<p>Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<p><strong>Considerations for licensors:</strong> Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. <a href="http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors">More considerations for licensors</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Considerations for the public:</strong> By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. <a href="http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees">More considerations for the public</a>.</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="creative-commons-attribution-40-international-public-license">Creative Commons Attribution 4.0 International Public License</h2>
|
||||
|
||||
<p>By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License (“Public License”). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.</p>
|
||||
|
||||
<h3 id="section-1--definitions">Section 1 – Definitions.</h3>
|
||||
|
||||
<p>a. <strong>Adapted Material</strong> means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.</p>
|
||||
|
||||
<p>b. <strong>Adapter’s License</strong> means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.</p>
|
||||
|
||||
<p>c. <strong>Copyright and Similar Rights</strong> means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.</p>
|
||||
|
||||
<p>d. <strong>Effective Technological Measures</strong> means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.</p>
|
||||
|
||||
<p>e. <strong>Exceptions and Limitations</strong> means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.</p>
|
||||
|
||||
<p>f. <strong>Licensed Material</strong> means the artistic or literary work, database, or other material to which the Licensor applied this Public License.</p>
|
||||
|
||||
<p>g. <strong>Licensed Rights</strong> means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.</p>
|
||||
|
||||
<p>h. <strong>Licensor</strong> means the individual(s) or entity(ies) granting rights under this Public License.</p>
|
||||
|
||||
<p>i. <strong>Share</strong> means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.</p>
|
||||
|
||||
<p>j. <strong>Sui Generis Database Rights</strong> means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.</p>
|
||||
|
||||
<p>k. <strong>You</strong> means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.</p>
|
||||
|
||||
<h3 id="section-2--scope">Section 2 – Scope.</h3>
|
||||
|
||||
<p>a. <strong><em>License grant.</em></strong></p>
|
||||
|
||||
<ol>
|
||||
<li>
|
||||
<p>Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:</p>
|
||||
|
||||
<p>A. reproduce and Share the Licensed Material, in whole or in part; and</p>
|
||||
|
||||
<p>B. produce, reproduce, and Share Adapted Material.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Exceptions and Limitations.</strong> For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Term.</strong> The term of this Public License is specified in Section 6(a).</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Media and formats; technical modifications allowed.</strong> The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Downstream recipients.</strong></p>
|
||||
|
||||
<p>A. <strong>Offer from the Licensor – Licensed Material.</strong> Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.</p>
|
||||
|
||||
<p>B. <strong>No downstream restrictions.</strong> You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>No endorsement.</strong> Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).</p>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>b. <strong><em>Other rights.</em></strong></p>
|
||||
|
||||
<ol>
|
||||
<li>
|
||||
<p>Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Patent and trademark rights are not licensed under this Public License.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.</p>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<h3 id="section-3--license-conditions">Section 3 – License Conditions.</h3>
|
||||
|
||||
<p>Your exercise of the Licensed Rights is expressly made subject to the following conditions.</p>
|
||||
|
||||
<p>a. <strong><em>Attribution.</em></strong></p>
|
||||
|
||||
<ol>
|
||||
<li>
|
||||
<p>If You Share the Licensed Material (including in modified form), You must:</p>
|
||||
|
||||
<p>A. retain the following if it is supplied by the Licensor with the Licensed Material:</p>
|
||||
|
||||
<p>i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);</p>
|
||||
|
||||
<p>ii. a copyright notice;</p>
|
||||
|
||||
<p>iii. a notice that refers to this Public License;</p>
|
||||
|
||||
<p>iv. a notice that refers to the disclaimer of warranties;</p>
|
||||
|
||||
<p>v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;</p>
|
||||
|
||||
<p>B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and</p>
|
||||
|
||||
<p>C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>If You Share Adapted Material You produce, the Adapter’s License You apply must not prevent recipients of the Adapted Material from complying with this Public License.</p>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<h3 id="section-4--sui-generis-database-rights">Section 4 – Sui Generis Database Rights.</h3>
|
||||
|
||||
<p>Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:</p>
|
||||
|
||||
<p>a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;</p>
|
||||
|
||||
<p>b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and</p>
|
||||
|
||||
<p>c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.</p>
|
||||
|
||||
<p>For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.</p>
|
||||
|
||||
<h3 id="section-5--disclaimer-of-warranties-and-limitation-of-liability">Section 5 – Disclaimer of Warranties and Limitation of Liability.</h3>
|
||||
|
||||
<p>a. <strong>Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.</strong></p>
|
||||
|
||||
<p>b. <strong>To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.</strong></p>
|
||||
|
||||
<p>c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.</p>
|
||||
|
||||
<h3 id="section-6--term-and-termination">Section 6 – Term and Termination.</h3>
|
||||
|
||||
<p>a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.</p>
|
||||
|
||||
<p>b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:</p>
|
||||
|
||||
<ol>
|
||||
<li>
|
||||
<p>automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>upon express reinstatement by the Licensor.</p>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.</p>
|
||||
|
||||
<p>c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.</p>
|
||||
|
||||
<p>d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.</p>
|
||||
|
||||
<h3 id="section-7--other-terms-and-conditions">Section 7 – Other Terms and Conditions.</h3>
|
||||
|
||||
<p>a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.</p>
|
||||
|
||||
<p>b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.</p>
|
||||
|
||||
<h3 id="section-8--interpretation">Section 8 – Interpretation.</h3>
|
||||
|
||||
<p>a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.</p>
|
||||
|
||||
<p>b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.</p>
|
||||
|
||||
<p>c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.</p>
|
||||
|
||||
<p>d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.</p>
|
||||
|
||||
<blockquote>
|
||||
<p>Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at <a href="http://creativecommons.org/policies">creativecommons.org/policies</a>, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.</p>
|
||||
|
||||
<p>Creative Commons may be contacted at creativecommons.org</p>
|
||||
</blockquote>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
<div id="footer">
|
||||
<div class="container">
|
||||
<p>
|
||||
|
||||
This 3D printable project is offered under <a href="LICENSE.html">an open source license</a>. The site is built with software under <a href="other-licenses.html">various open source licenses</a>. Create your own MySTL site with cookiecutter-mystl (coming soon!).
|
||||
|
||||
</p>
|
||||
<a class="pull-right" href="#">Back to top</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
107
index.html
Normal file
107
index.html
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="My STL">
|
||||
<meta name="author" content="Jeff Epler">
|
||||
|
||||
|
||||
|
||||
<link href='http://fonts.googleapis.com/css?family=Arvo:400,700|PT+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
|
||||
<link href="resources/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="resources/css/style.css" rel="stylesheet">
|
||||
<link href="resources/css/lightbox.css" rel="stylesheet">
|
||||
<script src="resources/js/three.min.js"></script>
|
||||
<script src="resources/js/STLLoader.js"></script>
|
||||
<script src="resources/js/OrbitControls.js"></script>
|
||||
<script src="resources/js/stlviewer.js"></script>
|
||||
<script src="resources/js/lightbox.js"></script>
|
||||
<title>MySTL Demonstration page</title>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<div id="header">
|
||||
<div class="container">
|
||||
<h1>MySTL Demonstration page</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<div class="container">
|
||||
|
||||
<h3 id="featureless-cube">Featureless Cube</h3>
|
||||
|
||||
<html>
|
||||
|
||||
|
||||
|
||||
<img src="resources/gen/main.png" title="Featureless Cube" data-stl="resources/gen/main.stl" />
|
||||
|
||||
|
||||
</html>
|
||||
|
||||
<h3 id="monolith-from-2001">Monolith from 2001</h3>
|
||||
|
||||
<html>
|
||||
|
||||
|
||||
|
||||
<img src="resources/gen/monolith.png" title="Monolith from 2001" data-stl="resources/gen/monolith.stl" />
|
||||
|
||||
|
||||
|
||||
|
||||
<img src="resources/HAL_2001_monolith.jpg" title="Monolith from 2001" />
|
||||
|
||||
|
||||
</html>
|
||||
|
||||
<h2 id="downloads">Downloads</h2>
|
||||
|
||||
<h3 id="featureless-cube-1">Featureless Cube:</h3>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<p><a href="resources/main.scad">main.scad</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p><a href="resources/gen/main.stl">main.stl</a></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="monolith-from-2001-1">Monolith from 2001:</h3>
|
||||
|
||||
<p>STL generated with <code class="highlighter-rouge">-Dsize=[1,4,9]</code></p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<p><a href="resources/main.scad">main.scad</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p><a href="resources/gen/monolith.stl">monolith.stl</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p><a href="resources/monolith.txt">monolith.txt</a></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
<div id="footer">
|
||||
<div class="container">
|
||||
<p>
|
||||
|
||||
This 3D printable project is offered under <a href="LICENSE.html">an open source license</a>. The site is built with software under <a href="other-licenses.html">various open source licenses</a>. Create your own MySTL site with cookiecutter-mystl (coming soon!).
|
||||
|
||||
</p>
|
||||
<a class="pull-right" href="#">Back to top</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
58
other-licenses.html
Normal file
58
other-licenses.html
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="My STL">
|
||||
<meta name="author" content="Jeff Epler">
|
||||
|
||||
|
||||
|
||||
<link href='http://fonts.googleapis.com/css?family=Arvo:400,700|PT+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
|
||||
<link href="resources/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="resources/css/style.css" rel="stylesheet">
|
||||
<link href="resources/css/lightbox.css" rel="stylesheet">
|
||||
<script src="resources/js/three.min.js"></script>
|
||||
<script src="resources/js/STLLoader.js"></script>
|
||||
<script src="resources/js/OrbitControls.js"></script>
|
||||
<script src="resources/js/stlviewer.js"></script>
|
||||
<script src="resources/js/lightbox.js"></script>
|
||||
<title>Web Site Licenses</title>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<div id="header">
|
||||
<div class="container">
|
||||
<h1>Web Site Licenses</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<div class="container">
|
||||
<p>This website is built on various open source technologies:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://github.com/jekyll/jekyll/blob/master/LICENSE">Jekyll</a> [MIT]</li>
|
||||
<li><a href="https://github.com/jhvanderschee/jekyllcodex/#mit-license">Jekyll Codex</a> [MIT]</li>
|
||||
<li><a href="https://github.com/mrdoob/three.js/blob/dev/LICENSE">three.js</a> [MIT]</li>
|
||||
<li><a href="https://tonybox.net/posts/simple-stl-viewer/">simple-stl-viewer</a> [MIT]</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
<div id="footer">
|
||||
<div class="container">
|
||||
<p>
|
||||
|
||||
This 3D printable project is offered under <a href="LICENSE.html">an open source license</a>. The site is built with software under <a href="other-licenses.html">various open source licenses</a>. Create your own MySTL site with cookiecutter-mystl (coming soon!).
|
||||
|
||||
</p>
|
||||
<a class="pull-right" href="#">Back to top</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
resources/HAL_2001_monolith.jpg
Normal file
BIN
resources/HAL_2001_monolith.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 78 KiB |
497
resources/css/bootstrap.min.css
vendored
Normal file
497
resources/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
95
resources/css/lightbox.css
Normal file
95
resources/css/lightbox.css
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
#lightbox {width: 100%; height: 100%; position: fixed; top: 0; left: 0; background: rgba(0,0,0,0.85); z-index: 9999999; line-height: 0; cursor: pointer; display: none;}
|
||||
#lightbox .img {
|
||||
position: relative;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
-ms-transform: translateX(-50%) translateY(-50%);
|
||||
-webkit-transform: translate(-50%,-50%);
|
||||
transform: translate(-50%,-50%);
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
#lightbox .img img {opacity: 0; pointer-events: none; width: auto;}
|
||||
@media screen and (min-width: 1200px) {
|
||||
#lightbox .img {
|
||||
max-width: 1200px;
|
||||
}
|
||||
}
|
||||
@media screen and (min-height: 1200px) {
|
||||
#lightbox .img {
|
||||
max-height: 1200px;
|
||||
}
|
||||
}
|
||||
#lightbox span {display: block; position: fixed; bottom: 13px; height: 1.5em; line-height: 1.4em; width: 100%; text-align: center; color: white; text-shadow:
|
||||
-1px -1px 0 #000,
|
||||
1px -1px 0 #000,
|
||||
-1px 1px 0 #000,
|
||||
1px 1px 0 #000;
|
||||
}
|
||||
|
||||
#lightbox span {display: none;}
|
||||
|
||||
#lightbox .videoWrapperContainer {
|
||||
position: relative;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
-ms-transform: translateX(-50%) translateY(-50%);
|
||||
-webkit-transform: translate(-50%,-50%);
|
||||
transform: translate(-50%,-50%);
|
||||
max-width: 900px;
|
||||
max-height: 100%;
|
||||
}
|
||||
#lightbox .videoWrapperContainer .videoWrapper {
|
||||
height: 0;
|
||||
line-height: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
padding-bottom: 56.333%; /* custom */
|
||||
background: black;
|
||||
}
|
||||
#lightbox .videoWrapper iframe {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
display: block;
|
||||
}
|
||||
#lightbox #prev, #lightbox #next {height: 50px; line-height: 36px; display: none; margin-top: -25px; position: fixed; top: 50%; padding: 0 15px; cursor: pointer; text-decoration: none; z-index: 99; color: white; font-size: 60px;}
|
||||
#lightbox.gallery #prev, #lightbox.gallery #next {display: block;}
|
||||
#lightbox #prev {left: 0;}
|
||||
#lightbox #next {right: 0;}
|
||||
#lightbox #close {height: 50px; width: 50px; position: fixed; cursor: pointer; text-decoration: none; z-index: 99; right: 0; top: 0;}
|
||||
#lightbox #close:after, #lightbox #close:before {position: absolute; margin-top: 22px; margin-left: 14px; content: ""; height: 3px; background: white; width: 23px;
|
||||
-webkit-transform-origin: 50% 50%;
|
||||
-moz-transform-origin: 50% 50%;
|
||||
-o-transform-origin: 50% 50%;
|
||||
transform-origin: 50% 50%;
|
||||
/* Safari */
|
||||
-webkit-transform: rotate(-45deg);
|
||||
/* Firefox */
|
||||
-moz-transform: rotate(-45deg);
|
||||
/* IE */
|
||||
-ms-transform: rotate(-45deg);
|
||||
/* Opera */
|
||||
-o-transform: rotate(-45deg);
|
||||
}
|
||||
#lightbox #close:after {
|
||||
/* Safari */
|
||||
-webkit-transform: rotate(45deg);
|
||||
/* Firefox */
|
||||
-moz-transform: rotate(45deg);
|
||||
/* IE */
|
||||
-ms-transform: rotate(45deg);
|
||||
/* Opera */
|
||||
-o-transform: rotate(45deg);
|
||||
}
|
||||
#lightbox, #lightbox * {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.lightbox-image-stl { cursor: pointer; }
|
||||
0
resources/css/style.css
Normal file
0
resources/css/style.css
Normal file
BIN
resources/gen/main.png
Normal file
BIN
resources/gen/main.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
resources/gen/main.stl
Normal file
BIN
resources/gen/main.stl
Normal file
Binary file not shown.
BIN
resources/gen/monolith.png
Normal file
BIN
resources/gen/monolith.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
resources/gen/monolith.stl
Normal file
BIN
resources/gen/monolith.stl
Normal file
Binary file not shown.
1183
resources/js/OrbitControls.js
Normal file
1183
resources/js/OrbitControls.js
Normal file
File diff suppressed because it is too large
Load diff
393
resources/js/STLLoader.js
Normal file
393
resources/js/STLLoader.js
Normal file
|
|
@ -0,0 +1,393 @@
|
|||
/**
|
||||
* @author aleeper / http://adamleeper.com/
|
||||
* @author mrdoob / http://mrdoob.com/
|
||||
* @author gero3 / https://github.com/gero3
|
||||
* @author Mugen87 / https://github.com/Mugen87
|
||||
* @author neverhood311 / https://github.com/neverhood311
|
||||
*
|
||||
* Description: A THREE loader for STL ASCII files, as created by Solidworks and other CAD programs.
|
||||
*
|
||||
* Supports both binary and ASCII encoded files, with automatic detection of type.
|
||||
*
|
||||
* The loader returns a non-indexed buffer geometry.
|
||||
*
|
||||
* Limitations:
|
||||
* Binary decoding supports "Magics" color format (http://en.wikipedia.org/wiki/STL_(file_format)#Color_in_binary_STL).
|
||||
* There is perhaps some question as to how valid it is to always assume little-endian-ness.
|
||||
* ASCII decoding assumes file is UTF-8.
|
||||
*
|
||||
* Usage:
|
||||
* var loader = new THREE.STLLoader();
|
||||
* loader.load( './models/stl/slotted_disk.stl', function ( geometry ) {
|
||||
* scene.add( new THREE.Mesh( geometry ) );
|
||||
* });
|
||||
*
|
||||
* For binary STLs geometry might contain colors for vertices. To use it:
|
||||
* // use the same code to load STL as above
|
||||
* if (geometry.hasColors) {
|
||||
* material = new THREE.MeshPhongMaterial({ opacity: geometry.alpha, vertexColors: true });
|
||||
* } else { .... }
|
||||
* var mesh = new THREE.Mesh( geometry, material );
|
||||
*
|
||||
* For ASCII STLs containing multiple solids, each solid is assigned to a different group.
|
||||
* Groups can be used to assign a different color by defining an array of materials with the same length of
|
||||
* geometry.groups and passing it to the Mesh constructor:
|
||||
*
|
||||
* var mesh = new THREE.Mesh( geometry, material );
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* var materials = [];
|
||||
* var nGeometryGroups = geometry.groups.length;
|
||||
*
|
||||
* var colorMap = ...; // Some logic to index colors.
|
||||
*
|
||||
* for (var i = 0; i < nGeometryGroups; i++) {
|
||||
*
|
||||
* var material = new THREE.MeshPhongMaterial({
|
||||
* color: colorMap[i],
|
||||
* wireframe: false
|
||||
* });
|
||||
*
|
||||
* }
|
||||
*
|
||||
* materials.push(material);
|
||||
* var mesh = new THREE.Mesh(geometry, materials);
|
||||
*/
|
||||
|
||||
|
||||
THREE.STLLoader = function ( manager ) {
|
||||
|
||||
THREE.Loader.call( this, manager );
|
||||
|
||||
};
|
||||
|
||||
THREE.STLLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype ), {
|
||||
|
||||
constructor: THREE.STLLoader,
|
||||
|
||||
load: function ( url, onLoad, onProgress, onError ) {
|
||||
|
||||
var scope = this;
|
||||
|
||||
var loader = new THREE.FileLoader( scope.manager );
|
||||
loader.setPath( scope.path );
|
||||
loader.setResponseType( 'arraybuffer' );
|
||||
loader.load( url, function ( text ) {
|
||||
|
||||
try {
|
||||
|
||||
onLoad( scope.parse( text ) );
|
||||
|
||||
} catch ( e ) {
|
||||
|
||||
if ( onError ) {
|
||||
|
||||
onError( e );
|
||||
|
||||
} else {
|
||||
|
||||
console.error( e );
|
||||
|
||||
}
|
||||
|
||||
scope.manager.itemError( url );
|
||||
|
||||
}
|
||||
|
||||
}, onProgress, onError );
|
||||
|
||||
},
|
||||
|
||||
parse: function ( data ) {
|
||||
|
||||
function isBinary( data ) {
|
||||
|
||||
var expect, face_size, n_faces, reader;
|
||||
reader = new DataView( data );
|
||||
face_size = ( 32 / 8 * 3 ) + ( ( 32 / 8 * 3 ) * 3 ) + ( 16 / 8 );
|
||||
n_faces = reader.getUint32( 80, true );
|
||||
expect = 80 + ( 32 / 8 ) + ( n_faces * face_size );
|
||||
|
||||
if ( expect === reader.byteLength ) {
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
// An ASCII STL data must begin with 'solid ' as the first six bytes.
|
||||
// However, ASCII STLs lacking the SPACE after the 'd' are known to be
|
||||
// plentiful. So, check the first 5 bytes for 'solid'.
|
||||
|
||||
// Several encodings, such as UTF-8, precede the text with up to 5 bytes:
|
||||
// https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding
|
||||
// Search for "solid" to start anywhere after those prefixes.
|
||||
|
||||
// US-ASCII ordinal values for 's', 'o', 'l', 'i', 'd'
|
||||
|
||||
var solid = [ 115, 111, 108, 105, 100 ];
|
||||
|
||||
for ( var off = 0; off < 5; off ++ ) {
|
||||
|
||||
// If "solid" text is matched to the current offset, declare it to be an ASCII STL.
|
||||
|
||||
if ( matchDataViewAt( solid, reader, off ) ) return false;
|
||||
|
||||
}
|
||||
|
||||
// Couldn't find "solid" text at the beginning; it is binary STL.
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
function matchDataViewAt( query, reader, offset ) {
|
||||
|
||||
// Check if each byte in query matches the corresponding byte from the current offset
|
||||
|
||||
for ( var i = 0, il = query.length; i < il; i ++ ) {
|
||||
|
||||
if ( query[ i ] !== reader.getUint8( offset + i, false ) ) return false;
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
function parseBinary( data ) {
|
||||
|
||||
var reader = new DataView( data );
|
||||
var faces = reader.getUint32( 80, true );
|
||||
|
||||
var r, g, b, hasColors = false, colors;
|
||||
var defaultR, defaultG, defaultB, alpha;
|
||||
|
||||
// process STL header
|
||||
// check for default color in header ("COLOR=rgba" sequence).
|
||||
|
||||
for ( var index = 0; index < 80 - 10; index ++ ) {
|
||||
|
||||
if ( ( reader.getUint32( index, false ) == 0x434F4C4F /*COLO*/ ) &&
|
||||
( reader.getUint8( index + 4 ) == 0x52 /*'R'*/ ) &&
|
||||
( reader.getUint8( index + 5 ) == 0x3D /*'='*/ ) ) {
|
||||
|
||||
hasColors = true;
|
||||
colors = new Float32Array( faces * 3 * 3 );
|
||||
|
||||
defaultR = reader.getUint8( index + 6 ) / 255;
|
||||
defaultG = reader.getUint8( index + 7 ) / 255;
|
||||
defaultB = reader.getUint8( index + 8 ) / 255;
|
||||
alpha = reader.getUint8( index + 9 ) / 255;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var dataOffset = 84;
|
||||
var faceLength = 12 * 4 + 2;
|
||||
|
||||
var geometry = new THREE.BufferGeometry();
|
||||
|
||||
var vertices = new Float32Array( faces * 3 * 3 );
|
||||
var normals = new Float32Array( faces * 3 * 3 );
|
||||
|
||||
for ( var face = 0; face < faces; face ++ ) {
|
||||
|
||||
var start = dataOffset + face * faceLength;
|
||||
var normalX = reader.getFloat32( start, true );
|
||||
var normalY = reader.getFloat32( start + 4, true );
|
||||
var normalZ = reader.getFloat32( start + 8, true );
|
||||
|
||||
if ( hasColors ) {
|
||||
|
||||
var packedColor = reader.getUint16( start + 48, true );
|
||||
|
||||
if ( ( packedColor & 0x8000 ) === 0 ) {
|
||||
|
||||
// facet has its own unique color
|
||||
|
||||
r = ( packedColor & 0x1F ) / 31;
|
||||
g = ( ( packedColor >> 5 ) & 0x1F ) / 31;
|
||||
b = ( ( packedColor >> 10 ) & 0x1F ) / 31;
|
||||
|
||||
} else {
|
||||
|
||||
r = defaultR;
|
||||
g = defaultG;
|
||||
b = defaultB;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for ( var i = 1; i <= 3; i ++ ) {
|
||||
|
||||
var vertexstart = start + i * 12;
|
||||
var componentIdx = ( face * 3 * 3 ) + ( ( i - 1 ) * 3 );
|
||||
|
||||
vertices[ componentIdx ] = reader.getFloat32( vertexstart, true );
|
||||
vertices[ componentIdx + 1 ] = reader.getFloat32( vertexstart + 4, true );
|
||||
vertices[ componentIdx + 2 ] = reader.getFloat32( vertexstart + 8, true );
|
||||
|
||||
normals[ componentIdx ] = normalX;
|
||||
normals[ componentIdx + 1 ] = normalY;
|
||||
normals[ componentIdx + 2 ] = normalZ;
|
||||
|
||||
if ( hasColors ) {
|
||||
|
||||
colors[ componentIdx ] = r;
|
||||
colors[ componentIdx + 1 ] = g;
|
||||
colors[ componentIdx + 2 ] = b;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
|
||||
geometry.setAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
|
||||
|
||||
if ( hasColors ) {
|
||||
|
||||
geometry.setAttribute( 'color', new THREE.BufferAttribute( colors, 3 ) );
|
||||
geometry.hasColors = true;
|
||||
geometry.alpha = alpha;
|
||||
|
||||
}
|
||||
|
||||
return geometry;
|
||||
|
||||
}
|
||||
|
||||
function parseASCII( data ) {
|
||||
|
||||
var geometry = new THREE.BufferGeometry();
|
||||
var patternSolid = /solid([\s\S]*?)endsolid/g;
|
||||
var patternFace = /facet([\s\S]*?)endfacet/g;
|
||||
var faceCounter = 0;
|
||||
|
||||
var patternFloat = /[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source;
|
||||
var patternVertex = new RegExp( 'vertex' + patternFloat + patternFloat + patternFloat, 'g' );
|
||||
var patternNormal = new RegExp( 'normal' + patternFloat + patternFloat + patternFloat, 'g' );
|
||||
|
||||
var vertices = [];
|
||||
var normals = [];
|
||||
|
||||
var normal = new THREE.Vector3();
|
||||
|
||||
var result;
|
||||
|
||||
var groupCount = 0;
|
||||
var startVertex = 0;
|
||||
var endVertex = 0;
|
||||
|
||||
while ( ( result = patternSolid.exec( data ) ) !== null ) {
|
||||
|
||||
startVertex = endVertex;
|
||||
|
||||
var solid = result[ 0 ];
|
||||
|
||||
while ( ( result = patternFace.exec( solid ) ) !== null ) {
|
||||
|
||||
var vertexCountPerFace = 0;
|
||||
var normalCountPerFace = 0;
|
||||
|
||||
var text = result[ 0 ];
|
||||
|
||||
while ( ( result = patternNormal.exec( text ) ) !== null ) {
|
||||
|
||||
normal.x = parseFloat( result[ 1 ] );
|
||||
normal.y = parseFloat( result[ 2 ] );
|
||||
normal.z = parseFloat( result[ 3 ] );
|
||||
normalCountPerFace ++;
|
||||
|
||||
}
|
||||
|
||||
while ( ( result = patternVertex.exec( text ) ) !== null ) {
|
||||
|
||||
vertices.push( parseFloat( result[ 1 ] ), parseFloat( result[ 2 ] ), parseFloat( result[ 3 ] ) );
|
||||
normals.push( normal.x, normal.y, normal.z );
|
||||
vertexCountPerFace ++;
|
||||
endVertex ++;
|
||||
|
||||
}
|
||||
|
||||
// every face have to own ONE valid normal
|
||||
|
||||
if ( normalCountPerFace !== 1 ) {
|
||||
|
||||
console.error( 'THREE.STLLoader: Something isn\'t right with the normal of face number ' + faceCounter );
|
||||
|
||||
}
|
||||
|
||||
// each face have to own THREE valid vertices
|
||||
|
||||
if ( vertexCountPerFace !== 3 ) {
|
||||
|
||||
console.error( 'THREE.STLLoader: Something isn\'t right with the vertices of face number ' + faceCounter );
|
||||
|
||||
}
|
||||
|
||||
faceCounter ++;
|
||||
|
||||
}
|
||||
|
||||
var start = startVertex;
|
||||
var count = endVertex - startVertex;
|
||||
|
||||
geometry.addGroup( start, count, groupCount );
|
||||
groupCount ++;
|
||||
|
||||
}
|
||||
|
||||
geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
|
||||
geometry.setAttribute( 'normal', new THREE.Float32BufferAttribute( normals, 3 ) );
|
||||
|
||||
return geometry;
|
||||
|
||||
}
|
||||
|
||||
function ensureString( buffer ) {
|
||||
|
||||
if ( typeof buffer !== 'string' ) {
|
||||
|
||||
return THREE.LoaderUtils.decodeText( new Uint8Array( buffer ) );
|
||||
|
||||
}
|
||||
|
||||
return buffer;
|
||||
|
||||
}
|
||||
|
||||
function ensureBinary( buffer ) {
|
||||
|
||||
if ( typeof buffer === 'string' ) {
|
||||
|
||||
var array_buffer = new Uint8Array( buffer.length );
|
||||
for ( var i = 0; i < buffer.length; i ++ ) {
|
||||
|
||||
array_buffer[ i ] = buffer.charCodeAt( i ) & 0xff; // implicitly assumes little-endian
|
||||
|
||||
}
|
||||
|
||||
return array_buffer.buffer || array_buffer;
|
||||
|
||||
} else {
|
||||
|
||||
return buffer;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// start
|
||||
|
||||
var binData = ensureBinary( data );
|
||||
|
||||
return isBinary( binData ) ? parseBinary( binData ) : parseASCII( ensureString( data ) );
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
87
resources/js/lightbox.js
Normal file
87
resources/js/lightbox.js
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
function setGallery(el) {
|
||||
var elements = document.body.querySelectorAll(".gallery");
|
||||
elements.forEach(element => {
|
||||
element.classList.remove('gallery');
|
||||
});
|
||||
if(el.closest('ul, p')) {
|
||||
var link_elements = el.closest('ul, p').querySelectorAll("a[class*='lightbox-']");
|
||||
link_elements.forEach(link_element => {
|
||||
link_element.classList.remove('current');
|
||||
});
|
||||
link_elements.forEach(link_element => {
|
||||
if(el.getAttribute('href') == link_element.getAttribute('href')) {
|
||||
link_element.classList.add('current');
|
||||
}
|
||||
});
|
||||
if(link_elements.length>1) {
|
||||
document.getElementById('lightbox').classList.add('gallery');
|
||||
link_elements.forEach(link_element => {
|
||||
link_element.classList.add('gallery');
|
||||
});
|
||||
}
|
||||
var currentkey;
|
||||
var gallery_elements = document.querySelectorAll('a.gallery');
|
||||
Object.keys(gallery_elements).forEach(function (k) {
|
||||
if(gallery_elements[k].classList.contains('current')) currentkey = k;
|
||||
});
|
||||
if(currentkey==(gallery_elements.length-1)) var nextkey = 0;
|
||||
else var nextkey = parseInt(currentkey)+1;
|
||||
if(currentkey==0) var prevkey = parseInt(gallery_elements.length-1);
|
||||
else var prevkey = parseInt(currentkey)-1;
|
||||
document.getElementById('next').addEventListener("click", function() {
|
||||
gallery_elements[nextkey].click();
|
||||
});
|
||||
document.getElementById('prev').addEventListener("click", function() {
|
||||
gallery_elements[prevkey].click();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
//create lightbox div in the footer
|
||||
var newdiv = document.createElement("div");
|
||||
newdiv.tabIndex = 0;
|
||||
newdiv.setAttribute('id',"lightbox");
|
||||
document.body.appendChild(newdiv);
|
||||
|
||||
//add classes to links to be able to initiate lightboxes
|
||||
var elements = document.querySelectorAll('img');
|
||||
elements.forEach(element => {
|
||||
var url = element.getAttribute('data-stl');
|
||||
if(url) {
|
||||
element.classList.add('lightbox-image-stl');
|
||||
}
|
||||
});
|
||||
|
||||
//remove the clicked lightbox
|
||||
document.getElementById('lightbox').addEventListener("click", function(event) {
|
||||
if(event.target.id == 'close'){
|
||||
this.innerHTML = '';
|
||||
document.getElementById('lightbox').style.display = 'none';
|
||||
}
|
||||
});
|
||||
// hit esc to dismiss lightbox
|
||||
document.getElementById('lightbox').addEventListener("keydown", function(event) {
|
||||
if(event.key == 'Escape'){
|
||||
this.innerHTML = '';
|
||||
document.getElementById('lightbox').style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
//add the stl lightbox on click
|
||||
var elements = document.querySelectorAll('img.lightbox-image-stl');
|
||||
elements.forEach(element => {
|
||||
element.addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
document.getElementById('lightbox').innerHTML = '<a id="close"></a><a id="next">›</a><a id="prev">‹</a><div id="model" class="img" style="width: 100%; height:100%;" title="'+this.getAttribute('title')+'" ><</div><span>'+this.getAttribute('title')+'</span>';
|
||||
document.getElementById('lightbox').style.display = 'block';
|
||||
document.getElementById('model').setAttribute('data-rotate', 'x');
|
||||
document.getElementById('model').setAttribute('data-zdistance', '4');
|
||||
STLViewer(document.getElementById("model"), this.getAttribute('data-stl'));
|
||||
setGallery(this);
|
||||
document.getElementById('lightbox').focus();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
86
resources/js/stlviewer.js
Normal file
86
resources/js/stlviewer.js
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
|
||||
function STLViewerEnable(classname) {
|
||||
var models = document.getElementsByClassName(classname);
|
||||
for (var i = 0; i < models.length; i++) {
|
||||
STLViewer(models[i], models[i].getAttribute("data-src"));
|
||||
}
|
||||
}
|
||||
|
||||
function STLViewer(elem, model) {
|
||||
|
||||
var renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
|
||||
var camera = new THREE.PerspectiveCamera(50, elem.clientWidth / elem.clientHeight, 1, 1000);
|
||||
|
||||
renderer.setSize(elem.clientWidth, elem.clientHeight);
|
||||
elem.appendChild(renderer.domElement);
|
||||
|
||||
var controls = new THREE.OrbitControls(camera, renderer.domElement);
|
||||
controls.enableDamping = true;
|
||||
controls.rotateSpeed = 0.7;
|
||||
controls.dampingFactor = 0.1;
|
||||
controls.enableZoom = true;
|
||||
controls.enablePan = true;
|
||||
controls.autoRotate = true;
|
||||
controls.autoRotateSpeed = 0.75;
|
||||
|
||||
var scene = new THREE.Scene();
|
||||
|
||||
scene.add(new THREE.HemisphereLight(0xffffff, 0x080820, 1.5));
|
||||
|
||||
(new THREE.STLLoader()).load(model, function (geometry) {
|
||||
|
||||
// Determine the color
|
||||
var colorString = elem.getAttribute("data-color")
|
||||
if(colorString != null) { var color = new THREE.Color(colorString); }
|
||||
else { var color = 0xffff33 }
|
||||
|
||||
// Set up the material
|
||||
var material = new THREE.MeshPhongMaterial({ color: color, specular: 100, shininess: 100 });
|
||||
var mesh = new THREE.Mesh(geometry, material);
|
||||
scene.add(mesh);
|
||||
|
||||
// Compute the middle
|
||||
var middle = new THREE.Vector3();
|
||||
geometry.computeBoundingBox();
|
||||
geometry.boundingBox.getCenter(middle);
|
||||
|
||||
// Center it
|
||||
mesh.geometry.applyMatrix(new THREE.Matrix4().makeTranslation( -middle.x, -middle.y, -middle.z ) );
|
||||
|
||||
// Rotate, if desired
|
||||
if(elem.getAttribute("data-rotate") == "x")
|
||||
mesh.rotation.x = -Math.PI/3
|
||||
|
||||
// Pull the camera away as needed
|
||||
var largestDimension = Math.max(geometry.boundingBox.max.x - geometry.boundingBox.min.x,
|
||||
geometry.boundingBox.max.y - geometry.boundingBox.min.y,
|
||||
geometry.boundingBox.max.z - geometry.boundingBox.min.z)
|
||||
camera.position.z = largestDimension * elem.getAttribute("data-zdistance");
|
||||
|
||||
|
||||
var animate = function () {
|
||||
requestAnimationFrame(animate);
|
||||
controls.update();
|
||||
renderer.render(scene, camera);
|
||||
}; animate();
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutationList, observer) {
|
||||
mutationList.forEach(element => {
|
||||
if(element.removedNodes.length > 0) {
|
||||
renderer.dispose();
|
||||
geometry.dispose();
|
||||
material.dispose();
|
||||
observer.disconnect();
|
||||
}
|
||||
})
|
||||
});
|
||||
observer.observe(elem.parentElement, {childList: true});
|
||||
|
||||
window.addEventListener('resize', function () {
|
||||
renderer.setSize(elem.clientWidth, elem.clientHeight);
|
||||
camera.aspect = elem.clientWidth / elem.clientHeight;
|
||||
camera.updateProjectionMatrix();
|
||||
}, false);
|
||||
});
|
||||
}
|
||||
1068
resources/js/three.min.js
vendored
Normal file
1068
resources/js/three.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
resources/main.scad
Normal file
3
resources/main.scad
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
size = 10;
|
||||
|
||||
cube(size);
|
||||
9
resources/monolith.txt
Normal file
9
resources/monolith.txt
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
The next time you see the full moon high in the south, look carefully at its
|
||||
right-hand edge and let your eye travel upward along the curve of the disk.
|
||||
Round about two o'clock you will notice a small, dark oval: anyone with normal
|
||||
eyesight can find it quite easily. It is the great walled plain, one of the
|
||||
finest on the Moon, known as the Mare Crisium---the Sea of Crises. Three hundred
|
||||
miles in diameter, and almost completely surrounded by a ring of magnificent
|
||||
mountains, it had never been explored until we entered it in the late summer of
|
||||
1996.
|
||||
[extract from SENTINEL OF ETERNITY (1951) by Arthur C. Clarke]
|
||||
Loading…
Reference in a new issue