routing.core.wires#

Wires.

class routing.core.wires.AWGWire(waypoints, n, name='')[source]#

Bases: Wire

AWGWire object.

Parameters:
  • waypoints – waypoints

  • n – n

  • name – name

class routing.core.wires.IECWire(waypoints, section, name='')[source]#

Bases: Wire

IECWire object.

Parameters:
  • waypoints – waypoints

  • section – section

  • name – name of IECWire

class routing.core.wires.JunctionWire(point1: Point3D, tangeancy1: Vector3D, point2: Point3D, tangeancy2: Vector3D, targeted_length: float, diameter: float, targeted_curvature: float | None = None, name: str = '')[source]#

Bases: Wire

JunctionWire object.

Parameters:
  • point1 – point1

  • tangeancy1 – tangeancy1

  • point2 – point2

  • tangeancy2 – tangeancy2

  • targeted_length – targeted_length

  • diameter – diameter

  • targeted_curvature – targeted_curvature

  • name – Name of JunctionWire

collision_points(list_point_cloud3d)[source]#
classmethod curvature_radius(point1: Point3D, tangeancy1: Vector3D, point2: Point3D, tangeancy2: Vector3D, targeted_curv: float, diameter: float, length_min: float, length_max: float, length_step: float | None = None, nb_solutions_tested: int = 100, name: str = '')[source]#
classmethod dict_to_object(dict_: Dict[str, Any], force_generic: bool = False, global_dict=None, pointers_memo: dict[str, Any] | None = None, path: str = '#')[source]#

Generic dict_to_object method.

distance_to_3d_mesh_shell(triangles_mesh, vertices_mesh, precision: float = 0.001, return_points: bool = False)[source]#
distance_to_shell(shell: OpenTriangleShell3D, precision: float = 0.001, return_points: bool = False)[source]#
distance_to_trimesh_shell(trimesh_shell, precision: float = 0.001, return_points: bool = False)[source]#
classmethod from_min_distance(point1: Point3D, tangeancy1: Vector3D, point2: Point3D, tangeancy2: Vector3D, targeted_curv: float, diameter: float, length_min: float, length_max: float, list_point_cloud, name: str = '')[source]#
get_curve()[source]#
global_point_distance(point_cloud3d, point_coord=False)[source]#
property minimum_curvature_radius#
classmethod n_junction_wires(points, curvature_radius, diameter, tangent_start=None, tangent_end=None, avg_length=0)[source]#
point_distance(list_point_cloud3d)[source]#
rotate_tangent2(theta, alpha)[source]#
to_cloud(precision: float = 0.001, combined: bool = True)[source]#
to_dict(use_pointers: bool = True, memo=None, path: str = '#', id_method=True, id_memo=None)[source]#

Generic to_dict method.

update(x) None[source]#
update_juction_wire(list_dist_values)[source]#
volmdlr_primitives()[source]#

Get Primitive3D objects representing the 3D geometry.

This method must be implemented by subclasses to provide their 3D geometric representation.

Returns:

List of Primitive3D objects

Raises:

NotImplementedError – If not implemented by subclass

class routing.core.wires.JunctionWireGenerator(point1: Point3D, tangent1: Vector3D, point2: Point3D, name: str = '')[source]#

Bases: Object3D

JunctionWireGenerator object.

Parameters:
  • point1 – point1

  • tangent1 – tangent1

  • point2 – point2

  • name – Name of JunctionWireGenerator

calculate_new_tangents(normal, angle_min_max: tuple[float] = (0, 360), angle_step: float = 30)[source]#
static generate_rotate_tangents(normal, thetas, alphas)[source]#
class routing.core.wires.JunctionWireTangentOptimizer(junction_wire: JunctionWire, tangent2: Vector3D, range_theta: tuple[float, float], range_alpha: tuple[float, float], lmax: float, lmin: float, list_point_cloud3d: PointCloud3D | None = None, name: str = '')[source]#

Bases: DessiaObject

JunctionWireTangentOptimizer object.

Parameters:
  • junction_wire – junction_wire

  • tangent1 – tangent1

  • range_theta – range_theta

  • range_alpha – range_alpha

  • lmax – lmax

  • lmin – lmin

  • list_point_cloud3d – list_point_cloud3d

  • name – Name of JunctionWireGenerator

initial_condition()[source]#
objective_func(x)[source]#
optimize_tangent(max_loops: float = 10)[source]#
update(x) None[source]#
class routing.core.wires.RoutingSpec(source: Point3D, destination: Point3D, diameter: float, color: tuple[float, float, float] | None = None, curvature_radius: float = 0, name: str = '')[source]#

Bases: DessiaObject

A class representing a routing specification with source, destination, and diameter.

This class inherits from DessiaObject, and defines a routing requirement with source and destination points and a wire diameter.

Parameters:
  • source – The source point for routing.

  • destination – The destination point for routing.

  • diameter – The wire diameter in length units.

  • color – The optional RGB color tuple (r, g, b) for visualization. Defaults to None.

  • curvature_radius – The curvature radius for the wire. Defaults to 0.

  • name – The name of the RoutingSpec. Defaults to ‘’.

