You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to pass parameters into modules /functions by reference? Having such a mechanism allows writing modules that can significantly enhance re-usability of components. For example imagine the following:
c = 5; // side c of the triangle
b = 4; // side b of the triangle
a = 3; // side a of the trinagle
r = 1; // radius of round triangle corners
h = 3; // hight of triangle
p = [...]; // Coordinates of corner centers and triangle's center of gravity
// create a triangle with round corners and a 2 mm diameter centered hole in each corner
difference () {
3D_TRIANGLE (s1=a,s2=b,s3=c,hi=h,p_arr=p); // module drawing 3D-triangles with rounded corners
translate (p[0] cylinder (r1=1,r2=1,h=5,center=true); // p[0] got co-ordinate of triangle A - corner
translate (p[1] cylinder (r1=1,r2=1,h=5,center=true); // p[1] got co-ordinate of triangle B - corner
translate (p[2] cylinder (r1=1,r2=1,h=5,center=true); // p[2] got co-ordinate of triangle C - corner
}
The text was updated successfully, but these errors were encountered:
Would it be possible to pass parameters into modules /functions by reference? Having such a mechanism allows writing modules that can significantly enhance re-usability of components. For example imagine the following:
c = 5; // side c of the triangle
b = 4; // side b of the triangle
a = 3; // side a of the trinagle
r = 1; // radius of round triangle corners
h = 3; // hight of triangle
p = [...]; // Coordinates of corner centers and triangle's center of gravity
// create a triangle with round corners and a 2 mm diameter centered hole in each corner
difference () {
3D_TRIANGLE (s1=a,s2=b,s3=c,hi=h,p_arr=p); // module drawing 3D-triangles with rounded corners
translate (p[0] cylinder (r1=1,r2=1,h=5,center=true); // p[0] got co-ordinate of triangle A - corner
translate (p[1] cylinder (r1=1,r2=1,h=5,center=true); // p[1] got co-ordinate of triangle B - corner
translate (p[2] cylinder (r1=1,r2=1,h=5,center=true); // p[2] got co-ordinate of triangle C - corner
}
The text was updated successfully, but these errors were encountered: