[OpenSCAD] Surface() from PNG and difference()

MLewis revmikelewis at gmail.com
Wed Apr 29 13:01:24 EDT 2015


Hoping someone can give me a hand here:

I've got a PNG that I want to "stamp" into the side of an object. To test
this, I created the following code:

*** BEGIN CODE ***
logo="M3logo1.png";

wid=58;
logox = 587;
logoy = 623;

difference(){
    cube([wid,wid,2]);
    translate([wid/4,wid/4,3])
        scale([.5*wid/logox,.5*wid/logoy,.02])
            surface(file=logo,invert=true);

}
*** END CODE ***

As shown below, it previews (F5) correctly. However, the GUI is very
sluggish with this render.
When I attempt to render (F6), however, I get nothing:

The original PNG:
<http://forum.openscad.org/file/n12517/M3logo1.png> 

The Preview:
<http://forum.openscad.org/file/n12517/Screen_Shot_2015-04-29_at_11.png> 

The Attempt to Render:
<http://forum.openscad.org/file/n12517/Screen_Shot_2015-04-29_at_11.png> 

One other data point: I've increased my caches in the GUI, but when I run
"OpenSCAD -o foo.stl LogoTest.scad" from the command line, I get "WARNING:
GeometryEvaluator: Node didn't fit into cache" errors (three of them), the
process runs forever (as far as I can tell) and uses 99ish% of the CPU.

Any help that anyone can provide would be greatly appreciated. Thanks a lot!


Mike Lewis



--
View this message in context: http://forum.openscad.org/Surface-from-PNG-and-difference-tp12517.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list