Index: work/fem/matlab/AddPcbrndVia.m =================================================================== --- work/fem/matlab/AddPcbrndVia.m (revision 29185) +++ work/fem/matlab/AddPcbrndVia.m (revision 29186) @@ -19,8 +19,7 @@ % the following converts the points = CalcPcbrndPointsOffset(PCBRND, points); -start_z = PCBRND.layer_types(PCBRND.layers(layer_start).number); -stop_z = PCBRND.layer_types(PCBRND.layers(layer_stop).number); +current = PCBRND.layer_types(PCBRND.layers(layer_start).number); % the following escapes my otherwise clean priority lookup scheme and I % should appologize for that. @@ -30,17 +29,18 @@ % if ether of them is 3D instead of 2D that must be added to the via. % we need to use the matterial from the start layer to decide the via % matterial. -start.layer = PCBRND.layer_types(PCBRND.layers(layer_start).number); -stop.layer = PCBRND.layer_types(PCBRND.layers(layer_stop).number); +start.layer = PCBRND.layers(layer_start); +stop.layer = PCBRND.layers(layer_stop); + % here is do the math for converting [x, y] to [x, y, z] with z offsets for % start and stop layer thickness. -start_point = [ points(1,1), points(2,1), start_z ]; -stop_point = [ points(1,1), points(2,1), stop_z ]; +start_point = [ points(1,1), points(2,1), start.layer.zbottom ]; +stop_point = [ points(1,1), points(2,1), stop.layer.ztop ]; % unlike the other public functions in pcb2csx this currently doesn't obey any % changes on 2D vs 3D copper layers. -CSX = AddCylinder(CSX,current.name,1,start_point, stop_point, dia_od); +CSX = AddCylinder(CSX, current.name, 1, start_point, stop_point, dia_od); endfunction