class routing.core.wires.Wire(waypoints: list[Point3D], diameter: float, color: tuple[float, float, float] | None = None, bending_radius_factor: float = 3.0, name: str = '')[source]#

Bases: Object3D

A class representing a wire with 3D waypoints and diameter.

Defines a 3D path through waypoints with a constant diameter. It’s used to represent electrical wires, cables, and similar linear components in routing problems.

Parameters:
  • waypoints – The list of Point3D objects defining the 3D path of the wire. Must contain at least 2 points.

  • diameter – The wire diameter in length units (same unit as waypoints).

  • color – The optional RGB color tuple (r, g, b) between 0 and 1 for visualization. If None, uses default color. Defaults to None.

  • name – The name to identify this wire. Defaults to ‘’.

property bending_radius: float#

Bending radius in m.

classmethod dict_to_object(dict_: Dict[str, Any], force_generic: bool = False, global_dict=None, pointers_memo: dict[str, Any] | None = None, path: str = '#')[source]#

Generic dict_to_object method.

get_curve()[source]#
length(estimate=False)[source]#
property path#
plot(ax=None, color='k')[source]#

Generic plot getting plot_data function to plot.

to_dict(use_pointers: bool = True, memo=None, path: str = '#', id_method=True, id_memo=None)[source]#

Generic to_dict method.

to_linesegments()[source]#
volmdlr_primitives()[source]#

Get Primitive3D objects representing the 3D geometry.

This method must be implemented by subclasses to provide their 3D geometric representation.

Returns:

List of Primitive3D objects

Raises:

NotImplementedError – If not implemented by subclass

class routing.core.wires.WireHarness(wires: list[Wire], name: str = '')[source]#

Bases: DessiaObject

A class representing a wire harness containing multiple wires.

This class inherits from DessiaObject, and groups multiple Wire objects together as a harness.

Parameters:
  • wires – The list of Wire objects in this harness.

  • name – The name of the WireHarness. Defaults to ‘’.

length()[source]#
plot(ax=None)[source]#

Generic plot getting plot_data function to plot.

class routing.core.wires.Wiring(single_wires: list[Wire], wire_harnesses: list[WireHarness], dicts_section: list[dict] | None = None, vol_weight: float = 0, fixation_zones: list[WiringFixationZone] | None = None, env_temp: VolumeModel | None = None, color: tuple[float, float, float] = (0.5725490196078431, 0.42745098039215684, 0.15294117647058825), name: str = '')[source]#

Bases: Object3D

A class defining a combination of single wires and wire harnesses.

Combines single Wire objects and WireHarness objects into a complete wiring system with sections, fixation zones, and environmental properties.

Parameters:
  • single_wires – The list of single Wire objects.

  • wire_harnesses – The list of WireHarness objects.

  • dicts_section – The optional list of dictionaries defining wire sections. Defaults to None.

  • vol_weight – The volumetric weight for weight calculation. Defaults to 0.

  • fixation_zones – The optional list of WiringFixationZone objects. Defaults to None.

  • env_temp – The optional VolumeModel representing the environment temperature. Defaults to None.

  • color – The RGB color tuple (r, g, b) for visualization. Defaults to (146 / 255, 109 / 255, 39 / 255).

  • name – The name to identify this wiring. Defaults to ‘’.

calculate_new_diameters()[source]#
combine_piping()[source]#

Lucas’ method on the restructured branch.

combined_dict(pipe_types)[source]#
combined_dict_connected()[source]#

Function that returns a dictionary with the linked between simple wire and combined. Self has to be a non combined solution.

Returns:

A dictionary of linked between wires.

common_routes()[source]#
decombine_piping()[source]#
dict_connected_fixation_zones()[source]#
static dict_connected_ways(ways)[source]#
dict_spliting_point()[source]#
dict_zone_fixation_single_wire()[source]#
find_derivations(return_nb_out: bool = False)[source]#
static get_points_connected_to_sub(all_waypoints, connecting_wire_point)[source]#
get_wiring_data()[source]#

Return wiring_data.

global_distance_to_volume_model()[source]#
property graph#
static in_ways(ways, way_to_add)[source]#
is_way(ways, new_sub) bool[source]#
property length#
length_(estimate=False)[source]#

Gives the cumulative length of wires.

Parameters:

estimate – If set to True, compute the length without the raddi of wires

min_distances_to_volume_model(precision=0.001)[source]#
property number_branch#
property number_derivations#
plot(x3d=Vector3D(1.0, 0.0, 0.0), y3d=Vector3D(0.0, 1.0, 0.0), ax=None, breaking_points=False, target=False)[source]#

Generic plot getting plot_data function to plot.

spaced_wires() None[source]#
to_step(filepath: str)[source]#
to_step_stream(stream: StringFile)[source]#
to_stl(filepath)[source]#
to_stl_stream(stream: BinaryFile)[source]#
to_vector2d()[source]#
property total_length_m#
total_volume()[source]#
volmdlr_primitives(add_env: bool = True, merge_mesh: bool = False)[source]#

Get Primitive3D objects representing the 3D geometry.

This method must be implemented by subclasses to provide their 3D geometric representation.

