1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 10:14:41 +02:00
This commit is contained in:
Justin Lin
2022-03-15 18:35:18 +08:00
parent 3357bd4e84
commit b5063e12bf
2 changed files with 12 additions and 13 deletions

View File

@@ -36,14 +36,14 @@ function _build_cell(cell_radius, cell) =
let( let(
x = _get_x(cell), x = _get_x(cell),
y = _get_y(cell), y = _get_y(cell),
walls = concat( walls = [
_is_mask(cell) ? [] : _row_wall(cell_radius, x, y), if(!_is_mask(cell)) each _row_wall(cell_radius, x, y),
[_is_top_wall(cell) || _is_top_right_wall(cell) ? _top(cell_radius) : []], if(_is_top_wall(cell) || _is_top_right_wall(cell)) _top(cell_radius),
[_is_right_wall(cell) || _is_top_right_wall(cell) ? _right_wall(cell_radius, x) : []] if(_is_right_wall(cell) || _is_top_right_wall(cell)) _right_wall(cell_radius, x)
), ],
cell_p = _cell_position(cell_radius, x, y) cell_p = _cell_position(cell_radius, x, y)
) )
[ [
for(wall = walls) for(wall = walls)
if(wall != []) [for(p = wall) cell_p + p] [for(p = wall) cell_p + p]
]; ];

View File

@@ -1,9 +1,8 @@
use <_mz_square_comm.scad>; use <_mz_square_comm.scad>;
function _square_walls(cell, cell_width) = function _square_walls(cell, cell_width) =
let( let(loc = [get_x(cell), get_y(cell)] * cell_width)
loc = [get_x(cell), get_y(cell)] * cell_width, [
top = top_wall(cell) || top_right_wall(cell) ? [[0, cell_width] + loc, [cell_width, cell_width] + loc] : [], if(top_wall(cell) || top_right_wall(cell)) each [[0, cell_width] + loc, [cell_width, cell_width] + loc],
right = right_wall(cell) || top_right_wall(cell) ? [[cell_width, cell_width] + loc, [cell_width, 0] + loc] : [] if(right_wall(cell) || top_right_wall(cell)) each [[cell_width, cell_width] + loc, [cell_width, 0] + loc]
) ];
concat(top, right);