@modular-circuit/transpiler 0.0.88 → 0.0.89

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.
@@ -6,6 +6,7 @@ export declare function get_power_pos(pwr_number: number): {
6
6
  y: number;
7
7
  };
8
8
  export declare const BLOCK_PIN_GAP: number;
9
+ export declare const BLOCK_PIN_TB_MARGIN: number;
9
10
  export declare const WIRE_PADDING: number;
10
11
  export interface LabelPadding {
11
12
  l_side: number;
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/converter/netlist_to_kicad/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AAI9D,eAAO,MAAM,SAAS,QAAiB,CAAA;AAEvC,eAAO,MAAM,SAAS,QAAY,CAAA;AAQlC,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM;;;EAE/C;AAKD,eAAO,MAAM,aAAa,QAAgB,CAAA;AAQ1C,eAAO,MAAM,YAAY,QAAY,CAAA;AAErC,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,YAAY,CAAA;IACtB,KAAK,EAAE,YAAY,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,IAAI,CAAA;IACT,YAAY,EAAE,IAAI,CAAA;CACnB;AAED,qBAAa,MAAM;IACjB,OAAO,CAAC,KAAK,CAAgB;IAE7B,OAAO,CAAC,MAAM,CAAgB;IAE9B,OAAO,CAAC,UAAU,CAAI;IAEf,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,WAAW;CAoDlE"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/converter/netlist_to_kicad/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AAI9D,eAAO,MAAM,SAAS,QAAiB,CAAA;AAEvC,eAAO,MAAM,SAAS,QAAY,CAAA;AAQlC,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM;;;EAE/C;AAKD,eAAO,MAAM,aAAa,QAAgB,CAAA;AAE1C,eAAO,MAAM,mBAAmB,QAAgB,CAAA;AAQhD,eAAO,MAAM,YAAY,QAAY,CAAA;AAErC,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,YAAY,CAAA;IACtB,KAAK,EAAE,YAAY,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,IAAI,CAAA;IACT,YAAY,EAAE,IAAI,CAAA;CACnB;AAED,qBAAa,MAAM;IACjB,OAAO,CAAC,KAAK,CAAgB;IAE7B,OAAO,CAAC,MAAM,CAAgB;IAE9B,OAAO,CAAC,UAAU,CAAI;IAEf,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,WAAW;CAoDlE"}
@@ -11,6 +11,7 @@ export function get_power_pos(pwr_number) {
11
11
  var BLOCK_START_Y = 36 * GRID_SIZE;
12
12
  var BLOCK_START_X = BLOCK_START_Y;
13
13
  export var BLOCK_PIN_GAP = 4 * GRID_SIZE;
14
+ export var BLOCK_PIN_TB_MARGIN = 2 * GRID_SIZE;
14
15
  var BLOCK_MARGIN_TOP = 8 * GRID_SIZE;
15
16
  var MIN_BLOCK_WIDTH = 8 * GRID_SIZE;
16
17
  var BLOCK_MARGIN_LEFT = 16 * GRID_SIZE;
@@ -24,7 +25,7 @@ var Layout = /** @class */ (function () {
24
25
  this.max_height = 0;
25
26
  }
26
27
  Layout.prototype.get_block_geometry = function (factor) {
27
- var block_height = Math.ceil(factor.total_pin_num / 2) * BLOCK_PIN_GAP;
28
+ var block_height = Math.floor(factor.total_pin_num / 2) * BLOCK_PIN_GAP + 2 * BLOCK_PIN_TB_MARGIN;
28
29
  var block_width = Math.max(MIN_BLOCK_WIDTH, factor.internal.l_side + factor.internal.r_side + INTERNAL_LABEL_MARGIN);
29
30
  var block_bounding_width = Math.max(block_width, factor.internal.l_side +
30
31
  factor.internal.r_side +
@@ -32,7 +32,7 @@ import { gen_hierarchical_label, gen_net_label, gen_sheet_pin } from '../../kica
32
32
  import { gen_sch_sheet } from '../../kicad/sheet';
33
33
  import { gen_lib_gnd, gen_lib_vcc, gen_sch_gnd, gen_sch_vcc } from '../../kicad/symbols';
34
34
  import { GENERATOR_NAME, GENERATOR_VERSION, SCH_VERSION } from '../../utils/constraints';
35
- import { BLOCK_PIN_GAP, FONT_SIZE, Layout, WIRE_PADDING, get_power_pos } from './layout';
35
+ import { BLOCK_PIN_GAP, BLOCK_PIN_TB_MARGIN, FONT_SIZE, Layout, WIRE_PADDING, get_power_pos } from './layout';
36
36
  import { gen_wire } from '../../kicad/wire/gen_wire';
37
37
  var NetListConverter = /** @class */ (function () {
38
38
  function NetListConverter(ctx) {
@@ -255,11 +255,11 @@ var NetListConverter = /** @class */ (function () {
255
255
  NetListConverter.prototype.convert_sheet_symbol = function (sheet_sym, rect, sch, sheet_names_count) {
256
256
  var port_count = sheet_sym.pins.length;
257
257
  var pins = [];
258
- var h_count = Math.ceil(port_count / 2);
258
+ var h_count = Math.floor(port_count / 2);
259
259
  for (var i = 0; i < port_count; i++) {
260
260
  var is_left = i < h_count;
261
261
  var x = is_left ? rect.pos.x : rect.pos.x + rect.size.x;
262
- var y = rect.pos.y + BLOCK_PIN_GAP * Math.abs(i - h_count);
262
+ var y = rect.pos.y + BLOCK_PIN_GAP * Math.abs(i < h_count ? i : i - h_count) + BLOCK_PIN_TB_MARGIN;
263
263
  var justify = is_left ? 'left' : 'right';
264
264
  var rotation = is_left ? 180 : 0;
265
265
  pins.push(this.convert_sheet_pin(sheet_sym.pins[i], { x: x, y: y }, sch, justify, rotation, is_left));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modular-circuit/transpiler",
3
- "version": "0.0.88",
3
+ "version": "0.0.89",
4
4
  "description": "Intermediate representation of the modular circuit",
5
5
  "main": "./build/index.js",
6
6
  "files": [
@@ -27,9 +27,9 @@
27
27
  "js-base64": "^3.7.7",
28
28
  "jszip": "^3.10.1",
29
29
  "@modular-circuit/electronics-model": "0.0.54",
30
+ "@modular-circuit/perc": "0.0.61",
30
31
  "@modular-circuit/utils": "0.0.40",
31
- "@modular-circuit/ir": "0.0.61",
32
- "@modular-circuit/perc": "0.0.61"
32
+ "@modular-circuit/ir": "0.0.61"
33
33
  },
34
34
  "scripts": {
35
35
  "clean": "rimraf build",