├── reference ├── element-list ├── resources │ ├── x.png │ └── glass.png ├── type-search-index.zip ├── member-search-index.zip ├── package-search-index.zip ├── package-search-index.js ├── script-dir │ ├── images │ │ ├── ui-icons_222222_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_454545_256x240.png │ │ ├── ui-icons_888888_256x240.png │ │ ├── ui-icons_cd0a0a_256x240.png │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ ├── ui-bg_glass_65_dadada_1x400.png │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ └── ui-bg_highlight-soft_75_cccccc_1x100.png │ ├── jszip-utils │ │ └── dist │ │ │ ├── jszip-utils-ie.min.js │ │ │ ├── jszip-utils.min.js │ │ │ ├── jszip-utils-ie.js │ │ │ └── jszip-utils.js │ ├── jquery-ui.structure.min.css │ └── jquery-ui.structure.css ├── type-search-index.js ├── index.html ├── deprecated-list.html ├── constant-values.html ├── lunar │ ├── class-use │ │ ├── Lists.html │ │ ├── Meshes.html │ │ ├── Render.html │ │ ├── Vectors.html │ │ └── LFace.html │ ├── package-tree.html │ ├── package-use.html │ └── package-summary.html ├── allpackages-index.html ├── overview-tree.html ├── allclasses-index.html ├── index-files │ ├── index-16.html │ ├── index-10.html │ ├── index-6.html │ ├── index-11.html │ ├── index-18.html │ ├── index-19.html │ ├── index-20.html │ ├── index-21.html │ ├── index-5.html │ ├── index-2.html │ ├── index-15.html │ ├── index-7.html │ ├── index-1.html │ ├── index-17.html │ ├── index-4.html │ ├── index-12.html │ └── index-14.html └── script.js ├── .gitignore ├── lib └── lunar.jar ├── .gitattributes ├── resources ├── code │ ├── ExampleTaglet.class │ └── ant-contrib-1.0b3.jar ├── library.properties └── build.properties ├── examples ├── Mesh_Modification │ ├── data │ │ └── humanScaleModel.mtl │ └── Mesh_Modification.pde ├── Basic │ └── Basic.pde ├── Mesh_Generation │ └── Mesh_Generation.pde └── Particles │ └── Particles.pde ├── .classpath ├── .project ├── src └── lunar │ ├── LFace.java │ ├── LVector.java │ ├── LMesh.java │ └── Render.java └── README.md /reference/element-list: -------------------------------------------------------------------------------- 1 | lunar 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | tmp 3 | distribution 4 | -------------------------------------------------------------------------------- /lib/lunar.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/lib/lunar.jar -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.html linguist-detectable=false 2 | *.css linguist-detectable=false 3 | -------------------------------------------------------------------------------- /reference/resources/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/resources/x.png -------------------------------------------------------------------------------- /reference/resources/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/resources/glass.png -------------------------------------------------------------------------------- /reference/type-search-index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/type-search-index.zip -------------------------------------------------------------------------------- /reference/member-search-index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/member-search-index.zip -------------------------------------------------------------------------------- /reference/package-search-index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/package-search-index.zip -------------------------------------------------------------------------------- /resources/code/ExampleTaglet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/resources/code/ExampleTaglet.class -------------------------------------------------------------------------------- /reference/package-search-index.js: -------------------------------------------------------------------------------- 1 | packageSearchIndex = [{"l":"All Packages","url":"allpackages-index.html"},{"l":"lunar"}] -------------------------------------------------------------------------------- /resources/code/ant-contrib-1.0b3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/resources/code/ant-contrib-1.0b3.jar -------------------------------------------------------------------------------- /reference/script-dir/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/script-dir/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /reference/script-dir/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/script-dir/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /reference/script-dir/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/script-dir/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /reference/script-dir/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/script-dir/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /reference/script-dir/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/script-dir/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /reference/script-dir/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/script-dir/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /reference/script-dir/images/ui-bg_glass_65_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/script-dir/images/ui-bg_glass_65_dadada_1x400.png -------------------------------------------------------------------------------- /reference/script-dir/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/script-dir/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /reference/script-dir/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/script-dir/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /reference/script-dir/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/script-dir/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /reference/script-dir/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boydhont/lunar/HEAD/reference/script-dir/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /reference/type-search-index.js: -------------------------------------------------------------------------------- 1 | typeSearchIndex = [{"l":"All Classes","url":"allclasses-index.html"},{"p":"lunar","l":"LFace"},{"p":"lunar","l":"Lists"},{"p":"lunar","l":"LMesh"},{"p":"lunar","l":"LVector"},{"p":"lunar","l":"Meshes"},{"p":"lunar","l":"Render"},{"p":"lunar","l":"Vectors"}] -------------------------------------------------------------------------------- /examples/Mesh_Modification/data/humanScaleModel.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'rp_dennis_posed_004_30k.blend' 2 | # Material Count: 1 3 | 4 | newmtl rp_dennis_posed_004 5 | Ns 225.000000 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.800000 0.800000 0.800000 8 | Ks 0.500000 0.500000 0.500000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.000000 11 | d 1.000000 12 | illum 2 13 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | lunar-for-processing 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/Basic/Basic.pde: -------------------------------------------------------------------------------- 1 | import lunar.*; 2 | 3 | //A basic setup for a 3d scene 4 | 5 | void setup() 6 | { 7 | size(800, 800, P3D); 8 | } 9 | 10 | void draw() 11 | { 12 | background(230); 13 | stroke(230); 14 | fill(10, 250, 150); 15 | 16 | //Camera 17 | Render.mouseCamera(this, new LVector(50, 50, 50), 300); 18 | 19 | //Mesh generation 20 | LMesh mesh = Meshes.boxMesh(100, 100, 100, 5, 5, 5); 21 | 22 | //Mesh rendering 23 | Render.mesh(this, mesh); 24 | } 25 | -------------------------------------------------------------------------------- /src/lunar/LFace.java: -------------------------------------------------------------------------------- 1 | package lunar; 2 | 3 | public class LFace { 4 | 5 | public int a; 6 | public int b; 7 | public int c; 8 | 9 | public LFace(int _a, int _b, int _c) 10 | { 11 | a = _a; 12 | b = _b; 13 | c = _c; 14 | } 15 | 16 | public LFace(int[] d) 17 | { 18 | a = d[0]; 19 | b = d[1]; 20 | c = d[2]; 21 | } 22 | 23 | public LFace(java.util.ArrayList d) 24 | { 25 | a = d.get(0); 26 | b = d.get(1); 27 | c = d.get(2); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/lunar/LVector.java: -------------------------------------------------------------------------------- 1 | package lunar; 2 | 3 | public class LVector { 4 | 5 | public float x; 6 | public float y; 7 | public float z; 8 | 9 | public LVector() 10 | { 11 | x = y = z = 0; 12 | } 13 | 14 | public LVector(float _x, float _y) 15 | { 16 | x = _x; 17 | y = _y; 18 | z = 0; 19 | } 20 | 21 | public LVector(float _x, float _y, float _z) 22 | { 23 | x = _x; 24 | y = _y; 25 | z = _z; 26 | } 27 | 28 | public LVector(float[] f) 29 | { 30 | x = f[0]; 31 | y = f[1]; 32 | z = f[2]; 33 | } 34 | 35 | public LVector(java.util.ArrayList f) 36 | { 37 | x = f.get(0); 38 | y = f.get(1); 39 | z = f.get(2); 40 | } 41 | 42 | public LVector(processing.core.PVector v) 43 | { 44 | x = v.x; 45 | y = v.y; 46 | z = v.z; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/lunar/LMesh.java: -------------------------------------------------------------------------------- 1 | package lunar; 2 | 3 | public class LMesh { 4 | 5 | public java.util.ArrayList vertices; 6 | public java.util.ArrayList faces; 7 | 8 | public java.util.ArrayList children; 9 | 10 | public LMesh() 11 | { 12 | vertices = new java.util.ArrayList(); 13 | faces = new java.util.ArrayList(); 14 | children = new java.util.ArrayList(); 15 | } 16 | 17 | public LMesh(java.util.ArrayList _vertices, java.util.ArrayList _faces) 18 | { 19 | vertices = _vertices; 20 | faces = _faces; 21 | children = new java.util.ArrayList(); 22 | } 23 | 24 | public LMesh(java.util.ArrayList _children) 25 | { 26 | vertices = new java.util.ArrayList(); 27 | faces = new java.util.ArrayList(); 28 | children = new java.util.ArrayList(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /reference/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Generated Documentation (Untitled) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 |
20 | 23 |

