Methods, apparatus, electronic devices and storage media for replicating PCB traces

By automating the calculation and plotting of the coordinates of the start, end, and intersection points of PCB traces, the problem of manually adjusting trace spacing errors and the time-consuming manual inspection in existing technologies is solved, achieving efficient and accurate trace replication.

CN116757148BActive Publication Date: 2026-11-17INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310572527.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-19
Publication Date
2026-11-17
Estimated Expiration
2043-05-19

AI Technical Summary

Technical Problem

In PCB design, when existing technologies replicate PCB traces with fixed spacing and quantity, designers are prone to errors when manually adjusting the spacing between traces. Furthermore, manual visual inspection is time-consuming and labor-intensive, reducing design efficiency.

Method used

By obtaining the copy spacing, copy quantity, and copy direction of the baseline trace, the coordinates of the endpoints of each segment of the baseline trace are determined. Based on these coordinates and directions, the starting coordinates, ending coordinates, and straight line equations of N copied traces are automatically drawn, the intersection coordinates are calculated, and finally each copied trace is automatically drawn.

Benefits of technology

It enables the rapid and accurate replication of baseline traces according to the corresponding replication spacing and quantity, improving the design efficiency and accuracy of trace replication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116757148B_ABST
    Figure CN116757148B_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, electronic device, and storage medium for copying PCB traces, belonging to the field of computer technology. The method includes: obtaining the copying spacing, copying quantity, and copying direction corresponding to a reference trace; determining the endpoint coordinates of each segment of the reference trace; based on the endpoint coordinates, copying spacing, and copying direction of each segment of the reference trace, determining the starting and ending coordinates of N copy traces, as well as the linear equations corresponding to each segment of the N copy traces, where N equals the copying quantity; determining the coordinates of the intersection points between each segment of each copy trace according to the linear equations corresponding to each segment of each copy trace; and automatically drawing each copy trace based on the coordinates of the intersection points between each segment of each copy trace, combined with the starting and ending coordinates of each copy trace. This enables the rapid and accurate copying of the reference trace according to the corresponding copying spacing and copying quantity, improving design efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for copying PCB traces. Background Technology

[0002] In the process of printed circuit board (PCB) design, especially on large server motherboards, it is necessary to copy traces with consistent properties at fixed intervals and in fixed quantities. In related technologies, after the designer selects the traces to be copied, they use the copy command built into the PCB design software to paste them into the desired location. However, this method only works for copying traces at fixed intervals in the horizontal or vertical direction, not in the direction of bends. If the traces to be copied include segments at an angle, the designer currently needs to manually adjust the spacing between the traces. This method is prone to errors, and manual visual inspection is time-consuming and laborious, reducing PCB design efficiency. Summary of the Invention

[0003] This invention provides a method, apparatus, electronic device, and storage medium for copying PCB traces, which solves the problems in related technologies where, when copying PCB traces at fixed intervals and in fixed quantities, designers are prone to errors when manually adjusting the spacing between traces, and manual visual inspection is time-consuming and laborious, thus reducing PCB design efficiency.

[0004] In a first aspect, the present invention provides a method for replicating PCB traces, comprising:

[0005] Obtain the copy spacing, copy quantity, and copy direction corresponding to the baseline trace;

[0006] Determine the endpoint coordinates of each segment of the reference trace;

[0007] Based on the endpoint coordinates of each segment of the baseline routing, the replication spacing, and the replication direction, the starting coordinates and ending coordinates of N replicated routings are determined, as well as the straight line equations corresponding to each segment of the N replicated routings, where N is equal to the replication number.

[0008] Based on the equations of the straight lines corresponding to each segment of each copied route, the coordinates of the intersection points between each segment of each copied route are determined. Based on the coordinates of the intersection points between each segment of each copied route, combined with the starting and ending coordinates of each copied route, each copied route is automatically drawn.

[0009] In some embodiments, determining the endpoint coordinates of each segment of the reference trace includes:

[0010] The starting point coordinates and ending point coordinates of each segment of the reference trace are obtained sequentially;

[0011] The obtained coordinates are deduplicated and arranged in descending order of the vertical coordinates to obtain the endpoint coordinates of each segment of the reference trace.

[0012] In some embodiments, determining the start-point and end-point coordinates of N copied routes based on the endpoint coordinates of each segment of the reference route, the copy spacing, and the copy direction, as well as the straight line equations corresponding to each segment of the N copied routes, includes:

[0013] Based on the endpoint coordinates of the first line segment of the reference trace and the copying direction, determine the starting coordinates and corresponding straight line equations of each copied line segment that is parallel to the first line segment of the reference trace at each copying interval.

[0014] Based on the endpoint coordinates of the last line segment of the reference trace and the copying direction, determine the endpoint coordinates and corresponding straight line equations of each copied line segment that is parallel to the last line segment of the reference trace at each copying interval.

[0015] Based on the endpoint coordinates of each intermediate segment of the reference trace and the copying direction, the equations of the straight lines corresponding to the copying segments parallel to each intermediate segment of the reference trace at each copying interval are determined.

[0016] In some embodiments, determining the starting coordinates and corresponding straight line equations of each copied line segment parallel to the first line segment of the reference trace, based on the endpoint coordinates of the first line segment of the reference trace and the copying direction, at intervals of the copying spacing, includes:

[0017] Based on the endpoint coordinates of the first line segment of the reference trace, determine the slope corresponding to the first line segment;

[0018] Draw a first straight line perpendicular to the first line segment from the starting point of the first line segment. On the first straight line, starting from the starting point of the first line segment, set a copy point every copy interval according to the copy direction until N copy points are set.

[0019] Based on the first distance formula and the first dot product formula, the coordinates of the N copy points are calculated, and the coordinates of the N copy points are used as the starting coordinates of each copy line segment that is parallel to the first line segment at each copy interval.

[0020] Based on the slope and the coordinates of each copy point, determine the equation of the straight line corresponding to the copy line segment parallel to the first line segment for each copy route.

[0021] In some embodiments, determining the endpoint coordinates and corresponding straight line equations of each copied line segment parallel to the last line segment of the reference trace, based on the endpoint coordinates of the last line segment of the reference trace and the copying direction at intervals of the copying distance, includes:

[0022] Based on the endpoint coordinates of the last line segment of the reference route, determine the slope corresponding to the last line segment;

[0023] Draw a second straight line perpendicular to the last line segment from the end point of the last line segment. Starting from the end point of the last line segment on the second straight line, set a copy point every copy interval according to the copy direction until N copy points are set.

[0024] Based on the second distance formula and the second dot product formula, the coordinates of the N copy points are calculated, and the coordinates of the N copy points are used as the endpoint coordinates of each copy line segment that is parallel to the last line segment at each copy interval.

[0025] Based on the slope and the coordinates of each of the copy points, determine the equation of the straight line corresponding to the copy line segment parallel to the last line segment for each copy path.

[0026] In some embodiments, determining the linear equations of copied line segments parallel to the intermediate segments of the reference route at each copying interval based on the endpoint coordinates of each intermediate segment of the reference route and the copying direction includes:

[0027] For each intermediate segment of the aforementioned baseline trace, perform the following steps one by one:

