Quantcast

No object when doing projection?

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

No object when doing projection?

Scalpel78
Hi,
I'm trying to do a projection of my part to 2D so that I can export it to DXF for lasercutting. However, when I include the projection() call at the end of the script there is no output.

Can you see what I'm doing wrong?

$fn=100;

module sensor()
{
    width = 8;
    translate([0,-2.5,-5])
    union() {
        cube([5.5,5,10]);
        translate([5,-1.5,-3]) cube([1,width,19]);
    }
}

module curve(diameter, width)
{
    difference()
    {
        circle(diameter);
        circle(diameter-width);
        translate([-25,0,0]) cube([100,150,3], center=true);
       
    }
}

module part()
{
    difference()
    {
        curve(diameter=60, width=10);
   
        for (a = [-180 : 26 : 180])
            rotate(a) translate([60-12, 0, 0]) sensor();
    }
}

//projection(cut=false)
part();
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No object when doing projection?

jdawgaz

On Wed, Feb 15, 2017 at 1:58 PM, Scalpel78 <[hidden email]> wrote:
$fn=100;

module sensor()
{
    width = 8;
    translate([0,-2.5,-5])
    union() {
        cube([5.5,5,10]);
        translate([5,-1.5,-3]) cube([1,width,19]);
    }
}

module curve(diameter, width)
{
    difference()
    {
        circle(diameter);
        circle(diameter-width);
        translate([-25,0,0]) cube([100,150,3], center=true);

    }
}

module part()
{
    difference()
    {
        curve(diameter=60, width=10);

        for (a = [-180 : 26 : 180])
            rotate(a) translate([60-12, 0, 0]) sensor();
    }
}

//projection(cut=false)
part();

according to the errors: you are mixing 2D and 3D operations
just put this before your circles: 
    linear_extrude(height=3) 

so linear_extrude(height=3)  circle(....)


--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Openscad developer

The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov


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