;================================================================================ ; Robert Johnstone ; Simon Fraser University ; ; Last Modified: 2000/12/05 ; ; Copyright 2000 Robert W. Johnstone ;-------------------------------------------------------------------------------- if( (!boundp( 'admLibraryName )) then warn( "Setting the destination library to default value of ADM" ) admLibraryName = "ADM" ) pcDefinePCell( list( ddGetObj(admLibraryName) "strain_bentbeam_gauge_2" "layout" ) ; end of list for first argument ( ( length1 200.0 ) ( length2 200.0 ) ( angle 0.1 ) ( width 50.0 ) ( actuation 10.0 ) ( include_poly0 "boolean" nil ) ) ; end of parameter list prog( let( pcTechFile p0_minWidth p0p_enclosure p_minSpacing p_minWidth pa_enclosure a_nomWidth rodObj1 rodObj2 tmp tmp2 player alayer length b_width) player = "POLY2" alayer = "ANCHOR2" ; load tech file rules pcTechFile = techGetTechFile( pcCellView ) p0_minWidth = techGetSpacingRule( pcTechFile "minWidth" "POLY0" ) if( (p0_minWidth==nil) then warn("minWidth rule for POLY0 not set") ) p0p_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY0" player ) if( (p0p_enclosure==nil) then warn("minEnclosure rule for POLY0->" + player + " not set.") ) p_minSpacing = techGetSpacingRule( pcTechFile "minSpacing" player ) if( (p_minSpacing==nil) then warn("minSpacing rule for " + player + " not set") ) p_minWidth = techGetSpacingRule( pcTechFile "minWidth" player ) if( (p_minWidth==nil) then warn("minWidth rule for " + player + " not set") ) pa_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" player alayer ) if( (pa_enclosure==nil) then warn("minEnclosure rule for " + player + "->" + alayer + " not set.") ) a_nomWidth = techGetSpacingRule( pcTechFile "nomWidth" alayer ) if( (a_nomWidth==nil) then warn("nomWidth rule for " + player + " not set") ) ; check parameters width = if( (width<2*a_nomWidth+2*pa_enclosure) 2*a_nomWidth+2*pa_enclosure width ) length2 = if( (length2<0) 0 length2 ) ; precalculate values length = length1 + length2 ; create geometry tmp = 2*a_nomWidth + 2*pa_enclosure dbCreateRect( pcCellView player list( -width*0.5:0 width*0.5:-tmp ) ) dbCreateRect( pcCellView alayer list( -width*0.5+pa_enclosure:-pa_enclosure width*0.5-pa_enclosure:-tmp+pa_enclosure ) ) dbCreateRect( pcCellView player list( -width*0.5:length width*0.5:length+tmp ) ) dbCreateRect( pcCellView alayer list( -width*0.5+pa_enclosure:length+pa_enclosure width*0.5-pa_enclosure:length+tmp-pa_enclosure ) ) if( (length2>0) then dbCreateRect( pcCellView player list( -width*0.5:0 width*0.5:length2 ) ) ) tmp = length2 + length1*0.5 tmp2 = length1 * 0.5 * tan( angle ) b_width = p_minWidth / cos(angle) dbCreatePolygon( pcCellView player list( -width*0.5:length2 -width*0.5:length2+b_width -width*0.5+tmp2:tmp -width*0.5:length-b_width -width*0.5:length -width*0.5+b_width:length -width*0.5+b_width:length-b_width -width*0.5+b_width+tmp2:tmp -width*0.5+b_width:length2+b_width -width*0.5+b_width:length2 ) ) dbCreatePolygon( pcCellView player list( width*0.5:length2 width*0.5:length2+b_width width*0.5-tmp2:tmp width*0.5:length-b_width width*0.5:length width*0.5-b_width:length width*0.5-b_width:length-b_width width*0.5-b_width-tmp2:tmp width*0.5-b_width:length2+b_width width*0.5-b_width:length2 ) ) ; measurement indicator dbCreateRect( pcCellView player list( -width*0.5+tmp2+b_width*0.5:tmp-p_minWidth*0.5 0:tmp+p_minWidth*0.5 ) ) dbCreateRect( pcCellView player list( width*0.5-tmp2-b_width*0.5:tmp-p_minWidth*0.5 width*0.5-tmp2-b_width-p_minWidth:tmp+p_minWidth*0.5 )) dbCreateRect( pcCellView player list( width*0.5-tmp2-b_width-p_minWidth:tmp-p_minWidth*1.5-p_minSpacing width*0.5-tmp2-b_width-p_minWidth*2:tmp+p_minWidth*1.5+p_minSpacing ) ) dbCreateRect( pcCellView player list( width*0.5-tmp2-b_width-p_minWidth*2:tmp-p_minWidth*0.5-p_minSpacing 0:tmp-p_minWidth*1.5-p_minSpacing ) ) dbCreateRect( pcCellView player list( width*0.5-tmp2-b_width-p_minWidth*2:tmp+p_minWidth*0.5+p_minSpacing 0:tmp+p_minWidth*1.5+p_minSpacing ) ) ; measurement calibration tmp = length + 2*a_nomWidth + 2*pa_enclosure + p_minSpacing*2 + p_minWidth*1.5 dbCreateRect( pcCellView player list( -width*0.5+tmp2+b_width*0.5:tmp-p_minWidth*0.5 0:tmp+p_minWidth*0.5 ) ) dbCreateRect( pcCellView player list( width*0.5-tmp2-b_width*0.5:tmp-p_minWidth*0.5 width*0.5-tmp2-b_width-p_minWidth:tmp+p_minWidth*0.5 )) dbCreateRect( pcCellView player list( width*0.5-tmp2-b_width-p_minWidth:tmp-p_minWidth*1.5-p_minSpacing width*0.5-tmp2-b_width-p_minWidth*2:tmp+p_minWidth*1.5+p_minSpacing ) ) dbCreateRect( pcCellView player list( width*0.5-tmp2-b_width-p_minWidth*2:tmp-p_minWidth*0.5-p_minSpacing 0:tmp-p_minWidth*1.5-p_minSpacing ) ) dbCreateRect( pcCellView player list( width*0.5-tmp2-b_width-p_minWidth*2:tmp+p_minWidth*0.5+p_minSpacing 0:tmp+p_minWidth*1.5+p_minSpacing ) ) dbCreateRect( pcCellView player list( -width*0.5:length+2*a_nomWidth+2*pa_enclosure -width*0.5+tmp2+b_width:length+2*a_nomWidth+2*pa_enclosure+p_minSpacing*3+p_minWidth*3 ) ) dbCreateRect( pcCellView player list( width*0.5:length+2*a_nomWidth+2*pa_enclosure width*0.5-tmp2-b_width:length+2*a_nomWidth+2*pa_enclosure+p_minSpacing*3+p_minWidth*3 ) ) ; ground plane if( (include_poly0==t) then tmp = 2*pa_enclosure + 2*a_nomWidth dbCreateRect( pcCellView "POLY0" list( -width*0.5-p0p_enclosure:-tmp-p0p_enclosure width*0.5+p0p_enclosure:length+tmp+3*p_minSpacing+3*p_minWidth+p0p_enclosure ) ) ) ; Create the instNamePrefix property dbReplaceProp( pcCellView "instNamePrefix" "string" "test" ) ; set version string dbReplaceProp( pcCellView "version" "string" "1.1.1" ) ; body SKILL code returns value t return(t) ) )