[0028] Based on the endpoint coordinates of the current intermediate line segment of the reference route, determine the slope corresponding to the current intermediate line segment;

[0029] Based on the slope and the endpoint coordinates, determine the equation of the line corresponding to the current intermediate line segment;

[0030] Based on the formula for the distance between parallel lines, the copy spacing, and the copy direction, determine the value of the constant term of the equation of the line corresponding to each copied line segment parallel to the current intermediate line segment;

[0031] Based on the value of the constant term, determine the equations of the lines corresponding to each copied line segment that is parallel to the current intermediate line segment.

[0032] In some embodiments, automatically drawing each copied route based on the coordinates of the intersection points between the segments of each copied route, combined with the start and end coordinates of each copied route, includes:

[0033] Each copied route is automatically drawn based on the starting coordinates of the first line segment, the coordinates of the intersection points between the line segments of each copied route, and the ending coordinates of the last line segment of each copied route.

[0034] In some embodiments, the first dot product formula is: the dot product between the first vector and the second vector is zero, wherein the first vector is the vector corresponding to the first line segment of the reference trace, and the second vector is the vector corresponding to the line segment formed by each copy point and the starting point of the first line segment of the reference trace;

[0035] The first distance formula is: the distance between the starting point of the first segment of the reference trace and each copy point is equal to the product of the serial number corresponding to each copy point and the copy spacing.

[0036] In some embodiments, the second dot product formula is: the dot product between the third vector and the fourth vector is zero, wherein the third vector is the vector corresponding to the last line segment of the reference trace, and the fourth vector is the vector corresponding to the line segment formed by each copy point and the endpoint of the last line segment of the reference trace;

[0037] The second distance formula is: the distance between the end point of the last segment of the reference trace and each copy point is equal to the product of the serial number of each copy point and the copy spacing.

[0038] In a second aspect, the present invention provides a PCB trace replication apparatus, comprising:

[0039] The acquisition unit is used to acquire the copy spacing, copy quantity, and copy direction corresponding to the baseline trace;

[0040] The first determining unit is used to determine the endpoint coordinates of each segment of the reference trace;

[0041] The second determining unit is used to determine the starting coordinates and ending coordinates of N copied routes, as well as the straight line equations corresponding to each line segment of the N copied routes, based on the endpoint coordinates of each line segment of the reference route, the copying spacing and the copying direction, where N is equal to the number of copies.

[0042] The drawing unit is used to determine the coordinates of the intersection points between the line segments of each copied route based on the straight line equations corresponding to each line segment of each copied route. Based on the coordinates of the intersection points between the line segments of each copied route, combined with the starting coordinates and ending coordinates of each copied route, the unit automatically draws each copied route.

[0043] Thirdly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the PCB trace copying method as described in any of the first aspects.

[0044] Fourthly, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the PCB trace copying method as described in any of the first aspects.

[0045] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the PCB trace copying method as described in any of the first aspects.

[0046] The present invention provides a PCB trace replication method, apparatus, electronic device, and storage medium. It acquires the replication spacing, replication quantity, and replication direction corresponding to a reference trace; determines the endpoint coordinates of each segment of the reference trace; then, based on the endpoint coordinates of each segment of the reference trace, the replication spacing, and the replication direction, determines the starting and ending coordinates of N replicated traces, as well as the linear equations corresponding to each segment of the N replicated traces, where N equals the replication quantity; further, based on the linear equations corresponding to each segment of each replicated trace, it determines the coordinates of the intersection points between each segment of each replicated trace; and based on the coordinates of the intersection points between each segment of each replicated trace, combined with the starting and ending coordinates of each replicated trace, it automatically draws each replicated trace, achieving rapid and accurate replication of the reference trace according to the corresponding replication spacing and replication quantity, thereby improving the design efficiency and accuracy of trace replication. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in this invention or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is one of the flowcharts illustrating a method for replicating PCB traces according to an embodiment of the present invention;

[0049] Figure 2 This is a schematic diagram of the reference routing provided in one embodiment of the present invention;

[0050] Figure 3 One of the schematic diagrams of a replicated reference trace provided in one embodiment of the present invention;

[0051] Figure 4 A second schematic diagram of a replicated reference trace provided in one embodiment of the present invention;

[0052] Figure 5 This is a second flowchart illustrating a method for replicating PCB traces according to an embodiment of the present invention.

[0053] Figure 6 This is a third flowchart illustrating a method for replicating PCB traces according to an embodiment of the present invention.

[0054] Figure 7 This is a fourth flowchart illustrating a method for replicating PCB traces according to an embodiment of the present invention.

[0055] Figure 8 Fifth of a flowchart illustrating a method for replicating PCB traces according to an embodiment of the present invention;

[0056] Figure 9 This is a sixth flowchart illustrating a method for replicating PCB traces according to an embodiment of the present invention.

[0057] Figure 10 This is a schematic diagram of a PCB trace replication device provided in one embodiment of the present invention;

[0058] Figure 11 This is a schematic diagram of the physical structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation

[0059] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0060] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, not limited in number; for example, the first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0061] In view of the shortcomings of related technologies, when replicating PCB traces according to a fixed spacing and quantity, designers are prone to errors in manually adjusting the spacing between traces, and manual visual inspection is time-consuming and laborious, which reduces the efficiency of PCB design. The present invention provides a method, device, electronic device and storage medium for replicating PCB traces.

[0062] The execution subject of the PCB trace replication method provided by the present invention can be a PCB trace replication device. The device can be implemented by software and / or hardware. The device can be integrated into PCB design software or electronic devices with PCB design software installed. The electronic devices can be terminal devices (such as smartphones, personal computers, learning machines, etc.), servers (such as local servers or cloud servers, or server clusters, etc.), processors, or chips, etc.

[0063] The following example uses a PCB trace replication device as the execution subject, combined with... Figures 1-11 The present invention will now be described.

[0064] Figure 1 This is one of the flowcharts illustrating a method for replicating PCB traces according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps: step 110, step 120, step 130, and step 140. These method steps are merely one possible implementation of the present invention. They include:

[0065] Step 110: Obtain the copy spacing, copy quantity, and copy direction corresponding to the baseline trace;

[0066] It is understood that traces refer to signal lines, power lines, and ground lines in PCB layout design, and this invention does not specifically limit them. The reference trace in this invention is a trace that needs to be copied according to the PCB layout design requirements. During the PCB layout design process, after selecting the reference trace, the designer sets the copy spacing, copy quantity, and copy direction corresponding to the reference trace. The copy direction is the relative relationship between the position of the copy trace clicked by the designer and the position of the reference trace. For example, if the designer clicks on the left side of the reference trace, the copy direction is to the left, and the copied trace is located to the left of the reference trace; if the designer clicks on the right side of the reference trace, the copy direction is to the right, and the copied trace is located to the right of the reference trace.

[0067] After receiving the settings information from the designer, the PCB trace replication device automatically obtains the replication spacing, replication quantity, and replication direction corresponding to the reference trace. Step 120: Determine the endpoint coordinates of each segment of the reference trace;

[0068] In practical implementation, the baseline routing is first divided into a polyline composed of multiple line segments. These multiple line segments can be three, four, or other segments; the present invention does not specify the number of line segments. After dividing the baseline routing into a polyline composed of multiple line segments, the starting and ending coordinates of each line segment are obtained. Then, the coordinates of duplicate points are removed, thereby determining the endpoint coordinates of each line segment of the baseline routing.

[0069] Figure 2 A schematic diagram of the reference trace provided in one embodiment of the present invention, such as... Figure 2 As shown, Figure 2 The baseline routing is split into a polyline composed of three line segments: A0B0, B0C0, and C0D0. Then, the starting and ending coordinates of each line segment are obtained as (XA0,YA0), (XB0,YB0), (XB0,YB0), (XC0,YC0), (XC0,YC0), and (XD0,YD0). The coordinates of the duplicate points (XB0,YB0) and (XC0,YC0) are then removed, and the coordinates of the endpoints of each line segment of the baseline routing are determined as (XA0,YA0), (XB0,YB0), (XC0,YC0), and (XD0,YD0).

[0070] Step 130: Based on the endpoint coordinates of each segment of the baseline routing, the replication spacing, and the replication direction, determine the starting coordinates and ending coordinates of N replicated routings, as well as the straight line equations corresponding to each segment of the N replicated routings, where N is equal to the replication number;

[0071] In this embodiment of the invention, a copied trace refers to a trace obtained by copying a reference trace.

[0072] In practice, based on the endpoint coordinates of each segment of the baseline routing and the replication spacing, the starting point coordinates and ending point coordinates of each replicated routing are determined according to the routing replication direction, as well as the straight line equations corresponding to each segment of each replicated routing, until the straight line equations corresponding to each segment of N replicated routings are determined.

[0073] For example, Figure 3 One of the schematic diagrams of the replicated reference trace provided in one embodiment of the present invention is shown below. Figure 3 As shown, for Figure 2 In the baseline trace, a copy spacing of D and a copy quantity of N are set. The baseline trace is copied. Assuming the copy direction clicked by the designer is the right side of the baseline trace, based on the endpoint coordinates (XA0,YA0), (XB0,YB0), (XC0,YC0), and (XD0,YD0) of each segment of the baseline trace line0 and the copy spacing D, the first segment of each copied trace is determined as follows. Figure 3The equations of the lines corresponding to A1B1, A2B2...AnBn are used to determine the intermediate line segments of each copied path, as shown below. Figure 3 The equations of the lines corresponding to B1C1, B2C2...BnCn are used to determine the last line segment of each copied trace, as shown below. Figure 3 The equations of the straight lines corresponding to C1D1, C2D2...CnDn are used to determine the equations of the straight lines corresponding to each segment of the N copied traces. This allows for the copying of the baseline trace to the right of the baseline trace with a copying interval of D and a copying quantity of N.

[0074] For example, Figure 4 This is a second schematic diagram of a replicated reference trace provided in one embodiment of the present invention, as shown below. Figure 4 As shown, for Figure 2 In the baseline trace, a copy spacing of D and a copy quantity of N are set. The baseline trace is copied. Assuming the copy direction clicked by the designer is to the left of the baseline trace, based on the endpoint coordinates (XA0,YA0), (XB0,YB0), (XC0,YC0), and (XD0,YD0) of each segment of the baseline trace line0 and the copy spacing D, the first segment of each copied trace is determined as follows. Figure 3 The equations of the lines corresponding to A1B1, A2B2...AnBn are used to determine the intermediate line segments of each copied path, as shown below. Figure 3 The equations of the lines corresponding to B1C1, B2C2...BnCn are used to determine the last line segment of each copied trace, as shown below. Figure 3 The equations of the straight lines corresponding to C1D1, C2D2...CnDn are used to determine the equations of the straight lines corresponding to each segment of the N copied traces. This allows for the copying of the baseline trace to the left of the baseline trace with a copying interval of D and a copying quantity of N.

[0075] Step 140: Based on the straight line equations corresponding to each line segment of each copied route, determine the coordinates of the intersection points between each line segment of each copied route. Based on the coordinates of the intersection points between each line segment of each copied route, combined with the starting point coordinates and ending point coordinates of each copied route, automatically draw each copied route.

[0076] It is understood that, when each replicated route includes at least one intermediate line segment, the coordinates of the intersection points between the segments of each replicated route include: the coordinates of the intersection point between the first intermediate line segment and the first line segment of each replicated route, the coordinates of the intersection points between the intermediate line segments of each replicated route, and the coordinates of the intersection point between the last intermediate line segment and the last line segment of each replicated route.

[0077] Taking a baseline trace consisting of four line segments as an example, for the first replicated trace, including line segments A1B1, B1C1, C1D1, and D1E1, the coordinates of the intersection points between the line segments of each replicated trace are determined based on the corresponding straight line equations of each line segment. This includes: calculating the coordinates (XB1, ..., ...) of the intersection point between the first intermediate line segment B1C1 and the first line segment A1B1 based on the straight line equations of the first intermediate line segment B1C1 and the first line segment A1B1. Given the equations of the first intermediate line segment B1C1 and the last line segment C1D1, calculate the coordinates (XC1, YC1) of the intersection point between the first intermediate line segment B1C1 and the last intermediate line segment C1D1. Given the equations of the last intermediate line segment C1D1 and the last line segment D1E1, calculate the coordinates (XD1, YD1) of the intersection point between the last intermediate line segment C1D1 and the last line segment D1E1.

[0078] After obtaining the coordinates of the intersection points between the segments of a copied route, the copied route can be automatically drawn by combining the coordinates of the starting point and the ending point of the copied route.

[0079] In this embodiment of the invention, the replication spacing, replication quantity, and replication direction corresponding to the baseline routing are obtained; and the endpoint coordinates of each segment of the baseline routing are determined; then, based on the endpoint coordinates of each segment of the baseline routing, the replication spacing, and the replication direction, the starting coordinates and ending coordinates of N replication routings, as well as the linear equations corresponding to each segment of the N replication routings, are determined, where N is equal to the replication quantity; further, based on the linear equations corresponding to each segment of each replication routing, the coordinates of the intersection points between each segment of each replication routing are determined; based on the coordinates of the intersection points between each segment of each replication routing, combined with the starting coordinates and ending coordinates of each replication routing, each replication routing is automatically drawn, thereby enabling the rapid and accurate replication of the baseline routing according to the corresponding replication spacing and replication quantity, which can improve the design efficiency and accuracy of routing replication.

[0080] In some embodiments, automatically drawing each copied route based on the coordinates of the intersection points between the segments of each copied route, combined with the start and end coordinates of each copied route, includes:

[0081] Each copied route is automatically drawn based on the starting coordinates of the first line segment, the coordinates of the intersection points between the line segments of each copied route, and the ending coordinates of the last line segment of each copied route.

[0082] It can be understood that the first segment of each copied trace is the copied segment that is parallel to the first segment of the reference trace; the last segment of each copied trace is the copied segment that is parallel to the last segment of the reference trace.

