!***************************************************************
! LSG_FAST_CONN              / 2015-05-19 / Vertex Systems
!
! Faster and/or connector
!***************************************************************
!
debug ./LSG_FAST_CONN.dbg
!
FCode2$= get(FCODE2)
if (len(FCode2$)) then Conn= 1
Qty= #QTY#
Z= #WDT#
Z= Z/2+mm_to_dwg(.1)
!
P0= 0
Di= mm_to_dwg(2)
Dx(1)= 0; Dy(1)=  mm_to_dwg(10)
Dx(2)=  mm_to_dwg(10); Dy(2)=  0
Dx(3)=   0; Dy(3)=   -mm_to_dwg(10)
Dx(4)= -mm_to_dwg(10); Dy(4)= 0
Dx(5)=  mm_to_dwg(0); Dy(5)= 0
!
linewidth 0.35
level 91
color -224
!
if (Qty == 1) then
  D(1)= 1
endif
if Qty == 2 then
  D(1)= 1
  D(2)= 2
endif
if Qty == 3 then
  D(1)= 1
  D(2)= 2
  D(3)= 4
endif
if Qty == 4 then
  D(1)= 1
  D(2)= 2
  D(3)= 4
  D(4)= 5
endif
if Qty == 5 then
  D(1)= 1
  D(2)= 2
  D(3)= 3
  D(4)= 4
  D(5)= 5
endif

!
P0= 0
L0= 0
I= 1
loop Qty
  loop 2
    Bx= Dx(D(I))
    By= Dy(D(I))
    line Bx-Di,By+Di,Z,Bx+Di,By-Di,Z
    line Bx-Di,By-Di,Z,Bx+Di,By+Di,Z

    Bx= Dx(D(I))
    By= Dy(D(I))
    Bz = Z
    point(1) Bx,By,Bz
    point(2) Bx-Di,By+Di,Bz
    point(3) Bx+Di,By+Di,Bz
    circle P1,P2,P3

    P0= P0+4
    L0= L0+2
    Z= -Z
  endloop
  I= I+1
endloop
!
