Method for detecting closed loop path of geometric figure and electronic device
By detecting the target point of the component in the computer-aided design image file and moving the component in different directions to determine the minimum gap position, the problem of incorrect determination of the starting point of component analysis in the prior art is solved, accurate dimensional chain analysis is achieved, and product manufacturing yield is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2026-03-10
AI Technical Summary
Existing dimensional chain analysis methods are prone to errors in determining the starting point of component analysis, resulting in large errors in tolerance analysis results and reduced manufacturing yield.
By detecting components in computer-aided design image files, target points are defined and components are moved in different directions to determine the minimum gap position. The size path of the component is determined by combining the target point position.
Accurately determine component dimensions and dimensional chains to reduce tolerance analysis errors and improve product manufacturing yield.
Smart Images

Figure CN121637686A_ABST
Abstract
Description
Technical Field
[0001] This application relates to a method and electronic device for detecting closed loop paths of geometric figures, and more particularly to a method and electronic device for detecting closed loop paths of geometric figures that can be used for dimensional chain analysis. Background Technology
[0002] During product manufacturing and assembly, issues such as component collisions, excessive gaps, or step differences often occur, leading to non-compliance with appearance specifications or increased costs associated with mold modifications. Therefore, to avoid these problems, tolerance analysis is necessary during product design to confirm the rationality of the tolerance design. Dimensional chain analysis is a common tolerance analysis method. Existing dimensional chain analysis methods involve creating cross-sectional views of a 3D model using 3D software, marking the path on the cross-section, and then using 3D analysis software to measure the path dimensions and fill the dimensions and tolerances into the analysis table. However, due to the complexity of the structural and assembly relationships, it is easy to encounter situations where the starting point of the analysis for the target component cannot be determined. Furthermore, errors in component size or dimensional chain judgment often occur, leading to errors in the tolerance analysis results and reducing manufacturing yield. Therefore, existing technologies need improvement. Summary of the Invention
[0003] Therefore, it is necessary to provide a method and electronic device for detecting closed loop paths of geometric figures that can be used for dimensional chain analysis, in order to address the above problems.
[0004] The technical solution is as follows:
[0005] This application provides a method for detecting closed-loop paths in geometric figures, including:
[0006] Obtain a computer-aided design image file, and detect a first component and a second component in the computer-aided design image file;
[0007] Define the target point and its location on the first component and the second component;
[0008] During a first operation, the first component is moved from an initial position toward a first direction and it is detected whether the first component and the second component are in contact;
[0009] Based on the detection of the first component touching the second component during the first operation, a first minimum gap position is determined;
[0010] During a second operation, the first component is moved from the initial position toward a second direction and it is detected whether the first component and the second component are in contact, wherein the second direction is different from the first direction;
[0011] Based on the detection of the first component touching the second component during the second operation, a second minimum gap position is determined;
[0012] The size paths of the first component and the second component are determined based on the position of the target point on the first component, the position of the target point on the second component, the position of the first minimum gap, and the position of the second minimum gap.
[0013] The technical solution will be further explained below:
[0014] In one embodiment, the step of determining the position of the first minimum gap based on the detection of the first component touching the second component during the first operation includes:
[0015] When the first component touches the second component during the first operation, a first contact point on the first component and a first position of the first contact point are determined; and
[0016] Determine a second position of the first contact point of the first component when the first component is in the initial position; and
[0017] The first position and the second position of the first contact point are used as the first minimum gap position.
[0018] In one embodiment, the step of determining the second minimum gap position based on detecting that the first component touches the second component during the second operation includes:
[0019] During the second operation, when the first component touches the second component, a second contact point on the first component and a first position of the second contact point are determined; and
[0020] Determine a second position of the second contact point of the first component when the first component is in the initial position; and
[0021] The first position and the second position of the second contact point are used as the second minimum gap position.
[0022] In one embodiment, the step of determining the size paths of the first component and the second component based on the position of the target point on the first component, the position of the target point on the second component, the position of the first minimum gap, and the position of the second minimum gap includes:
[0023] Starting from the position of the target point of the first component, determine the dimensional path formed between the position of the target point of the first component and the relevant position on the first component; and
[0024] The dimensional path formed between the relevant position of the first component and the position of the target point of the second component is determined.
[0025] In one embodiment, the closed-loop path detection method further includes:
[0026] During the first operation, if the distance the first component moves from the initial position along the first direction is greater than a target gap size, it is determined that there is no contact between the first component and the second component; and during the second operation, if the distance the first component moves from the initial position along the second direction is greater than the target gap size, it is determined that there is no contact between the first component and the second component.
[0027] This application also provides an electronic device, including:
[0028] A storage device for storing instructions; and
[0029] A processing circuit configured to execute the instructions, wherein the instructions include:
[0030] A computer-aided design image file is obtained, and a first component and a second component are detected in the computer-aided design image file;
[0031] Define the target point and its location on the first component and the second component;
[0032] During a first operation, the first component is moved from an initial position toward a first direction and it is detected whether the first component and the second component are in contact;
[0033] Based on the detection of the first component touching the second component during the first operation, a first minimum gap position is determined;
[0034] During a second operation, the first component is moved from the initial position toward a second direction and it is detected whether the first component and the second component are in contact, wherein the second direction is different from the first direction;
[0035] Based on the detection of the first component touching the second component during the second operation, a second minimum gap position is determined;
[0036] The size paths of the first component and the second component are determined based on the position of the target point on the first component, the position of the target point on the second component, the position of the first minimum gap, and the position of the second minimum gap.
[0037] In one embodiment, the instructions include:
[0038] When the first component touches the second component during the first operation, a first contact point on the first component and a first position of the first contact point are determined; and
[0039] Determine a second position of the first contact point of the first component when the first component is in the initial position; and
[0040] The first position and the second position of the first contact point are used as the first minimum gap position.
[0041] In one embodiment, the instructions include:
[0042] During the second operation, when the first component touches the second component, a second contact point on the first component and a first position of the second contact point are determined; and
[0043] Determine a second position of the second contact point of the first component when the first component is in the initial position; and
[0044] The first position and the second position of the second contact point are used as the second minimum gap position.
[0045] In one embodiment, the instructions include:
[0046] Starting from the position of the target point of the first component, determine the dimensional path formed between the position of the target point of the first component and the relevant position on the first component; and
[0047] The dimensional path formed between the relevant position of the first component and the position of the target point of the second component is determined.
[0048] In one embodiment, the instructions include:
[0049] During the first operation, if the distance the first component moves from the initial position along the first direction is greater than a target gap size, it is determined that there is no contact between the first component and the second component; and during the second operation, if the distance the first component moves from the initial position along the second direction is greater than the target gap size, it is determined that there is no contact between the first component and the second component.
[0050] In the aforementioned method and electronic device for detecting closed-loop paths of geometric shapes, since the dimensional paths of the first component and the second component can be determined based on the positions of the target points, the first minimum gap position, and the second minimum gap position on the first component and the second component, the closed-loop path detection method can not only effectively determine the starting point of the target component, but also accurately determine the component size or dimensional chain, thereby reducing the error generated during tolerance analysis and effectively improving the product manufacturing yield. Attached Figure Description
[0051] Figure 1 This is a schematic diagram of a process according to an embodiment of the present invention.
[0052] Figure 2 This is a schematic diagram of the structure for detecting adjacent geometric components according to an embodiment of the present invention.
[0053] Figure 3 This is a schematic diagram of the structure of the first component moving along a first direction and touching the second component, according to an embodiment of the present invention.
[0054] Figure 4 This is a structural diagram showing the position of the first contact point when the first component is in its initial position according to an embodiment of the present invention.
[0055] Figure 5 This is a schematic diagram of the structure of the first component moving along the second direction and touching the second component in an embodiment of the present invention.
[0056] Figure 6 This is a structural diagram showing the position of the second contact point when the first component is in its initial position according to an embodiment of the present invention.
[0057] Figure 7 This is a schematic diagram of the dimensional paths of the first component and the second component in an embodiment of the present invention.
[0058] Figure 8 This is a structural schematic diagram of the dimensional path for the non-axial hole matching case of adjacent components in an embodiment of the present invention.
[0059] Explanation of reference numerals in the attached figures:
[0060] 1. Process; 10. First component; 20. Second component; a0, a1, a2, b1, b2, Ta, Tb, Position; CP1, CP2, Contact point; D1, D2, Direction; S100, S102, S104, S106, S108, S110, S112, S114, S116, Step; TP1, TP2, Target point. Detailed Implementation
[0061] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application are described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.
[0062] In the description of this application, it should be understood that if terms such as "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential" appear, these terms indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0063] Furthermore, where the terms "first" and "second" appear, these terms are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, where the term "multiple" appears, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0064] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "joining," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise expressly limited. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0065] In this application, unless otherwise expressly specified and limited, the use of descriptions such as "above" or "below" the second feature indicates that the first and second features are in direct contact or indirect contact via an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. Similarly, "below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0066] It should be noted that if an element is referred to as being "fixed to" or "set on" another element, it can be directly on the other element or there may be an intervening element. If an element is considered to be "connected to" another element, it can be directly connected to the other element or there may be an intervening element. If so, the terms "vertical," "horizontal," "upper," "lower," "left," "right," and similar expressions used in this application are for illustrative purposes only and do not represent the only possible implementation.
[0067] This invention can be applied to the product design process of computer-aided design, and can provide the ability to detect closed-loop paths between adjacent geometric components during the design process. Please refer to... Figure 1 , Figure 1 This is a schematic diagram of process 1 according to an embodiment of the present invention. Process 1 is used to process the detection of closed loop paths of adjacent components. Process 1 includes the following steps:
[0068] Step S100: Begin.
[0069] Step S102: Obtain a computer-aided design image file, and detect a first component and a second component in the computer-aided design image file.
[0070] Step S104: Define the target point and its location on the first component and the second component.
[0071] Step S106: During a first operation, the first component is moved from an initial position toward a first direction and it is detected whether the first component and the second component are in contact.
[0072] Step S108: Based on the detection that the first component touches the second component during the first operation, a first minimum gap position is determined.
[0073] Step S110: During a second operation, the first component is moved from the initial position toward a second direction and it is detected whether the first component and the second component are in contact, wherein the second direction is different from the first direction.
[0074] Step S112: Based on the detection of the first component touching the second component during the second operation, a second minimum gap position is determined.
[0075] Step S114: Determine the size path of the first component and the second component based on the position of the target point on the first component, the position of the target point on the second component, the position of the first minimum gap, and the position of the second minimum gap.
[0076] Step S116: End.
[0077] According to process 1, in step S102, the embodiments of the present invention can be executed on computer-aided design software for an electronic device. The electronic device may include a computer device, and the computer device is equipped with computer-aided design software, which may be AutoCAD, Creo, Python, Pro / Engineer, SolidWorks, but is not limited thereto. The embodiments of the present invention can generate a computer-aided design image file through the computer-aided design software. The embodiments of the present invention can generate a computer-aided design image file that includes at least a first component and a second component through the computer-aided design software. The embodiments of the present invention can use the computer-aided design software to take a target cross-sectional screenshot of the three-dimensional model of the generated computer-aided design image file, obtain a cross-sectional view, and store it as a two-dimensional computer-aided design image file. For example, a cross-sectional screenshot can be taken of the location in the three-dimensional model of a product component where tolerance analysis is to be performed to obtain a corresponding cross-sectional view, and the cross-sectional view can be stored as a two-dimensional view. For example, the cross-sectional view can be stored in Drawing Exchange Format (DXF) file format, but is not limited thereto. For example, Creo analysis software can be used to read computer-aided design image files that include a first component and a second component, to obtain a cross-sectional view of the three-dimensional model in the image file, and then save it as a computer-aided design image file in DXF file format.
[0078] In step S102, after obtaining a computer-aided design image file of a two-dimensional cross-sectional view after the target cross-section is captured, this embodiment of the invention can detect a first component 10 and a second component 20 in the computer-aided design image file. In one embodiment, the computer-aided design image file of the two-dimensional cross-sectional view can be read and imported using Python software. For example, the ezdxf function library of Python software can be used to read and import the computer-aided design image file of the two-dimensional cross-sectional view in DXF file format, and then the Shapely suite can be used to perform relevant geometric operations on the image file to convert the geometric shape patterns of each component. Then, a first component and a second component can be detected in the computer-aided design image file. Figure 2 As shown, Python software is used to detect the components of a computer-aided design image. The computer-aided design image file includes a first component 10 and a second component 20. Subsequently, through process 1 of this embodiment, this embodiment can provide a closed-loop dimension path for processing and detecting adjacent first component 10 and second component 20 during the design process.
[0079] In step S104, target points and their locations can be defined on the first component 10 and the second component 20 in the computer-aided design image file. In one embodiment, the location where tolerance analysis is to be performed can be set as the target point. For example, the target point can be set at the gap or step difference after the two components are assembled. Figure 2 As shown, a target point TP1 is defined in the first component 10, and its position is Ta. A target point TP2 is defined in the second component 20, and its position is Tb. The distance between the positions Ta of target point TP1 and Tb of target point TP2 can be the gap after the first component 10 and the second component 20 are assembled. The distance between the positions Ta of TP1 and Tb of target point TP2 can be assumed to be a target gap size, which can be a gap size within the allowable tolerance range.
[0080] In step S106, during a first operation, the first component 10 can be moved from an initial position toward a first direction, and it can be detected whether the first component 10 and the second component 20 are in contact. During the first operation, before moving the first component 10 toward the first direction, the positions of each component of the first component 10 when the first component 10 is in the initial position, and the positions of each component of the second component 20 when the second component 20 is in the initial position, can be recorded. Figure 2As shown, when the first component 10 is in an initial position a0, the positions of all constituent points of the first component 10 can be recorded. Next, the first component 10 is moved from the initial position a0 towards a first direction D1, and a touch detection is performed to detect whether a touch occurs between the first component 10 and the second component 20. If a touch is detected between the first component 10 and the second component 20 during the movement of the first component 10, the touch detection ends, and the movement gap position of the touch event is determined accordingly. Furthermore, if the movement distance of the first component 10 towards the first direction is greater than a predetermined value (e.g., a target gap size), the touch detection ends, and it is determined that there was no touch between the first component 10 and the second component 20 when the first component moved from the initial position towards the first direction.
[0081] In one embodiment, the touch detection determination regarding whether the first component 10 and the second component 20 are in contact can be made by detecting whether the two components include at least one common point. When at least one common point is detected between the first component 10 and the second component 20, it indicates that the first component 10 and the second component 20 are in contact, and the common point is the touch point. For example, when the first component 10 or the second component 20 moves, the Touches function library in the Shapely suite of Python software can be used to determine whether the first component 10 and the second component 20 have at least one common point. When at least one common point is detected between the first component 10 and the second component 20, it indicates that the first component 10 and the second component 20 are in contact, and the common point is the touch point. For example, when the first component 10 or the second component 20 moves, the Touches library in the Shapely suite of Python software can be used to determine whether the first component 10 and the second component 20 have at least one common point, and the None library in the Shapely suite can be used to determine whether the first component 10 and the second component 20 are not touching. When at least one common point is detected between the first component 10 and the second component 20, it means that the first component 10 and the second component 20 have touched, and the common point is the touch point. In addition, the Intersects library in the Shapely suite of Python software can be used to determine whether there is interference between the first component 10 and the second component 20. If there is interference, it means that the two may have an internal common point. At this time, in addition to the boundary points touching, the first component 10 and the second component 20 also have interference at their internal common points. When interference is determined between the first component 10 and the second component 20, the movement gap position of the touch event is not calculated based on this relative position.
[0082] In step S108, based on the detection of the first component 10 contacting the second component 20 during the first operation period, this embodiment of the invention can determine a first minimum gap position. When the first component 10 is detected contacting the second component 20 during the first operation period, a first contact point on the first component and the position of the first contact point can be determined. For example... Figure 3 As shown, when the first component 10 touches the second component 20, a portion of the first component 10 (i.e., the contact point CP1) touches the second component 20. When the first component 10 and the second component 20 touch, the position of the contact point CP1 on the first component 10 is b1. For example, when the first component 10 moves, the Touches library in the Shapely suite of Python software can be used to determine the common point between the first component 10 and the second component 20. When the common point between the first component 10 and the second component 20 is detected, the contact point CP1 on the first component 10 and its current position b1 can be determined.
[0083] Furthermore, since the positions of all constituent parts of the first component 10 when it is in the initial position a0 have been recorded in step S106, the position of the contact point CP1 on the first component 10 when it is in the initial position a0 can be determined. For example... Figure 4 As shown, when the first component 10 is in the initial position a0, the position of the contact point CP1 on the first component 10 is a1. In this embodiment of the invention, the position a1 of the contact point CP1 of the first component 10 when it is in the initial position a0 and the position b1 of the contact point CP1 of the first component 10 when it contacts the second component can be determined as the first minimum gap position. That is, the first minimum gap position includes positions a1 and b1 related to the first contact point CP1 of the first component 10.
[0084] In step S110, during a second operation, the first component 10 can be moved from its initial position toward a second direction, and it can be detected whether the first component 10 and the second component 20 are in contact. Figure 4 As shown, when the first component 10 is in an initial position a0, the first component 10 is moved from the initial position a0 towards a second direction D2, and a touch detection is performed to detect whether there is a touch between the first component 10 and the second component 20. If it is determined that there is a touch between the first component 10 and the second component 20 during the movement of the first component 10, the touch detection ends and the movement gap position of the touch event is determined accordingly. Furthermore, if the movement distance of the first component 10 towards the second direction D2 is greater than a predetermined value (e.g., a target gap size), the touch detection ends and it is determined that there is no touch between the first component 10 and the second component 20 when the first component moves from the initial position towards the second direction.
[0085] In step S112, based on the detection of the first component 10 contacting the second component 20 during the second operation, this embodiment of the invention can determine a second minimum gap position. When the first component 10 is detected contacting the second component 20 during the second operation, a second contact point on the first component and the position of the second contact point can be determined. For example... Figure 5 As shown, when the first component 10 touches the second component 20, a portion of the first component 10 (i.e., contact point CP2) touches the second component 20. When the first component 10 and the second component 20 touch, the position of contact point CP2 on the first component 10 is b2. For example, when the first component 10 moves, the Touches function library in the Shapely suite of Python software can be used to determine the common point between the first component 10 and the second component 20. When the first component 10 and the second component 20 are detected to be a common point, the position b2 of contact point CP2 on the first component 10 and the position of contact point CP1 at this time can be determined. Since the positions of all constituent parts of the first component 10 when it is in the initial position a0 have been recorded in step S106, the position of contact point CP2 on the first component 10 when the first component 10 is in the initial position a0 can be determined. Figure 6 As shown, when the first component 10 is in the initial position a0, the position of the contact point CP2 on the first component 10 is a2. In this embodiment of the invention, the position a2 of the contact point CP2 of the first component 10 when it is in the initial position a0 and the position b2 of the contact point CP2 of the first component 10 when it contacts the second component can be determined as the second minimum gap position. That is, the second minimum gap position includes positions a2 and b2 related to the first contact point CP2 of the first component 10.
[0086] In step S114, the dimensional paths of the first component 10 and the second component 20 are determined based on the positions of the target points on the first component 10, the target points on the second component 20, the first minimum gap position, and the second minimum gap position. In this embodiment of the invention, the distance between positions a1 and b1 of the first minimum gap position and the distance between positions a2 and b2 of the second minimum gap position are calculated, and it is determined whether the distance between positions a1 and b1 of the first minimum gap position is the same as the distance between positions a2 and b2 of the second minimum gap position. If the distance between positions a1 and b1 of the first minimum gap position and the distance between positions a2 and b2 of the second minimum gap position are the same, then it is determined to be a shaft-hole fit. In this embodiment of the invention, the position of a central shaft can be calculated based on the positions a1 and b1 of the first minimum gap position and the positions a2 and b2 of the second minimum gap position. Figure 4As shown, the position of the central axis is calculated as a0 (also used to represent the initial position of the first component 10). On the other hand, if the distance between the first minimum clearance position a1 and position b1 is different from the distance between the second minimum clearance position a2 and position b2, it is determined to be a non-axis-hole fit, and the position of the central axis does not need to be calculated. Next, starting from the position Ta of the target point TP1 of the first component 10, all dimensional paths of the first component 10 and the second component 20 are determined. The relevant dimensions of the first component 10 are determined starting from the position Ta of the target point TP1 of the first component 10. Figure 7 As shown, a dimension path 1 is formed from the position Ta of the target point TP1 of the first component 10 to the position a0 of the central axis (the dimension path is represented by a circled number). A dimension path 2 is formed from the position a1 of the first minimum clearance position related to the shaft hole and the first component 10 in its initial position to the position a2 of the second minimum clearance position. A dimension path 3 is formed from the position b1 of the first minimum clearance position related to the shaft hole and the first component 10 and the second component 20 in contact to the position b2 of the second minimum clearance position. A dimension path 4 is formed by determining the center offset of the shaft hole. A dimension path 5 is formed from the position a0 of the central axis to the position Tb of the target point TP2 of the second component 20. In this way, closed-loop path detection can be achieved.
[0087] Please refer to Figure 8 , Figure 8 This is a schematic diagram of the dimensional path for a non-axial hole configuration of adjacent components according to an embodiment of the present invention. Figure 8As shown, if the computer-aided design image file includes a first component 10 and a second component 20, according to process 1, a target point TP1 is defined in the first component 10, and the position of the target point TP1 is Ta. A target point TP2 is defined in the second component 20, and the position of the target point TP2 is Tb. The distance between the position Ta of the target point TP1 and the position Tb of the target point TP2 can be the gap after the first component 10 and the second component 20 are assembled. The distance between the position Ta of the target point TP1 and the position Tb of the target point TP2 can be assumed to be a target gap size, which can be a gap size within the allowable tolerance range. By moving the first component 10 from an initial position toward the first direction D1 and detecting when the first component 10 touches the second component 20, the contact point CP1 on the first component 10 and the position of the contact point CP1 are determined. If no contact event is detected when the first component 10 is moved from its initial position toward the second direction D2 by a distance greater than a predetermined value (e.g., the target gap size), it is determined that there is no contact between the first component 10 and the second component 20 during the movement of the first component 10 from its initial position toward the second direction D2. Then, the position a1 of the contact point CP1 of the first component 10 when it is in its initial position and the position b1 of the contact point CP1 when the first component 10 and the second component 20 collide can be determined as the first minimum gap position. Figure 8 As shown, a dimension path 1 (represented by circled numbers) can be formed from the position Ta of the target point TP2 of the first component 10 to the first minimum clearance position a1 related to the initial position of the first component 10. A dimension path 2 is formed from the position a1 of the first minimum clearance position related to the shaft hole and the initial position of the first component 10 to the position a2 of the second minimum clearance position. A dimension path 2 is formed from the position a1 of the first minimum clearance position related to the shaft hole and the contact between the first component 10 and the second component 20 to position b1. The center offset of the shaft hole is determined to form a dimension path 4. A dimension path 3 is formed from position b1 to the position Tb of the target point TP2 of the second component 20. In this way, closed-loop path detection can be achieved.
[0088] Those skilled in the art can combine, modify, or change the embodiments described above in accordance with the spirit of the present invention, but are not limited thereto. All the statements, steps, and / or processes (including suggested steps) above can be implemented by hardware, software, firmware (i.e., a combination of hardware devices and computer instructions, where the data in the hardware device is read-only software data), electronic systems, or combinations of the above devices. Hardware may include analog, digital, and mixed-signal circuits (i.e., microcircuits, microchips, or silicon chips). For example, hardware may be an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a programmable logic component, coupled hardware components, or a combination of the above hardware. In other embodiments, hardware may include a general-purpose processor, a microprocessor, a controller, a digital signal processor (DSP), or a combination of the above hardware. Software may be a combination of program code, a combination of instructions, and / or a combination of functions (features) stored in a storage device, such as a computer-readable recording medium or a non-transitory computer-readable medium. For example, computer-readable recording media may include read-only memory (ROM), flash memory, random-access memory (RAM), a Subscriber Identity Module (SIM), a hard disk, a floppy disk, or an optical disk read-only memory (CD-ROM / DVD-ROM / BD-ROM), but are not limited thereto. Embodiments of the present invention may include an electronic device, which includes processing circuitry and a storage device. The process steps and embodiments of the present invention may be compiled into program code or instructions and stored in the storage device of the electronic device. The processing circuitry of the electronic device can be used to read and execute the program code or instructions stored in the storage device to implement all the aforementioned steps and functions.
[0089] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0090] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for detecting a closed loop path of a geometric figure, the method comprising: The method comprises: obtaining a computer-aided design image file and detecting a first component and a second component in the computer-aided design image file; defining target points and positions of the target points on the first component and the second component; in a first operation period, moving the first component from an initial position toward a first direction and detecting whether the first component contacts the second component; based on the detection that the first component contacts the second component in the first operation period, determining a first minimum clearance position; in a second operation period, moving the first component from the initial position toward a second direction different from the first direction and detecting whether the first component contacts the second component; based on the detection that the first component contacts the second component in the second operation period, determining a second minimum clearance position; determining a dimension path of the first component and the second component according to the positions of the target points on the first component, the positions of the target points on the second component, the first minimum clearance position, and the second minimum clearance position.
2. The closed-loop path detection method of claim 1, wherein The step of determining the first minimum clearance position based on the detection that the first component contacts the second component in the first operation period comprises: when the first component contacts the second component in the first operation period, determining a first contact point on the first component and a first position of the first contact point; and determining a second position of the first contact point on the first component when the first component is in the initial position; and determining the first position and the second position of the first contact point as the first minimum clearance position.
3. The closed-loop path detection method of claim 1, wherein The step of determining the second minimum clearance position based on the detection that the first component contacts the second component in the second operation period comprises: when the first component contacts the second component in the second operation period, determining a second contact point on the first component and a first position of the second contact point; and determining a second position of the second contact point on the first component when the first component is in the initial position; and determining the first position and the second position of the second contact point as the second minimum clearance position.
4. The closed-loop path detection method of claim 1, wherein The step of determining the dimension path of the first component and the second component according to the positions of the target points on the first component, the positions of the target points on the second component, the first minimum clearance position, and the second minimum clearance position comprises: starting from the position of the target point on the first component, determining a dimension path formed between the position of the target point on the first component and a related position on the first component; and determining a dimension path formed between the related position on the first component and the position of the target point on the second component.
5. The closed-loop path detection method of claim 1, wherein, The closed-loop path detection method further comprises: determining that the first component and the second component do not touch each other when a distance of movement of the first component from the initial position in the first direction during the first operation is greater than a target gap size, and determining that the first component and the second component do not touch each other when a distance of movement of the first component from the initial position in the second direction during the second operation is greater than the target gap size.
6. An electronic device, comprising: comprising: a storage device configured to store instructions; and a processing circuit configured to execute the instructions, wherein the instructions comprise: obtaining a computer-aided design image file and detecting a first component and a second component in the computer-aided design image file; defining target points and positions of the target points on the first component and the second component; moving the first component from an initial position toward a first direction during a first operation and detecting whether the first component and the second component touch each other; based on detecting that the first component touches the second component during the first operation, determining a first minimum gap position; moving the first component from the initial position toward a second direction during a second operation and detecting whether the first component and the second component touch each other, wherein the second direction is different from the first direction; based on detecting that the first component touches the second component during the second operation, determining a second minimum gap position; determining a size path of the first component and the second component according to the positions of the target points on the first component, the positions of the target points on the second component, the first minimum gap position, and the second minimum gap position. 7.The electronic device of claim 6, wherein, the instructions comprise: when detecting that the first component touches the second component during the first operation, determining a first touch point on the first component and a first position of the first touch point; and determining a second position of the first touch point on the first component when the first component is at the initial position; and determining the first position and the second position of the first touch point as the first minimum gap position. 8.The electronic device of claim 6, wherein, the instructions comprise: when detecting that the first component touches the second component during the second operation, determining a second touch point on the first component and a first position of the second touch point; and determining a second position of the second touch point on the first component when the first component is at the initial position; and determining the first position and the second position of the second touch point as the second minimum gap position. 9.The electronic device of claim 6, wherein, the instructions comprise: determining a size path of the first component from the positions of the target points on the first component; and determining a size path between the relevant positions on the first component and the positions of the target points on the second component. 10.The electronic device of claim 6, wherein, the instructions comprise: In the first operation, if the first component is moved from the initial position by a distance greater than a target gap size in the first direction, it is determined that the first component does not contact the second component, and in the second operation, if the first component is moved from the initial position by a distance greater than the target gap size in the second direction, it is determined that the first component does not contact the second component.