[0083] For example, when the baseline routing consists of four line segments A0B0, B0C0, C0D0, and D0E0, for the first copied routing, the coordinates of the starting point (XA1, YA1) of the first line segment A1B1, the coordinates of the intersection point (XB1, YB1) of the first intermediate line segment B1C1 and the first line segment A1B1, the coordinates of the intersection point (XC1, YC1) of the first intermediate line segment B1C1 and the last intermediate line segment C1D1, the coordinates of the intersection point (XD1, YD1) of the last intermediate line segment C1D1 and the last line segment D1E1, and the coordinates of the ending point (XE1, YE1) of the last line segment D1E1 are connected sequentially to automatically draw the first copied routing. This process is repeated until the Nth routing is copied.

[0084] In this embodiment of the invention, each copied trace is automatically drawn based on the starting coordinates of the first segment of each copied trace, the coordinates of the intersection points between each segment of each copied trace, and the ending coordinates of the last segment of each copied trace. This enables the rapid and accurate copying of the baseline trace according to the corresponding copying interval and copying quantity, thereby improving the design efficiency and accuracy of trace copying.

[0085] In some embodiments, Figure 5 This is a second flowchart illustrating a PCB trace replication method according to an embodiment of the present invention, as shown below. Figure 5 As shown, step 120 includes:

[0086] Step 510: Sequentially obtain the starting point coordinates and ending point coordinates of each segment of the reference trace;

[0087] Optionally, the starting coordinates and ending coordinates of each segment of the baseline routing can be obtained using the programming language corresponding to the design software (e.g., the Candence Skill language) and stored. The storage method can be a list or other storage methods. This invention does not make specific limitations. For example, the following description uses a list storage method.

[0088] by Figure 2 For example, the starting coordinates and ending coordinates of the three line segments A0B0, B0C0 and C0D0 of the reference route are obtained in sequence to obtain ((XA0,YA0)(XB0,YB0)), ((XB0,YB0)(XC0,YC0)), ((XC0,YC0)(XD0,YD0)), and stored in the first list list1, that is, list1={((XA0,YA0)(XB0,YB0)), ((XB0,YB0)(XC0,YC0)), ((XC0,YC0)(XD0,YD0))}.

[0089] Step 520: The obtained coordinates are deduplicated and arranged in descending order of the vertical coordinates to obtain the endpoint coordinates of each line segment of the reference route.

[0090] As can be seen from list1, list1 includes the coordinates of multiple duplicate endpoints. Therefore, it is necessary to remove duplicate coordinates in order to obtain the endpoint coordinates of each segment of the baseline trace.

[0091] It is understandable that in PCB design, the coordinates are consistent with the two-dimensional coordinate axes, i.e., horizontally from left to right, from smallest to largest; vertically from bottom to top, from smallest to largest. Removing the duplicate coordinates (XB0, YB0) and (XC0, YC0) from list1 and arranging them in descending order of their ordinates yields the second list, list2, i.e., list2 = {(XA0, YA0), (XB0, YB0), (XC0, YC0), (XD0, YD0)}. This leads to the endpoint coordinates of the three line segments that make up the baseline trace, i.e., (XA0, YA0), (XB0, YB0), (XC0, YC0), and (XD0, YD0).

[0092] It should be noted that arranging the deduplicated coordinates in descending order of the ordinate is more in line with design habits. However, they can also be arranged in ascending order of the ordinate. It can be understood that arranging them in ascending order of the ordinate is a conventional replacement for the descending order arrangement in this invention, and also falls within the scope of protection of this invention. For example, Figure 3 In the diagram, line segment C0D0 can be the first line segment, and line segment A0B0 can be the last line segment.

[0093] Similarly, when the reference trace is composed of multiple line segments, the endpoint coordinates of each line segment that makes up the reference trace can be obtained in the above manner.

[0094] In this embodiment of the invention, the starting coordinates and ending coordinates of each line segment of the baseline routing are obtained sequentially; then the obtained coordinates are deduplicated and arranged in descending order of the vertical coordinates to obtain the endpoint coordinates of each line segment of the baseline routing, thus preparing for the replication of the routing.

[0095] In some embodiments, Figure 6 This is a third flowchart illustrating a PCB trace replication method according to an embodiment of the present invention, as shown below. Figure 6 As shown, step 130 includes:

[0096] Step 610: Based on the endpoint coordinates of the first line segment of the reference trace and the copying direction, determine the starting point coordinates and the corresponding straight line equation of each copied line segment that is parallel to the first line segment of the reference trace at each copying interval;

[0097] In specific implementation, the slope corresponding to the first line segment is determined by the endpoint coordinates of the first line segment of the reference route; N copy points are determined based on the first line segment of the reference route combined with the copy direction and copy spacing; and the equation of the straight line corresponding to the copy line segment parallel to the first line segment of each copy route is determined by the slope and the coordinates of each copy point.

[0098] Step 620: Based on the endpoint coordinates of the last line segment of the reference trace and the copying direction, determine the endpoint coordinates and corresponding straight line equations of each copied line segment that is parallel to the last line segment of the reference trace at each copying interval;

[0099] In practice, the slope of the last line segment is determined by the endpoint coordinates of the last line segment of the reference route; N copy points are determined based on the last line segment of the reference route, combined with the copy direction and copy spacing; and the equation of the straight line corresponding to the copy line segment parallel to the last line segment of each copy route is determined by the slope and the coordinates of each copy point.

[0100] Step 630: Based on the endpoint coordinates of each intermediate segment of the reference trace and the copying direction, determine the straight line equations corresponding to the copying segments that are parallel to each intermediate segment of the reference trace at each copying interval.

[0101] In practice, the equation of each intermediate line segment is determined based on the coordinates of its endpoints. Furthermore, the equation of each line segment corresponding to each copied line segment parallel to the original line segment is determined based on the formula for the distance between parallel lines, combined with the copying spacing and copying direction.

[0102] The order of steps 610, 620, and 630 can be adjusted, and the present invention does not limit their order.

[0103] In this embodiment of the invention, by dividing the reference trace into three parts—the first segment of the reference trace, each intermediate segment of the reference trace, and the last segment of the reference trace—and determining the linear equations corresponding to the copy segments parallel to each segment of the reference trace for each part of the reference trace, the coordinates of the intersection points between each segment of each copy trace can be further determined. By combining the starting coordinates of the first segment of each copy trace, the coordinates of the intersection points between each segment of each copy trace, and the ending coordinates of the last segment of each copy trace, each copy trace can be automatically drawn according to a fixed copy spacing and a fixed copy number.

[0104] In some embodiments, Figure 7This is the fourth flowchart illustrating a method for replicating PCB traces according to an embodiment of the present invention. Figure 7 As shown, step 610 includes:

[0105] Step 710: Determine the slope corresponding to the first line segment based on the endpoint coordinates of the first line segment of the reference route;

[0106] In specific implementation, with Figure 3 For example, based on the endpoint coordinates (XA0, YA0) and (XB0, YB0) of the first line segment A0B0 of the baseline routing, we first use the two-point vector formula to obtain... Then determine the slope of the line containing the first line segment A0B0. It should be noted that the case where line segment A0B0 is perpendicular is excluded here.

[0107] Step 720: Draw a first straight line perpendicular to the first line segment from the starting point of the first line segment. On the first straight line, starting from the starting point of the first line segment, set a copy point every copy interval according to the copy direction until N copy points are set.

