altium-to-circuit-json 0.0.73 → 0.0.75

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 CHANGED
@@ -5055,25 +5055,47 @@ import {
5055
5055
  AltiumViaRecord as AltiumViaRecord3
5056
5056
  } from "altiumts";
5057
5057
 
5058
- // lib/pcb/annotations/convertPcbCircularKeepout.ts
5059
- function convertPcbCircularKeepout({
5058
+ // lib/pcb/annotations/convertPcbArcKeepout.ts
5059
+ import { approximateAltiumArc as approximateAltiumArc3 } from "altiumts";
5060
+ function convertPcbArcKeepout({
5060
5061
  layerMap,
5061
5062
  record,
5062
5063
  recordIndex
5063
5064
  }) {
5064
5065
  const center = record.center;
5065
5066
  const radiusMils = record.radiusMils;
5067
+ if (!center || !radiusMils) return void 0;
5066
5068
  const rawSweepDegrees = record.endAngle - record.startAngle;
5067
5069
  const isFullCircle = rawSweepDegrees === 0 || Math.abs(rawSweepDegrees) >= 360;
5068
- if (!center || !radiusMils || !isFullCircle) return void 0;
5070
+ if (isKeepoutLayer(record.layer)) {
5071
+ if (!isFullCircle) return void 0;
5072
+ return {
5073
+ type: "pcb_keepout",
5074
+ pcb_keepout_id: `pcb_keepout_altium_arc_${recordIndex}`,
5075
+ shape: "circle",
5076
+ center: toMillimeterPoint(center),
5077
+ radius: milsToMillimeters(radiusMils + (record.widthMils ?? 0) / 2),
5078
+ layers: layerMap.layers,
5079
+ description: "Altium circular keepout"
5080
+ };
5081
+ }
5082
+ const layer = layerMap.getLayer(record.layer);
5083
+ if (!layer) return void 0;
5084
+ const outline = approximateAltiumArc3({
5085
+ center,
5086
+ radius: radiusMils,
5087
+ startAngleDegrees: record.startAngle,
5088
+ endAngleDegrees: record.endAngle
5089
+ }).map(toMillimeterPoint);
5090
+ if (outline.length < 2) return void 0;
5069
5091
  return {
5070
5092
  type: "pcb_keepout",
5071
5093
  pcb_keepout_id: `pcb_keepout_altium_arc_${recordIndex}`,
5072
- shape: "circle",
5073
- center: toMillimeterPoint(center),
5074
- radius: milsToMillimeters(radiusMils + (record.widthMils ?? 0) / 2),
5075
- layers: layerMap.layers,
5076
- description: "Altium circular keepout"
5094
+ shape: "outline",
5095
+ outline,
5096
+ stroke_width: milsToMillimeters(record.widthMils ?? 4),
5097
+ layers: [layer],
5098
+ description: "Altium arc keepout"
5077
5099
  };
5078
5100
  }
5079
5101
 
@@ -5153,7 +5175,7 @@ function convertPcbDimension({
5153
5175
  // lib/pcb/annotations/convertPcbFabricationNotePath.ts
5154
5176
  import {
5155
5177
  AltiumTrackRecord as AltiumTrackRecord6,
5156
- approximateAltiumArc as approximateAltiumArc3
5178
+ approximateAltiumArc as approximateAltiumArc4
5157
5179
  } from "altiumts";
5158
5180
  function convertPcbFabricationNotePath({
5159
5181
  record,
@@ -5165,7 +5187,7 @@ function convertPcbFabricationNotePath({
5165
5187
  route = [record.start, record.end];
5166
5188
  } else {
5167
5189
  if (!record.center || !record.radiusMils) return void 0;
5168
- route = approximateAltiumArc3({
5190
+ route = approximateAltiumArc4({
5169
5191
  center: record.center,
5170
5192
  radius: record.radiusMils,
5171
5193
  startAngleDegrees: record.startAngle,
@@ -5197,7 +5219,7 @@ function isExplodedPcbDimensionGraphic(document, record) {
5197
5219
  }
5198
5220
 
5199
5221
  // lib/pcb/routing/convertPcbArcTrack.ts
5200
- import { approximateAltiumArc as approximateAltiumArc4 } from "altiumts";
5222
+ import { approximateAltiumArc as approximateAltiumArc5 } from "altiumts";
5201
5223
  function convertPcbArcTrack({
5202
5224
  layerMap,
5203
5225
  record,
@@ -5208,7 +5230,7 @@ function convertPcbArcTrack({
5208
5230
  const layer = layerMap.getLayer(record.layer);
5209
5231
  if (!layer) return void 0;
5210
5232
  const width = milsToMillimeters(record.widthMils ?? 4);
5211
- const points = approximateAltiumArc4({
5233
+ const points = approximateAltiumArc5({
5212
5234
  center: record.center,
5213
5235
  radius: record.radiusMils,
5214
5236
  startAngleDegrees: record.startAngle,
@@ -5289,13 +5311,13 @@ function convertPcbVia({
5289
5311
  }
5290
5312
 
5291
5313
  // lib/pcb/silkscreen/convertPcbSilkscreenArc.ts
5292
- import { approximateAltiumArc as approximateAltiumArc5 } from "altiumts";
5314
+ import { approximateAltiumArc as approximateAltiumArc6 } from "altiumts";
5293
5315
  function convertPcbSilkscreenArc({
5294
5316
  record,
5295
5317
  recordIndex
5296
5318
  }) {
5297
5319
  if (!record.center || !record.radiusMils) return void 0;
5298
- const points = approximateAltiumArc5({
5320
+ const points = approximateAltiumArc6({
5299
5321
  center: record.center,
5300
5322
  radius: record.radiusMils,
5301
5323
  startAngleDegrees: record.startAngle,
@@ -5885,13 +5907,16 @@ function convertPcbRecords(context) {
5885
5907
  const { document, elements, layerMap, netContext, options } = context;
5886
5908
  const routing = { layerMap, netContext };
5887
5909
  for (const [recordIndex, record] of document.records.entries()) {
5888
- if (record instanceof AltiumArcRecord5 && isKeepoutLayer(record.layer) && options.includeKeepouts !== false) {
5889
- const keepout = convertPcbCircularKeepout({
5890
- layerMap,
5891
- record,
5892
- recordIndex
5893
- });
5894
- if (keepout) elements.push(keepout);
5910
+ const isKeepoutArc = record instanceof AltiumArcRecord5 && (isKeepoutLayer(record.layer) || record.getBoolean("KEEPOUT") === true);
5911
+ if (isKeepoutArc) {
5912
+ if (options.includeKeepouts !== false) {
5913
+ const keepout = convertPcbArcKeepout({
5914
+ layerMap,
5915
+ record,
5916
+ recordIndex
5917
+ });
5918
+ if (keepout) elements.push(keepout);
5919
+ }
5895
5920
  continue;
5896
5921
  }
5897
5922
  if (record instanceof AltiumDimensionRecord) {