forked from ebecheto/Skill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayerOffset.il
71 lines (60 loc) · 2.24 KB
/
layerOffset.il
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
;; copyleft ebecheto
/**************************************************
* layerOffset gives the bounding box of a selected layer*
* default is MET1 *
* *
* Version : 2.1 November 2007 *
* *
***************************************************/
;load("~/Skill/layerOffset.il")
; USAGE :
; layerOffset()
; layerOffset( "MET4" geGetWindowCellView())
; layerOffset( "PAD" geGetWindowCellView())
procedure(layerOffset( @optional (layer "MET1") (cv geGetWindowCellView()))
let( (xmin ymin xmax ymax x0M1 y0M1 x1M1 y1M1) ; to use later with layerOffset(pcMaster)
xmin=caar(cv~>bBox)
ymin=cadar(cv~>bBox)
xmax=caadr(cv~>bBox)
ymax=cadadr(cv~>bBox)
x0M1=xmax
y0M1=ymax
x1M1=xmin
y1M1=ymin
printf("cellName : %L \n" cv~>cellName)
foreach(met1Lpp
setof(lpp cv~>layerPurposePairs lpp~>layerName==layer)
(printf " ~>shapes = %L of %L\n" met1Lpp~>shapes met1Lpp~>layerName)
foreach(shape met1Lpp~>shapes
(printf "bBox of = %L\n" shape~>bBox)
x0M1=min(caar(shape~>bBox) x0M1)
y0M1=min(cadar(shape~>bBox) y0M1)
x1M1=max(caadr(shape~>bBox) x1M1)
y1M1=max(cadadr(shape~>bBox) y1M1)
);foreach
);foreach
x0M1=x0M1 - xmin
y0M1=y0M1 - ymin
x1M1=xmax - x1M1
y1M1=ymax - y1M1
;;list((x0M1 y0M1)(x1M1 y1M1));;<== derniere ligne est le resultat renvoye;;<== ne marche pas.. comprends pas la différence ...
bBox=list(x0M1:y0M1 x1M1:y1M1);;<== derniere ligne est le resultat renvoye
printf("(W,L)=(%g,%g)" caadr(bBox)-caar(bBox) cadadr(bBox)-cadar(bBox))
bBox
); fin du let
);fin procedure
;; defun(bBoxWidth (bBox) caadr(bBox)-caar(bBox))
;; defun(bBoxHeight (bBox) cadadr(bBox)-cadar(bBox))
; cv~>layerPurposePairs~>?
; foreach( mapcar x cv~>layerPurposePairs x~>nShapes)
; foreach( mapcar x cv~>layerPurposePairs x~>shapes)
; foreach( mapcar x cv~>layerPurposePairs x~>purpose)
layoutCell = dbOpenCellViewByType( "PAD_cell" "PAD_base_io_M2less" "layout" )
yoyo = layerOffset()
printf("%L" yoyo)
;dbClose(layoutCell)
dbPurge(layoutCell)
;; ((4.2 968.475) (1119.15 309.9))
;; cv=geOpen( ?lib layoutCell~>libName ?cell layoutCell~>cellName ?view "layout" ) ;; <== check results
;; ;; hiZoomIn(cv '((4.2 968.475) (1119.15 309.9)))
;; hiZoomWindowAtPoint( cv 1 centerBbox(yoyo) )