lunar/package-summary.html

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /reference/script-dir/jszip-utils/dist/jszip-utils-ie.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g\r\n";document.write(b),a.JSZipUtils._getBinaryFromXHR=function(a){for(var b=a.responseBody,c={},d=0;256>d;d++)for(var e=0;256>e;e++)c[String.fromCharCode(d+(e<<8))]=String.fromCharCode(d)+String.fromCharCode(e);var f=IEBinaryToArray_ByteStr(b),g=IEBinaryToArray_ByteStr_Last(b);return f.replace(/[\s\S]/g,function(a){return c[a]})+g}},{}]},{},[1]); 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lunar for Processing 2 | 3 | ### What is Lunar? 4 | Lunar is a lightweight parametric design library for the minimalist, inspired on existing node-based plug-ins for CAD software. She holds algorithms for the easy generation and adaptation of polygon meshes, vectors and list patterns. She has a built-in interactive camera and additional renderer extensions. 5 | 6 | ## Example 7 | 8 | ``` 9 | import lunar.*; 10 | 11 | void setup() { 12 | size(800, 800, P3D); 13 | } 14 | 15 | void draw(){ 16 | background(230); 17 | 18 | Render.mouseCamera(this, new LVector(), 300); 19 | LMesh mesh = Meshes.boxMesh(100, 100, 100, 5, 5, 5); 20 | Render.mesh(this, mesh); 21 | } 22 | ``` 23 | 24 | ### Why use Lunar? 25 | Lunar is meant for architects, designers and artists that don't want to learn multiple, complex, libraries to visualize their three-dimensional concepts. Lunar has all the building blocks for fast sketching in three dimensions. 26 | 27 | ### How to work with Lunar? 28 | Lunar groups her algorithms under several classes: 29 | - Vector 30 | - Vector calculation 31 | - Vector field generation 32 | - Meshes 33 | - Mesh generation 34 | - Lists 35 | - List adaptations 36 | - Pattern generation 37 | - Render 38 | - Object drawing 39 | - Camera 40 | 41 | The methods are static and can be called directly from the class. 42 | ``` 43 | Render.gradientBackground(this, color(0), color(230)); 44 | ``` 45 | 46 | Each method, except the render methods, return an object. To modify an object, you should replace the original with the result of the method. 47 | ``` 48 | LVector v = new LVector(0,4,2); 49 | v = Vectors.unitVector(v); 50 | ``` 51 | 52 | --- 53 | Dipl.- Ing Boy d'Hont | www.bdhont.net -------------------------------------------------------------------------------- /reference/script-dir/jquery-ui.structure.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.12.1 - 2018-12-06 2 | * http://jqueryui.com 3 | * Copyright jQuery Foundation and other contributors; Licensed MIT */ 4 | 5 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0} -------------------------------------------------------------------------------- /reference/script-dir/jszip-utils/dist/jszip-utils.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.JSZipUtils=a():"undefined"!=typeof global?global.JSZipUtils=a():"undefined"!=typeof self&&(self.JSZipUtils=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g= interval) 70 | { 71 | direction = new LVector(random(-0.02, 0.02), random(-0.02, 0.02), random(-0.02, 0.02)); 72 | timer = 0; 73 | } 74 | 75 | //Render the Mesh 76 | noStroke(); 77 | Render.rainbowMesh(this, mesh); 78 | 79 | //(Optional) Generate and render the scene 80 | translate(0, 0, -100); 81 | noFill(); 82 | strokeWeight(1); 83 | stroke(180, 180, 180, 200*map(mouseY, 0, height*0.75, 1, 0)); 84 | if(mouseY < height/2) ellipse(0, 0, 250, 250); 85 | 86 | translate(90, 0, 0); 87 | noStroke(); 88 | shape(humanScaleModel); 89 | } 90 | -------------------------------------------------------------------------------- /reference/script-dir/jszip-utils/dist/jszip-utils-ie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | ;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o\r\n"+ 18 | "\r\n"; 32 | 33 | // inject VBScript 34 | document.write(IEBinaryToArray_ByteStr_Script); 35 | 36 | global.JSZipUtils._getBinaryFromXHR = function (xhr) { 37 | var binary = xhr.responseBody; 38 | var byteMapping = {}; 39 | for ( var i = 0; i < 256; i++ ) { 40 | for ( var j = 0; j < 256; j++ ) { 41 | byteMapping[ String.fromCharCode( i + (j << 8) ) ] = 42 | String.fromCharCode(i) + String.fromCharCode(j); 43 | } 44 | } 45 | var rawBytes = IEBinaryToArray_ByteStr(binary); 46 | var lastChr = IEBinaryToArray_ByteStr_Last(binary); 47 | return rawBytes.replace(/[\s\S]/g, function( match ) { 48 | return byteMapping[match]; 49 | }) + lastChr; 50 | }; 51 | 52 | // enforcing Stuk's coding style 53 | // vim: set shiftwidth=4 softtabstop=4: 54 | 55 | },{}]},{},[1]) 56 | ; 57 | -------------------------------------------------------------------------------- /examples/Mesh_Generation/Mesh_Generation.pde: -------------------------------------------------------------------------------- 1 | import lunar.*; 2 | 3 | //Generates a mesh from goniometric formulas 4 | 5 | //Generate the mesh 6 | LMesh mesh = pastaMesh(100, 100); 7 | 8 | void setup() 9 | { 10 | //Processing Environment 11 | size(800, 800, P3D); 12 | smooth(8); 13 | } 14 | 15 | void draw() 16 | { 17 | //Look and feel 18 | Render.gradientBackground(this, color(230), color(240)); 19 | cursor(CROSS); 20 | lights(); 21 | ambientLight(128, 128, 128); 22 | Render.mouseCamera(this, new LVector(), 500); 23 | 24 | //Render the mesh 25 | noStroke(); 26 | Render.rainbowMesh(this, mesh); 27 | } 28 | 29 | //Generates a vector according to a goniometric formula 30 | LVector ravioliVector (float u, float v) 31 | { 32 | //Map the u and v to the range 33 | u = map(u, 0, TWO_PI, 0, TWO_PI); 34 | v = map(v, 0, TWO_PI, 0, PI); 35 | 36 | //Generate the vector 37 | LVector p = new LVector( 38 | sin(v)*cos(u), 39 | sin(u), 40 | v 41 | ); 42 | 43 | return p; 44 | } 45 | 46 | //Generates the mesh 47 | LMesh pastaMesh(float scale, int resolution) 48 | { 49 | LMesh mesh = new LMesh(); 50 | 51 | float s = scale; //scale factors 52 | int n = resolution; //step size 53 | 54 | //The mesh 55 | int[][] indexTable = new int[n][n]; //The indextable for the generation of the faces 56 | int index = 0; 57 | 58 | for (int i = 0; i< n; i++) 59 | { 60 | for (int j = 0; j< n; j++) 61 | { 62 | //Define the u and v values 63 | float u = map(i, 0, n-1, 0, TWO_PI); 64 | float v = map(j, 0, n-1, 0, TWO_PI); 65 | 66 | //Generate the vector 67 | LVector p = new LVector(); 68 | p = ravioliVector(u, v); 69 | 70 | //Correct position and scale 71 | p = Vectors.addedVector(p, Vectors.zAxisVector(-PI*0.5)); 72 | p = Vectors.multipliedVector(p, s); 73 | 74 | //Add the vector to the vertex list 75 | mesh.vertices.add(p); 76 | 77 | //Add the vertex index to the index table 78 | indexTable[i][j] = index; 79 | index++; 80 | } 81 | } 82 | 83 | //Generate faces according to the index table 84 | for (int i = 1; i< n; i++) 85 | { 86 | for (int j = 1; j< n; j++) 87 | { 88 | //First triangle face 89 | LFace fL = new LFace( 90 | indexTable[i-1][j], 91 | indexTable[i][j-1], 92 | indexTable[i-1][j-1] 93 | ); 94 | 95 | //Second triangle face 96 | LFace fR = new LFace( 97 | indexTable[i][j-1], 98 | indexTable[i-1][j], 99 | indexTable[i][j] 100 | ); 101 | 102 | //Add the faces to thse mesh 103 | mesh.faces.add(fL); 104 | mesh.faces.add(fR); 105 | } 106 | } 107 | 108 | return mesh; 109 | } 110 | -------------------------------------------------------------------------------- /resources/library.properties: -------------------------------------------------------------------------------- 1 | # More on this file here: https://github.com/processing/processing/wiki/Library-Basics 2 | # UTF-8 supported. 3 | 4 | # The name of your Library as you want it formatted. 5 | name = Lunar 6 | 7 | # List of authors. Links can be provided using the syntax [author name](url). 8 | authors = [Boy d'Hont](www.bdhont.net) 9 | 10 | # A web page for your Library, NOT a direct link to where to download it. 11 | url = https://github.com/boydhont/lunar 12 | 13 | # The category (or categories) of your Library, must be from the following list: 14 | # "3D" "Animation" "Compilations" "Data" 15 | # "Fabrication" "Geometry" "GUI" "Hardware" 16 | # "I/O" "Language" "Math" "Simulation" 17 | # "Sound" "Utilities" "Typography" "Video & Vision" 18 | # 19 | # If a value other than those listed is used, your Library will listed as 20 | # "Other". Many categories must be comma-separated. 21 | categories = 3D 22 | 23 | # A short sentence (or fragment) to summarize the Library's function. This will 24 | # be shown from inside the PDE when the Library is being installed. Avoid 25 | # repeating the name of your Library here. Also, avoid saying anything redundant 26 | # like mentioning that it's a Library. This should start with a capitalized 27 | # letter, and end with a period. 28 | sentence = Parametric design library for the minimalist, inspired on existing node-based plug-ins for CAD software. Holds algorithms for easy generation and adaptation of polygon meshes, vectors and list patterns. 29 | 30 | # Additional information suitable for the Processing website. The value of 31 | # 'sentence' always will be prepended, so you should start by writing the 32 | # second sentence here. If your Library only works on certain operating systems, 33 | # mention it here. 34 | paragraph = Lunar is meant for architects, designers and artists that don't want to learn multiple, complex, libraries to visualize their three-dimensional concepts. Lunar has all the building blocks for fast sketching in three dimensions. 35 | 36 | # Links in the 'sentence' and 'paragraph' attributes can be inserted using the 37 | # same syntax as for authors. 38 | # That is, [here is a link to Processing](http://processing.org/) 39 | 40 | # A version number that increments once with each release. This is used to 41 | # compare different versions of the same Library, and check if an update is 42 | # available. You should think of it as a counter, counting the total number of 43 | # releases you've had. 44 | version = 1 # This must be parsable as an int 45 | 46 | # The version as the user will see it. If blank, the version attribute will be 47 | # used here. This should be a single word, with no spaces. 48 | prettyVersion = 1.0.0 # This is treated as a String 49 | 50 | # The min and max revision of Processing compatible with your Library. 51 | # Note that these fields use the revision and not the version of Processing, 52 | # parsable as an int. For example, the revision number for 2.2.1 is 227. 53 | # You can find the revision numbers in the change log: https://raw.githubusercontent.com/processing/processing/master/build/shared/revisions.txt 54 | # Only use maxRevision (or minRevision), when your Library is known to 55 | # break in a later (or earlier) release. Otherwise, use the default value 0. 56 | minRevision = 0 57 | maxRevision = 0 58 | -------------------------------------------------------------------------------- /reference/script-dir/jquery-ui.structure.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI CSS Framework 1.12.1 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/category/theming/ 10 | */ 11 | /* Layout helpers 12 | ----------------------------------*/ 13 | .ui-helper-hidden { 14 | display: none; 15 | } 16 | .ui-helper-hidden-accessible { 17 | border: 0; 18 | clip: rect(0 0 0 0); 19 | height: 1px; 20 | margin: -1px; 21 | overflow: hidden; 22 | padding: 0; 23 | position: absolute; 24 | width: 1px; 25 | } 26 | .ui-helper-reset { 27 | margin: 0; 28 | padding: 0; 29 | border: 0; 30 | outline: 0; 31 | line-height: 1.3; 32 | text-decoration: none; 33 | font-size: 100%; 34 | list-style: none; 35 | } 36 | .ui-helper-clearfix:before, 37 | .ui-helper-clearfix:after { 38 | content: ""; 39 | display: table; 40 | border-collapse: collapse; 41 | } 42 | .ui-helper-clearfix:after { 43 | clear: both; 44 | } 45 | .ui-helper-zfix { 46 | width: 100%; 47 | height: 100%; 48 | top: 0; 49 | left: 0; 50 | position: absolute; 51 | opacity: 0; 52 | filter:Alpha(Opacity=0); /* support: IE8 */ 53 | } 54 | 55 | .ui-front { 56 | z-index: 100; 57 | } 58 | 59 | 60 | /* Interaction Cues 61 | ----------------------------------*/ 62 | .ui-state-disabled { 63 | cursor: default !important; 64 | pointer-events: none; 65 | } 66 | 67 | 68 | /* Icons 69 | ----------------------------------*/ 70 | .ui-icon { 71 | display: inline-block; 72 | vertical-align: middle; 73 | margin-top: -.25em; 74 | position: relative; 75 | text-indent: -99999px; 76 | overflow: hidden; 77 | background-repeat: no-repeat; 78 | } 79 | 80 | .ui-widget-icon-block { 81 | left: 50%; 82 | margin-left: -8px; 83 | display: block; 84 | } 85 | 86 | /* Misc visuals 87 | ----------------------------------*/ 88 | 89 | /* Overlays */ 90 | .ui-widget-overlay { 91 | position: fixed; 92 | top: 0; 93 | left: 0; 94 | width: 100%; 95 | height: 100%; 96 | } 97 | .ui-autocomplete { 98 | position: absolute; 99 | top: 0; 100 | left: 0; 101 | cursor: default; 102 | } 103 | .ui-menu { 104 | list-style: none; 105 | padding: 0; 106 | margin: 0; 107 | display: block; 108 | outline: 0; 109 | } 110 | .ui-menu .ui-menu { 111 | position: absolute; 112 | } 113 | .ui-menu .ui-menu-item { 114 | margin: 0; 115 | cursor: pointer; 116 | /* support: IE10, see #8844 */ 117 | list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); 118 | } 119 | .ui-menu .ui-menu-item-wrapper { 120 | position: relative; 121 | padding: 3px 1em 3px .4em; 122 | } 123 | .ui-menu .ui-menu-divider { 124 | margin: 5px 0; 125 | height: 0; 126 | font-size: 0; 127 | line-height: 0; 128 | border-width: 1px 0 0 0; 129 | } 130 | .ui-menu .ui-state-focus, 131 | .ui-menu .ui-state-active { 132 | margin: -1px; 133 | } 134 | 135 | /* icon support */ 136 | .ui-menu-icons { 137 | position: relative; 138 | } 139 | .ui-menu-icons .ui-menu-item-wrapper { 140 | padding-left: 2em; 141 | } 142 | 143 | /* left-aligned */ 144 | .ui-menu .ui-icon { 145 | position: absolute; 146 | top: 0; 147 | bottom: 0; 148 | left: .2em; 149 | margin: auto 0; 150 | } 151 | 152 | /* right-aligned */ 153 | .ui-menu .ui-menu-icon { 154 | left: auto; 155 | right: 0; 156 | } 157 | -------------------------------------------------------------------------------- /examples/Particles/Particles.pde: -------------------------------------------------------------------------------- 1 | import lunar.*; 2 | 3 | //Creates a simple 2D particle system with mouse interaction 4 | 5 | //Canvas size 6 | LVector windowSize = new LVector(800, 800); 7 | LVector canvasSize = new LVector(windowSize.x*pow(0.625, 2), windowSize.y*0.625); 8 | LVector canvasOffset = new LVector((windowSize.x-canvasSize.x)*0.5, (windowSize.y-canvasSize.y)*0.5); 9 | 10 | //Points and their movement 11 | ArrayList points; 12 | ArrayList acceleration; 13 | 14 | void settings() 15 | { 16 | //Processing Environment 17 | size((int)windowSize.x, (int)windowSize.y, P2D); 18 | smooth(8); 19 | } 20 | 21 | void setup() 22 | { 23 | //Generate point field and movement 24 | points = Vectors.randomVectors(canvasSize.x, canvasSize.y, 255, 200); 25 | acceleration = Vectors.randomVectors(2, 2, 10, points.size()); 26 | 27 | //Correct position and accelerations of the points 28 | LVector d = new LVector(canvasOffset.x, canvasOffset.y); 29 | LVector s = new LVector(-1, -1, -5); 30 | for (int i = 0; i < points.size(); i++) 31 | { 32 | LVector v = points.get(i); 33 | v = Vectors.addedVector(v, d); 34 | points.set(i, v); 35 | 36 | LVector a = acceleration.get(i); 37 | a = Vectors.addedVector(a, s); 38 | acceleration.set(i, a); 39 | } 40 | } 41 | 42 | void draw() 43 | { 44 | //Processing look and feel 45 | background(240); 46 | cursor(CROSS); 47 | 48 | //(optional) Generate and render the scene 49 | noStroke(); 50 | rectMode(CENTER); 51 | 52 | for (int i = -9; i<20; i++) 53 | { 54 | if (i < 0)fill(255, 255, 255, map(i, -9, 0, 0, 50)); 55 | else fill(0, 0, 0, map(i, 0, 9, 50, 0)); 56 | rect(width*0.5+i, height*0.5+i, canvasSize.x, canvasSize.y, 20, 20, 20, 20); 57 | } 58 | 59 | fill(240); 60 | rect(width*0.5, height*0.5, canvasSize.x, canvasSize.y, 20, 20, 20, 20); 61 | 62 | //Animate points 63 | for (int i = 0; i< points.size(); i++) 64 | { 65 | LVector v = points.get(i); 66 | LVector a = acceleration.get(i); 67 | 68 | if (v.x < canvasOffset.x || v.x > canvasOffset.x + canvasSize.x) a.x = Vectors.reversedVector(a).x; 69 | if (v.y < canvasOffset.y || v.y > canvasOffset.y + canvasSize.y) a.y = Vectors.reversedVector(a).y; 70 | if (v.z < 0 || v.z > 255) a.z = Vectors.reversedVector(a).z; 71 | 72 | v = Vectors.addedVector(v, a); 73 | 74 | points.set(i, v); 75 | acceleration.set(i, a); 76 | } 77 | 78 | //Render points 79 | for (LVector v : points) 80 | { 81 | stroke(100, 100, 100, map(v.z, 0, 255, 0, 255)); 82 | strokeWeight(map(v.z, 0, 255, 2, 5)); 83 | point(v.x, v.y); 84 | }; 85 | 86 | //Calculate points close to the mouse 87 | LVector mousePosition = new LVector(mouseX, mouseY); 88 | ArrayList flattedPoints = new ArrayList(); 89 | for (LVector v : points) flattedPoints.add(new LVector(v.x, v.y)); 90 | ArrayList highlightedPoints = Vectors.closestVectors(mousePosition, flattedPoints, 40); 91 | 92 | //Render points close to the mouse 93 | noFill(); 94 | 95 | for (LVector v : highlightedPoints) 96 | { 97 | stroke 98 | ( 99 | map(mousePosition.x, canvasOffset.x, canvasOffset.x + canvasSize.x, 0, 255), 100 | map(mousePosition.y, canvasOffset.y, canvasOffset.y + canvasSize.y, 0, 255), 101 | map(mousePosition.y, canvasOffset.y, canvasOffset.y + canvasSize.y, 255, 0), 102 | map(v.z, 0, 255, 100, 255) 103 | ); 104 | 105 | strokeWeight(map(v.z, 0, 255, 5, 15)); 106 | point(v.x, v.y); 107 | 108 | strokeWeight(1); 109 | ellipse(v.x, v.y, map(v.z, 0, 255, 10, 30), map(v.z, 0, 255, 10, 30)); 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /reference/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Deprecated List 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Deprecated API

