OpenSCAD generates non-manifold objects when importing .svg

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

OpenSCAD generates non-manifold objects when importing .svg

gabr42
I have a very simple heart-shape Bezier, stored in an Inkskape .svg file. [
heart4.svg <https://www.dropbox.com/s/h9127d32bjpks8r/heart4.svg?dl=1>  ]

My program is offseting and linear_extruding this object with various
thicknesses and differences one from another. It generates a broken object
("Object may not be a valid 2-manifold") and I don't understand why.

This simple program works correctly:

module heart () {
  import("heart4.svg", convexity=10);
}

for(i=[1:1])
translate([20*i, 0, 0])
linear_extrude(10)
difference () {
  offset(r=2*i)
  heart();

  heart();  
}

Result is rendered correctly, F6 works:

<http://forum.openscad.org/file/t2769/heart4_1.jpg>

If I change just the 'for' command to:

for(i=[1:2])

... I get two hearts that seem fine in a preview, but render warns about a
non-manifold objects and indeed if I export the .STL file it is completely
broken.

<http://forum.openscad.org/file/t2769/heart4_2.jpg>

Interestingly, if I change the 'for' to:

for(i=[2:2])

... program generates just the second heart and F6 works again!

<http://forum.openscad.org/file/t2769/heart4_5.jpg>

Does anyone has a workaround for this problem? Indeed, in this simple case I
could run the program twice and export two separate objects but in reality I
want to do something like this:

!
difference () {
  for(i=[1:2])
  linear_extrude(10-5*(i-1))
  offset(r=2*i)
  heart();  

  translate([0, 0, -0.01])
  linear_extrude(10.02)
  heart();  
}

This works in F5:

<http://forum.openscad.org/file/t2769/heart4_3.jpg>

... but again fails in F6:

<http://forum.openscad.org/file/t2769/heart4_4.jpg>

Primož



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
tp3
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD generates non-manifold objects when importing .svg

tp3
The "does not happen with single hard object" is just an illusion as
the linear_extrude of 2d geometry does not involve the CSG engine
(this is not really advertised but sort-of visible by the different
summary output).

As the problem goes away when adding offset(0.1) to the differenced
part, I suspect it might be an overlap at the sharp edge at the top.

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD generates non-manifold objects when importing .svg

Ronaldo
In reply to this post by gabr42
To confirm that a rendered (F6) object is really correct (and it is a manyfold) just do any boolean operation with it like:

union() {
  object();
  cube();
}


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD generates non-manifold objects when importing .svg

gabr42
Thank you! Offsetting differenced object indeed does the trick!

I tried "everything" :) but never though of that.

Primož



--
Sent from: http://forum.openscad.org/

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