Returns:

List of Primitive3D objects

Raises:

NotImplementedError – If not implemented by subclass

property volume#
volume_section()[source]#
property weight#
property wire_mass_kg#
property wires_from_waypoints#

Create wire from waypoints.

wiring_combined()[source]#
class routing.core.wires.WiringCombined(single_wires: list[Wire], vol_weight: float = 0, fixation_zones: list[WiringFixationZone] | None = None, env_temp: VolumeModel | None = None, color: tuple[float, float, float] = (0.5725490196078431, 0.42745098039215684, 0.15294117647058825), name: str = '')[source]#

Bases: Object3D

A class defining a combination of single wires per portion.

Represents a combination of single wires per portion. A portion is a zone where wires share a route.

Parameters:
  • single_wires – The list of combined pipes described as Wire objects.

  • vol_weight – The density of material used in g/cm^3. Defaults to 0.

  • fixation_zones – The list of fixation zones per single_wire. Defaults to None.

  • env_temp – The environment to display. Defaults to None.

  • color – The wiring color as RGB tuple (r, g, b). Defaults to (146 / 255, 109 / 255, 39 / 255).

  • name – The name of the result. Defaults to ‘’.

classmethod automatic_fixation_zones(single_wires: list[Wire], min_distance_between_split: float, min_distance_between_start_end: float, vol_weight: float = 0, env_temp: VolumeModel | None = None, color: tuple[float, float, float] = (0.5725490196078431, 0.42745098039215684, 0.15294117647058825), name: str = '')[source]#
derivations()[source]#
dict_connected_fixation_zones()[source]#
dict_connected_single_wire()[source]#
dict_spliting_point()[source]#
dict_zone_fixation_single_wire()[source]#
find_derivations(return_nb_out: bool = False)[source]#
find_fixation_zones(min_distance_between_split: float, min_distance_between_start_end: float, print_debug: bool = False)[source]#
property graph#
graph_connected_fixation_zones()[source]#
graph_fixation_point(distance_max_between_fixation: float | None = None)[source]#
property length#
property number_branch#
property number_derivations#
volmdlr_primitives(add_env_temp: bool = True)[source]#
Parameters:

add_env_temp – Parameter used to add environment in the display.

volume()[source]#
property weight#
class routing.core.wires.WiringFixationZone(start: Point3D, end: Point3D, edges: list[LineSegment3D], name: str = '')[source]#

Bases: DessiaObject

A class defining a zone where a fixation is possible.

This class inherits from DessiaObject, and represents a zone defined by start and end points with edges where wire fixations can be placed.

Parameters:
  • start – The start point of the fixation zone.

  • end – The end point of the fixation zone.

  • edges – The list of LineSegment3D edges defining the zone boundaries.

  • name – The name to identify this fixation zone. Defaults to ‘’.

property length#
class routing.core.wires.WiringResult(wirings: list[Wiring], env_displace: list[Stl] | None = None, env_displacement: list[Frame3D] | None = None, env_fix: list[Stl] | None = None, initial_wirings: list[Wiring] | None = None, distance_multiplier: float = 0.001, env_tempo: VolumeModel | None = None, name: str = '')[source]#

Bases: Object3D

A class representing a wiring result containing multiple wirings and environment information.

Contains wiring results along with moving and fixed environment information for analysis and visualization.

Parameters:
  • wirings – The list of Wiring results.

  • env_displace – The optional list of moving environment STL files. Defaults to None.

  • env_displacement – The optional list of deflection frames for moving environment. Defaults to None.

  • env_fix – The optional list of fixed environment STL files. Defaults to None.

  • initial_wirings – The optional list of results before combination. Defaults to None.

  • distance_multiplier – The converter from mm to m. Defaults to 0.001.

  • env_tempo – The environment to display. Defaults to None.

  • name – The name of the result. Defaults to ‘’.

curvature_radius_wirings(curvature_radius_target: float)[source]#
plot_data(reference_path: str = '#', **kwargs)[source]#
to_csv(filepath: str) None[source]#
to_csv_stream(stream: StringFile) None[source]#
to_vector2d()[source]#
volmdlr_primitives()[source]#

Get Primitive3D objects representing the 3D geometry.

This method must be implemented by subclasses to provide their 3D geometric representation.

Returns:

List of Primitive3D objects

Raises:

NotImplementedError – If not implemented by subclass

class routing.core.wires.WiringResults(wiring_results: list[WiringResult], env_tempo: VolumeModel | None = None, name: str = '')[source]#

Bases: Object3D

A class representing a collection of wiring results.

Contains multiple WiringResult objects for analysis and comparison.

Parameters:
  • wiring_results – The list of WiringResult objects.

  • env_tempo – The environment to display. Defaults to None.

  • name – The name of the result. Defaults to ‘’.

to_vector2d()[source]#
volmdlr_primitives()[source]#

Get Primitive3D objects representing the 3D geometry.

This method must be implemented by subclasses to provide their 3D geometric representation.

Returns:

List of Primitive3D objects

Raises:

NotImplementedError – If not implemented by subclass

routing.core.wires.point_belongs(bbox, nodes_matrix: array) bool[source]#