[0108] In specific implementation, with Figure 3 For example, starting from point A0 of the first line segment A0B0, draw the first straight line perpendicular to the first line segment A0B0 (e.g., ...). Figure 3 Starting from the beginning of the first line segment (A0) on the first straight line, a copy point is set at every copy interval D until N copy points are set, resulting in copy point A1, copy point A2, ..., copy point An.

[0109] Step 730: Based on the first distance formula and the first dot product formula, calculate the coordinates of the N copy points, and use the coordinates of the N copy points as the starting coordinates of each copy line segment that is parallel to the first line segment at each copy interval;

[0110] It should be noted that the first dot product formula is: the dot product between the first vector and the second vector is zero, where the first vector is the vector corresponding to the first line segment of the reference trace, and the second vector is the vector corresponding to the line segment formed by each copy point and the starting point of the first line segment of the reference trace.

[0111] The first distance formula is: the distance between the starting point of the first segment of the reference trace and each copy point is equal to the product of the serial number corresponding to each copy point and the copy spacing.

[0112] Based on the first distance formula and the first dot product formula, the coordinates of the N copied points can be obtained quickly and accurately.

[0113] It can be understood that, based on the distance |A0An| between A0 and each replicated point = n*D (n cycles from 1 to N, where n is the index of each replicated point), the first distance formula (a) is obtained:

[0114]

[0115] Then use vectors with vector Perpendicular, i.e., vector with vector The dot product is 0, which gives us the first dot product formula (b):

[0116] (XAn-XA0)*(XB0-XA0)+(YAn-YA0)*(YB0-YA0)=0 (b)

[0117] Combining formulas (a) and (b), the coordinates of the N copy points are calculated, namely (XA1, YA1), (XA2, YA2), ..., (XAn, YAn). Each copy point has two coordinates. At this point, the coordinates of each copy point need to be further determined based on the relationship between the position of the copy line clicked by the designer and the position of the baseline line. If the position of the copy line clicked by the designer is to the left of the baseline line, then YAn greater than YA0 is used; otherwise, YAn less than YA0 is used. Simultaneously, the coordinates of the N copy points are sequentially used as the starting coordinates of each copy line segment parallel to the first line segment at each copy interval D.

[0118] Step 740: Based on the slope and the coordinates of each copy point, determine the equation of the straight line corresponding to the copy line segment parallel to the first line segment for each copy line.

[0119] In specific implementation, with Figure 3 For example, based on the slope K A0B0 Given the coordinates of each copied point (XA1, YA1), (XA2, YA2), ..., (XAn, YAn), determine the equation L of the straight line corresponding to the copied line segment parallel to the first line segment for each copied path using the point-slope formula. An for:

[0120] Y = K A0B0 *(X-XAn)+YAn

[0121] Specifically, if A0B0 is a vertical line segment, then determine the equation L of the straight line corresponding to the copy line segment parallel to the first line segment for each copied route. An for:

[0122] Xn=XA0+N*D

[0123] Optionally, the equation L of the straight line corresponding to the copied line segment parallel to the first line segment of each copied route is set. An Store in listA, i.e., listA = {(1,L} A1 (2,L) A2 )…(i,L Ai )…(N,L An )}.

[0124] In this embodiment of the invention, a detailed description is provided of how to determine the equation of the straight line corresponding to the copy line segment parallel to the first line segment for each copied trace, in order to prepare for the copying of the trace.

[0125] In some embodiments, the wiring is... Figure 8 This is the fifth flowchart illustrating a method for replicating PCB traces according to an embodiment of the present invention. Figure 8 As shown, step 620 includes:

[0126] Step 810: Based on the endpoint coordinates of the last line segment of the reference trace, determine the slope corresponding to the last line segment;

[0127] In specific implementation, with Figure 3 For example, based on the endpoint coordinates (XD0, YD0) and (XC0, YC0) of the last line segment C0D0 of the baseline route, the coordinates are first obtained using the two-point vector formula. Then determine the slope of the line containing the last line segment C0D0. It should be noted that the case where line segment A0B0 is perpendicular is excluded here.

[0128] Step 820: Draw a second straight line perpendicular to the last line segment, passing through the end point of the last line segment. Starting from the end point of the last line segment on the second straight line, set a copy point every copy interval according to the copy direction until N copy points are set.

[0129] In specific implementation, with Figure 3 For example, passing through the endpoint D0 of the last line segment C0D0, draw a second straight line perpendicular to the last line segment C0D0 (e.g., ...). Figure 3 Starting from the end point D0 of the last line segment on the second straight line, set a copy point every copy interval D until N copy points are set, resulting in copy point D1, copy point D2, ..., copy point Dn.

[0130] Step 830: Based on the second distance formula and the second dot product formula, calculate the coordinates of the N copy points, and use the coordinates of the N copy points as the endpoint coordinates of each copy line segment that is parallel to the last line segment at each copy interval.

[0131] It should be noted that the second dot product formula is: the dot product between the third vector and the fourth vector is zero, wherein the third vector is the vector corresponding to the last line segment of the reference route, and the fourth vector is the vector corresponding to the line segment formed by each copy point and the endpoint of the last line segment of the reference route.

[0132] The second distance formula is: the distance between the end point of the last segment of the reference trace and each copy point is equal to the product of the serial number of each copy point and the copy spacing.

[0133] Based on the second distance formula and the second dot product formula, the coordinates of the N copied points can be obtained quickly and accurately.

[0134] It can be understood that, based on the distance |D0Dn| between D0 and each replicated point = n*D (n cycles from 1 to N, where n is the index of each replicated point), the second distance formula (c) is obtained:

[0135]

[0136] Then use vectors with vector Perpendicular, i.e., vector with vector The dot product is 0, thus we obtain the second dot product formula (d):

[0137] (XDn-XD0)*(XC0-XD0)+(YDn-YD0)*(YC0-YD0)=0 (d)

[0138] Combining formulas (c) and (d), the coordinates of the N copy points are calculated, namely (XD1, YD1), (XD2, YD2), ..., (XDn, YDn). Each copy point has two coordinates. At this point, the coordinates of each copy point need to be further determined based on the relationship between the position of the copy line clicked by the designer and the position of the baseline line. If the position of the copy line clicked by the designer is to the left of the baseline line, then YDn, which is greater than YD0, is used; otherwise, YDn, which is less than YD0, is used. Simultaneously, the coordinates of the N copy points are sequentially used as the endpoint coordinates of each copy line segment parallel to the last line segment at each copy interval D.

[0139] Step 840: Based on the slope and the coordinates of each copy point, determine the equation of the straight line corresponding to the copy line segment parallel to the last line segment for each copy line.

[0140] In specific implementation, with Figure 3 For example, based on the slope K C0D0 Given the coordinates (XD1, YD1), (XD2, YD2), ..., (XDn, YDn) of each copied point, determine the equation L of the straight line corresponding to the copied line segment parallel to the last line segment for each copied path using the point-slope formula. Dn for:

[0141] Y = K C0D0 *(X-XDn)+YDn

[0142] Specifically, if C0D0 is a vertical line segment, then the equation L of the straight line corresponding to the copied line segment parallel to the last line segment of each copied route is determined. Dn for:

[0143] Pn = XDn

[0144] Optionally, the equation L of the straight line corresponding to the copied line segment parallel to the last line segment of each copied trace is set. Dn Store in list D, i.e., listD = {(1,L} D1 (2,L) D2 )…(i,L Di )…(N,L Dn )}.

[0145] In this embodiment of the invention, a detailed description is provided of how to determine the equation of the straight line corresponding to the copy line segment parallel to the last line segment for each copied trace, in order to prepare for the copying of the trace.

[0146] In some embodiments, Figure 9 This is a flowchart illustrating a method for replicating PCB traces according to an embodiment of the present invention, as shown in Figure 6. Figure 9 As shown, step 630 includes: performing the following steps one by one for each intermediate segment of the reference trace:

[0147] Step 910: Based on the endpoint coordinates of the current intermediate line segment of the reference route, determine the slope corresponding to the current intermediate line segment;

[0148] In practical implementation, it is assumed that Figure 3 In this context, B0C0 represents the current intermediate line segment. Based on the endpoint coordinates (XB0, YB0) and (XC0, YC0) of the current intermediate line segment B0C0 of the baseline routing, we first obtain the coordinates using the two-point vector formula. Then determine the slope of the line containing the current intermediate line segment B0C0. It should be noted that the case where line segment A0B0 is perpendicular is excluded here.

[0149] Step 920: Based on the slope and the endpoint coordinates, determine the equation of the line corresponding to the current intermediate line segment;

[0150] In practical implementation, based on the slope K B0C0 Given the endpoint coordinates (XB0, YB0) and (XC0, YC0) of the current intermediate line segment B0C0, determine the equation L of the line corresponding to the current intermediate line segment using the point-slope form. B0C0 for: The corresponding general equation is:

[0151] (YC0-YB0)*X-(XC0-XB0)*Y-(YC0-YB0)*XC0+YC0*(YC0-YB0)=0

[0152] Step 930: Determine the value of the constant term of the equation of the line corresponding to each copied line segment parallel to the current intermediate line segment, based on the formula for the distance between parallel lines, the copy spacing, and the copy direction;

[0153] In practical implementation, assume that it is parallel to line L. B0C0 The equation of the parallel straight line L after each interval D is... B0C0n The equation is (YC0-YB0)*X-(XC0-XB0)*Y+Kn=0, where Kn is a constant term. L is obtained using the general equation formula for the spacing between parallel lines. B0C0n :

[0154]

[0155] Starting from 1 and going up to N, we calculate the values ​​of K1, K2, ..., Kn. Each calculated Kn has two values. At this point, we need to further determine the value of Kn based on the relationship between the position of the copied line clicked by the designer and the position of the baseline line. If the copy direction clicked by the designer is to the right of the baseline line, we take the larger Kn; otherwise, we take the smaller Kn. This determines the constant term of the equation of the line corresponding to each copied line segment parallel to the current intermediate line segment.

[0156] Step 940: Based on the value of the constant term, determine the equations of the lines corresponding to each copied line segment that is parallel to the current intermediate line segment.

[0157] In practice, the value of Kn obtained in step 930 is substituted into formula (e) to determine the equation L of the line corresponding to each copied line segment parallel to the current intermediate line segment. B0C0n .

[0158] Specifically, if B0C0 is a vertical line segment, based on the relationship between the position of the copied line clicked by the designer and the position of the reference trace, if the position of the copied line clicked by the designer is to the right of the reference trace, then the equation of the straight line L parallel to B0C0 after each interval D is... B0C0n The expression is: X = XC0 + N*D, and conversely, X = XC0 - N*D.

[0159] Optionally, the equations L of the lines corresponding to each copied line segment parallel to the current intermediate line segment are... B0C0n Store in an intermediate list listBC, i.e., listBC = {(1,L B0C01 (2,L) B0C02 )…(i,L B0C0i )…(N,L B0C0n )}.

[0160] Similarly, for each intermediate segment of the reference trace, the above steps are performed one by one, and the straight line equation corresponding to each intermediate segment of the reference trace is stored in the corresponding intermediate list.

[0161] In this embodiment of the invention, a detailed description is provided of how to determine the linear equations corresponding to the copied line segments that are parallel to each intermediate line segment of the reference trace at each interval of the specified spacing, in order to prepare for the copying of the trace.

[0162] In some embodiments, with Figure 3 For example, let i take values ​​from 1 to N, and retrieve line L from listA, listBC, and listD respectively. Ai L B0C0i L Di The equation of the line is given, and L is calculated. Ai and L B0C0i The intersection point Bi,L B0C0i and L Di The intersection point Ci is connected to Ai, Bi, Ci and Di in sequence to automatically draw each copy line according to a fixed copy spacing and copy number.

[0163] In this embodiment of the invention, the equations corresponding to each segment of each copied line are obtained from listA (containing the equations of each copied line segment parallel to the first line segment), listD (containing the equations of each copied line segment parallel to the last line segment of the reference line), and listBC (containing the equations of each copied line segment parallel to the middle line segment of the reference line). Then, the coordinates of the intersection points between the segments of each copied line are determined. Furthermore, by combining the starting coordinates and ending coordinates of each copied line, each copied line is automatically drawn according to a fixed copying interval and a fixed copying number.

[0164] The PCB trace replication apparatus provided by the present invention is described below. The PCB trace replication apparatus described below and the PCB trace replication method described above can be referred to in correspondence.

[0165] Figure 10 This is a schematic diagram of the PCB trace replication device provided in one embodiment of the present invention, as shown below. Figure 10 As shown, the PCB trace replication device 1000 includes:

[0166] The acquisition unit 1010 is used to acquire the copy spacing, copy quantity, and copy direction corresponding to the baseline trace;

[0167] The first determining unit 1020 is used to determine the endpoint coordinates of each segment of the reference trace;

[0168] The second determining unit 1030 is used to determine the starting coordinates and ending coordinates of N copied routes, as well as the straight line equations corresponding to each line segment of the N copied routes, based on the endpoint coordinates of each line segment of the reference route, the copying spacing and the copying direction, where N is equal to the copying quantity.

[0169] The drawing unit 1040 is used to determine the coordinates of the intersection points between the line segments of each copied route according to the straight line equations corresponding to each line segment of each copied route, and automatically draw each copied route based on the coordinates of the intersection points between the line segments of each copied route, combined with the starting coordinates and ending coordinates of each copied route.

[0170] In some embodiments, determining the start-point and end-point coordinates of N copied routes based on the endpoint coordinates of each segment of the reference route, the copy spacing, and the copy direction, as well as the straight line equations corresponding to each segment of the N copied routes, includes:

[0171] Based on the endpoint coordinates of the first line segment of the reference trace and the copying direction, determine the starting coordinates and corresponding straight line equations of each copied line segment that is parallel to the first line segment of the reference trace at each copying interval.

[0172] Based on the endpoint coordinates of the last line segment of the reference trace and the copying direction, determine the endpoint coordinates and corresponding straight line equations of each copied line segment that is parallel to the last line segment of the reference trace at each copying interval.

[0173] Based on the endpoint coordinates of each intermediate segment of the reference trace and the copying direction, the equations of the straight lines corresponding to the copying segments parallel to each intermediate segment of the reference trace at each copying interval are determined.

[0174] In some embodiments, determining the starting coordinates and corresponding straight line equations of each copied line segment parallel to the first line segment of the reference trace, based on the endpoint coordinates of the first line segment of the reference trace and the copying direction, at intervals of the copying spacing, includes:

[0175] Based on the endpoint coordinates of the first line segment of the reference trace, determine the slope corresponding to the first line segment;

[0176] Draw a first straight line perpendicular to the first line segment from the starting point of the first line segment. On the first straight line, starting from the starting point of the first line segment, set a copy point every copy interval according to the copy direction until N copy points are set.

[0177] Based on the first distance formula and the first dot product formula, the coordinates of the N copy points are calculated, and the coordinates of the N copy points are used as the starting coordinates of each copy line segment that is parallel to the first line segment at each copy interval.

[0178] Based on the slope and the coordinates of each copy point, determine the equation of the straight line corresponding to the copy line segment parallel to the first line segment for each copy route.

[0179] In some embodiments, determining the endpoint coordinates and corresponding straight line equations of each copied line segment parallel to the last line segment of the reference trace, based on the endpoint coordinates of the last line segment of the reference trace and the copying direction at intervals of the copying distance, includes:

[0180] Based on the endpoint coordinates of the last line segment of the reference route, determine the slope corresponding to the last line segment;

[0181] Draw a second straight line perpendicular to the last line segment from the end point of the last line segment. Starting from the end point of the last line segment on the second straight line, set a copy point every copy interval according to the copy direction until N copy points are set.

[0182] Based on the second distance formula and the second dot product formula, the coordinates of the N copy points are calculated, and the coordinates of the N copy points are used as the endpoint coordinates of each copy line segment that is parallel to the last line segment at each copy interval.

[0183] Based on the slope and the coordinates of each of the copy points, determine the equation of the straight line corresponding to the copy line segment parallel to the last line segment for each copy path.

[0184] In some embodiments, determining the linear equations of copied line segments parallel to the intermediate segments of the reference route at each copying interval based on the endpoint coordinates of each intermediate segment of the reference route and the copying direction includes:

[0185] For each intermediate segment of the aforementioned baseline trace, perform the following steps one by one:

[0186] Based on the endpoint coordinates of the current intermediate line segment of the reference route, determine the slope corresponding to the current intermediate line segment;

[0187] Based on the slope and the endpoint coordinates, determine the equation of the line corresponding to the current intermediate line segment;

[0188] Based on the formula for the distance between parallel lines, the copy spacing, and the copy direction, determine the value of the constant term of the equation of the line corresponding to each copied line segment parallel to the current intermediate line segment;

[0189] Based on the value of the constant term, determine the equations of the lines corresponding to each copied line segment that is parallel to the current intermediate line segment.

[0190] In some embodiments, automatically drawing each copied route based on the coordinates of the intersection points between the segments of each copied route, combined with the start and end coordinates of each copied route, includes:

[0191] Each copied route is automatically drawn based on the starting coordinates of the first line segment, the coordinates of the intersection points between the line segments of each copied route, and the ending coordinates of the last line segment of each copied route.

[0192] In some embodiments, the first dot product formula is: the dot product between the first vector and the second vector is zero, wherein the first vector is the vector corresponding to the first line segment of the reference trace, and the second vector is the vector corresponding to the line segment formed by each copy point and the starting point of the first line segment of the reference trace;

[0193] The first distance formula is: the distance between the starting point of the first segment of the reference trace and each copy point is equal to the product of the serial number corresponding to each copy point and the copy spacing.

[0194] In some embodiments, the second dot product formula is: the dot product between the third vector and the fourth vector is zero, wherein the third vector is the vector corresponding to the last line segment of the reference trace, and the fourth vector is the vector corresponding to the line segment formed by each copy point and the endpoint of the last line segment of the reference trace;

[0195] The second distance formula is: the distance between the end point of the last segment of the reference trace and each copy point is equal to the product of the serial number of each copy point and the copy spacing.

[0196] It should be noted that the PCB trace replication device provided in this embodiment of the invention can implement all the method steps implemented in the above-mentioned PCB trace replication method embodiment and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.

[0197] Figure 11 This is a schematic diagram of the physical structure of an electronic device provided in one embodiment of the present invention, as shown below. Figure 11 As shown, the electronic device may include a processor 1110, a communications interface 1120, a memory 1130, and a communication bus 1140, wherein the processor 1110, the communications interface 1120, and the memory 1130 communicate with each other through the communication bus 1140. The processor 1110 can call logic instructions in the memory 1130 to execute a PCB trace replication method, which includes: obtaining the replication spacing and replication quantity corresponding to the reference trace; determining the endpoint coordinates of each segment of the reference trace; determining the straight line equations corresponding to each segment of N replicated traces based on the endpoint coordinates of each segment of the reference trace and the replication spacing, where N is equal to the replication quantity; determining the coordinates of the intersection points between each segment of each replicated trace according to the straight line equations corresponding to each segment of each replicated trace; and automatically drawing each replicated trace based on the coordinates of the intersection points between each segment of each replicated trace.

[0198] Furthermore, the logical instructions in the aforementioned memory 1130 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to related technologies, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0199] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the PCB trace copying method provided by the above methods. The method includes: obtaining the copying spacing, copying quantity, and copying direction corresponding to the reference trace; determining the endpoint coordinates of each segment of the reference trace; determining the starting coordinates and ending coordinates of N copied traces, and the straight line equations corresponding to each segment of the N copied traces, based on the endpoint coordinates of each segment of the reference trace, the copying spacing, and the copying direction, where N is equal to the copying quantity; determining the coordinates of the intersection points between each segment of each copied trace according to the straight line equations corresponding to each segment of each copied trace; and automatically drawing each copied trace based on the coordinates of the intersection points between each segment of each copied trace, combined with the starting coordinates and ending coordinates of each copied trace.

[0200] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a PCB trace copying method provided by the above methods. The method includes: obtaining the copying spacing, copying quantity, and copying direction corresponding to a reference trace; determining the endpoint coordinates of each segment of the reference trace; determining the starting coordinates and ending coordinates of N copied traces, and the straight line equations corresponding to each segment of the N copied traces, based on the endpoint coordinates of each segment of the reference trace, the copying spacing, and the copying direction, where N is equal to the copying quantity; determining the coordinates of the intersection points between each segment of each copied trace according to the straight line equations corresponding to each segment of each copied trace; and automatically drawing each copied trace based on the coordinates of the intersection points between each segment of each copied trace, combined with the starting coordinates and ending coordinates of each copied trace.

