Treatment Sound Proofing Pyramides

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

Treatment Sound Proofing Pyramides

Higraphics
Hello Members;

i just try create a formulate in the OpenScad of a mate sound proofing by
some pyramids like this:

Excellent Sound Insulation Soundproof wall sticker
<https://www.aliexpress.com/item/32955836989.html>  

*and that my script :*
================================ BEGIN SCRIPT
// Variables de Pyramide
Area_X=82.1;
Area_Y=82.1;
H=37;
Top_Pyramide=0.01;

// changeable variable
X=Area_X*2;

module Pyramide(){
    // Pyramide
    color("green")
        linear_extrude(height = H, scale = Top_Pyramide)
            square([Area_X, Area_Y], center = true);
}

union(Area_X){
// all position got from [ctr]+[4]
    Pyramide();
 // Front
     for (i = [Area_X, X]){
        translate([0, i, 0])
        Pyramide();
    }
 // Front Right
    for (i = [Area_X, X]){
        translate([i, X, 0])
        Pyramide();
    }    
    for (i = [Area_X, X]){
        translate([i, i, 0])
        Pyramide();
    }  
    for (i = [Area_X, X]){
        translate([X, i, 0])
        Pyramide();
    }
 // Front Left
    for (i = [Area_X, X]){
        translate([-i, i, 0])
        Pyramide();
    }    
    for (i = [Area_X, X]){
        translate([-i, X, 0])
        Pyramide();
    }    
    for (i = [Area_X, X]){
        translate([-X, i, 0])
        Pyramide();
    }    
 // Back
    for (i = [Area_X, X]){
        translate([0, -i, 0])
        Pyramide();
    }
 // Back Left
    for (i = [Area_X, X]){
        translate([-i, -X, 0])
        Pyramide();
    }
    for (i = [Area_X, X]){
        translate([-i, -i, 0])
        Pyramide();
    }
    for (i = [Area_X, X]){
        translate([-X, -i, 0])
        Pyramide();
    }
 // Back Right
     for (i = [Area_X, X]){
        translate([i, -i, 0])
        Pyramide();
    }  
     for (i = [Area_X, X]){
        translate([X, -i, 0])
        Pyramide();
    }  
    for (i = [Area_X, X]){
        translate([i, -X, 0])
        Pyramide();
    }  
 // Left
     for (i = [Area_X, X]){
        translate([-i, 0, 0])
        Pyramide();
     }  
 // Right
     for (i = [Area_X, X]){
        translate([i, 0, 0])
        Pyramide();
    }    
}

union(Area_X) ;

================================ END SCRIPT

<http://forum.openscad.org/file/t2643/Pyramide_Sound_Proof.jpg>


in this variable: X=Area_X*2;
by changing 2 by 1 or lower i got good model
but when i multiple Area_X by 3 or more i got pyramided far from the main
object

my be i forget a dimension in union(Area_X) function or my script need some
work
because i'm beginner of using For in my script

thank you for our suggesting  




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

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

Re: Treatment Sound Proofing Pyramides

boxcarmib
Here’s your program in much shorter code. You can change the number of pyramids in the X and Y dimensions by changing the values of totalX and totalY

// Variables de Pyramide
Area_X=82.1;
Area_Y=82.1;
H=37;
Top_Pyramide=0.01;

// changeable variable
X=Area_X*2;

totalX = 5;
totalY = 5;

module Pyramide(){
   // Pyramide
   color("green")
       linear_extrude(height = H, scale = Top_Pyramide)
           square([Area_X, Area_Y], center = true);
}

translate([-Area_X * (totalX - 1) * .5, -Area_Y * (totalY - 1) * .5])
for(x = [0:totalX - 1], y=[0:totalY - 1])
        translate([x * Area_X, y * Area_Y])
                Pyramide();


