Patrick.Cashman

Extrema of board outline object is reported incorrectly when the most extreme object is an arc.

Discussion created by Patrick.Cashman on Jan 24, 2019
Latest reply on Feb 4, 2019 by Patrick.Cashman

FYI, in case you use the Extrema function of polygon objects:

 

I have a board outline with an arc at its lowest point. I have code that reports the MinY value of extrema of the board outline. The code also cycles through the pointsarray of the board outline geometry and reports the value of the center of the arc - the arc radius. The two values are different.

 

Here is what the board outline looks like:

bo_image.jpg

 

Here is the code:

 

Dim ptary, ptary2 As Object

Dim geom As MGCPCB.Geometry

Dim bo As MGCPCB.BoardOutline

Dim minx, miny, maxx, maxy, x, y, r As Double

Dim ext As MGCPCB.Extrema

Dim n As Integer

Dim pt As pt2

 

 

ptary2 = line_ptary

 

 

 

 

bo = pcbdoc.BoardOutline

geom = bo.Geometry

ptary = geom.PointsArray

ext = bo.Extrema

minx = ext.MinX(0)

miny = ext.MinY(0)

maxx = ext.MaxX(0)

maxy = ext.MaxY(0)

 

 

Debug.Print("miny: " & miny)

 

For n = 0 To UBound(ptary, 2)

x = ptary(0, n)

y = ptary(1, n)

r = Math.Abs(ptary(2, n))

 

 

If Not r = 0 Then

Debug.Print("y - r: " & y - r)

End If

Next

 

The code produces the following results:

 

miny: -11.048341

...

y - r: -11.047442

 

The values are close but not the same. The extrema.miny value is not correct. When a horizontal line is drawn with the y value of extrema.miny, it clearly does not touch the arc. I verified the coordinates of the bottom of the arc in AutoCAD with a DXF export of the board outline. In the DXF file it matches the value derived by subtracting the radius from the Y value of the arc center.

 

I've put in an SR, # 3272198671. I'll post up the resolution as it happens.

 

SR #: 3272198671

Outcomes