[OpenSCAD] mixing 2D and 3D

doug moen doug at moens.org
Sat Jun 25 18:17:09 EDT 2016


Your model has 2 2D objects and 3 3D objects at the top level. This is
clearly visible in F5 preview.

You can't export a mixture of 2D and 3D objects, we don't support any file
formats where this makes sense, and the F6 render fails for this reason.

If you want to export to STL, you'll need to disable the 2D objects before
doing F6 and Export. Likewise, if you want to export to DXF, you'll need to
disable the 3D objects before doing F6 and Export.

On 25 June 2016 at 17:58, jon <jon at jonbondy.com> wrote:

> I'm playing around with moldings.  I thought I was careful to keep all of
> the 2D stuff together and all of the 3D stuff together, but I guess I was
> wrong.
>
> 1) if I do a hull() on 2D objects, don't I get a 2D object as a result?
>
> 2) can a module() return a 2D object?
>
> 3) sure would be nice if the error messages gave even a HINT about where
> the problem was.  I doubt that I am the first to whine about this.
>
> Thanks
>
> Jon
>
> ---
>
> $fn = 100;
> eps = 0.1;
>
> module RoundedSquare(x, y) {
>     hull() {
>         translate([0,     1]) square(1);
>         translate([x-4, y-4]) circle(4);
>         translate([x-1,   1]) square(1);
>         translate([0,   y-1]) square(1);
>         }
>     }
>
> module CrossSection1()
>     difference() {
>         union() {
>             square([10, 20]);
>             translate([10, 3])
>                 circle(2);
>             }
>         translate([10, 15])
>             circle(2);
>         }
>
> CrossSection1();
>
> translate([0, 30, 0])
>     CrossSection2();
>
> module CrossSection2()
>     difference() {
>         union() {
>             RoundedSquare(10, 20);
>             translate([10, 12])
>                 circle(2);
>             }
>         translate([10, 5])
>             circle(2);
>         }
>
> translate([80, 0, 0])
>     rotate([0, -90, 0])
>         linear_extrude(height = 50)
>             CrossSection1();
>
> translate([80, 30, 0])
>     rotate([0, -90, 0])
>         linear_extrude(height = 50)
>             CrossSection2();
>
> difference() {
>     translate([-50, 50 + 15, 0])
>         rotate([0, -90, 90])
>             linear_extrude(height = 50)
>                 CrossSection2();
>     translate([-50, 0, -eps])
>         rotate([0, -90, 0])
>             linear_extrude(height = 50)
>                 CrossSection2();
>     }
>
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20160625/9be72ca7/attachment-0002.html>


More information about the Discuss mailing list