surface(), . http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#Surface. script , . 'Surface.dat. difference().
"surface.dat"
difference() {
translate([0,0,5])cube([10,10,10], center =true);
rotate([0,0,90])surface(file = "surface.dat", center = true, convexity = 5);}
28.10.2014:
pixeldata for . (x), (y) greyvalue/255 . , , , . (x) . . python3.4, PyQt5 Qt.QtGui.QImage. openscad 2000 . "//"
opencad- script:
include <./matrix_p.scad>;
difference() {
translate([-b,0,0]) rotate([0,90,0]) difference() {
cylinder(h = hb, r = rb, center = false);
translate([0,0,-0.5]) cylinder(h = hb+1, r = rb-tb, center = false);
}
for (val = m)
rotate([-ap*val[0],0,0]) translate([0,-rb-0.1,-ps/2]) linear_extrude(height = ps) polygon(points = val[1]);
}
matrix_p.scad:
// userinput
rb = 50; //radius bracelet
tb = 5; //thickness of b.
hb = 80; //height of b.
b = 10; //borderwidth beside engraving
// input from Qt.QtGui.QImage
iw = 590; //imagewidth in pixel
ih = 726; //height in pixel
ps = (hb-2*b)/ih; //scaling of pixel to fill the free place
ap = (ps*180)/(PI*rb); //angle per pixel