altium-to-circuit-json 0.0.85 → 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 +19 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3305,12 +3305,19 @@ function convertOwnedComponentRecords({
|
|
|
3305
3305
|
},
|
|
3306
3306
|
renderingContext
|
|
3307
3307
|
);
|
|
3308
|
-
return elements.map(
|
|
3309
|
-
|
|
3308
|
+
return elements.map((element) => {
|
|
3309
|
+
const preparedElement = record instanceof AltiumSchPinRecord && element.type === "schematic_line" ? {
|
|
3310
3310
|
...element,
|
|
3311
|
+
stroke_width: Math.max(
|
|
3312
|
+
scaleLength(1, renderingContext.scale),
|
|
3313
|
+
0.05
|
|
3314
|
+
)
|
|
3315
|
+
} : element;
|
|
3316
|
+
return preparedElement.type === "schematic_text" ? preparedElement : {
|
|
3317
|
+
...preparedElement,
|
|
3311
3318
|
schematic_component_id: schematicComponentId
|
|
3312
|
-
}
|
|
3313
|
-
);
|
|
3319
|
+
};
|
|
3320
|
+
});
|
|
3314
3321
|
});
|
|
3315
3322
|
}
|
|
3316
3323
|
|
|
@@ -6228,7 +6235,11 @@ function convertSlottedThroughHolePad({
|
|
|
6228
6235
|
Math.max(geometry.slotLengthMils, geometry.holeSizeMils, 1)
|
|
6229
6236
|
);
|
|
6230
6237
|
const layers = ["top", "bottom"];
|
|
6231
|
-
|
|
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) {
|
|
6232
6243
|
return {
|
|
6233
6244
|
type: "pcb_plated_hole",
|
|
6234
6245
|
pcb_plated_hole_id: `pcb_plated_hole_${id}`,
|
|
@@ -6243,6 +6254,7 @@ function convertSlottedThroughHolePad({
|
|
|
6243
6254
|
layers
|
|
6244
6255
|
};
|
|
6245
6256
|
}
|
|
6257
|
+
const rectBorderRadius = isRectangularPad ? cornerRadius : Math.min(width, height) / 2;
|
|
6246
6258
|
const isRotated = holeCcwRotationDegrees !== 0 || geometry.ccwRotationDegrees !== 0;
|
|
6247
6259
|
if (isRotated) {
|
|
6248
6260
|
return {
|
|
@@ -6256,7 +6268,7 @@ function convertSlottedThroughHolePad({
|
|
|
6256
6268
|
hole_ccw_rotation: holeCcwRotationDegrees,
|
|
6257
6269
|
rect_pad_width: width,
|
|
6258
6270
|
rect_pad_height: height,
|
|
6259
|
-
rect_border_radius:
|
|
6271
|
+
rect_border_radius: rectBorderRadius,
|
|
6260
6272
|
rect_ccw_rotation: geometry.ccwRotationDegrees,
|
|
6261
6273
|
hole_offset_x: milsToMillimeters(holeOffset.x),
|
|
6262
6274
|
hole_offset_y: milsToMillimeters(holeOffset.y),
|
|
@@ -6275,7 +6287,7 @@ function convertSlottedThroughHolePad({
|
|
|
6275
6287
|
hole_height: holeHeight,
|
|
6276
6288
|
rect_pad_width: width,
|
|
6277
6289
|
rect_pad_height: height,
|
|
6278
|
-
rect_border_radius:
|
|
6290
|
+
rect_border_radius: rectBorderRadius,
|
|
6279
6291
|
hole_offset_x: milsToMillimeters(holeOffset.x),
|
|
6280
6292
|
hole_offset_y: milsToMillimeters(holeOffset.y),
|
|
6281
6293
|
x,
|