hns - 日記自動生成システム - Version 2.19.9

先月 2024年01月 来月
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Namazu for hns による簡易全文検索
詳しくは 詳細指定/ヘルプを参照して下さい
検索式:

2024年01月30日(火) 旧暦 [n年日記] [更新:"2024/01/30 06:05:18"]

#1 [openscad] Sign Wave by hexagonal placemnet

STL format (one unit)
The left: one unit, count = 100, this is to be used for conversion
the right: 4 x 4 unit, count = 50, this is just for a reference for placement.








R3 = 1.7320508;

module SignWaveHexagonal ( X, Y, Z, count ) {
    Z2 = Z/2;      // cos varies -1 to 1, make it half
    delta = X /count;
    constx = -180; // phase shift to start on bottom
    consty = 0;
    zshift = 1;  // convert amplitude (-1 to +1) to (0, 2)
    bottom = 0.1; // not to give true 0

    for (    seqY = [0:1:count - 1] ){
      for (  seqX = [0:1:count - 1] ){  
        x = (seqX   ) * delta          ;  // location x
        y = (seqY   ) * delta  * R3 / 2;  // location y
        height = Z2 * (cos (seqY / count * 360 + constx )         + zshift )
                    * (cos (seqX / count * 360 + consty / 2 * R3) + zshift ) + bottom;
        translate ([x,y,0]) cube ([delta, delta, height]);
	} 
    }
}

module two_unit (x, y, z, count) {
translate([ x/2, y/2 * R3, 0])  SignWaveHexagonal ( x,  y,  z, count ) ;
                                SignWaveHexagonal ( x,  y,  z, count ) ;
}

n = 0;       // n = 0 gives only one unit, place x pitch 50, y pitch 86.60
count = 100; //  not make too big if n > 1

// n = 0, count = 200 needs 20 minutes to generate STL format

for  (xn  = [0:1:n]){
     x = xn * 50;
     for  (yn  = [0:1:n]){
        y = yn * 50 * R3 * 2;
	  translate([x, y, 0]) two_unit (50,50,20, count);
     }
 }



最近の日記
2024年11月14日
DWL66+ 2018 405 nm
2024年02月19日
another (large, 0.55 x 1.0 m/m) version for contrast curve
2024年02月15日
curved star cone
2024年02月13日
paraboloid with base plane
2024年02月09日
bit map format for contrast curve
以上、1 日分です。
タイトル一覧
カテゴリ分類
Powered by hns-2.19.9, HyperNikkiSystem Project