A method for automatic cable routing for three-dimensional models

CN116502375BActive Publication Date: 2026-08-18NANCHANG HANGKONG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211264548.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-17
Publication Date
2026-08-18
Estimated Expiration
2042-10-17

AI Technical Summary

Technical Problem

布线设计人员需要根据接线表,基于产品三维模型对产品内线缆的走线路径进行设计,布线人员进行线缆布局的设计过程中,面临诸如布线时间长、效率低、所布线缆繁多容易布错、线缆易与模型发生干涉而无法发现等问题,主要表现在:人工布线设计慢、效率低;线缆数量众多,人工进行线缆布局工作量大

Benefits of technology

[0038]1. This invention can accurately obtain information on all parts within the model and adopt reasonable obstacle avoidance strategies for the parts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116502375B_ABST
    Figure CN116502375B_ABST
Patent Text Reader

Abstract

The application discloses a kind of three-dimensional model cable automatic wiring method, including obtaining user wiring requirement, selecting cable name, belonging harness, starting end, termination, reel attribute;Automatic traversal three-dimensional model, obtain each part position data;Utilize two kinds of obstacle avoidance strategies to process wiring path and component interference;Search wiring path by multiple rule particle swarm algorithm and generate cable in three-dimensional model;The cable that is wired can pass through hole part, maximize utilization three-dimensional model internal space, the application can assist wiring designer to carry out cable automatic layout, for designer improve suitable cable wiring path, improve cable wiring efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cable layout technology in 3D design software and 3D models, and particularly to an automatic cable routing method for 3D models. Background Technology

[0002] Nowadays, various complex electromechanical products contain a large number of cables. Due to the large number of cables, cable layout often consumes a significant amount of time and effort for cabling designers. Currently, most cable laying is done by creating a digital prototype before actual installation. The cable layout is planned on a digital model of the product to determine the cable routing paths in advance. Cabling designers need to design the cable routing paths based on the wiring diagram and the product's 3D model. During the cable layout design process, cabling personnel face problems such as long wiring time, low efficiency, the large number of cables making mistakes easy, and cables interfering with the model without being detected. These problems mainly manifest as: slow and inefficient manual cabling design; and a large workload due to the large number of cables and the manual cable layout process. Summary of the Invention

[0003] The purpose of this invention is to solve the technical problems existing in the prior art and to provide an automatic cable routing method for three-dimensional models.

[0004] To achieve the above objectives, the technical solution provided by this invention is: an automatic cable routing method for a three-dimensional model, comprising the following steps:

[0005] Step 1: Design the cable routing attribute selection function. The routing attributes include cable name, cable bundle, cable reel, start end, and end end.

[0006] Step 2: Based on the cable selected in Step 1, obtain the current 3D model, create cable path attributes through the model and cable, set the obstacle avoidance strategy for the part, the obstacle avoidance strategy includes axis alignment bounding box decision and directed distance field decision, and create a directed distance field array and an axis alignment bounding box array to store the part model items.

[0007] Step 3: Obtain the starting segment and ending point of the cable selected by the user in Step 1, obtain the three-dimensional coordinates of the starting segment and ending point in the model, generate the critical path points of the cabling using the multi-rule particle swarm algorithm, and discretize and fit the path points into a dense point sequence using spline interpolation.

[0008] Step 4: Traverse the model to obtain the model assembly coordinate system, traverse the directed distance field array and axis-aligned bounding box array to obtain the part assembly matrix, and perform pose transformation on the dense point sequence.

[0009] Step 5: Perform interference detection between the dense point sequence after pose transformation and the parts in the directed distance field array and axis-aligned bounding box array, respectively, using axis-aligned bounding box decision and directed distance field decision;

[0010] Step 6: The multi-rule particle swarm algorithm uses a weighting method to score the generated dense point sequence, and uses the score to constrain the iteration direction of the particle swarm to generate a cable path that conforms to the wiring process.

