-
Notifications
You must be signed in to change notification settings - Fork 114
KLC: S3.1: Better define symbol center #296
Comments
In most cases, that would indeed make sense. For odd-shaped components, I guess just ignoring the errors is ok for now. If we want to better define the rules for those, I guess a more thorough review of the current components is needed. As mentioned before, it might be good to give a couple of considerations, e.g.:
|
What if a symbol has the body from -100mil to 200mil (only considering horizontal), with pins at -200mil of length 100mil? In that case, centering using the body and pins would be best. I'm not saying the above is wrong, and it may be the best option, but I'm providing a pathological example that breaks it. Also consider that the user doesn't need to rotate more than 90 degrees because of the X- and Y-axis mirroring features for symbols. They can, but they don't need to. For the standard triangle opamp symbols, the body is +/-200mil (pins are +/-300mil) so it's fine. No matter what, manual review is needed. Whether pins are used or not, if there is no error with a 50mil allowance the symbol should be fine. If there is a warning by the check script, it's almost certainly impossible to know what to suggest and so human review is required. |
Doesn't that example work? Centering on the body gives the origin at (ideally) 50mil, which can be rounded to 0 mil to end up on the 100mil-grid. Centering on the pins + body (-200mil to 200mil) also puts the origin at 0mil, so that would work just fine? Or did you mean pins at both sides? |
I didn't see any rounding specified above, but yes, if <=50mil can still be ignored, then the example above is OK. Thinking about this more: what is the objective? To get a perfect algorithm? To do just a reasonable job? To decide what is important, checking it thoroughly, and ignoring the rest? Those could all be possible approaches. However, it occurred to me that we probably don't have to choose. There are be, for example, 3 checks: body centered, pins centered, and body + pins centered. They could all allow 50mil or less slop. And each one could trigger a warning or an error, depending on the severity of each variation we choose. For the short time it would take to run multiple checks, it would give the reviewer much more information to make a decision about what to do and what resolution to suggest. Might it be better to just be more comprehensive since some manual effort will be required anyway? |
Original thread: KiCad/kicad-symbols#213
From @poeschlr:
I would try to define symbol centering in a way that is both easy to check and useful.
For me the ideal situation would be to take into account only the main body shape and not the pins (as there may not be pins on every side of a component thus making it not "centered" if taken into account). This would also be useful as when a user rotates a symbol, intuitively expects it to pivot around the body center. If pins are taken into account for body centering and the symbol does not have pins on one side, when rotating the symbol, the user has to move the symbol to keep the body in the same placement as before.
This may be a little bit more complicated for oddly shaped components. I don't know if you want to add an exception for symbols like opamps that have for example triangular shape. In that case the user may expect it to rotate around the centroid instead of the center of its axis aligned bounding box. (Personally I wouldn't add this exception for test implementation easyness).
@matthijskooijman, would this solve the original issue?
The text was updated successfully, but these errors were encountered: