french

Detecting Silk screen on top of a pad

Discussion created by french on Mar 31, 2009
Latest reply on Oct 18, 2010 by MikeD

Ive written an app that will basically detect if the box for a silk screen ref des overlaps any surface mount pads but the code takes a really long time to run.  The built in silkscreen generator has a function in it that I like where it breaks the text if the silkscreen overlaps a surface mount pad that actually runs really fast, but I just want a report of the occurences of these overlaps so I can manually correct the issue.  Basically Im wondering if anyone has a better idea on how to determine if silkscreen ref des is overlaping onto a surface mount pad than taking the extrema of a silk screen and then iterating through every single pad on the board.

 

 

 

Private Function SilkCheck()

 

Dim silks As MGCPCB.FabricationLayerTexts

 

Dim silk As MGCPCB.FabricationLayerText

 

Dim pads As MGCPCB.PadstackObjects

 

Dim pad As MGCPCB.PadstackObject

 

Dim x, y As Integer

 

 

 

silks = docPCB.FabricationLayerTexts(MGCPCB.EPcbFabricationType.epcbFabSilkscreen)

pads = docPCB.PadstackObjects(MGCPCB.EPcbPadstackObjectType.epcbPadstackObjectPin)

 

 

For Each silk In silks

     y = 0

 

     For Each pad In pads

        

          'Center of silk in pad

 

          If silk.PositionX <= pad.Extrema.MaxX And silk.PositionX >= pad.Extrema.MinX And silk.PositionY <= pad.Extrema.MaxY And silk.PositionY >= pad.Extrema.MinY Then

               ListSilks.Items.Add(stringConv(silk.TextString, x + 1, y + 1, silk.SideName))

 

          End If

 

 

          If silk.Extrema.MinX >= pad.Extrema.MinX And silk.Extrema.MinX <= pad.Extrema.MaxX Then

 

               'bottom left of silk in pad

 

               If silk.Extrema.MinY >= pad.Extrema.MinY And silk.Extrema.MinY <= pad.Extrema.MaxY Then

 

 

                    ListSilks.Items.Add(stringConv(silk.TextString, x + 1, y + 1, silk.SideName))

 

               End If

 

               'top left of silk in pad

 

               If silk.Extrema.MaxY >= pad.Extrema.MinY And silk.Extrema.MaxY <= pad.Extrema.MaxY Then

 

 

                    ListSilks.Items.Add(stringConv(silk.TextString, x + 1, y + 1, silk.SideName))

 

               End If

 

          End If

 

 

          If silk.Extrema.MaxX >= pad.Extrema.MinX And silk.Extrema.MaxX <= pad.Extrema.MaxX Then

 

               'bottom right of silk in pad

 

               If silk.Extrema.MinY >= pad.Extrema.MinY And silk.Extrema.MinY <= pad.Extrema.MaxY Then

 

 

                    ListSilks.Items.Add(stringConv(silk.TextString, x + 1, y + 1, silk.SideName))

 

               End If

 

               'top right of silk in pad

 

               If silk.Extrema.MaxY >= pad.Extrema.MinY And silk.Extrema.MaxY <= pad.Extrema.MaxY Then

 

 

                    ListSilks.Items.Add(stringConv(silk.TextString, x + 1, y + 1, silk.SideName))

 

               End If

 

          End If

 

 

          y = y + 1

 

          Next

 

 

     x = x + 1

 

     Next

End Function

Outcomes