[0011] Step 7: Iterate using the multi-rule particle swarm optimization algorithm and output the optimal dense point sequence;

[0012] Step 8: Fill the optimal dense point sequence, start segment, and end position information into the cable path attributes to generate the wiring path and wiring cable in the 3D model.

[0013] Preferably, the attribute selection function in step 1 includes the following steps:

[0014] Step 101: Set up a cable name input box. When the user enters a cable name, the system will automatically store the cable name.

[0015] Step 102: Set up the wire harness drop-down list. The system automatically traverses the model, obtains all wire harnesses, and obtains the wire harness names. The names are then entered into the wire harness drop-down list. When the user clicks the drop-down list and selects the wire harness to which the cable belongs, the selected wire harness name is saved.

[0016] Step 103: Set up the spool drop-down list. The spools store cable attribute information such as color and diameter. The system automatically traverses the model's spool information and stores all spool names in the spool drop-down list. When the user clicks the drop-down list to select a spool, the system reads the color and diameter information of the selected spool and displays it in the list box for the user to select the spool. After the user selects a spool, the system saves the name of the selected spool.

[0017] Step 104: Set up the input function for the start and end points of the cabling; the user clicks the "Causing End Points" function button, selects the start and end coordinate systems of the cable in the model, and the system reads and saves the selection of the start and end coordinate systems.

[0018] The preferred axis-aligned bounding box decision is as follows:

[0019]

