|
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);
}
}
( Post message... )
|
最近の日記 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 | ||