I have a logo i want to use as a stamp. Is there any way I can use
surface() without having to specify a filename? I'd like to have it in my
library file and not have dependencies (since i call the file from
different computers on my network).
//For example:
array = [[barf],[hurk],[sick]];
surface(array);
Thanks,
--Ari MD
drxenocide wrote
can use surface() without having to specify a filename?
No.
Admin - email* me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
Sent from: http://forum.openscad.org/
Interesting alternative. It cannot be performed by surface() but it can be
done in user space with polyhedron().
data = [ for(a=[0:10:360])
[ for(b=[0:10:360])
cos(a-b)+4*sin(a+b)+(a+b)/40 ]
];
surfaceData(data, center=true);
cube();
// operate like the builtin module surface() but
// from a matrix of floats instead of a text file
module surfaceData(M, center=false, convexity=10){
n = len(M);
m = len(M[0]);
miz = min([for(Mi=M) min(Mi)]);
minz = miz<0? miz-1 : -1;
ctr = center ? [-(m-1)/2, -(n-1)/2, 0]: [0,0,0];
points = [ // original data points
for(i=[0:n-1])for(j=[0:m-1]) [j, i, M[i][j]] +ctr,
[ 0, 0, minz ] + ctr,
[ m-1, 0, minz ] + ctr,
[ m-1, n-1, minz ] + ctr,
[ 0, n-1, minz ] + ctr,
// additional interpolated points
// the points bellow with undef coordinates are not used by
faces
for(i=[0:n-1])for(j=[0:m-1])
let( med = (M[i][j]+M[i+1][j]+M[i+1][j+1]+M[i][j+1])/4 )
[j+0.5, i+0.5, med] + ctr
];
faces = [ // faces connecting data points to interpolated ones
for(i=[0:n-2])
for(j=[im:im+m-2])
each [ [ j+1, j, j+nm+4 ],
[ j, j+m, j+nm+4 ],
[ j+m, j+m+1, j+nm+4 ],
[ j+m+1, j+1, j+nm+4 ] ] ,
// lateral and bottom faces
[ for(i=[0:m-1]) i, nm+1, nm ],
[ for(i=[m-1:-1:0]) -m+i+nm, nm+3, nm+2 ],
[ for(i=[n-1:-1:0]) im, nm, nm+3 ],
[ for(i=[0:n-1]) im+m-1, nm+2, nm+1 ],
[nm, nm+1, nm+2, n*m+3 ]
];
polyhedron(points, faces, convexity);
}
Em qui, 4 de jul de 2019 às 17:16, Ari Diacou ari.diacou@gmail.com
escreveu:
I have a logo i want to use as a stamp. Is there any way I can use
surface() without having to specify a filename? I'd like to have it in my
library file and not have dependencies (since i call the file from
different computers on my network).
//For example:
array = [[barf],[hurk],[sick]];
surface(array);
Thanks,
--Ari MD
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
It sounds like what my px_xxx functions are doing recently.
https://github.com/JustinSDK/dotSCAD/tree/v2
If you can turn your logo into a polygon, px_polygon might help you. For
example:
https://openhome.cc/eGossip/OpenSCAD/lib2-px_polygon.html
http://forum.openscad.org/file/t1825/lib2-px_polygon-1.jpg
Sent from: http://forum.openscad.org/
Thanks all.
Ronaldo, I never get over your ability to use polygon/polyhedron for
EVERYTHING.
On Fri, Jul 5, 2019 at 12:02 AM caterpillar caterpillar@openhome.cc wrote:
It sounds like what my px_xxx functions are doing recently.
https://github.com/JustinSDK/dotSCAD/tree/v2
If you can turn your logo into a polygon, px_polygon might help you. For
example:
https://openhome.cc/eGossip/OpenSCAD/lib2-px_polygon.html
http://forum.openscad.org/file/t1825/lib2-px_polygon-1.jpg
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Ronaldo, I never get over your ability to use polygon/polyhedron for
EVERYTHING.
I have two daughters playing with patchwork. I have enjoyed myself weaving
and origami a lot. My mother was a dressmaker. Sewing is in my DNA. :)
It could be reproduced with the union of 2*(n-1)*(m-1) piramids and the
same number of truncated prisms for a nxm input matrix; a hard 3D patchwork
anyway but with a longer render time.
I have included the code in the Tips&Tricks section of the manual.