Adjustable shape

120
8
1.62
15
list($svg_width, $svg_height) = [500, 500]; list($center_x, $center_y) = [$svg_width / 2, $svg_height / 2]; list($x1, $y1) = [$center_x, $center_y]; $r = 120; $levels = 15; $ngon_sides = 8; $lw = 3.2; $lines = []; $corners = array_fill(0, $ngon_sides, [$center_x, $center_y]); $curl_factor = (1 + sqrt(5)) / 2; for($level = 0; $level < $levels; $level++) { $first_level = $level + 1; for($i = 0; $i < $ngon_sides; $i++) { $angle = $i * 360 / $ngon_sides + $level/$curl_factor * 120; $rad = deg2rad($angle); list($x1, $y1) = $corners[$i]; $f = (1.3*$r + 20*$level)/$first_level; $x2 = $x1 + $f*cos($rad); $y2 = $y1 + $f*sin($rad); $lines[] = "<line x1='{$x1}' y1='{$y1}' x2='{$x2}' y2='{$y2}' stroke-width='{$lw}' stroke='black' />"; $corners[$i] = [$x2, $y2]; } $lw -= 3 / $levels; $r -= $levels; } $lines = implode('', $lines);