routing.core.wires#
Wires.
- class routing.core.wires.AWGWire(waypoints, n, name='')[source]#
Bases:
WireAWGWire object.
- Parameters:
waypoints – waypoints
n – n
name – name
- class routing.core.wires.IECWire(waypoints, section, name='')[source]#
Bases:
WireIECWire 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:
WireJunctionWire object.
- Parameters:
point1 – point1
tangeancy1 – tangeancy1
point2 – point2
tangeancy2 – tangeancy2
targeted_length – targeted_length
diameter – diameter
targeted_curvature – targeted_curvature
name – Name of JunctionWire
- 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]#
- property minimum_curvature_radius#
- classmethod n_junction_wires(points, curvature_radius, diameter, tangent_start=None, tangent_end=None, avg_length=0)[source]#
- class routing.core.wires.JunctionWireGenerator(point1: Point3D, tangent1: Vector3D, point2: Point3D, name: str = '')[source]#
Bases:
Object3DJunctionWireGenerator object.
- Parameters:
point1 – point1
tangent1 – tangent1
point2 – point2
name – Name of JunctionWireGenerator
- 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:
DessiaObjectJunctionWireTangentOptimizer 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
- 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:
DessiaObjectA 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:
Object3DA 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.
- property path#
- class routing.core.wires.WireHarness(wires: list[Wire], name: str = '')[source]#
Bases:
DessiaObjectA 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 ‘’.
- 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:
Object3DA 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 ‘’.
- 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.
- property graph#
- 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
- 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.
- property total_length_m#
- 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#
- property weight#
- property wire_mass_kg#
- property wires_from_waypoints#
Create wire from waypoints.
- 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:
Object3DA 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]#
- find_fixation_zones(min_distance_between_split: float, min_distance_between_start_end: float, print_debug: bool = False)[source]#
- property graph#
- 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.
- property weight#
- class routing.core.wires.WiringFixationZone(start: Point3D, end: Point3D, edges: list[LineSegment3D], name: str = '')[source]#
Bases:
DessiaObjectA 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:
Object3DA 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 ‘’.
- class routing.core.wires.WiringResults(wiring_results: list[WiringResult], env_tempo: VolumeModel | None = None, name: str = '')[source]#
Bases:
Object3DA 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 ‘’.