Nabble has removed Mailing-list integration.
Posts created here DO NOT GET SENT TO THE MAILING LIST.
Mailing-list emails DO NOT GET POSTED TO THE FORUM.
So basically the Forum is now out of date, we are looking into migrating the history.

For now you should send emails, people will see them, discuss@lists.openscad.org.

Bug while rendering a recursive construction

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

Bug while rendering a recursive construction

Sedona
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Bug while rendering a recursive construction

Parkinbot
Your polyhedron is partially inside out. Use F12 to check for purple triangles.
Another problem might be singularities where the polyhedrons meet. I used a scale(1.01) as workaround

This code works:

a= 10;
SOMMETS = [
            [0,0,a/sqrt(2)],
            [a/sqrt(2),0,0],
            [0,a/sqrt(2),0],
            [-a/sqrt(2),0,0],
            [0,-a/sqrt(2),0],
            [0,0,-a/sqrt(2)] ];

module octa() {
    scale(1.01)
    polyhedron(
        points = SOMMETS,
        faces = [ [1,0,2], [2,0,3], [3,0,4], [4,0,1], [5,1,2], [5,2,3], [5,3,4], [5,4,1] ]
        );
    }

module fractale(n) {
    if ( n == 0 )    {
        octa();   
    } else {  
       for (point = SOMMETS) { 
            fractale(n-1);
            translate(pow(2, n - 1)*[a/sqrt(2),a/sqrt(2),0]) fractale(n-1);
            translate(pow(2, n - 1)*[0,2*a/sqrt(2),0]) fractale(n-1);
            translate(pow(2, n - 1)*[-a/sqrt(2),a/sqrt(2),0]) fractale(n-1);
            // top
            translate(pow(2, n - 1)*[0,a/sqrt(2),a/sqrt(2)]) fractale(n-1);
            // bottom
            translate(pow(2, n - 1)*[0,a/sqrt(2),-a/sqrt(2)]) fractale(n-1);
       }
    }
}


fractale(2);

Reply | Threaded
Open this post in threaded view
|

Re: Bug while rendering a recursive construction

Sedona
Great, thank you very much,
I'm still getting screwed with the faces...
Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Bug while rendering a recursive construction

Sedona
In reply to this post by Parkinbot
The STL file needs to be repaired after pressing F7.
And the repair in 3D Builder removes "holes" in the fractal, that's not right.
The problem persists with "scale(1.xx)", I ask you again for help...
Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Bug while rendering a recursive construction

Parkinbot
Did you use my code? It defines the polyhedrons correctly and should let you export the stl (f7) after f6.
Reply | Threaded
Open this post in threaded view
|

Re: Bug while rendering a recursive construction

Sedona
Yes.
No problem detected in OpenSCAD.
But :
Reply | Threaded
Open this post in threaded view
|

Re: Bug while rendering a recursive construction

Parkinbot
OK, I had a quick check on your code and found out that there are even more singularities. I guess, because your polygon contains the origin, which is not affected by scale. After adding some small x-translations at least my slicer didn't complain any more.

a= 10;
SOMMETS = [
            [0,0,a/sqrt(2)],
            [a/sqrt(2),0,0],
            [0,a/sqrt(2),0],
            [-a/sqrt(2),0,0],
            [0,-a/sqrt(2),0],
            [0,0,-a/sqrt(2)] ];

module octa() {
    scale(1.01)
    polyhedron(
        points = SOMMETS,
        faces = [ [1,0,2], [2,0,3], [3,0,4], [4,0,1], [5,1,2], [5,2,3], [5,3,4], [5,4,1] ]
        );
    }

module fractale(n) {
    if ( n == 0 )    {
        octa();   
    } else {  
       for (point = SOMMETS) { 
            fractale(n-1);
            translate(pow(2, n - 1)*[a/sqrt(2),a/sqrt(2),0]) fractale(n-1);
            translate(pow(2, n - 1)*[0.01,2*a/sqrt(2),0]) fractale(n-1);
            translate(pow(2, n - 1)*[-a/sqrt(2),a/sqrt(2),0]) fractale(n-1);
            // top
            translate(pow(2, n - 1)*[0.01,a/sqrt(2),a/sqrt(2)]) fractale(n-1);
            // bottom
            translate(pow(2, n - 1)*[0.01,a/sqrt(2),-a/sqrt(2)]) fractale(n-1);
       }
    }
}


fractale(2);
Reply | Threaded
Open this post in threaded view
|

Re: Bug while rendering a recursive construction

Sedona
Thank you very much.
I understood the modifications.
In fact, I had gotten around the problem by changing the definition of the octahedron, using two "cylinders" with 4 faces and a radius = 0 at the top vertex rather than by a polyhedron.