Quantcast

Trying to import 2D object

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Trying to import 2D object

jazzjohn
This code:
scale([1, 1, 0.1])
  surface(file = "softfold.png", center = true, invert = true);

produces this output:
WARNING: PolySet has degenerate polygons

and no object appears onscreen.

Here's the file:
softfold.png
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trying to import 2D object

cacb
On 14. mars 2017 22:10, jazzjohn wrote:

> This code:
> scale([1, 1, 0.1])
>   surface(file = "softfold.png", center = true, invert = true);
>
> produces this output:
> WARNING: PolySet has degenerate polygons
>
> and no object appears onscreen.
>
> Here's the file:
> softfold.png <http://forum.openscad.org/file/n20889/softfold.png>
I would add some margins to that file, the object touches the image
edges. Depending on the algorithm, it could cause problems. I would also
reduce the image size by half or more, as the surface command really
eats memory.

If you want to create solids from such images, there are several ways to
do it, the surface command may not always be the best or easiest. See
attached file for the result of an alternative approach.

Carsten Arnholm

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

softfold1.scad (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trying to import 2D object

jazzjohn
Very nice!
Is your generator available?

Thank you!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trying to import 2D object

cacb
On 14. mars 2017 23:33, jazzjohn wrote:
> Very nice!
> Is your generator available?
>
> Thank you!

It will be considered after I manage to publish some other code (based
on Carve), but right now it isn't. It works well on many images (white
foreground, black background, 1bit PNG), but if you don't know how it
works it is easy to screw up. Some polishing needed.

Carsten Arnholm

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Loading...