📄 clinecut.il
字号:
); endif
axlDBCreateLine(cline3 segwidth etchlayer segnetname)
);; end slope crossing right vline and top hline
( ;; slope crossing right vline and bottom hline ( positive slope )
yrint < hty && yrint > hby && xbint > vlx && xbint < vrx && cYbeg < hby && cXend > vrx
if(debug then
axlUIWPrint(nil " - Slope crosses RIGHT vline and BOTTOM hline")
); endif
p1x = cXbeg
p1y = cYbeg
p4x = cXend
p4y = cYend
p2x = xbint
p2y = hby
p3x = p2x + (cutwidth / cslope)
p3y = p2y + cutwidth
p6y = yrint
p6x = vrx
p5x = p6x - cutwidth
p5y = p6y - (cslope * cutwidth)
cline1 = list(list(p1x p1y) list(p2x p2y))
cline2 = list(list(p3x p3y) list(p5x p5y))
cline3 = list(list(p6x p6y) list(p4x p4y))
etchlayer = cseg->layer
segnetname = cseg->net->name
segwidth = cseg->width
axlDeleteObject(cseg)
axlDBCreateLine(cline1 segwidth etchlayer segnetname)
if( p5x > p3x then
axlDBCreateLine(cline2 segwidth etchlayer segnetname)
); endif
axlDBCreateLine(cline3 segwidth etchlayer segnetname)
);; end slope crossing right vline and bottom hline
); end cond
;i++
); end foreach
); end sloped
); end case
); end defun
;###########################################################
;# #
;# End of _lcb_ccCutclinesegs #
;# #
;###########################################################
;###########################################################
;# #
;# _lcb_ccSortclinesegs #
;# #
;###########################################################
defun( _lcb_ccSortclinesegs ()
;; First remove all clineseg dbids that are within
;; the area boundary
foreach(cseg cc_lclinesegs
if(axlIsPointInsideBox(nthelem(1 cseg->startEnd) cutbox) &&
axlIsPointInsideBox(nthelem(2 cseg->startEnd) cutbox) then
cc_lclinesegs = remd(cseg cc_lclinesegs)
;; for debug purposes make list of those clinesegs that are
;; within the box for displaying purposes
lcsegsignore = cons(cseg lcsegsignore)
); endif
); end foreach
;; Remaining list contains only those that cross the boundary.
;; Make a list of clinesegs by horizontal, vertical, and slope
;; for easier manipulation.
;; Results of axlLineSlope() are:
;; 0 - Horizontal line
;; nil - Vertical line
;; <n> - Sloped line, where <n> may be positive or negative number.
foreach(cseg cc_lclinesegs
case(axlLineSlope(cseg->startEnd)
( (0.0 0)
;; Horizontal segment
lhorcsegs = cons(cseg lhorcsegs)
); end 0
(nil
;; Vertical segment
lvertcsegs = cons(cseg lvertcsegs)
); end nil
(t
;; sloped lines
lslopecsegs = cons(cseg lslopecsegs)
); end t
); end case
); end foreach
); end defun
;###########################################################
;# #
;# End of _lcb_ccSortclinesegs #
;# #
;###########################################################
;###########################################################
;# #
;# _lcb_ccGetBoundaryLines #
;# #
;###########################################################
defun( _lcb_ccGetBoundaryLines ()
first = nthelem(1 cutbox)
second = nthelem(2 cutbox)
;; The user may draw the window from left to right,
;; right to left, top to bottom, or bottom to top.
;; Must make sure which side is which.
if(nthelem(1 first) < nthelem(1 second) then
firstcoord = nthelem(1 cutbox)
secondcoord = nthelem(2 cutbox)
else
firstcoord = nthelem(2 cutbox)
secondcoord = nthelem(1 cutbox)
); endif
; Check Y coord and make the highest one top
if(nthelem(2 firstcoord) > nthelem(2 secondcoord) then
htop = list(firstcoord list(nthelem(1 secondcoord) nthelem(2 firstcoord)))
hbot = list(list(nthelem(1 firstcoord) nthelem(2 secondcoord)) secondcoord)
else
htop = list(list(nthelem(1 firstcoord) nthelem(2 secondcoord)) secondcoord)
hbot = list(firstcoord list(nthelem(1 secondcoord) nthelem(2 firstcoord)))
); endif
htopbegin = nthelem(1 htop)
htopend = nthelem(2 htop)
hty = nthelem(2 htopbegin)
htopbeginx = nthelem(1 htopbegin)
hbotbegin = nthelem(1 hbot)
hbotend = nthelem(2 hbot)
hby = nthelem(2 hbotend)
vleftbegin = htopbegin
vleftend = hbotbegin
vleft = list(vleftbegin vleftend)
vlx = nthelem(1 vleftbegin)
vrightbegin = htopend
vrightend = hbotend
vright = list(htopend hbotend)
vrx = nthelem(1 vrightbegin)
;; draw boundary lines for visual inspection
lwidth = 0
;class_sub = "board geometry/cutline"
axlDBCreateLine(list(htopbegin htopend) lwidth class_sub)
axlDBCreateLine(list(vrightbegin vrightend) lwidth class_sub)
axlDBCreateLine(list(hbotbegin hbotend) lwidth class_sub)
axlDBCreateLine(list(vleftbegin vleftend) lwidth class_sub)
); end defun
;###########################################################
;# #
;# End of _lcb_ccGetBoundaryLines #
;# #
;###########################################################
;###########################################################
;# #
;# _lcb_ccPopUp #
;# #
;###########################################################
defun( _lcb_ccPopUp ()
sprintf(pm1 "- Exit -")
popup_cc = axlUIPopupDefine( nil (list
(list "- Start Over -" '_lcb_ccOops)
(list pm1 '_lcb_ccCancel)
;(list "Cancel (same as above)" '_lcb_ccCancel)
))
axlUIPopupSet(popup_cc)
); end defun
;###########################################################
;# #
;# End of _lcb_ccPopUp #
;# #
;###########################################################
;###########################################################
;# #
;# _lcb_ccOops #
;# #
;###########################################################
defun( _lcb_ccOops ()
axlUIWPrint(nil " - Selected RMB Oops")
axlCancelEnterFun()
); end defun
;###########################################################
;# #
;# End of _lcb_ccOops #
;# #
;###########################################################
;###########################################################
;# #
;# _lcb_ccCancel #
;# #
;###########################################################
defun( _lcb_ccCancel ()
axlUIWPrint(nil " - Selected RMB Exit")
notdone = nil
axlCancelEnterFun()
); end defun
;###########################################################
;# #
;# End of _lcb_ccCancel #
;# #
;###########################################################
;###########################################################
;# #
;# clinecut_Form_Action #
;# #
;###########################################################
(defun clinecut_Form_Action (clinecut_Form)
(case clinecut_Form->curField
("cutwidth"
lastvalue = strcat(clinecut_Form->curValue " " dbunits)
cutwidth = evalstring(clinecut_Form->curValue) ;; bug in axlMiniStatusLoad
axlGRPDrwUpdate(ghandle)
axlUIWPrint(nil " - Cut Distance is %L %s" cutwidth dbunits)
)
("info" axlUIWPrint(clinecut_Form "Info Button")
clinecut_info_createInfo()
;axlGRPDrwUpdate(ghandle)
)
("close"
axlUIWPrint(nil " - Selected CLOSE button")
axlCancelEnterFun()
notdone = nil
); end cancel
); end case
);end defun
;###########################################################
;# #
;# End of clinecut_Form_Action #
;# #
;###########################################################
;###########################################################
;# #
;# _lcb_cutcline_graphic #
;# #
;###########################################################
(defun _lcb_cutcline_graphic (handle)
axlGRPDrwMapWindow(ghandle 1800 1200)
;; draw board outline
putprop(handle "unfilled" 'fill)
putprop(handle "gray" 'color)
putprop(handle 30 'width)
axlGRPDrwPoly(handle list('(1 1) '(1790 1) '(1790 1000)
'(1700 1000) '(1700 1200) '(90 1200) '(90 1000) '(1 1000) '(1 1)))
; draw symbol pins
putprop(handle "filled" 'fill)
putprop(handle "green" 'color)
putprop(handle 1 'width)
axlGRPDrwCircle(handle '(700 400) 50)
axlGRPDrwCircle(handle '(1100 400) 50)
axlGRPDrwCircle(handle '(700 500) 50)
axlGRPDrwCircle(handle '(1100 500) 50)
axlGRPDrwCircle(handle '(700 600) 50)
axlGRPDrwCircle(handle '(1100 600) 50)
axlGRPDrwCircle(handle '(700 700) 50)
axlGRPDrwCircle(handle '(1100 700) 50)
axlGRPDrwCircle(handle '(700 800) 50)
axlGRPDrwCircle(handle '(1100 800) 50)
axlGRPDrwCircle(handle '(700 900) 50)
axlGRPDrwCircle(handle '(1100 900) 50)
; draw symbol
putprop(handle "unfilled" 'fill)
putprop(handle "black" 'color)
putprop(handle 20 'width)
axlGRPDrwRectangle(handle '(750 300) '(1050 1000))
; draw lines from pins
putprop(handle "blue" 'color)
putprop(handle 30 'width)
/*
axlGRPDrwLine(handle list('(700 400) '(100 400)))
axlGRPDrwLine(handle list('(1100 400) '(1700 400)))
axlGRPDrwLine(handle list('(700 500) '(100 500)))
axlGRPDrwLine(handle list('(1100 500) '(1700 500)))
*/
axlGRPDrwLine(handle list('(100 400) '(200 400)))
axlGRPDrwLine(handle list('(300 400) '(700 400)))
axlGRPDrwLine(handle list('(1100 400) '(1400 400)))
axlGRPDrwLine(handle list('(1500 400) '(1700 400)))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -