routing.wires#

Wires.

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

Bases: Wire

AWGWire object.

Parameters:
  • waypoints (waypoints) – waypoints

  • n (n) – n

  • name (str, optional, defaults to ‘’) – name

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

Bases: Wire

IECWire object.

Parameters:
  • waypoints (waypoints) – waypoints

  • section (section) – section

  • name (str, optional, defaults to ‘’) – name of IECWire

class routing.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 (volmdlr.Point3D) – point1

  • tangeancy1 (volmdlr.Vector3D) – tangeancy1

  • point2 (volmdlr.Point3D) – point2

  • tangeancy2 (volmdlr.Vector3D) – tangeancy2

  • targeted_length (float) – targeted_length

  • diameter (float) – diameter

  • targeted_curvature (float) – targeted_curvature

  • name (str, optional, defaults to ‘’) – 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, quick: bool = False, 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_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]#
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.wires.JunctionWireGenerator(point1: Point3D, tangent1: Vector3D, point2: Point3D, name: str = '')[source]#

Bases: Object3D

JunctionWireGenerator object.

Parameters:
  • point1 (volmdlr.Point3D) – point1

  • tangent1 (volmdlr.Vector3D) – tangent1

  • point2 (volmdlr.Point3D) – point2

  • name (str, optional, defaults to ‘’) – Name of JunctionWireGenerator

calculate_new_tangents(normal, theta_min_max: tuple[float] = (0, 360), alpha_min_max: tuple[float] = (-30, 90), theta_step: float = 30, alpha_step: float = 15)[source]#
static generate_rotate_tangents(normal, thetas, alphas)[source]#
class routing.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 (JunctionWire) – junction_wire

  • tangent1 (volmdlr.Vector3D) – tangent1

  • range_theta (Tuple[float, float]) – range_theta

  • range_alpha (Tuple[float, float]) – range_alpha

  • lmax (float) – lmax

  • lmin (float) – lmin

  • list_point_cloud3d (cloud.PointCloud3D) – list_point_cloud3d

  • name (str, optional, defaults to ‘’) – Name of JunctionWireGenerator

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

Bases: DessiaObject

RoutingSpec object.

Parameters:
  • source (volmdlr.Point3D) – source

  • destination (volmdlr.Point3D) – destination

  • diameter (float) – diameter

  • color (Tuple[float, float, float]) – color

  • name (str, optional, defaults to ‘’) – Name of RoutingSpec

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

Bases: Object3D

Parameters:

waypoints – a list of volmdlr.Point3D waypoints

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.wires.WireHarness(wires: list[Wire], name: str = '')[source]#

Bases: DessiaObject

WireHarness object.

Parameters:
  • wires (List[Wire]) – wires

  • name (str, optional, defaults to ‘’) – Name of WireHarness

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

Generic plot getting plot_data function to plot.

class routing.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

Defines a combination of single wires and wire harnesses.

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.

Return type:

dict

common_routes()[source]#
decombine_piping()[source]#
dict_connected_fixation_zones()[source]#
dict_connected_single_wire()[source]#
dict_spliting_point()[source]#
dict_zone_fixation_single_wire()[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)[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 wire_mass_kg#
property wires_from_waypoints#

Create wire from waypoints.

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

Bases: DessiaObject

Defines zone where a fixation is possible.

property length#
class routing.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

WiringResult object.

Parameters:
  • wirings (List[Wiring]) – wirings

  • env_displace (List[volmdlr.stl.Stl]) – env_displace

  • env_displacement (List[volmdlr.Frame3D]) – env_displacement

  • env_fix (List[volmdlr.stl.Stl]) – env_fix

  • initial_wirings (List[Wiring]) – initial_wirings

  • distance_multiplier (float) – distance_multiplier

  • name (str, optional, defaults to ‘’) – Name of WiringResult

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.wires.WiringResults(wiring_results: list[WiringResult], env_tempo: VolumeModel | None = None, name: str = '')[source]#

Bases: Object3D

WiringResults object.

Parameters:
  • wiring_results (List[WiringResult]) – wiring_results

  • env_tempo (volmdlr.core.VolumeModel) – env_tempo

  • name (str, optional, defaults to ‘’) – Name of WiringResults

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.wires.point_belongs(bbox, nodes_matrix: array) bool[source]#