70 |

Contents

71 |
72 |
73 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /reference/constant-values.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Constant Field Values 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Constant Field Values

70 |
71 |

Contents

72 |
73 |
74 |
75 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /reference/lunar/class-use/Lists.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class lunar.Lists 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Uses of Class
lunar.Lists

70 |
71 |
No usage of lunar.Lists
72 |
73 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /reference/lunar/class-use/Meshes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class lunar.Meshes 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Uses of Class
lunar.Meshes

70 |
71 |
No usage of lunar.Meshes
72 |
73 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /reference/lunar/class-use/Render.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class lunar.Render 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Uses of Class
lunar.Render

70 |
71 |
No usage of lunar.Render
72 |
73 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /reference/lunar/class-use/Vectors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class lunar.Vectors 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Uses of Class
lunar.Vectors

70 |
71 |
No usage of lunar.Vectors
72 |
73 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /reference/allpackages-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Packages 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

All Packages

70 |
71 |
72 |
73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 |
Package Summary 
PackageDescription
lunar 
88 |
89 |
90 |
91 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /reference/lunar/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | lunar Class Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Hierarchy For Package lunar

70 |
71 |
72 |
73 |

Class Hierarchy

74 | 87 |
88 |
89 |
90 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /reference/overview-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Class Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Hierarchy For All Packages

70 | Package Hierarchies: 71 | 74 |
75 |
76 |
77 |

Class Hierarchy

78 | 91 |
92 |
93 |
94 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /reference/script-dir/jszip-utils/dist/jszip-utils.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.JSZipUtils=e():"undefined"!=typeof global?global.JSZipUtils=e():"undefined"!=typeof self&&(self.JSZipUtils=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 2 | 3 | 4 | 5 | 6 | Uses of Package lunar 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Uses of Package
lunar

70 |
71 |
72 |
73 |
    74 |
  • 75 |
    76 | 77 | 78 |
    79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 |
    Classes in lunar used by lunar 
    ClassDescription
    LFace 
    LMesh 
    LVector 
    102 |
    103 |
    104 |
  • 105 |
106 |
107 |
108 |
109 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /reference/allclasses-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Classes 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

All Classes

70 |
71 |
72 |
73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 |
Class Summary 
ClassDescription
LFace 
Lists 
LMesh 
LVector 
Meshes 
Render 
Vectors 
112 |
113 |
114 |
115 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /reference/lunar/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | lunar 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Package lunar

70 |
71 |
72 |
73 |
    74 |
  • 75 |
    76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 |
    Class Summary 
    ClassDescription
    LFace 
    Lists 
    LMesh 
    LVector 
    Meshes 
    Render 
    Vectors 
    115 |
    116 |
  • 117 |
118 |
119 |
120 |
121 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /reference/index-files/index-16.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | U-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

U

75 |
76 |
unitVector(LVector) - Static method in class lunar.Vectors
77 |
78 |
Returns the unitized vector
79 |
80 |
81 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
82 |
83 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /reference/index-files/index-10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | N-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

N

75 |
76 |
nullPattern(ArrayList<T>) - Static method in class lunar.Lists
77 |
78 |
Tests a list for null items
79 |
80 |
81 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
82 |
83 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /reference/index-files/index-6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | G-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

G

75 |
76 |
gradientBackground(PApplet, int, int) - Static method in class lunar.Render
77 |
78 |
Draws the background as a gradient
79 |
80 |
81 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
82 |
83 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /reference/index-files/index-11.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | O-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

O

75 |
76 |
orbitCamera(PApplet, LVector, LVector) - Static method in class lunar.Render
77 |
78 |
Creates a camera that orbits around a target point
79 |
80 |
81 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
82 |
83 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /reference/index-files/index-18.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | W-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

W

75 |
76 |
wovenList(ArrayList<T>, ArrayList<T>, ArrayList<Boolean>) - Static method in class lunar.Lists
77 |
78 |
Weaves a set of input data
79 |
80 |
81 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
82 |
83 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /reference/index-files/index-19.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | X-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

X

75 |
76 |
x - Variable in class lunar.LVector
77 |
 
78 |
xAxisVector(float) - Static method in class lunar.Vectors
79 |
80 |
Returns a vector parallel to the x-axis
81 |
82 |
83 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
84 |
85 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /reference/index-files/index-20.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Y-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

Y

75 |
76 |
y - Variable in class lunar.LVector
77 |
 
78 |
yAxisVector(float) - Static method in class lunar.Vectors
79 |
80 |
Returns a vector parallel to the y-axis
81 |
82 |
83 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
84 |
85 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /reference/index-files/index-21.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Z-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

Z

75 |
76 |
z - Variable in class lunar.LVector
77 |
 
78 |
zAxisVector(float) - Static method in class lunar.Vectors
79 |
80 |
Returns a vector parallel to the z-axis
81 |
82 |
83 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
84 |
85 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /reference/index-files/index-5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | F-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

F

75 |
76 |
faces - Variable in class lunar.LMesh
77 |
 
78 |
faceVectices(LFace, LMesh) - Static method in class lunar.Meshes
79 |
80 |
Returns the vertices that make a face
81 |
82 |
83 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
84 |
85 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /reference/index-files/index-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | B-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

B

75 |
76 |
b - Variable in class lunar.LFace
77 |
 
78 |
boxMesh(float, float, float, int, int, int) - Static method in class lunar.Meshes
79 |
80 |
Generates a mesh in the shape of a box
81 |
82 |
83 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
84 |
85 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /reference/index-files/index-15.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | T-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

T

75 |
76 |
triangleMesh(LVector, LVector, LVector) - Static method in class lunar.Meshes
77 |
78 |
Generates a mesh in the form of a single face
79 |
80 |
twoPointVector(LVector, LVector) - Static method in class lunar.Vectors
81 |
82 |
Returns the vector between two points
83 |
84 |
85 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
86 |
87 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /reference/index-files/index-7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | I-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

I

75 |
76 |
insertedItemsList(ArrayList<T>, ArrayList<T>, int) - Static method in class lunar.Lists
77 |
78 |
Inserts a collection of items into a list
79 |
80 |
itemIndex(ArrayList<T>, T) - Static method in class lunar.Lists
81 |
82 |
Retrieves the index of a certain item in a list
83 |
84 |
85 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
86 |
87 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /reference/script.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. 3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 4 | * 5 | * 6 | * 7 | * 8 | * 9 | * 10 | * 11 | * 12 | * 13 | * 14 | * 15 | * 16 | * 17 | * 18 | * 19 | * 20 | * 21 | * 22 | * 23 | * 24 | */ 25 | 26 | var moduleSearchIndex; 27 | var packageSearchIndex; 28 | var typeSearchIndex; 29 | var memberSearchIndex; 30 | var tagSearchIndex; 31 | function loadScripts(doc, tag) { 32 | createElem(doc, tag, 'script-dir/jszip/dist/jszip.js'); 33 | createElem(doc, tag, 'script-dir/jszip-utils/dist/jszip-utils.js'); 34 | if (window.navigator.userAgent.indexOf('MSIE ') > 0 || window.navigator.userAgent.indexOf('Trident/') > 0 || 35 | window.navigator.userAgent.indexOf('Edge/') > 0) { 36 | createElem(doc, tag, 'script-dir/jszip-utils/dist/jszip-utils-ie.js'); 37 | } 38 | createElem(doc, tag, 'search.js'); 39 | 40 | $.get(pathtoroot + "module-search-index.zip") 41 | .done(function() { 42 | JSZipUtils.getBinaryContent(pathtoroot + "module-search-index.zip", function(e, data) { 43 | JSZip.loadAsync(data).then(function(zip){ 44 | zip.file("module-search-index.json").async("text").then(function(content){ 45 | moduleSearchIndex = JSON.parse(content); 46 | }); 47 | }); 48 | }); 49 | }); 50 | $.get(pathtoroot + "package-search-index.zip") 51 | .done(function() { 52 | JSZipUtils.getBinaryContent(pathtoroot + "package-search-index.zip", function(e, data) { 53 | JSZip.loadAsync(data).then(function(zip){ 54 | zip.file("package-search-index.json").async("text").then(function(content){ 55 | packageSearchIndex = JSON.parse(content); 56 | }); 57 | }); 58 | }); 59 | }); 60 | $.get(pathtoroot + "type-search-index.zip") 61 | .done(function() { 62 | JSZipUtils.getBinaryContent(pathtoroot + "type-search-index.zip", function(e, data) { 63 | JSZip.loadAsync(data).then(function(zip){ 64 | zip.file("type-search-index.json").async("text").then(function(content){ 65 | typeSearchIndex = JSON.parse(content); 66 | }); 67 | }); 68 | }); 69 | }); 70 | $.get(pathtoroot + "member-search-index.zip") 71 | .done(function() { 72 | JSZipUtils.getBinaryContent(pathtoroot + "member-search-index.zip", function(e, data) { 73 | JSZip.loadAsync(data).then(function(zip){ 74 | zip.file("member-search-index.json").async("text").then(function(content){ 75 | memberSearchIndex = JSON.parse(content); 76 | }); 77 | }); 78 | }); 79 | }); 80 | $.get(pathtoroot + "tag-search-index.zip") 81 | .done(function() { 82 | JSZipUtils.getBinaryContent(pathtoroot + "tag-search-index.zip", function(e, data) { 83 | JSZip.loadAsync(data).then(function(zip){ 84 | zip.file("tag-search-index.json").async("text").then(function(content){ 85 | tagSearchIndex = JSON.parse(content); 86 | }); 87 | }); 88 | }); 89 | }); 90 | if (!moduleSearchIndex) { 91 | createElem(doc, tag, 'module-search-index.js'); 92 | } 93 | if (!packageSearchIndex) { 94 | createElem(doc, tag, 'package-search-index.js'); 95 | } 96 | if (!typeSearchIndex) { 97 | createElem(doc, tag, 'type-search-index.js'); 98 | } 99 | if (!memberSearchIndex) { 100 | createElem(doc, tag, 'member-search-index.js'); 101 | } 102 | if (!tagSearchIndex) { 103 | createElem(doc, tag, 'tag-search-index.js'); 104 | } 105 | $(window).resize(function() { 106 | $('.navPadding').css('padding-top', $('.fixedNav').css("height")); 107 | }); 108 | } 109 | 110 | function createElem(doc, tag, path) { 111 | var script = doc.createElement(tag); 112 | var scriptElement = doc.getElementsByTagName(tag)[0]; 113 | script.src = pathtoroot + path; 114 | scriptElement.parentNode.insertBefore(script, scriptElement); 115 | } 116 | 117 | function show(type) { 118 | count = 0; 119 | for (var key in data) { 120 | var row = document.getElementById(key); 121 | if ((data[key] & type) !== 0) { 122 | row.style.display = ''; 123 | row.className = (count++ % 2) ? rowColor : altColor; 124 | } 125 | else 126 | row.style.display = 'none'; 127 | } 128 | updateTabs(type); 129 | } 130 | 131 | function updateTabs(type) { 132 | var firstRow = document.getElementById(Object.keys(data)[0]); 133 | var table = firstRow.closest('table'); 134 | for (var value in tabs) { 135 | var tab = document.getElementById(tabs[value][0]); 136 | if (value == type) { 137 | tab.className = activeTableTab; 138 | tab.innerHTML = tabs[value][1]; 139 | tab.setAttribute('aria-selected', true); 140 | tab.setAttribute('tabindex',0); 141 | table.setAttribute('aria-labelledby', tabs[value][0]); 142 | } 143 | else { 144 | tab.className = tableTab; 145 | tab.setAttribute('aria-selected', false); 146 | tab.setAttribute('tabindex',-1); 147 | tab.setAttribute('onclick', "show("+ value + ")"); 148 | tab.innerHTML = tabs[value][1]; 149 | } 150 | } 151 | } 152 | 153 | function switchTab(e) { 154 | if (e.keyCode == 37 || e.keyCode == 38) { 155 | $("[aria-selected=true]").prev().click().focus(); 156 | e.preventDefault(); 157 | } 158 | if (e.keyCode == 39 || e.keyCode == 40) { 159 | $("[aria-selected=true]").next().click().focus(); 160 | e.preventDefault(); 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /reference/lunar/class-use/LFace.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class lunar.LFace 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Uses of Class
lunar.LFace

70 |
71 |
72 |
73 |
    74 |
  • 75 |
    76 | 77 | 78 |

    Uses of LFace in lunar

    79 |
    80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 |
    Fields in lunar with type parameters of type LFace 
    Modifier and TypeFieldDescription
    java.util.ArrayList<LFace>LMesh.faces 
    97 |
    98 |
    99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 113 | 116 | 117 | 118 |
    Methods in lunar with parameters of type LFace 
    Modifier and TypeMethodDescription
    static java.util.ArrayList<LVector>Meshes.faceVectices​(LFace face, 112 | LMesh parentMesh) 114 |
    Returns the vertices that make a face
    115 |
    119 |
    120 |
    121 |
  • 122 |
123 |
124 |
125 |
126 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /reference/index-files/index-1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | A-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

A

75 |
76 |
a - Variable in class lunar.LFace
77 |
 
78 |
addedVector(LVector, LVector) - Static method in class lunar.Vectors
79 |
80 |
Performs vector-vector addition
81 |
82 |
amplitudedVector(LVector, float) - Static method in class lunar.Vectors
83 |
84 |
Sets the amplitude of a vector
85 |
86 |
angleBetweenVectors(LVector, LVector) - Static method in class lunar.Vectors
87 |
88 |
Computes the angle between two vector
89 |
90 |
91 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
92 |
93 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /reference/index-files/index-17.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | V-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

V

75 |
76 |
vectorDistance(LVector, LVector) - Static method in class lunar.Vectors
77 |
78 |
Returns the distance between two vectors
79 |
80 |
vectorLength(LVector) - Static method in class lunar.Vectors
81 |
82 |
Computes the amplitude of a vector
83 |
84 |
Vectors - Class in lunar
85 |
 
86 |
Vectors() - Constructor for class lunar.Vectors
87 |
 
88 |
vertices - Variable in class lunar.LMesh
89 |
 
90 |
91 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
92 |
93 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /reference/index-files/index-4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | D-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

D

75 |
76 |
deconstructVector(LVector) - Static method in class lunar.Vectors
77 |
78 |
Deconstructs a vector into its component parts
79 |
80 |
dispatchedLists(ArrayList<T>, ArrayList<Boolean>) - Static method in class lunar.Lists
81 |
82 |
Dispatches items in a list into two lists
83 |
84 |
dividedVector(LVector, float) - Static method in class lunar.Vectors
85 |
86 |
Returns a vector-scalar division
87 |
88 |
dotProduct(LVector, LVector) - Static method in class lunar.Vectors
89 |
90 |
Returns the vector dot product
91 |
92 |
93 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
94 |
95 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /resources/build.properties: -------------------------------------------------------------------------------- 1 | # Create a Library for the Processing open source programming language and 2 | # environment (http://processing.org/) 3 | # 4 | # Customize the build properties to make the ant-build-process work for your 5 | # environment. How? Please read the comments below. 6 | # 7 | # The default properties are set for OS X. Please refer to comments for Windows 8 | # settings. 9 | 10 | 11 | # Where is your Processing sketchbook located? 12 | # If you are not sure, check the sketchbook location in your Processing 13 | # application preferences. 14 | # ${user.home} points the compiler to your home directory. 15 | # For windows the default path to your sketchbook would be 16 | # ${user.home}/My Documents/Processing (make adjustments below) 17 | 18 | #sketchbook.location=${user.home}/My Documents/Processing 19 | sketchbook.location=${user.home}/sketchbook 20 | 21 | 22 | # Where are the jar files located that are required for compiling your Library 23 | # such as e.g. core.jar? 24 | # By default the local classpath location points to folder libs inside Eclipse's 25 | # workspace (by default found in your home directory). 26 | # For Windows, the default path would be 27 | # ${user.home}/Documents/workspace/libs (make adjustments below) 28 | # For OS X,the following path will direct you into Processing's application 29 | # package, in case you put Processing inside your Applications folder. 30 | 31 | classpath.local.location=${user.home}/Documenten/Projects/T002 - Lunar Library Processing/Source Documents/Processing Library/lunar-library-master/lib/ 32 | #classpath.local.location=/Applications/Processing.app/Contents/Java/core/library 33 | 34 | 35 | # Add all jar files that are required for compiling your project to the local 36 | # and project classpath. Use a comma as delimiter. These jar files must be 37 | # inside your classpath.local.location folder. 38 | 39 | classpath.local.include=core.jar 40 | 41 | 42 | # Add Processing's libraries folder to the classpath. 43 | # If you don't need to include the libraries folder to your classpath, comment 44 | # out the following line. 45 | 46 | classpath.libraries.location=${sketchbook.location}/libraries 47 | 48 | 49 | # Set the java version that should be used to compile your Library. 50 | 51 | java.target.version=1.8 52 | 53 | 54 | # Set the description of the Ant build.xml file. 55 | 56 | ant.description=Processing Library Ant build file. 57 | 58 | 59 | # Give your Library a name. The name must not contain spaces or special 60 | # characters. 61 | 62 | project.name=lunar 63 | 64 | 65 | # The name as the user will see it. This can contain spaces and special 66 | # characters. 67 | 68 | project.prettyName=Lunar 69 | 70 | 71 | # Use 'normal' or 'fast' as value for project.compile. 72 | # 'fast' will only compile the project into your sketchbook. 73 | # 'normal' will compile the distribution including the javadoc-reference and all 74 | # web-files (the compile process here takes longer). 75 | # All files compiled with project.compile=normal are stored in the distribution 76 | # folder. 77 | 78 | project.compile=normal 79 | 80 | 81 | # Set your name and URL, used for the web page and properties file. 82 | 83 | author.name=Boy d'Hont 84 | author.url=http://www.bdhont.net 85 | 86 | 87 | # Set the web page for your Library. 88 | # This is NOT a direct link to where to download it. 89 | 90 | library.url=http://bdhont.net/lunar 91 | 92 | 93 | # Set the category (or categories) of your Library from the following list: 94 | # "3D" "Animation" "Compilations" "Data" 95 | # "Fabrication" "Geometry" "GUI" "Hardware" 96 | # "I/O" "Language" "Math" "Simulation" 97 | # "Sound" "Utilities" "Typography" "Video & Vision" 98 | # 99 | # If a value other than those listed is used, your Library will listed as 100 | # "Other". Many categories must be comma-separated. 101 | 102 | library.categories="3D" 103 | 104 | 105 | # A short sentence (or fragment) to summarize the Library's function. This will 106 | # be shown from inside the PDE when the Library is being installed. Avoid 107 | # repeating the name of your Library here. Also, avoid saying anything redundant 108 | # like mentioning that it's a Library. This should start with a capitalized 109 | # letter, and end with a period. 110 | 111 | library.sentence=Parametric design library for the minimalist, inspired on existing node-based plug-ins for CAD software. Holds algorithms for easy generation and adaptation of polygon meshes, vectors and list patterns. 112 | 113 | 114 | # Additional information suitable for the Processing website. The value of 115 | # 'sentence' always will be prepended, so you should start by writing the 116 | # second sentence here. If your Library only works on certain operating systems, 117 | # mention it here. 118 | 119 | library.paragraph= 120 | 121 | 122 | # Set the source code repository for your project. 123 | # We recommend Bitbucket (https://bitbucket.org) or GitHub (https://github.com). 124 | 125 | source.host=GitHub 126 | source.url=https://github.com/boydhont/lunar 127 | source.repository=https://github.com/boydhont/lunar.git 128 | 129 | 130 | # The current version of your Library. 131 | # This number must be parsable as an int. It increments once with each release. 132 | # This is used to compare different versions of the same Library, and check if 133 | # an update is available. 134 | 135 | library.version=1 136 | 137 | 138 | # The version as the user will see it. 139 | 140 | library.prettyVersion=1.0.0 141 | 142 | 143 | # The min and max revision of Processing compatible with your Library. 144 | # Note that these fields use the revision and not the version of Processing, 145 | # parsable as an int. For example, the revision number for 2.2.1 is 227. 146 | # You can find the revision numbers in the change log: https://raw.githubusercontent.com/processing/processing/master/build/shared/revisions.txt 147 | # Only use maxRevision (or minRevision), when your Library is known to 148 | # break in a later (or earlier) release. Otherwise, use the default value 0. 149 | 150 | compatible.minRevision=0 151 | compatible.maxRevision=0 152 | 153 | 154 | # The platforms and Processing version that the Library has been tested 155 | # against. This information is only used in the generated webpage. 156 | 157 | tested.platform=linux 158 | tested.processingVersion=3.2.3 159 | 160 | 161 | # Additional information for the generated webpage. 162 | 163 | library.copyright=(c) 2020 164 | library.dependencies=? 165 | library.keywords=? 166 | 167 | 168 | # Include javadoc references into your project's javadocs. 169 | 170 | #javadoc.java.href=http://docs.oracle.com/javase/7/docs/api/ 171 | javadoc.java.href=http://docs.oracle.com/javase/8/docs/api/ 172 | javadoc.processing.href=http://processing.github.io/processing-javadocs/core/ 173 | -------------------------------------------------------------------------------- /reference/index-files/index-12.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | P-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

P

75 |
76 |
pickedAndChosenList(ArrayList<T>, ArrayList<T>, ArrayList<Boolean>) - Static method in class lunar.Lists
77 |
78 |
Pick and choose from a set of input data
79 |
80 |
planeMesh(float, float, int, int) - Static method in class lunar.Meshes
81 |
82 |
Generates a mesh in the shape of a plane
83 |
84 |
polarToCartesianVector(LVector) - Static method in class lunar.Vectors
85 |
86 |
Converts a polar vector to a Cartesian vector
87 |
88 |
PVector(LVector) - Static method in class lunar.Vectors
89 |
90 |
Converts a vector into a PVector
91 |
92 |
93 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
94 |
95 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /reference/index-files/index-14.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | S-Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 25 | 28 |
29 | 66 |
67 |
68 |
69 |

Index

70 |
71 |
A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages 72 | 73 | 74 |

S

75 |
76 |
shiftedList(ArrayList<T>, int) - Static method in class lunar.Lists
77 |
78 |
Offsets all items in a list
79 |
80 |
siftedList(ArrayList<T>, ArrayList<Boolean>) - Static method in class lunar.Lists
81 |
82 |
Sifts elements using a repeating index pattern
83 |
84 |
splitLists(ArrayList<T>, int) - Static method in class lunar.Lists
85 |
86 |
Splits a list into separate parts
87 |
88 |
staticCamera(PApplet, LVector, LVector) - Static method in class lunar.Render
89 |
90 |
Creates a static camera
91 |
92 |
subList(ArrayList<T>, int, int) - Static method in class lunar.Lists
93 |
94 |
Extracts a sublist from a list
95 |
96 |
97 | A B C D F G I L M N O P R S T U V W X Y Z 
All Classes All Packages
98 |
99 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /src/lunar/Render.java: -------------------------------------------------------------------------------- 1 | package lunar; 2 | 3 | public class Render { 4 | 5 | /** 6 | * Draws a mesh 7 | * @param applet The Processing applet, write "this" 8 | * @param mesh The input mesh 9 | */ 10 | 11 | public static final void mesh(processing.core.PApplet applet, LMesh mesh) 12 | { 13 | processing.core.PGraphics graphicsBuffer = applet.g; 14 | 15 | graphicsBuffer.beginShape(processing.core.PConstants.TRIANGLES); 16 | 17 | for(LFace f : mesh.faces) 18 | { 19 | LVector a = mesh.vertices.get(f.a); 20 | LVector b = mesh.vertices.get(f.b); 21 | LVector c = mesh.vertices.get(f.c); 22 | 23 | LVector n = Vectors.unitVector(Vectors.crossProduct(Vectors.twoPointVector(a,c),Vectors.twoPointVector(a,b))); 24 | 25 | 26 | graphicsBuffer.normal(n.x, n.y, n.z); 27 | graphicsBuffer.vertex(a.x, a.y, a.z); 28 | graphicsBuffer.vertex(b.x, b.y, b.z); 29 | graphicsBuffer.vertex(c.x, c.y, c.z); 30 | } 31 | 32 | graphicsBuffer.endShape(); 33 | } 34 | 35 | /** 36 | * Draws the normals of a mesh 37 | * @param applet The Processing applet, write "this" 38 | * @param mesh The input mesh 39 | * @param normalLength The length of the normals 40 | */ 41 | 42 | public static final void meshNormals(processing.core.PApplet applet, LMesh mesh, float normalLength) 43 | { 44 | processing.core.PGraphics graphicsBuffer = applet.g; 45 | 46 | graphicsBuffer.beginShape(processing.core.PConstants.LINES); 47 | 48 | for (LFace f : mesh.faces) 49 | { 50 | LVector a = mesh.vertices.get(f.a); 51 | LVector b = mesh.vertices.get(f.b); 52 | LVector c = mesh.vertices.get(f.c); 53 | 54 | LVector m = Vectors.dividedVector(Vectors.addedVector(Vectors.addedVector(a, b), c), 3); 55 | LVector n = Vectors.unitVector(Vectors.crossProduct(Vectors.twoPointVector(a, c), Vectors.twoPointVector(a, b))); 56 | LVector v = Vectors.addedVector(m, Vectors.amplitudedVector(n, normalLength)); 57 | 58 | graphicsBuffer.line(m.x, m.y, m.z, v.x, v.y, v.z); 59 | } 60 | 61 | graphicsBuffer.endShape(); 62 | } 63 | 64 | /** 65 | * Draws the vertices of a mesh 66 | * @param applet The Processing applet, write "this" 67 | * @param mesh The input mesh 68 | */ 69 | 70 | public static final void meshVertices(processing.core.PApplet applet, LMesh mesh) 71 | { 72 | processing.core.PGraphics graphicsBuffer = applet.g; 73 | 74 | graphicsBuffer.beginShape(processing.core.PConstants.POINTS); 75 | 76 | for (LVector v : mesh.vertices) graphicsBuffer.point(v.x, v.y, v.z); 77 | 78 | graphicsBuffer.endShape(); 79 | } 80 | 81 | /** 82 | * Draws a mesh as a rainbow mesh 83 | * @param applet The Processing applet, write "this" 84 | * @param mesh The input mesh 85 | */ 86 | 87 | public static final void rainbowMesh(processing.core.PApplet applet, LMesh mesh) 88 | { 89 | processing.core.PGraphics graphicsBuffer = applet.g; 90 | 91 | graphicsBuffer.beginShape(processing.core.PConstants.TRIANGLES); 92 | 93 | for (LFace f : mesh.faces) 94 | { 95 | LVector a = mesh.vertices.get(f.a); 96 | LVector b = mesh.vertices.get(f.b); 97 | LVector c = mesh.vertices.get(f.c); 98 | 99 | LVector n = Vectors.unitVector(Vectors.crossProduct(Vectors.twoPointVector(a, c), Vectors.twoPointVector(a, b))); 100 | 101 | LVector colour = new LVector( 102 | processing.core.PApplet.map(n.x, -0.87f, 0.87f, 0, 255), 103 | processing.core.PApplet.map(n.y, -0.87f, 0.87f, 0, 255), 104 | processing.core.PApplet.map(n.z, -0.87f, 0.87f, 0, 255) 105 | ); 106 | 107 | graphicsBuffer.fill(colour.x, colour.y, colour.z); 108 | 109 | graphicsBuffer.normal(n.x, n.y, n.z); 110 | graphicsBuffer.vertex(a.x, a.y, a.z); 111 | graphicsBuffer.vertex(b.x, b.y, b.z); 112 | graphicsBuffer.vertex(c.x, c.y, c.z); 113 | } 114 | 115 | graphicsBuffer.endShape(); 116 | } 117 | 118 | /** 119 | * Draws the background as a gradient 120 | * @param applet The Processing applet, write "this" 121 | * @param colourA The first colour 122 | * @param colourB The second colour 123 | */ 124 | 125 | public static final void gradientBackground(processing.core.PApplet applet, int colourA, int colourB) 126 | { 127 | processing.core.PGraphics graphicsBuffer = applet.g; 128 | 129 | graphicsBuffer.hint(processing.core.PConstants.DISABLE_DEPTH_TEST); 130 | graphicsBuffer.pushMatrix(); 131 | graphicsBuffer.resetMatrix(); 132 | processing.opengl.PGraphicsOpenGL pgl = (processing.opengl.PGraphicsOpenGL)graphicsBuffer; 133 | boolean pushedLights = pgl.lights; 134 | pgl.lights = false; 135 | pgl.pushProjection(); 136 | graphicsBuffer.ortho(0, graphicsBuffer.width, graphicsBuffer.height, 0, -Float.MAX_VALUE, +Float.MAX_VALUE); 137 | 138 | graphicsBuffer.noFill(); 139 | graphicsBuffer.strokeWeight(1); 140 | 141 | for (int i = 0; i <= applet.height; i++) 142 | { 143 | float t = processing.core.PApplet.map(i, 0, applet.height, 0, 1); 144 | int colourC = applet.lerpColor(colourA, colourB, t); 145 | graphicsBuffer.stroke(colourC); 146 | graphicsBuffer.line(0, -i, applet.width, -i); 147 | } 148 | 149 | pgl.popProjection(); 150 | pgl.lights = pushedLights; 151 | graphicsBuffer.popMatrix(); 152 | graphicsBuffer.hint(processing.core.PConstants.ENABLE_DEPTH_TEST); 153 | } 154 | 155 | /** 156 | * Creates a static camera 157 | * @param applet The Processing applet, write "this" 158 | * @param target The position the camera is looking towards to 159 | * @param position The position of the camera 160 | */ 161 | 162 | public static final void staticCamera(processing.core.PApplet applet, LVector target, LVector position) 163 | { 164 | applet.camera(position.x, position.y, position.z, target.x, target.y, target.z, 0, 0, -1); 165 | } 166 | 167 | /** 168 | * Creates a camera that orbits around a target point 169 | * @param applet The Processing applet, write "this" 170 | * @param target The position the camera is looking towards to 171 | * @param polarPosition The position of the camera as a three-dimensional polar coordinate 172 | */ 173 | 174 | public static void orbitCamera(processing.core.PApplet applet, LVector target, LVector polarPosition) 175 | { 176 | LVector position = new LVector 177 | ( 178 | (float)(java.lang.Math.cos(polarPosition.y)*polarPosition.x), 179 | (float)(java.lang.Math.sin(polarPosition.y)*polarPosition.x), 180 | (float)(java.lang.Math.sin(polarPosition.z)*polarPosition.x) 181 | ); 182 | 183 | position = Vectors.addedVector(position, target); 184 | 185 | applet.camera(position.x, position.y, position.z, target.x, target.y, target.z, 0, 0, -1); 186 | } 187 | 188 | /** 189 | * Creates a camera that around a target points, dependent on the mouse position 190 | * @param applet The Processing applet, write "this" 191 | * @param target The position the camera is looking towards to 192 | * @param cameraDistance The distance of the camera to the target 193 | */ 194 | 195 | public static void mouseCamera(processing.core.PApplet applet, LVector target, float cameraDistance) 196 | { 197 | LVector mousePosition = new LVector 198 | ( 199 | cameraDistance, 200 | processing.core.PApplet.map(applet.mouseX, 0, applet.width, (float)java.lang.Math.PI, (float)-java.lang.Math.PI), 201 | processing.core.PApplet.map(applet.mouseY, 0, applet.height, (float)java.lang.Math.PI/2, (float)-java.lang.Math.PI/2) 202 | ); 203 | 204 | orbitCamera(applet, target, mousePosition); 205 | } 206 | 207 | } 208 | --------------------------------------------------------------------------------