> On Sep 23, 2019, at 1:45 PM, Higraphics <[hidden email]> wrote:
>
> Hello Members;
>
> i just try create a formulate in the OpenScad of a mate sound proofing by
> some pyramids like this:
>
> Excellent Sound Insulation Soundproof wall sticker
> <https://www.aliexpress.com/item/32955836989.html>  
>
> *and that my script :*
> ================================ BEGIN SCRIPT
> // Variables de Pyramide
> Area_X=82.1;
> Area_Y=82.1;
> H=37;
> Top_Pyramide=0.01;
>
> // changeable variable
> X=Area_X*2;
>
> module Pyramide(){
>    // Pyramide
>    color("green")
>        linear_extrude(height = H, scale = Top_Pyramide)
>            square([Area_X, Area_Y], center = true);
> }
>
> union(Area_X){
> // all position got from [ctr]+[4]
>    Pyramide();
> // Front
>     for (i = [Area_X, X]){
>        translate([0, i, 0])
>        Pyramide();
>    }
> // Front Right
>    for (i = [Area_X, X]){
>        translate([i, X, 0])
>        Pyramide();
>    }    
>    for (i = [Area_X, X]){
>        translate([i, i, 0])
>        Pyramide();
>    }  
>    for (i = [Area_X, X]){
>        translate([X, i, 0])
>        Pyramide();
>    }
> // Front Left
>    for (i = [Area_X, X]){
>        translate([-i, i, 0])
>        Pyramide();
>    }    
>    for (i = [Area_X, X]){
>        translate([-i, X, 0])
>        Pyramide();
>    }    
>    for (i = [Area_X, X]){
>        translate([-X, i, 0])
>        Pyramide();
>    }    
> // Back
>    for (i = [Area_X, X]){
>        translate([0, -i, 0])
>        Pyramide();
>    }
> // Back Left
>    for (i = [Area_X, X]){
>        translate([-i, -X, 0])
>        Pyramide();
>    }
>    for (i = [Area_X, X]){
>        translate([-i, -i, 0])
>        Pyramide();
>    }
>    for (i = [Area_X, X]){
>        translate([-X, -i, 0])
>        Pyramide();
>    }
> // Back Right
>     for (i = [Area_X, X]){
>        translate([i, -i, 0])
>        Pyramide();
>    }  
>     for (i = [Area_X, X]){
>        translate([X, -i, 0])
>        Pyramide();
>    }  
>    for (i = [Area_X, X]){
>        translate([i, -X, 0])
>        Pyramide();
>    }  
> // Left
>     for (i = [Area_X, X]){
>        translate([-i, 0, 0])
>        Pyramide();
>     }  
> // Right
>     for (i = [Area_X, X]){
>        translate([i, 0, 0])
>        Pyramide();
>    }    
> }
>
> union(Area_X) ;
>
> ================================ END SCRIPT
>
> <http://forum.openscad.org/file/t2643/Pyramide_Sound_Proof.jpg>
>
>
> in this variable: X=Area_X*2;
> by changing 2 by 1 or lower i got good model
> but when i multiple Area_X by 3 or more i got pyramided far from the main
> object
>
> my be i forget a dimension in union(Area_X) function or my script need some
> work
> because i'm beginner of using For in my script
>
> thank you for our suggesting  
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


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

Re: Treatment Sound Proofing Pyramides

OpenSCAD mailing list
In reply to this post by Higraphics
Have you considered to use the translate of the pyramids within a pair of
nested loops:

// Variables de Pyramide
Area_X=82.1;
Area_Y=82.1;
H=37;
Top_Pyramide=0.01;

x_count = 5;
y_count = 3;

// changeable variable
X=Area_X * 2;

module Pyramide(){
    // Pyramide
    color("green")
        linear_extrude(height = H, scale = Top_Pyramide)
            square([Area_X, Area_Y], center = true);
}

Pyramide();

for (i = [0 : Area_X : x_count * Area_X - 1]){
    for (s =[0 : Area_Y: y_count * Area_Y -1]){
        translate([i, s, 0])
        Pyramide();
    }
}

<http://forum.openscad.org/file/t824/pyramid_test.png>



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

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

Re: Treatment Sound Proofing Pyramides

Higraphics
Thank You Very Much boxcarmib,
i remove *X* variable i work with *totalX* and *totalY*
and that make the code simple as you told me, and also can i make rectangle
view of object
not only square form,

Thank You Very Much discuss,
*x_count* , *y_count* is the number of pyramids that i can translate it
trough x & y axe
i learn new things with this examples.  




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

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