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
/* | |
* Tested on node 0.6, Ubuntu | |
*/ | |
#!/usr/bin/node | |
COLOR_GREEN="\033[01;32m" | |
COLOR_RED="\033[01;31m" | |
COLOR_YELLOW="\033[01;33m" | |
COLOR_BLUE="\033[01;34m" | |
COLOR_NORMAL="\033[00m" |
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 sys | |
from OCC.gp import gp_Pnt | |
from OCC.BRep import BRep_Builder | |
from OCC.BRepBuilderAPI import BRepBuilderAPI_Sewing | |
from OCC.BRepBuilderAPI import BRepBuilderAPI_MakePolygon | |
from OCC.BRepBuilderAPI import BRepBuilderAPI_MakeFace | |
from OCC.BRepBuilderAPI import BRepBuilderAPI_MakeVertex | |
from OCC.TopoDS import TopoDS_Compound | |
from OCC import StlAPI |
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
#!/usr/bin/python | |
import sys | |
import math | |
sys.path.append('./src') | |
from cadmium import * | |
stlfname = sys.argv[1] |
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
// | |
// In the Main thread | |
// | |
var worker = new Worker('/path/of/webworker/code.js') | |
worker.onmessage = function (e) { | |
var result = JSON.parse(e.data); | |
if(result.type == 'debug') { | |
console.log(result.msg); | |
} else if(result.type == 'response') { |
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
// | |
// In the WebWorker | |
// | |
function debug(msg) { | |
postMessage(JSON.stringify({type:'debug',msg:msg})); | |
} | |
onmessage = function (e) { | |
try { |
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
from OCC.BRepPrimAPI import * | |
from OCC.BRepBuilderAPI import * | |
from OCC.gp import * | |
from OCC import StlAPI | |
from OCC.Precision import * | |
from OCC.Utils.Topology import * | |
from OCC.TopoDS import * | |
from OCC.TopAbs import * | |
from OCC.BRepMesh import * | |
from OCC.BRep import * |
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
# Copyright (c) 2010, Philip Plante of EndlessPaths.com | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
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
#!/usr/bin/python | |
from cadmium import * | |
LIMIT = 9 | |
def count_zeroes(lst): | |
return sum(1 for x in lst if x == 0) | |
def menger_void(k): |
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
#!/usr/bin/python | |
from cadmium import * | |
b0 = Box(x=4,y=4,z=4, center=True) | |
s0 = Sphere(radius=2.5) | |
(s0 - b0).toSTL('abstract.stl') |
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
#!/usr/bin/python | |
# | |
# Caterpillar Chain Wheel | |
# derived from OpenSCAD script from http://www.thingiverse.com/thing:8877 | |
# | |
import sys | |
from math import * | |
from cadmium import * |