pyrc.core.connecting#

check_contact_between_cells(bounds1: list, bounds2: list, tolerance: float | int)#

Check if two cells have touching surfaces.

Parameters:
  • bounds1 (list) – Boundaries of cell1 [-x, x, -y, y, -z, z]

  • bounds2 (list) – Boundaries of cell2 [-x, x, -y, y, -z, z]

  • tolerance (float) – Floating point tolerance

Returns:

True if surfaces touch with overlapping area, False otherwise

Return type:

bool

connect_cells_with_resistors(cells: list, tolerance: float = 1e-09) list[Resistor]#

Connect cells that share touching surfaces with resistor objects using AABB tree.

Parameters:
  • cells (list) – List of Cell objects to connect

  • tolerance (float) – Floating point tolerance for boundary comparison

Returns:

List of created Resistor objects

Return type:

list

visualize_contact_area(bounds1: list, bounds2: list, tolerance: float, contact_color=vector(1, 0, 0))#

Create a thin box and cylinder representing the contact area between two cells.

Parameters:
  • bounds1 (list) – Boundaries of cell1 [-x, x, -y, y, -z, z]

  • bounds2 (list) – Boundaries of cell2 [-x, x, -y, y, -z, z]

  • tolerance (float) – Floating point tolerance

  • contact_color (vpython.color) – Color for contact area visualization

Returns:

(box, cylinder) representing contact area, or None if no contact

Return type:

tuple or None