altium-to-circuit-json 0.0.86 → 0.0.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6235,7 +6235,11 @@ function convertSlottedThroughHolePad({
|
|
|
6235
6235
|
Math.max(geometry.slotLengthMils, geometry.holeSizeMils, 1)
|
|
6236
6236
|
);
|
|
6237
6237
|
const layers = ["top", "bottom"];
|
|
6238
|
-
|
|
6238
|
+
const isRectangularPad = isRectangularShape(shape);
|
|
6239
|
+
const isAlignedCenteredSlot = normalizeAltiumAngle(
|
|
6240
|
+
holeCcwRotationDegrees - geometry.ccwRotationDegrees
|
|
6241
|
+
) === 0 && holeOffset.x === 0 && holeOffset.y === 0;
|
|
6242
|
+
if (!isRectangularPad && isAlignedCenteredSlot) {
|
|
6239
6243
|
return {
|
|
6240
6244
|
type: "pcb_plated_hole",
|
|
6241
6245
|
pcb_plated_hole_id: `pcb_plated_hole_${id}`,
|
|
@@ -6250,6 +6254,7 @@ function convertSlottedThroughHolePad({
|
|
|
6250
6254
|
layers
|
|
6251
6255
|
};
|
|
6252
6256
|
}
|
|
6257
|
+
const rectBorderRadius = isRectangularPad ? cornerRadius : Math.min(width, height) / 2;
|
|
6253
6258
|
const isRotated = holeCcwRotationDegrees !== 0 || geometry.ccwRotationDegrees !== 0;
|
|
6254
6259
|
if (isRotated) {
|
|
6255
6260
|
return {
|
|
@@ -6263,7 +6268,7 @@ function convertSlottedThroughHolePad({
|
|
|
6263
6268
|
hole_ccw_rotation: holeCcwRotationDegrees,
|
|
6264
6269
|
rect_pad_width: width,
|
|
6265
6270
|
rect_pad_height: height,
|
|
6266
|
-
rect_border_radius:
|
|
6271
|
+
rect_border_radius: rectBorderRadius,
|
|
6267
6272
|
rect_ccw_rotation: geometry.ccwRotationDegrees,
|
|
6268
6273
|
hole_offset_x: milsToMillimeters(holeOffset.x),
|
|
6269
6274
|
hole_offset_y: milsToMillimeters(holeOffset.y),
|
|
@@ -6282,7 +6287,7 @@ function convertSlottedThroughHolePad({
|
|
|
6282
6287
|
hole_height: holeHeight,
|
|
6283
6288
|
rect_pad_width: width,
|
|
6284
6289
|
rect_pad_height: height,
|
|
6285
|
-
rect_border_radius:
|
|
6290
|
+
rect_border_radius: rectBorderRadius,
|
|
6286
6291
|
hole_offset_x: milsToMillimeters(holeOffset.x),
|
|
6287
6292
|
hole_offset_y: milsToMillimeters(holeOffset.y),
|
|
6288
6293
|
x,
|