This file contains hidden or 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
# ##### BEGIN GPL LICENSE BLOCK ##### | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains hidden or 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
# must select 3 verts. | |
import bpy | |
#from mathutils import Vector, Quaternion | |
ob = bpy.context.object | |
# needs to be in object mode to check the status, i think? | |
# check if 3 verts selected. | |
selected_idx = [i.index for i in ob.data.vertices if i.select] |
This file contains hidden or 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
# http://docs.python.org/library/collections.html | |
# note to self | |
import collections | |
from collections import namedtuple | |
Robot = namedtuple('Robot', 'base, hinge1, arm_len, hinge2, wrist, hand') | |
Robot.base = 260 | |
Robot.hinge1 = 20 | |
Robot.arm_len = 120 |
This file contains hidden or 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
# as suggested and clarified by Campbell Barton, in the first response to this post. | |
# Here's an example of a helper function to do new classes that work like named tuples | |
# ---- | |
# 1 liner for making new named tuple like classes | |
def auto_class(name, slots): return type(name, (object, ), {"__slots__": slots}) | |
mytype = auto_class("TrickyClass", ("blah", "whee", "whoo")) | |
t = mytype() |
This file contains hidden or 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 textblock_one = new Array("Line 1", "Line 2", "Line 3", "Line 4"); | |
var textblock_two = new Array("Line 01", "Line 02", "Line 03", "Line 04", "more lines"); | |
var textblock_three = new Array("Line 001", "Line 002", "Line 003", "Line 004"); | |
var thisLineHeight = 18; | |
var fontSizeValue = 16; | |
var myDecoratorColour = '#555555'; | |
var myTextColour = '#333333'; |
This file contains hidden or 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
<div class="resource"> | |
<img width="260" height="399" src="/path/imagename.extention" id="imaginename" class="hidden"> | |
</div> | |
// next thing to try is access this rasterized image. | |
// like with : http://paperjs.org/tutorials/images/working-with-rasters/ | |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- Load the Paper.js library --> | |
<script type="text/javascript" src="js/paper.js"></script> | |
<!-- Load external PaperScript and associate it with myCanvas --> | |
<script type="text/paperscript" src="js/v2_MyScript.js" canvas="myCanvas"> | |
</script> | |
</head> |
This file contains hidden or 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
function displayImage(){ | |
// Create a raster item using the image tag with id='mona' | |
var raster = new Raster('imgtest'); | |
// Move the raster to the center of the view | |
raster.position = view.center; // or some integer. | |
} | |
displayImage(); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>Stroke Bounds</title> | |
<link rel="stylesheet" href="../css/style.css"> | |
<script type="text/javascript" src="../../lib/paper.js"></script> | |
<script type="text/paperscript" canvas="canvas"> | |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>Apt Progress</title> | |
<link rel="stylesheet" href="../css/style.css"> | |
<script type="text/javascript" src="../../lib/paper.js"></script> | |
<script type="text/paperscript" canvas="canvas"> | |
/* |