[0020] Equation 1 represents the mathematical expression for an axis-aligned bounding box, (x min ,y min ,z min ) and (x max ,y max ,z max(x, y, z) represents the coordinates of the two opposite corners of the bounding box. The set of points (x, y, z) whose 3D coordinates lie within the two opposite corners represents an axis-aligned bounding box. To determine whether a cable routing path interferes with a component, let the cable radius be r. c Path point set (x i ,y i ,z i (i∈(1,2,…,n), where n is the number of path points, the set of cable routing path points (x) obtained by the algorithm i ,y i ,z i Substitute into the following formula:

[0021]

[0022] (x i ,y i ,z i If all three terms in equation (1) are satisfied, it means that the path point set is outside the bounding box and the wiring path does not interfere with the component.

[0023] Directed distance field decision-making is as follows:

[0024] The part within the 3D model is triangularized. A triangular facet is a triangular plane composed of the coordinates of three vertices. The geometric data of the triangular facet is obtained by reading the model's STL file data, including the coordinates of the three vertices and the outward normal vector. The outward normal vector of the triangular facet is the coordinate of the normal vector pointing outward from the part entity. It can be calculated using the coordinates of the three vertices according to the right-hand screw rule. Assuming the coordinates of the three vertices are (v1...) x v1 y v1 z (v2) x v2 y v2 z (v3) x v3 y v3 z ), Outer normal vector N(n) x ,n y ,n z The calculation formula is as follows:

[0025]

[0026] Let p be the cable path point, and V0, V1, and V2 be the three vertices of the triangular facet Γ. Any point on the triangular facet can be represented by the parametric equation Γ(s,t), where D is the domain. and Let and represent two linearly independent vectors on the triangular facet. Assume that the point on the triangular facet closest to the path point p is p′. Then the distance between points p and p′ is ||Γ(s,t)-p||. To ensure non-negativity, we take the square value Q = ||Γ(s,t)-p||. 2 As the shortest distance, expansion yields a function of the independent variables s and t. Once the minimum value of function Q is found, p′ can be calculated, and the gradient of function Q can be determined, as shown in equation (4):

[0027]

[0028] Let gradient

[0029] Solving for:

[0030]

[0031] Substitute the parameters in equation (5) into Γ(s,t) to find the point p′ on the triangular facet that is closest to the path point p;

[0032] After obtaining p′ on the triangular facet, path point p, and the outward normal vector N(n) on the triangular facet... x ,n y ,n z ), calculate the dot product of p′p and the external normal vector N, DOT=p′p·N, and the field value sign(p) of the path point p is shown in equation (6);

[0033]

[0034] The values ​​of sign(p) are -1, 0, and 1, which represent the path point being inside the part, on the outer surface of the part, and outside the part, respectively.

[0035] Preferably, the directed distance field obstacle avoidance strategy is suitable for irregular parts or parts with holes. When the user clicks the "Select parts through which cables can pass" option, the user selects the parts that are determined by the directed distance field in the 3D model. The system automatically saves the position ID table of the selected parts in the assembly structure tree. The ID table can uniquely point to the parts, ensuring that they are distinguished from other parts with the same structure.

[0036] Preferably, in step 2, a directed distance field array and an axis-aligned bounding box array are created. The array is used to store part model items. The 3D model is accessed through the position ID table to obtain the part model items within the model. The model item ID is accessed, and the parts are stored in the directed distance field array and the axis-aligned bounding box array respectively based on the ID table.

[0037] Beneficial effects of this invention:

[0038] 1. This invention can accurately obtain information on all parts within the model and adopt reasonable obstacle avoidance strategies for the parts.

[0039] 2. This invention can ensure that the laid cables do not interfere with the three-dimensional model through interference detection.

[0040] 3. This invention can automatically lay out cables in a 3D model, improving wiring efficiency and reducing the workload of wiring personnel. Attached Figure Description

[0041] The accompanying drawings, which are provided to further illustrate the invention and constitute a part of this invention, are illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention.

[0042] Figure 1 This is a schematic diagram of the automatic cable routing process of the present invention. Detailed Implementation

[0043] This section will describe in detail specific embodiments of the present invention. Preferred embodiments of the present invention are shown in the accompanying drawings. The purpose of the drawings is to supplement the textual description with graphics, so that people can intuitively and vividly understand each technical feature and overall technical solution of the present invention, but they should not be construed as limiting the scope of protection of the present invention.

[0044] Reference Figure 1 A preferred embodiment of the present invention provides an automatic cable routing method for a three-dimensional model, comprising the following steps:

[0045] Step 1: Design the cable routing attribute selection function. The routing attributes include cable name, cable bundle, cable reel, start end, and end end.

[0046] Step 2: Based on the cable selected in Step 1, obtain the current 3D model, create cable path attributes through the model and cable, set the obstacle avoidance strategy for the part, the obstacle avoidance strategy includes axis alignment bounding box decision and directed distance field decision, and create a directed distance field array and an axis alignment bounding box array to store the part model items.

[0047] Step 3: Obtain the starting segment and ending point of the cable selected by the user in Step 1, and obtain the three-dimensional coordinates of the starting segment and ending point in the model. This is used to define the size of the algorithm search space, the limit of the search speed, and the limit of the search position. Use the multi-rule particle swarm algorithm to generate the critical path points of the cabling, and use spline interpolation to discretize and fit the path points into a dense point sequence.

[0048] Step 4: Traverse the model to obtain the model assembly coordinate system, traverse the directed distance field array and axis-aligned bounding box array to obtain the part assembly matrix, and perform pose transformation on the dense point sequence.

[0049] Step 5: Perform interference detection between the dense point sequence after pose transformation and the parts in the directed distance field array and axis-aligned bounding box array, respectively, using axis-aligned bounding box decision and directed distance field decision to ensure that the laid cables do not interfere or collide with the 3D model.

[0050] Step 6: The multi-rule particle swarm optimization algorithm uses a weighted method to score the generated dense point sequence. The scoring constrains the iteration direction of the particle swarm, generating cable paths that conform to the wiring process.

[0051] Step 7: Iterate using the multi-rule particle swarm optimization algorithm and output the optimal dense point sequence;

[0052] Step 8: Fill the optimal dense point sequence, start segment, and end position information into the cable path attributes to generate the wiring path and wiring cable in the 3D model.

[0053] The pose transformation in step 4 is as follows: transform the coordinates to the part coordinate system.

[0054] The relative positional relationships (translation and rotation) between objects are described using homogeneous transformation matrices. Transformation matrix T a←b As shown in equation (7), T represents the pose relationship between object "b" and component "a". a←b It is composed of rotation matrix R 3×3 Translation vector composition.

[0055]

[0056] Where R 3×3 The rotation matrix describing the coordinate system of "b" relative to the coordinate system of "a" is a three-row, three-column matrix with values ​​as shown in equation (8), representing the values ​​(inner product) of the X, Y, and Z axes of the coordinate system of "b" projected onto the X, Y, and Z axes of the coordinate system of "a". The vector (position vector) representing the change of the origin of the coordinate system of "b" relative to the coordinate system of "a".

[0057]

[0058] The coordinates of path point p in the assembly coordinate system ASM are: Asm p = (a, b, c) T The homogeneous transformation matrix of part B relative to the assembly coordinate system ASM is T. Asm←B (T B The goal is to determine the path point p relative to the modeling coordinate system B of part B. asm coordinates B p = (a′, b′, c′) T The pose transformation formula is as shown in equation (9).

[0059]

[0060] From the characteristics of homogeneous transformation matrices, we can know that:

[0061]

[0062] The inverse T of the homogeneous transformation matrix can be obtained from equation (10). B←Asm :

[0063]

[0064] Substituting equation (11) into equation (9):

[0065] B p = R T Asm←B ·( A pP Asm←B org (12)

[0066] Step 6 involves generating a cable path that conforms to the wiring process, specifically as follows:

[0067] Assume the dense point sequence is q i =(d ix ,d iy ,d iz (i = 1, 2, ..., n), where n is the number of points in the point series, ConSt is the process weight, and the scoring function is f(q). i As shown in equation (13)

[0068] min f(q i =sum(sqrt(diff(d ix ) 2 +diff(d iy ) 2 +diff(d iz ) 2 ))+K·ConSt(13)

[0069]

[0070] f(q i ) is the fitness calculation function of the MRPSO algorithm, where sum(sqrt(diff(d)) is the fitness calculation function. ix ) 2 +diff(d iy ) 2 +diff(d iz ) 2 The sum of the differential distances of the path points represents the cable path length. ConSt is the process weight, calculated from the AABB(q) of all points in the path point set. ia) Sign(q) i h(q) i The quantity and calculation are obtained. AABB(q) i a) is the interference function calculated for the bounding box, where 'a' is the electromagnetic coefficient. Increasing the volume of the bounding box prevents the path from being affected by strong electromagnetic regions. The wiring path does not interfere with components. AABB(q) i ,a)=0, otherwise, AABB(q i ,a)≠0. Sign(q) i ) is the interference function for calculating the range field, Sign(q) i If ) = 0, then the wiring path does not interfere with the component; otherwise, Sign(q) = 0. i h(q) ≠ 0. i h(q) is the wall-attached constraint. i If h(q) = 0, then the path meets the wall-hugging requirement; otherwise, h(q) = 0. i The value of the process weights is not equal to 0. The magnitude of the process weights affects the value of the fitness function, thereby encouraging particles to search for paths that meet the requirements.

[0071] This invention can accurately acquire information on all parts within the model and adopt reasonable obstacle avoidance strategies for the parts; this invention can ensure that the laid cables do not interfere with the 3D model through interference detection; this invention can automatically lay out cables in the 3D model, improve wiring efficiency, and reduce the workload of wiring personnel.

[0072] As a preferred embodiment of the present invention, it may also have the following additional technical features:

[0073] In this embodiment, the attribute selection function in step 1 includes the following steps:

[0074] Step 101: Set up a cable name input box. When the user enters a cable name, the system will automatically store the cable name.

[0075] Step 102: Set up the wire harness drop-down list. The system automatically traverses the model, obtains all wire harnesses, and obtains the wire harness names. The names are then entered into the wire harness drop-down list. When the user clicks the drop-down list and selects the wire harness to which the cable belongs, the selected wire harness name is saved.

[0076] Step 103: Set up the spool drop-down list. The spools store cable attribute information such as color and diameter. The system automatically traverses the model's spool information and stores all spool names in the spool drop-down list. When the user clicks the drop-down list to select a spool, the system reads the color and diameter information of the selected spool and displays it in the list box for the user to select the spool. After the user selects a spool, the system saves the name of the selected spool.

[0077] Step 104: Set up the input function for the start and end points of the cabling; the user clicks the "Causing End Points" function button, selects the start and end coordinate systems of the cable in the model, and the system reads and saves the selection of the start and end coordinate systems.

[0078] In this embodiment, the axis alignment bounding box decision is as follows:

[0079]

[0080] To determine whether the cable routing path interferes with the components, let the cable radius be r. c Path point set (x i ,y i ,z i (i∈(1,2,…,n), where n is the number of path points, the set of cable routing path points (x) obtained by the algorithm i ,y i ,z i Substitute into the following formula:

[0081]

[0082] (x i ,y i ,z i If all three terms in equation (1) are satisfied, it means that the path point set is outside the bounding box and the wiring path does not interfere with the component.

[0083] Directed distance field decision-making is as follows:

[0084] The part within the 3D model is triangularized. A triangular facet is a triangular plane composed of the coordinates of three vertices. The geometric data of the triangular facet is obtained by reading the model's STL file data, including the coordinates of the three vertices and the outward normal vector. The outward normal vector of the triangular facet is the coordinate of the normal vector pointing outward from the part entity. It can be calculated using the coordinates of the three vertices according to the right-hand screw rule. Assuming the coordinates of the three vertices are (v1...) x v1 y v1 z (v2) x v2 y v2 z (v3) x v3 y v3 z ), Outer normal vector N(n) x ,n y ,n z The calculation formula is as follows:

[0085]

[0086] Let p be the cable path point, and V0, V1, and V2 be the three vertices of the triangular facet Γ. Any point on the triangular facet can be represented by the parametric equation Γ(s,t), where D is the domain. and Let and represent two linearly independent vectors on the triangular facet. Assume that the point on the triangular facet closest to the path point p is p′. Then the distance between points p and p′ is ||Γ(s,t)-p||. To ensure non-negativity, we take the square value Q = ||Γ(s,t)-p||. 2 As the shortest distance, expansion yields a function of the independent variables s and t. Once the minimum value of function Q is found, p′ can be calculated, and the gradient of function Q can be determined, as shown in equation (4):

[0087]

[0088] Let gradient

[0089] Solving for:

[0090]

[0091] Substitute the parameters in equation (5) into Γ(s,t) to find the point p′ on the triangular facet that is closest to the path point p;

[0092] After obtaining p′ on the triangular facet, path point p, and the outward normal vector N(n) on the triangular facet... x ,n y ,n z ), calculate the dot product of p′p and the external normal vector N, DOT=p′p·N, and the field value sign(p) of the path point p is shown in equation (6);

[0093]

[0094] The values ​​of sign(p) are -1, 0, and 1, which represent the path point being inside the part, on the outer surface of the part, and outside the part, respectively.

[0095] In this embodiment, the directed distance field obstacle avoidance strategy is applicable to irregular parts or parts with holes. When the user clicks the "Select parts through which cables can pass" option, the user selects the parts that are determined by the directed distance field in the 3D model. The system automatically saves the position ID table of the selected parts in the assembly structure tree. The ID table can uniquely point to the parts, ensuring that they are distinguished from other parts with the same structure.

[0096] In this embodiment, step 2 creates a directed distance field array and an axis-aligned bounding box array. The array is used to store part model items. The three-dimensional model is accessed through the position ID table to obtain the part model items within the model. The model item ID is accessed and determined through the ID table. The parts are then stored in the directed distance field array and the axis-aligned bounding box array respectively.

[0097] Example 1

[0098] Step 1: Design the cable routing attribute selection function. The routing attributes include cable name, spool, harness, start end, and end end.

[0099] Step 101: Set up a cable name input box. When the user enters a cable name, the system will automatically store the cable name.

[0100] Step 102: Set up the wire harness dropdown list. The system will iterate through the wire harnesses in the 3D model and input them sequentially into the wire harness dropdown list. When the user clicks the dropdown list and selects the wire harness to which the cable belongs, the name of the selected wire harness will be saved.

[0101] Step 103: Set up the spool dropdown list. The spools store cable attribute information such as color and diameter. The system automatically traverses the model's spool information and stores all spool names in the spool dropdown list. When the user clicks the dropdown list to select a spool, the system reads the color and diameter information of the selected spool and displays it in the list box for the user's convenience. After the user selects a spool, the system saves the name of the selected spool.

[0102] Step 104: Set up the input function for the start and end points of the cabling. The start and end points refer to the coordinate systems on the parts at both ends of the cable and the parts connected to it in the 3D model. The user clicks the "Select Cabling End Points" function button, selects the start and end coordinate systems of the cable in the model, and the system reads and saves the selected start and end coordinate systems.

[0103] Step 2: Design cable-passable parts; cable-passable parts refer to certain special parts that have internal spaces for cables to pass through. Users click "Select cable-passable parts" and then click on the parts that allow cables to pass through in the 3D model. Subsequent paths will automatically pass through these parts without interfering with them.

[0104] Step 3: The user clicks "Wiring". The system collects the wiring attribute information provided by the user, performs a path space search on the 3D model, and generates the wiring cables. If the wiring work is not completed, the user can repeat step 1.

[0105] Step 4: When the user clicks "Show Information", the system will read all the laid cable information and display it to the user.

[0106] Without causing conflict, those skilled in the art can freely combine and use the above-mentioned additional technical features.

[0107] The above description is only a preferred embodiment of the present invention. Any technical solution that achieves the purpose of the present invention by essentially the same means is within the protection scope of the present invention.

Claims

1. A method for automatic routing of cables in a three-dimensional model, characterized by: Includes the following steps: Step 1: Design the cable routing attribute selection function. The routing attributes include cable name, cable bundle, cable reel, start end, and end end. Step 2: Based on the cable selected in Step 1, obtain the current 3D model, create cable path attributes through the model and cable, set the obstacle avoidance strategy for the part, the obstacle avoidance strategy includes axis alignment bounding box decision and directed distance field decision, and create a directed distance field array and an axis alignment bounding box array to store the part model items. Step 3: Obtain the starting segment and ending point of the cable selected by the user in Step 1, obtain the three-dimensional coordinates of the starting segment and ending point in the model, generate the critical path points of the cabling using the multi-rule particle swarm algorithm, and discretize and fit the path points into a dense point sequence using spline interpolation. Step 4: Traverse the model to obtain the model assembly coordinate system, traverse the directed distance field array and axis-aligned bounding box array to obtain the part assembly matrix, and perform pose transformation on the dense point sequence. Step 5: Perform interference detection between the dense point sequence after pose transformation and the parts in the directed distance field array and axis-aligned bounding box array, respectively, using axis-aligned bounding box decision and directed distance field decision; Step 6: The multi-rule particle swarm optimization algorithm uses a weighted method to score the generated dense point sequence. The scoring constrains the iteration direction of the particle swarm, generating cable paths that conform to the wiring process. Step 7: Iterate using the multi-rule particle swarm optimization algorithm and output the optimal dense point sequence; Step 8: Fill the optimal dense point sequence, start segment, and end position information into the cable path attributes to generate the wiring path and wiring cable in the 3D model.

2. The automatic cable routing method for a three-dimensional model according to claim 1, characterized in that: The attribute selection function in step 1 includes the following steps: Step 101: Set up a cable name input box. When the user enters a cable name, the system will automatically store the cable name. Step 102: Set up the wire harness drop-down list. The system automatically traverses the model, obtains all wire harnesses, and obtains the wire harness names. The names are then entered into the wire harness drop-down list. When the user clicks the drop-down list and selects the wire harness to which the cable belongs, the selected wire harness name is saved. Step 103: Set up the spool drop-down list. The spools store cable attribute information. The system automatically traverses the model's spool information and stores all spool names in the spool drop-down list. When the user clicks the drop-down list to select a spool, the system reads the color and diameter information of the selected spool and displays it in the list box for the user to select the spool. After the user selects a spool, the system saves the name of the selected spool. Step 104: Set up the input function for the start and end points of the cabling; the user clicks the "Causing End Points" function button, selects the start and end coordinate systems of the cable in the model, and the system reads and saves the selection of the start and end coordinate systems.

3. The automatic cable routing method for a three-dimensional model according to claim 1, characterized in that: The axis alignment bounding box decision is as follows: ; Equation (1) represents the mathematical expression for an axis-aligned bounding box. and This represents the set of points whose three-dimensional coordinates lie within the two diagonal coordinates of the bounding box. Representing an axis-aligned bounding box, this function determines whether the cable routing path interferes with the component. Let the cable radius be... Path point set , The number of path points is the set of cable routing path points obtained by the algorithm. Substitute into the following formula: ; If all three terms in equation (1) are satisfied, it means that the path point set is outside the bounding box and the wiring path does not interfere with the component. Directed distance field decision-making is as follows: In a 3D model, a part is triangularized. A triangular facet is a triangular plane composed of the coordinates of its three vertices. The geometric data of the triangular facet is obtained by reading the model's STL file data, including the coordinates of the three vertices and the outward normal vector. The outward normal vector of the triangular facet is the coordinate of the normal vector pointing outward from the part entity. It can be calculated using the coordinates of the three vertices according to the right-hand rule. Assuming the coordinates of the three vertices are... Outer normal vector The calculation formula is as follows: ; Cable path points are triangular facet The three vertices are respectively Any point on a triangular facet can be represented by a parametric equation. express, For the domain, , , , and Let and represent two linearly independent vectors on a facet, and assume the closest path point on the triangular facet. The point is Then point With point The distance is To ensure non-negativity, we take the square value. As the shortest distance, expansion yields information about the independent variable. and function Only need to find the function The minimum value can be used to find the answer. Calculation function The gradient is given by equation (4): ; Let gradient ; Solving for: ; Substitute the parameters in equation (5) Find the distance from the path point on the triangular facet. The nearest point ; After obtaining the triangular facet Path points and the outward normal vector on the triangular face Find With the outer normal vector Dot product Path points The field value is shown in equation (6); ; The values ​​-1, 0, and 1 represent the path point being inside the part, on the outer surface of the part, and outside the part, respectively.

4. The automatic cable routing method for a three-dimensional model according to claim 1, characterized in that: The directed distance field obstacle avoidance strategy is applicable to irregular parts or parts with holes. When the user clicks the "Select parts through which cables can pass" option, the user selects the parts that are determined by the directed distance field in the 3D model. The system automatically saves the position ID table of the selected parts in the assembly structure tree. The ID table can uniquely point to the parts, ensuring that they are distinguished from other parts with the same structure.

5. The automatic cable routing method for a three-dimensional model according to claim 4, characterized in that: In step 2, a directed distance field array and an axis-aligned bounding box array are created. The array is used to store part model items. The 3D model is accessed through the position ID table to obtain the part model items within the model. The model item ID is accessed, and the parts are stored in the directed distance field array and the axis-aligned bounding box array respectively based on the ID table.