[0201] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0202] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of software products. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0203] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for replicating PCB traces, characterized in that, include: Obtain the copy spacing, copy quantity, and copy direction corresponding to the baseline trace; Determining the endpoint coordinates of each segment of the reference routing includes: sequentially obtaining the start coordinates and end coordinates of each segment of the reference routing; deduplicating the obtained coordinates and arranging them in descending order of the vertical coordinates to obtain the endpoint coordinates of each segment of the reference routing. Based on the endpoint coordinates of each segment of the baseline trace, the replication spacing, and the replication direction, the starting and ending coordinates of N replication traces, as well as the corresponding line equations for each segment of the N replication traces, are determined. This includes: based on the endpoint coordinates of the first segment of the baseline trace and the replication direction, determining the starting coordinates and corresponding line equations of each replication segment parallel to the first segment of the baseline trace at each replication spacing; based on the endpoint coordinates of the last segment of the baseline trace and the replication direction, determining the ending coordinates and corresponding line equations of each replication segment parallel to the last segment of the baseline trace at each replication spacing; based on the endpoint coordinates of each intermediate segment of the baseline trace and the replication direction, determining the corresponding line equations of each replication segment parallel to each intermediate segment of the baseline trace at each replication spacing; where N equals the replication quantity. Based on the equations of the straight lines corresponding to each segment of each copied route, the coordinates of the intersection points between each segment of each copied route are determined. Based on the coordinates of the intersection points between each segment of each copied route, combined with the starting and ending coordinates of each copied route, each copied route is automatically drawn. Based on the endpoint coordinates of each intermediate segment of the reference trace and the replication direction, the equations of the straight lines corresponding to the replicated segments parallel to each intermediate segment of the reference trace at each replication interval are determined, including: For each intermediate segment of the aforementioned baseline trace, perform the following steps one by one: Based on the endpoint coordinates of the current intermediate line segment of the reference route, determine the slope corresponding to the current intermediate line segment; Based on the slope and the endpoint coordinates, determine the equation of the line corresponding to the current intermediate line segment; Based on the formula for the distance between parallel lines, the copy spacing, and the copy direction, determine the value of the constant term of the equation of the line corresponding to each copied line segment parallel to the current intermediate line segment; Based on the value of the constant term, determine the equations of the lines corresponding to each copied line segment that is parallel to the current intermediate line segment.

2. The method of claim 1, wherein, Based on the endpoint coordinates of the first line segment of the reference trace and the copying direction, the starting coordinates and corresponding straight line equations of each copied line segment parallel to the first line segment of the reference trace at each copying interval are determined, including: Based on the endpoint coordinates of the first line segment of the reference trace, determine the slope corresponding to the first line segment; Draw a first straight line perpendicular to the first line segment from the starting point of the first line segment. On the first straight line, starting from the starting point of the first line segment, set a copy point every copy interval according to the copy direction until N copy points are set. Based on the first distance formula and the first dot product formula, the coordinates of the N copy points are calculated, and the coordinates of the N copy points are used as the starting coordinates of each copy line segment that is parallel to the first line segment at each copy interval. Based on the slope and the coordinates of each copy point, determine the equation of the straight line corresponding to the copy line segment parallel to the first line segment for each copy route.

3. The method of claim 1, wherein the PCB trace is replicated by: Based on the endpoint coordinates of the last line segment of the reference trace and the copying direction, the endpoint coordinates and corresponding straight line equations of each copied line segment parallel to the last line segment of the reference trace at each copying interval are determined, including: Based on the endpoint coordinates of the last line segment of the reference route, determine the slope corresponding to the last line segment; Draw a second straight line perpendicular to the last line segment from the end point of the last line segment. Starting from the end point of the last line segment on the second straight line, set a copy point every copy interval according to the copy direction until N copy points are set. Based on the second distance formula and the second dot product formula, the coordinates of the N copy points are calculated, and the coordinates of the N copy points are used as the endpoint coordinates of each copy line segment that is parallel to the last line segment at each copy interval. Based on the slope and the coordinates of each of the copy points, determine the equation of the straight line corresponding to the copy line segment parallel to the last line segment for each copy path.

4. The method for replicating PCB traces according to any one of claims 1-3, characterized in that, The method automatically draws each copied route based on the coordinates of the intersection points between the segments of each copied route, combined with the starting and ending coordinates of each copied route, including: Each copied route is automatically drawn based on the starting coordinates of the first line segment, the coordinates of the intersection points between the line segments of each copied route, and the ending coordinates of the last line segment of each copied route.

5. The PCB trace replication method according to claim 2, characterized in that, The first dot product formula is: the dot product between the first vector and the second vector is zero, wherein the first vector is the vector corresponding to the first line segment of the reference trace, and the second vector is the vector corresponding to the line segment formed by each copy point and the starting point of the first line segment of the reference trace; The first distance formula is: the distance between the starting point of the first segment of the reference trace and each copy point is equal to the product of the serial number corresponding to each copy point and the copy spacing.

6. The PCB trace replication method according to claim 3, characterized in that, The second dot product formula is: the dot product between the third vector and the fourth vector is zero, wherein the third vector is the vector corresponding to the last line segment of the reference trace, and the fourth vector is the vector corresponding to the line segment formed by each copy point and the endpoint of the last line segment of the reference trace; The second distance formula is: the distance between the end point of the last segment of the reference trace and each copy point is equal to the product of the serial number of each copy point and the copy spacing.

7. A device for replicating PCB traces, characterized in that, include: The acquisition unit is used to acquire the copy spacing, copy quantity, and copy direction corresponding to the baseline trace; The first determining unit is used to determine the endpoint coordinates of each segment of the reference routing, including: sequentially obtaining the starting coordinates and ending coordinates of each segment of the reference routing; performing deduplication on the obtained coordinates and arranging them in descending order of the vertical coordinates to obtain the endpoint coordinates of each segment of the reference routing. The second determining unit is used to determine the straight line equations corresponding to each segment of the N copied routes based on the endpoint coordinates of each segment of the reference route and the copying interval, including: determining the starting point coordinates and corresponding straight line equations of each copied line segment parallel to the first segment of the reference route at each copying interval based on the endpoint coordinates of the first segment of the reference route and the copying direction; determining the ending point coordinates and corresponding straight line equations of each copied line segment parallel to the last segment of the reference route at each copying interval based on the endpoint coordinates of the last segment of the reference route and the copying direction; and determining the straight line equations corresponding to each copied line segment parallel to each intermediate segment of the reference route at each copying interval based on the endpoint coordinates of each intermediate segment of the reference route and the copying direction. The N is equal to the number of copies; the determination of the linear equations corresponding to the copied segments parallel to the intermediate segments of the reference route at each copy interval based on the endpoint coordinates of each intermediate segment of the reference route and the copy direction includes: for each intermediate segment of the reference route, performing the following steps one by one: determining the slope corresponding to the current intermediate segment based on the endpoint coordinates of the current intermediate segment of the reference route; determining the linear equation corresponding to the current intermediate segment based on the slope and the endpoint coordinates; determining the constant term of the linear equation corresponding to each copied segment parallel to the current intermediate segment according to the parallel line distance formula, the copy interval, and the copy direction; determining the linear equation corresponding to each copied segment parallel to the current intermediate segment based on the value of the constant term; The drawing unit is used to determine the coordinates of the intersection points between the line segments of each copied route based on the straight line equations corresponding to each line segment of each copied route, and automatically draw each copied route based on the coordinates of the intersection points between the line segments of each copied route.

Citation Information

Patent Citations

  • Method for designing irregular parallel lines based on Cadence design software

    CN111241779A

  • Method and device for realizing automatic equal spacing of PCB wiring and electronic equipment

    CN113486624A