I need a function that returns the distance between a point and the edge of
a smd pad. If the point is inside the pad, I'd want it to return 0.
Anyone tried doing that? I want the roundness of the smd to be a part of the
function too.
I need a function that returns the distance between a point and the edge of
a smd pad. If the point is inside the pad, I'd want it to return 0.
Anyone tried doing that? I want the roundness of the smd to be a part of the
function too.
"Olin Lathrop" <eagle@embedinc.com> wrote in message
news:hgap4t$8a5$1@cheetah.cadsoft.de...
That's going to be a little tricky since you have to mimic the Eagle SMD
roundness algorithm. The UL_SMD structure only gives you the rectangular
size and roundness as a separate parameter. There are various ways the
roundess parameter could be used to blend between a rectangle and a
elipse,
and I don't remember seeing documentation on how exactly Eagle does it.
On the other hand, maybe it doesn't need to be that accurate and you can
probably get a good idea of their method with a little experimentation.
Once you know how to compute the pad shape, the brute force way to do what
you ask would be to turn it into a polygon and perform a normal in/out
function. At least you know the polygon will be convex.
However, it still sounds like you're stuck in a rut having made the wrong
choice several layers up and now requiring ever more elaborate schemes to
work around the problem, when the right answer is to not be in this
situation in the first place. Step back and explain the original problem
you are trying to solve.
I know I can do it (gimme a day or two), that is not the problem. I just
didnt want to if anyone else has done it and wanted to share it before I
spend my valuable time.
"Olin Lathrop" <eagle@embedinc.com> wrote in message
news:hgap4t$8a5$1@cheetah.cadsoft.de...
That's going to be a little tricky since you have to mimic the Eagle SMD
roundness algorithm. The UL_SMD structure only gives you the rectangular
size and roundness as a separate parameter. There are various ways the
roundess parameter could be used to blend between a rectangle and a
elipse,
and I don't remember seeing documentation on how exactly Eagle does it.
On the other hand, maybe it doesn't need to be that accurate and you can
probably get a good idea of their method with a little experimentation.
Once you know how to compute the pad shape, the brute force way to do what
you ask would be to turn it into a polygon and perform a normal in/out
function. At least you know the polygon will be convex.
However, it still sounds like you're stuck in a rut having made the wrong
choice several layers up and now requiring ever more elaborate schemes to
work around the problem, when the right answer is to not be in this
situation in the first place. Step back and explain the original problem
you are trying to solve.
I know I can do it (gimme a day or two), that is not the problem. I just
didnt want to if anyone else has done it and wanted to share it before I
spend my valuable time.