markh-de / KiVar

PCB Assembly Variants for KiCad
MIT License
29 stars 0 forks source link

Enable/disable solder paste per footprint #53

Closed markh-de closed 3 months ago

markh-de commented 5 months ago

KiVar shall be able to switch solder paste application per footprint.

For this, the FOOTPRINT.Get/SetLocalSolderPasteMarginRatio() shall be used.

As this shall be mapped to a bool property, the original value must be saved. Therefore, a negative offset value shall be used.

As the resulting clearance is the sum of the PasteMarginRatio and the PasteMargin (which can be a fairly high positive value), there shall be a safety margin to make sure the effective solder paste amount (per pad) is really reduced to zero. Also, there can be an additional boundary check for reasonable PasteMargin values.

Using the Offset Value: KiVar shall classify a footprint as with paste if the ratio value is in the (usual) range of -10.0 to 10.0 (i.e. -1000% to 1000%) or without paste if the ratio values is in the range -10010.0 to -9990.0 (i.e. -1001000% to -999000%). If the ratio value cannot be classified, an error shall be thrown.

Enabling/disabling paste is then done by adding/subtracting the 10000.0 (i.e. 1000000%) offset.

Idea: Maybe the offset can use some "signature", such as 7573866582 or just 866582, representing the concatenation of the decimal ASCII codes for KIVAR or VAR, respectively.

The bool property identifier to be used shall be s (for "solder paste enabled", as p is already claimed by "in position file").

There shall be a note in the docs that this property will not be applied to "SMD Aperture" type pads.

This issue is related to #52, which was about "completely" removing footprints, although it seems that the real use-case was just enabling/disabling solder paste per footprint.

markh-de commented 5 months ago

RFC:

Any suggestions that are more elegant than changing the PasteMarginRatio as described above?

markh-de commented 3 months ago

Implemented on main branch: 80adb3c640b8ccee56e6973eacbc188e4c76a0d3