M18
G28 X0 Y0 Z0
| Found in this post: https://www.reddit.com/r/PrintrBot/comments/3jm8bc/start_gcode_does_not_extrudeandmove_but_the_code/ | |
| Use this to reset, center, and auto-extrudea small bit before printing. | |
| G90 ; Explicitly force absolute positioning in case it was not reset previously. | |
| G28 ; Home all axes. | |
| G29 ; Auto-level the bed. | |
| G0 X0 Y0 Z0.15 F9000 ; Move to the front-left part of the bed. | |
| M109 S{print_temperature} ; Set and wait for extruder temperature. | |
| G92 E0 ; Zero the extruder. |
| M501 - print settings | |
| M500 - save settings | |
| M212 - offsets | |
| M106 - fan on | |
| M107 - fan off | |
| References | |
| http://reprap.org/wiki/G-code |
| #define PI 3.14159265359 | |
| #define PI2 6.28318530718 | |
| // Comment or uncomment | |
| // (Leave commented if in shadergif) | |
| // (uncomment if in shadertoy) | |
| //#define shadertoy 1 | |
| #ifdef shadertoy | |
| // time is iGlobalTime in shadertoy |
| uniform float aoIntensity; // {"label":"AO intensity", "min":0, "max":1, "step":0.01, "default":0.15, "group":"Shading", "group_label":"Ambient occlusion"} | |
| uniform float aoSpread; // {"label":"AO spread", "min":0, "max":20, "step":0.01, "default":9, "group":"Shading"} | |
| // Ambient occlusion approximation. | |
| // Based upon boxplorer's implementation which is derived from: | |
| // http://www.iquilezles.org/www/material/nvscene2008/rwwtt.pdf | |
| float ambientOcclusion(vec3 p, vec3 n, float eps) | |
| { | |
| float o = 1.0; // Start at full output colour intensity | |
| eps *= aoSpread; // Spread diffuses the effect |
| // brdf | |
| vec3 radiance( | |
| vec3 n, // macro surface normal | |
| vec3 l, // direction from vertex to light | |
| vec3 v, // direction from vertex to view | |
| // matt | |
| float m, // roughness | |
| vec3 cdiff, // diffuse reflectance | |
| vec3 cspec, // specular reflectance : F0 | |
| // light |
| in vec2 v_texcoord; // texture coords | |
| in vec3 v_normal; // normal | |
| in vec3 v_binormal; // binormal (for TBN basis calc) | |
| in vec3 v_pos; // pixel view space position | |
| out vec4 color; | |
| layout(std140) uniform Transforms | |
| { | |
| mat4x4 world_matrix; // object's world position |
| #ifndef PHONG_LIGHTING_INC | |
| #define PHONG_LIGHTING_INC 1 | |
| #define USE_OPTIMIZATION 1 | |
| #include "BRDF.h" | |
| float GetAngleAttenuation(vec3 _l, vec3 _lightDir, float _angleScale, float _angleOffset) | |
| { | |
| float cosa = -dot(_l, _lightDir); |
| #ifdef GL_ES | |
| precision mediump float; | |
| #endif | |
| #extension GL_OES_standard_derivatives : enable | |
| uniform float time; | |
| uniform vec2 mouse; | |
| uniform vec2 resolution; |
| #include "DeferredRenderer.h" | |
| #include "cinder/gl/gl.h" | |
| #include "cinder/Log.h" | |
| #include "cinder/Buffer.h" | |
| #include "DeferredRendererShaders.h" | |
| #include "DeferredRenderer_random_png.h" | |
| using namespace ci; | |
| using namespace std; |