This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Curve = function(points, canvas){ | |
this.points = points.map( function(p){ return new Point(p); }) | |
this.points[0].setFirst(); | |
this.points[this.points.length-1].setLast(); | |
// create the underlying beziers | |
this.beziers = []; | |
for(var n=0; n<this.points.length-1; n++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CubicBezier = function(canvas, opts){ | |
if(!opts) opts = {}; | |
this.start = opts.start || new Vec2(100,100); | |
this.end = opts.end || new Vec2(400, 400); | |
this.c1 = opts.c1 || new Vec2(100, 300); | |
this.c2 = opts.c2 || new Vec2(300, 100); | |
this.curve = new fabric.Path( this.toSVGPath() ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( window.devicePixelRatio !== 1 ){ | |
var c = canvas.getElement(); // canvas = fabric.Canvas | |
var w = c.width, h = c.height; | |
// Scale the canvas up by two for retina | |
// just like for an image | |
c.setAttribute('width', w*window.devicePixelRatio); | |
c.setAttribute('height', h*window.devicePixelRatio); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Paul Kaplan, @ifitdidntwork | |
Create an ASCII STL file from a THREE.js mesh | |
that can be saved save from browser and 3D printed | |
-------------------------------------------------- | |
See further explanation here: | |
http://buildaweso.me/project/2013/2/25/converting-threejs-objects-to-stl-files | |
-------------------------------------------------- | |
Saving the file out of the browser is done using FileSaver.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#confirmation-overlay { | |
position: absolute; | |
width: 100%; | |
height:100%; | |
background: rgba(0,0,0,0.5); | |
top:0; | |
left:0; | |
line-height:18px; | |
font-size:18px; | |
z-index:100000000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
import atexit | |
def initController(): | |
port = serial.Serial( | |
port='/dev/tty.usbmodem1411', | |
baudrate=9600 | |
) | |
closePort(port) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+================================================ | |
+ | |
+ Vectric machine output configuration file | |
+ | |
+================================================ | |
+ | |
+ History | |
+ | |
+ Who When What | |
+ ======== ========== =========================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+================================================ | |
+ | |
+ Vectric machine output configuration file | |
+ | |
+================================================ | |
+ | |
+ History | |
+ | |
+ Who When What | |
+ ======== ========== =========================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script src="walkthrough.js"></script> | |
<link rel="stylesheet" href="walkthrough.css" /> | |
<body> | |
<div class='walkthrough-container'> | |
<div class="walkthrough-steps"> | |
<div |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) makeSparkRequest { | |
NSString *sparkApi = @"https://api.spark.io/v1/devices"; | |
NSString *deviceId = @"<YOUR_DEVICE_ID>"; | |
NSString *functionName = @"<YOUR_FUNCTION_NAME>"; // registered to cloud using Spark.function("FUNCTION_NAME", FUNCTION); | |
NSString *accessToken = @"<YOUR_ACCESS_TOKEN>"; | |
NSURL *url = [NSURL URLWithString: [NSString stringWithFormat:@"%@/%@/%@\?access_token=%@", | |
sparkApi, | |
deviceId, |