Index: matlab/AddPcbrndVia.m =================================================================== --- matlab/AddPcbrndVia.m (nonexistent) +++ matlab/AddPcbrndVia.m (revision 28801) @@ -0,0 +1,45 @@ +function CSX = AddPcbrndVia(CSX, PCBRND, layer_start, layer_stop, points, dia_od) +% +% Copyright (C) 2017 Evan Foss +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public License +% along with this program. If not, see +% + +% 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); + +% the following escapes my otherwise clean priority lookup scheme and I +% should appologize for that. +priority = prio.coppertrace; + +% we need the start and stop layer info for the following reasons +% 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); + +% here is do the math for converting [x, y] to [x, y, z] with z offsets for +% start and stop layer thickness. +points + +% 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,[0 0 -300], [0 200 300], 300); + +endfunction +