TWI901357B - Closed-loop path detection method for geometric pattern and electronic device - Google Patents
Closed-loop path detection method for geometric pattern and electronic deviceInfo
- Publication number
- TWI901357B TWI901357B TW113135365A TW113135365A TWI901357B TW I901357 B TWI901357 B TW I901357B TW 113135365 A TW113135365 A TW 113135365A TW 113135365 A TW113135365 A TW 113135365A TW I901357 B TWI901357 B TW I901357B
- Authority
- TW
- Taiwan
- Prior art keywords
- component
- processing circuit
- during
- point
- minimum gap
- Prior art date
Links
Landscapes
- Design And Manufacture Of Integrated Circuits (AREA)
Abstract
Description
本發明係關於一種幾何圖形之閉迴圈路徑偵測方法及電子裝置,尤指一種可用於尺寸鏈分析的幾何圖形之閉迴圈路徑偵測方法及電子裝置。The present invention relates to a closed-loop path detection method and electronic device for geometric figures, and more particularly to a closed-loop path detection method and electronic device for geometric figures that can be used for dimensional chain analysis.
在產品製造組裝過程中常會發生撞件、外觀間隙或段差過大的問題而導致外觀不符規範,亦或增加修改模具的額外成本。因此,為了避免上述問題發生,在產品製造設計時需進行公差分析以確認公差設計是否合理。尺寸鏈分析方法是目前常見的公差分析方法。現有尺寸鏈分析方法係通過三維應用軟體將三維模型進行剖面截圖後取得於剖面圖,再於剖面圖上標示路徑,並利用三維分析軟體進行路徑尺寸測量以將尺寸與公差回填至分析表中。然而,因為結構與組裝的關係複雜,很容易會遇到無法判斷出目標元件的分析起始點的情況,而且也常會發生元件尺寸或尺寸鏈判斷錯誤而使公差分析結果時產生誤差,進而降低製造良率。因此,現有的技術實有改進之必要。During product manufacturing and assembly, collisions, gaps, or excessive step differences often occur, resulting in non-standard appearance or the need for additional mold modification costs. Therefore, to avoid these issues, tolerance analysis is required during product manufacturing design to confirm the rationality of tolerance design. Dimension chain analysis is a common tolerance analysis method. Existing dimensional chain analysis methods use 3D application software to create a cross-sectional view of a 3D model, then mark the path on the cross-sectional view. The 3D analysis software is then used to measure the path dimensions, filling in the dimensions and tolerances into the analysis table. However, due to the complex relationship between structure and assembly, it is easy to encounter situations where the target component's analysis starting point cannot be determined. Furthermore, component size or dimension chain misjudgment often occurs, resulting in errors in tolerance analysis results, which in turn reduces manufacturing yield. Therefore, existing technologies are in need of improvement.
為了解決上述之問題,本發明提供一種可用於尺寸鏈分析的幾何圖形之閉迴圈路徑偵測方法及電子裝置,以解決上述問題。To solve the above problems, the present invention provides a closed loop path detection method and electronic device for geometric figures that can be used for dimensional chain analysis to solve the above problems.
本發明提供一種幾何圖形之閉迴圈路徑偵測方法,包括︰取得一電腦輔助設計影像檔案,並於該電腦輔助設計影像檔案中偵測出一第一元件以及一第二元件;於該第一元件及該第二元件上定義出目標點以及目標點之位置;於一第一運作期間,將該第一元件由一初始位置朝向一第一方向移動並偵測該第一元件與該第二元件是否有碰觸;基於該第一運作期間偵測到該第一元件碰觸該第二元件,判斷出一第一最小間隙位置;於一第二運作期間,將該第一元件由該初始位置朝向一第二方向移動並偵測該第一元件與該第二元件是否有碰觸,其中該第二方向不同於該第一方向;基於該第二運作期間偵測到該第一元件碰觸該第二元件,判斷出一第二最小間隙位置;根據該第一元件及該第二元件上之目標點之位置、該第一最小間隙位置以及該第二最小間隙位置判斷出該第一元件及該第二元件之尺寸路徑。The present invention provides a closed loop path detection method for a geometric figure, comprising: obtaining a computer-aided design image file, and detecting a first component and a second component in the computer-aided design image file; defining a target point and a position of the target point on the first component and the second component; during a first operation period, moving the first component from an initial position toward a first direction and detecting whether the first component and the second component are in contact; based on the detection of the first component contacting the second component during the first operation period, determining whether the first component is in contact with the second component; a first minimum gap position; during a second operation period, moving the first component from the initial position toward a second direction and detecting whether the first component and the second component touch each other, wherein the second direction is different from the first direction; determining a second minimum gap position based on detecting that the first component touches the second component during the second operation period; and determining the size path of the first component and the second component based on the positions of the target points on the first component and the second component, the first minimum gap position, and the second minimum gap position.
本發明另提供一種電子裝置,包括︰一儲存裝置,用以儲存指令;以及一處理電路,經配置用以執行所述指令,其中所述指令包括︰取得一電腦輔助設計影像檔案,並於該電腦輔助設計影像檔案中偵測出一第一元件以及一第二元件;於該第一元件及該第二元件上定義出目標點以及目標點之位置;於一第一運作期間,將該第一元件由一初始位置朝向一第一方向移動並偵測該第一元件與該第二元件是否有碰觸;基於該第一運作期間偵測到該第一元件碰觸該第二元件,判斷出一第一最小間隙位置;於一第二運作期間,將該第一元件由該初始位置朝向一第二方向移動並偵測該第一元件與該第二元件是否有碰觸,其中該第二方向不同於該第一方向;基於該第二運作期間偵測到該第一元件碰觸該第二元件,判斷出一第二最小間隙位置;根據該第一元件及該第二元件上之目標點之位置、該第一最小間隙位置以及該第二最小間隙位置判斷出該第一元件及該第二元件之尺寸路徑。The present invention further provides an electronic device comprising: a storage device for storing instructions; and a processing circuit configured to execute the instructions, wherein the instructions include: obtaining a computer-aided design image file, and detecting a first component and a second component in the computer-aided design image file; defining a target point and a position of the target point on the first component and the second component; during a first operation period, moving the first component from an initial position toward a first direction and detecting whether the first component and the second component are in contact; based on the detection of the first operation period, The first component contacts the second component, and a first minimum gap position is determined. During a second operation period, the first component is moved from the initial position toward a second direction to detect whether the first component and the second component are in contact, wherein the second direction is different from the first direction. Based on the detection of the first component contacting the second component during the second operation period, a second minimum gap position is determined. The dimensional paths of the first component and the second component are determined based on the positions of the target points on the first component and the second component, the first minimum gap position, and the second minimum gap position.
在說明書及後續的申請專利範圍當中使用了某些詞彙來指稱特定的元件。所屬領域中具有通常知識者應可理解,製造商可能會用不同的名詞來稱呼同樣的元件。本說明書及後續的申請專利範圍並不以名稱的差異來做為區分元件的方式,而是以元件在功能上的差異來做為區分的基準。在通篇說明書及後續的申請專利範圍當中所提及的「包括」或「包含」係為一開放式的用語,故應解釋成「包括但不限定於」。另外,「耦接」一詞在此係包含任何直接及間接的電氣連接手段。因此,若文中描述一第一裝置耦接於一第二裝置,則代表該第一裝置可直接電氣連接於該第二裝置,或透過其他裝置或連接手段間接地電氣連接至該第二裝置。Certain terms are used throughout this specification and the claims that follow to refer to specific components. A person skilled in the art will understand that manufacturers may use different terms to refer to the same component. This specification and the claims that follow do not distinguish components based on differences in name, but rather on differences in their functionality. Throughout this specification and the claims that follow, the words "include" or "comprising" are open-ended terms and should be interpreted as meaning "including, but not limited to." Furthermore, the term "coupled" is intended to encompass any direct and indirect electrical connection. Therefore, if a first device is described herein as being coupled to a second device, it means that the first device can be directly electrically connected to the second device, or indirectly electrically connected to the second device via other devices or connection means.
本發明實施例可應用於電腦輔助設計之產品物件設計過程,藉由本發明實施例可於設計過程中提供偵測出相鄰幾何圖形元件之閉迴圈路徑。請參考第1圖,第1圖為本發明實施例之一流程1之示意圖。流程1用以處理偵測出相鄰元件之閉迴圈路徑。流程1包含以下步驟:The present invention can be applied to the product object design process of computer-aided design. The present invention can provide a method for detecting closed loop paths of adjacent geometric components during the design process. Please refer to Figure 1, which is a schematic diagram of process 1 of one embodiment of the present invention. Process 1 is used to process closed loop paths of adjacent components. Process 1 includes the following steps:
步驟S100:開始。Step S100: Start.
步驟S102:取得一電腦輔助設計影像檔案,並於該電腦輔助設計影像檔案中偵測出一第一元件以及一第二元件。Step S102: Obtain a computer-aided design (CAD) image file, and detect a first component and a second component in the CAD image file.
步驟S104:於該第一元件及該第二元件上定義出目標點以及目標點之位置。Step S104: defining a target point and a position of the target point on the first component and the second component.
步驟S106:於一第一運作期間,將該第一元件由一初始位置朝向一第一方向移動並偵測該第一元件與該第二元件是否有碰觸。Step S106: During a first operation period, the first component is moved from an initial position toward a first direction and whether the first component and the second component are in contact is detected.
步驟S108:基於該第一運作期間偵測到該第一元件碰觸該第二元件,判斷出一第一最小間隙位置。Step S108: Determining a first minimum gap position based on detecting that the first component contacts the second component during the first operation.
步驟S110:於一第二運作期間,將該第一元件由該初始位置朝向一第二方向移動並偵測該第一元件與該第二元件是否有碰觸,其中該第二方向不同於該第一方向。Step S110: During a second operation period, the first component is moved from the initial position toward a second direction and detecting whether the first component and the second component are in contact, wherein the second direction is different from the first direction.
步驟S112:基於該第二運作期間偵測到該第一元件碰觸該第二元件,判斷出一第二最小間隙位置。Step S112: determining a second minimum gap position based on detecting that the first component contacts the second component during the second operation period.
步驟S114:根據該第一元件及該第二元件上之目標點之位置、該第一最小間隙位置以及該第二最小間隙位置判斷出該第一元件及該第二元件之尺寸路徑。Step S114: Determine the size paths of the first component and the second component based on the positions of the target points on the first component and the second component, the first minimum gap position, and the second minimum gap position.
步驟S116:結束。Step S116: End.
根據流程1,於步驟S102中,本發明實施例可執行於一電子裝置的電腦輔助設計軟體。電子裝置可包括一電腦裝置,且電腦裝置裝設有電腦輔助設計軟體,其中電腦輔助設計軟體可為AutoCAD、Creo、Python、Pro/Engineer、SolidWorks,但不以此為限。本發明實施例可透過電腦輔助設計軟體產生一電腦輔助設計影像檔案。本發明實施例可透過電腦輔助設計軟體產生至少包含有一第一元件以及一第二元件之電腦輔助設計影像檔案。本發明實施例可利用電腦輔助設計軟體將所產生之電腦輔助設計影像檔案的三維模型進行目標剖面截圖後取得於剖面圖並儲存成二維的電腦輔助設計影像檔案。例如,可對產品組件之三維模型中欲進行公差分析的位置進行剖面截圖後以取得相應剖面圖,並將剖面圖儲存成二維視圖。例如,可將剖面圖儲存成圖檔交換格式(Drawing Exchange Format,DXF)的檔案格式,但不以此為限。例如,可利用Creo分析軟體讀取包含有第一元件以及第二元件之電腦輔助設計影像檔案,以對影像檔案中的三維模型進行目標剖面截圖後取得於剖面圖並將之儲存成DXF檔案格式的電腦輔助設計影像檔案。According to Process 1, in step S102, embodiments of the present invention may execute computer-aided design (CAD) software on an electronic device. The electronic device may include a computer device equipped with CAD software, wherein the CAD software may be, but is not limited to, AutoCAD, Creo, Python, Pro/Engineer, or SolidWorks. Embodiments of the present invention may generate a CAD image file using the CAD software. Embodiments of the present invention may generate a CAD image file containing at least a first component and a second component using the CAD software. In embodiments of the present invention, a 3D model generated by computer-aided design (CAD) software can be used to create a cross-sectional screenshot of a target section of a CAD image file, obtain a cross-sectional view, and store the result as a 2D CAD image file. For example, a cross-sectional screenshot can be created at a location within a 3D model of a product component where tolerance analysis is desired, to obtain the corresponding cross-sectional view, which can then be stored as a 2D view. For example, the cross-sectional view can be stored in a Drawing Exchange Format (DXF) file format, but this is not a limitation. For example, Creo analysis software can be used to read a computer-aided design image file containing a first component and a second component, and a target cross-section screenshot of the three-dimensional model in the image file can be taken to obtain the cross-section view and save it as a computer-aided design image file in a DXF file format.
於步驟S102中,於取得經目標剖面截圖後之二維剖面圖之電腦輔助設計影像檔案後,本發明實施例可於電腦輔助設計影像檔案中偵測出一第一元件10以及一第二元件20。在一實施例中,可利用Python程式軟體讀取並匯入所述二維剖面圖之電腦輔助設計影像檔案。例如,可利用Python程式軟體之ezdxf函式庫讀取並匯入所述圖檔交換格式DXF檔案格式之二維剖面圖之電腦輔助設計影像檔案,再利用Shapely套件對影像檔案進行相關幾何運算以轉換出各元件的幾何形狀圖案。接著,可於電腦輔助設計影像檔案中偵測出一第一元件以及一第二元件。如第2圖所示,利用Python程式軟體偵測出電腦輔助設計影像之各元件。電腦輔助設計影像檔案中包括第一元件10以及第二元件20。後續通過本發明實施例的流程1,本發明實施例可於設計過程中提供處理偵測出相鄰的第一元件10與第二元件20元件之閉迴圈尺寸路徑。In step S102, after obtaining a CAD image file of a two-dimensional cross-sectional view after a target cross-sectional screenshot, embodiments of the present invention can detect a first component 10 and a second component 20 in the CAD image file. In one embodiment, Python software can be used to read and import the CAD image file of the two-dimensional cross-sectional view. For example, the ezdxf library of Python software can be used to read and import the CAD image file of the two-dimensional cross-sectional view in the DXF file format. The Shapely package can then be used to perform geometric operations on the image file to convert the geometric shapes of each component. Next, a first component and a second component can be detected in the CAD image file. As shown in Figure 2, Python software is used to detect the components in the CAD image. The CAD image file includes a first component 10 and a second component 20. Subsequently, through process 1 of this embodiment of the present invention, a closed-loop size path for detecting adjacent first and second components 10, 20 can be provided during the design process.
於步驟S104中,可於電腦輔助設計影像檔案中之第一元件10以及第二元件20上定義出目標點及其位置。在一實施例中,可將欲進行公差分析之處設定為目標點。例如,目標點可設置於兩元件組裝後之間隙或段差所在之處。如第2圖所示,於第一元件10定義出一目標點TP1,目標點TP1之位置為Ta。於第二元件20定義出一目標點TP2,目標點TP2之位置為Tb。目標點TP1之位置Ta與目標點TP2之位置Tb位置之間的間距可為第一元件10與第二元件20元件組裝後之間隙。標點TP1之位置Ta與目標點TP2之位置Tb位置之間的間距可預設為一目標間隙尺寸,目標間隙尺寸可為允許公差範圍的間隙尺寸。In step S104, target points and their positions 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 location where the gap or step difference between the two components is located after assembly. As shown in Figure 2, a target point TP1 is defined on the first component 10, and the position of target point TP1 is Ta. A target point TP2 is defined on the second component 20, and the position of target point TP2 is Tb. The distance between the position Ta of target point TP1 and the position Tb of target point TP2 can be the gap between the first component 10 and the second component 20 after assembly. The distance between the position Ta of the mark point TP1 and the position Tb of the target point TP2 may be preset as a target gap size, and the target gap size may be a gap size within an allowable tolerance range.
於步驟S106中,於一第一運作期間,可將第一元件10由一初始位置朝向一第一方向移動並偵測第一元件10與第二元件20是否有碰觸。於第一運作期間,在將第一元件10朝向第一方向移動之前,可紀錄當第一元件10處於初始位置時第一元件10之各構成部位的位置,以及紀錄當第二元件20處於初始位置時第二元件20之各構成部位的位置。如第2圖所示,當第一元件10處於一初始位置a0時可紀錄下第一元件10所有構成點部位的位置。接著,將第一元件10由初始位置a0朝向一第一方向D1移動並執行一碰觸偵測以偵測第一元件10與第二元件之間是否有碰觸的情況發生。於第一元件10的移動過程中若判斷出第一元件10與第二元件20之間有碰觸的情況發生時,則此碰觸偵測結束並據以判斷出所述碰觸事件之移動間隙位置。此外,於第一元件10朝向第一方向移動過程中,若第一元件10的移動距離大於一預定值(例如目標間隙尺寸)時,則此碰觸偵測結束並據以判斷出第一元件由初始位置朝向第一方向移動時第一元件10與第二元件20之間沒有碰觸。In step S106, during a first operation, the first element 10 can be moved from an initial position toward a first direction and contact between the first element 10 and the second element 20 can be detected. During the first operation, before the first element 10 is moved toward the first direction, the positions of each component of the first element 10 when the first element 10 is in the initial position can be recorded, and the positions of each component of the second element 20 when the second element 20 is in the initial position can be recorded. As shown in FIG. 2 , the positions of all components of the first element 10 can be recorded when the first element 10 is in an initial position a0. Next, the first element 10 is moved from the initial position a0 toward a first direction D1, and contact detection is performed to detect contact between the first element 10 and the second element. If, during the movement of the first element 10, a collision is detected between the first element 10 and the second element 20, the collision detection is terminated and the movement gap position of the collision event is determined accordingly. Furthermore, if, during the movement of the first element 10 in the first direction, the movement distance of the first element 10 exceeds a predetermined value (e.g., a target gap size), the collision detection is terminated and it is determined that there was no collision between the first element 10 and the second element 20 during the movement from the initial position toward the first direction.
在一實施例中,關於第一元件10與第二元件20是否有碰觸的碰觸偵測判斷,可通過偵測兩元件是否包括至少一個公共點以判斷兩元件是否有碰觸到。當偵測到第一元件10與第二元件20具有至少一個公共點時,這表示第一元件10與第二元件20有碰觸到,所述公共點即為碰觸點。例如,於第一元件10或第二元件20移動時,可利用Python程式軟體之Shapely套件中的Touches函式庫來判斷第一元件10與第二元件20是否有至少一個公共點。當偵測到第一元件10與第二元件20具有至少一個公共點時,這表示第一元件10與第二元件20有碰觸到,所述公共點即為碰觸點。例如,於第一元件10或第二元件20移動時,可利用Python程式軟體之Shapely套件中的Touches函式庫來判斷第一元件10與第二元件20是否有至少一個公共點以及利用Shapely套件中的None函式庫來判斷第一元件10與第二元件20是否無碰觸。當偵測到第一元件10與第二元件20具有至少一個公共點時,這表示第一元件10與第二元件20有碰觸到,所述公共點即為碰觸點。此外,可利用Python程式軟體之Shapely套件中的Intersects函式庫來判斷第一元件10與第二元件20間是否有干涉,若有干涉的話,表示兩者可能具備內部公共點。此時,第一元件10與第二元件20除了兩者的邊界點有碰觸外,尚有內部公共點的干涉情況。當判斷出第一元件10與第二元件20間有干涉時,則此相對位置不計算碰觸事件之移動間隙位置。In one embodiment, touch detection to determine whether a first element 10 and a second element 20 are touching can be performed by detecting whether the two elements include at least one common point. When the first element 10 and the second element 20 are detected to have at least one common point, this indicates that the first element 10 and the second element 20 are touching, and the common point is the touch point. For example, when the first element 10 or the second element 20 moves, the Touches library in the Shapely suite of Python programming software can be used to determine whether the first element 10 and the second element 20 have at least one common point. When the first element 10 and the second element 20 are detected to have at least one common point, this indicates that the first element 10 and the second element 20 are touching, and the common point is the touch point. For example, when the first element 10 or the second element 20 moves, the Touches library in the Shapely suite of Python programming software can be used to determine whether the first element 10 and the second element 20 have at least one common point, and the None library in the Shapely suite can be used to determine whether the first element 10 and the second element 20 are not touching. When it is detected that the first element 10 and the second element 20 have at least one common point, this indicates that the first element 10 and the second element 20 are touching, and the common point is the touching point. In addition, the Intersects library in the Shapely suite of Python programming software can be used to determine whether there is interference between the first element 10 and the second element 20. If there is interference, it means that the two may have internal common points. In this case, in addition to the contact at the boundary points of the first element 10 and the second element 20, there is also interference at the internal common points. When it is determined that there is interference between the first element 10 and the second element 20, this relative position is not calculated into the moving gap position of the touch event.
於步驟S108中,基於第一運作期間中偵測到第一元件10碰觸到第二元件20,本發明實施例可判斷出一第一最小間隙位置。於第一運作期間偵測到第一元件10碰觸第二元件20時可判斷出第一元件上之一第一碰觸點以及第一碰觸點之位置。如第3圖所示,當第一元件10碰觸到第二元件20時,第一元件10上之一部位點(即碰觸點CP1)碰觸到第二元件20。第一元件10與第二元件20碰觸時,第一元件10上之碰觸點CP1的位置為b1。例如,於第一元件10移動時,可利用Python程式軟體之Shapely套件中的Touches函式庫來判斷第一元件10與第二元件20間之個公共點。當偵測到第一元件10與第二元件20之公共點時可據以判斷出第一元件10上之碰觸點CP1以及此時碰觸點CP1的位置b1。In step S108, based on the detection of the first element 10 contacting the second element 20 during the first operation period, the embodiment of the present invention can determine a first minimum gap position. When the first element 10 is detected to contact the second element 20 during the first operation period, a first contact point on the first element and the position of the first contact point can be determined. As shown in Figure 3, when the first element 10 contacts the second element 20, a point on the first element 10 (i.e., contact point CP1) contacts the second element 20. When the first element 10 and the second element 20 contact, the position of the contact point CP1 on the first element 10 is b1. For example, when the first element 10 moves, the Touches library in the Shapely package of the Python programming software can be used to determine the common points between the first element 10 and the second element 20. When the common point between the first element 10 and the second element 20 is detected, the contact point CP1 on the first element 10 and the position b1 of the contact point CP1 at this time can be determined.
進一步地,由於在步驟S106中已記錄下第一元件10處於初始位置a0時所有構成部位點的位置,藉此可判斷出第一元件10處於初始位置a0時第一元件10上之碰觸點CP1的位置。如第4圖所示,當第一元件10處於初始位置a0時,第一元件10上之碰觸點CP1的位置為a1。本發明實施例可將第一元件10處於初始位置a0時第一元件10之碰觸點CP1的位置a1以及第一元件10與第二元件碰觸時第一元件10之碰觸點CP1的位置b1判斷做為第一最小間隙位置。也就是說,第一最小間隙位置包括與第一元件10之第一碰觸點CP1有關的位置a1、b1。Furthermore, since the positions of all component points when the first element 10 is at the initial position a0 have been recorded in step S106, the position of the contact point CP1 on the first element 10 when the first element 10 is at the initial position a0 can be determined. As shown in FIG. 4 , when the first element 10 is at the initial position a0, the position of the contact point CP1 on the first element 10 is a1. In this embodiment of the present invention, the position a1 of the contact point CP1 of the first element 10 when the first element 10 is at the initial position a0 and the position b1 of the contact point CP1 of the first element 10 when the first element 10 contacts the second element can be determined as the first minimum gap position. In other words, the first minimum gap position includes positions a1 and b1 related to the first contact point CP1 of the first element 10.
於步驟S110中,於一第二運作期間,可將第一元件10由初始位置朝向一第二方向移動並偵測第一元件10與第二元件20是否有碰觸。如第4圖所示,當第一元件10處於一初始位置a0時,將第一元件10由初始位置a0朝向一第二方向D2移動並執行一碰觸偵測以偵測第一元件10與第二元件之間是否有碰觸的情況發生。於第一元件10的移動過程中若判斷出第一元件10與第二元件20之間有碰觸的情況發生時,則此碰觸偵測結束並據以判斷出所述碰觸事件之移動間隙位置。此外,於第一元件10朝向第二方向D2移動過程中,若第一元件10的移動距離大於一預定值(例如目標間隙尺寸)時,則此碰觸偵測結束並據以判斷出第一元件由初始位置朝向第二方向移動時第一元件10與第二元件20之間沒有碰觸。In step S110, during a second operation, the first element 10 can be moved from an initial position toward a second direction to detect whether there is any contact between the first element 10 and the second element 20. As shown in FIG4 , when the first element 10 is at an initial position a0, the first element 10 is moved from the initial position a0 toward a second direction D2 and a contact detection operation is performed to detect whether there is any contact between the first element 10 and the second element 20. If contact is detected between the first element 10 and the second element 20 during the movement of the first element 10, the contact detection operation is terminated, and the position of the movement gap of the contact event is determined accordingly. Furthermore, during the movement of the first element 10 in the second direction D2, if the movement distance of the first element 10 is greater than a predetermined value (e.g., a target gap size), the contact detection is terminated and it is determined that there is no contact between the first element 10 and the second element 20 when the first element moves from the initial position in the second direction.
於步驟S112中,基於第二運作期間中偵測到第一元件10碰觸到第二元件20,本發明實施例可判斷出一第二最小間隙位置。於第二運作期間偵測到第一元件10碰觸第二元件20時可判斷出第一元件上之一第二碰觸點以及第二碰觸點之位置。如第5圖所示,當第一元件10碰觸到第二元件20時,第一元件10上之一部位點(即碰觸點CP2)碰觸到第二元件20。第一元件10與第二元件20碰觸時,第一元件10上之碰觸點CP2的位置為b2。例如,於第一元件10移動時,可利用Python程式軟體之Shapely套件中的Touches函式庫來判斷第一元件10與第二元件20間之個公共點。當偵測到第一元件10與第二元件20之公共點時可據以判斷出第一元件10上之碰觸點CP2以及此時碰觸點CP1的位置b2。由於在步驟S106中已記錄下第一元件10處於初始位置a0時所有構成部位點的位置,可判斷出第一元件10處於初始位置a0時第一元件10上之碰觸點CP2的位置。如第6圖所示,當第一元件10處於初始位置a0時,第一元件10上之碰觸點CP2的位置為a2。本發明實施例可將第一元件10處於初始位置a0時第一元件10之碰觸點CP2的位置a2以及第一元件10與第二元件碰觸時第一元件10之碰觸點CP2的位置b2判斷做為第二最小間隙位置。也就是說,第二最小間隙位置包括與第一元件10之第一碰觸點CP2有關的位置a2、b2。In step S112, based on the detection of the first element 10 contacting the second element 20 during the second operation period, the embodiment of the present invention can determine a second minimum gap position. When the first element 10 is detected to contact the second element 20 during the second operation period, a second contact point on the first element and the position of the second contact point can be determined. As shown in Figure 5, when the first element 10 contacts the second element 20, a point on the first element 10 (i.e., contact point CP2) contacts the second element 20. When the first element 10 and the second element 20 contact, the position of the contact point CP2 on the first element 10 is b2. For example, when the first element 10 moves, the Touches library in the Shapely package of the Python programming software can be used to determine the common points between the first element 10 and the second element 20. When the common point between the first element 10 and the second element 20 is detected, the contact point CP2 on the first element 10 and the position b2 of the contact point CP1 at that time can be determined accordingly. Since the positions of all component points when the first element 10 is at the initial position a0 have been recorded in step S106, the position of the contact point CP2 on the first element 10 when the first element 10 is at the initial position a0 can be determined. As shown in Figure 6, when the first element 10 is at the initial position a0, the position of the contact point CP2 on the first element 10 is a2. In this embodiment of the present invention, the position a2 of the contact point CP2 of the first element 10 when the first element 10 is at the initial position a0 and the position b2 of the contact point CP2 of the first element 10 when the first element 10 and the second element contact 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 element 10.
於步驟S114中,根據第一元件10及第二元件20上之目標點之位置、第一最小間隙位置以及第二最小間隙位置判斷出第一元件10及第二元件20之尺寸路徑。本發明實施例計算第一最小間隙位置之位置a1與位置b1間之距離以及計算第二最小間隙位置之位置a2與位置b2間之距離,並判斷第一最小間隙位置之位置a1與位置b1間之距離是否同於第二最小間隙位置之位置a2與位置b2間之距離。於判斷出第一最小間隙位置之位置a1與位置b1間之距離和第二最小間隙位置之位置a2與位置b2間之距離相同時,則判斷為軸孔配。本發明實施例可依據第一最小間隙位置之位置a1、b1及第二最小間隙位置之位置a2、b2計算出一中心軸之位置。如第4圖所示,計算出中心軸之位置為a0(亦用於表示第一元件10之初始位置)。另一方面,於判斷出第一最小間隙位置之位置a1與位置b1間之距離和第二最小間隙位置之位置a2與位置b2間之距離不相同時,則判斷為非軸孔配,不需計算出中心軸之位置。接著,以第一元件10之目標點TP1之位置Ta為起點,判斷出第一元件10及第二元件20之所有尺寸路徑。以第一元件10之目標點TP1之位置Ta為起點判斷出第一元件10的相關尺寸。如第7圖所示,判斷由第一元件10之目標點TP1之位置Ta至中心軸之位置a0形成尺寸路徑1(以帶圓圈的數字來表示尺寸路徑)。判斷由與軸孔配有關且第一元件10處於初始位置時有關的第一最小間隙位置之a1至第二最小間隙位置之位置a2形成尺寸路徑2。判斷由與軸孔配有關且第一元件10與第二元件20碰觸時有關的第一最小間隙位置之b1至第二最小間隙位置之位置b2形成尺寸路徑3。判斷軸孔配的中心偏移以形成尺寸路徑4。判斷由中心軸之位置a0至第二元件20之目標點TP2之位置Tb形成尺寸路徑5,如此一來,便能實現達到閉迴圈路徑偵測。In step S114, the dimensional paths of the first and second components 10 and 20 are determined based on the positions of the target points, the first minimum gap position, and the second minimum gap position. This embodiment of the present invention calculates 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. It then determines 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 determined to be the same, a shaft-hole fit is determined. The embodiment of the present invention can calculate the position of a central axis 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. As shown in Figure 4, the calculated position of the central axis is a0 (also used to represent the initial position of the first component 10). On the other hand, if the distance between the positions a1 and b1 of the first minimum gap position and the distance between the positions a2 and b2 of the second minimum gap position are determined to be different, it is determined to be a non-axis-hole fit, and the position of the central axis does not need to be calculated. Then, 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. As shown in Figure 7, Dimensional Path 1 is determined to be formed from the position Ta of the target point TP1 of the first component 10 to the position a0 of the center axis (the dimensional path is represented by the circled number). Dimensional Path 2 is determined to be formed from the first minimum gap position a1 associated with the shaft-hole assembly and when the first component 10 is in its initial position to the second minimum gap position a2. Dimensional Path 3 is determined to be formed from the first minimum gap position b1 associated with the shaft-hole assembly and when the first component 10 and the second component 20 contact each other to the second minimum gap position b2. Dimensional Path 4 is determined to be formed by determining the center offset of the shaft-hole assembly. It is determined that 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 element 20. In this way, closed loop path detection can be achieved.
請參考第8圖,第8圖為本發明實施例之相鄰元件非軸孔配情況之尺寸路徑之示意圖。如第8圖所示,若電腦輔助設計影像檔案中包括第一元件10及第二元件20。依據流程1,於第一元件10定義出一目標點TP1,目標點TP1之位置為Ta。於第二元件20定義出一目標點TP2,目標點TP2之位置為Tb。目標點TP1之位置Ta與目標點TP2之位置Tb位置之間的間距可為第一元件10與第二元件20元件組裝後之間隙。標點TP1之位置Ta與目標點TP2之位置Tb位置之間的間距可預設為一目標間隙尺寸,目標間隙尺寸可為允許公差範圍的間隙尺寸。通過將第一元件10由一初始位置朝向第一方向D1移動並偵測當第一元件10碰觸到第二元件20時,第一元件10上之碰觸點CP1以及碰觸點CP1位置為b1。當將第一元件10由初始位置朝向第二方向D2的移動距離大於一預定值(例如目標間隙尺寸)仍無偵測到碰觸事件時則判斷出第一元件10由初始位置朝向第二方向D2移動時第一元件10與第二元件20之間沒有碰觸。接著,可將第一元件10處於初始位置時第一元件10之碰觸點CP1的位置a1以及第一元件10與第二元件20碰觸時碰觸點CP1的位置b1判斷做為第一最小間隙位置。如第8圖所示,可判斷由第一元件10之目標點TP2之位置Ta至由第一元件10於初始位置時有關的第一最小間隙位置之a1形成尺寸路徑1(以帶圓圈的數字來表示尺寸路徑)。判斷由與軸孔配有關且第一元件10處於初始位置時有關的第一最小間隙位置之a1至第二最小間隙位置之位置a2形成尺寸路徑2。判斷由與軸孔配有關且第一元件10與第二元件20碰觸時有關的第一最小間隙位置之a1至位置b1形成尺寸路徑2。判斷軸孔配的中心偏移以形成尺寸路徑4。判斷由位置b1至第二元件20之目標點TP2之位置Tb形成尺寸路徑3,如此一來,便能實現達到閉迴圈路徑偵測。Please refer to Figure 8, which is a schematic diagram of the dimension path of the non-axial hole matching situation of adjacent components in an embodiment of the present invention. As shown in Figure 8, 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 on the first component 10, and the position of the target point TP1 is Ta. A target point TP2 is defined on 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 preset to a target gap size, and the target gap size can be a gap size within the allowable tolerance range. The first element 10 is moved from an initial position toward a first direction D1 and, when the first element 10 contacts the second element 20, the contact point CP1 on the first element 10 and the position of the contact point CP1 are detected as b1. If no contact event is detected after the first element 10 is moved from the initial position toward a second direction D2 by a distance greater than a predetermined value (e.g., a target gap size), it is determined that there is no contact between the first element 10 and the second element 20 during the movement from the initial position toward the second direction D2. The position a1 of the contact point CP1 of the first element 10 when the first element 10 is in the initial position and the position b1 of the contact point CP1 when the first element 10 and the second element 20 contact are then determined as the first minimum gap position. As shown in Figure 8, it can be determined that dimensional path 1 is formed from the position Ta of the target point TP2 of the first component 10 to the first minimum gap position a1 associated with the initial position of the first component 10 (the dimensional path is represented by the circled number). Dimensional path 2 is determined to be formed from the first minimum gap position a1 associated with the shaft hole assembly and the initial position of the first component 10 to the second minimum gap position a2. Dimensional path 2 is determined to be formed from the first minimum gap position a1 associated with the shaft hole assembly and the contact between the first component 10 and the second component 20 to position b1. Dimensional path 4 is determined to be formed by the center offset of the shaft hole assembly. It is determined that a dimension path 3 is formed from the 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.
本領域具通常知識者當可依本發明的精神加以結合、修飾或變化以上所述的實施例,而不限於此。上述所有的陳述、步驟、及/或流程(包含建議步驟),可透過硬體、軟體、韌體(即硬體裝置與電腦指令的組合,硬體裝置中的資料為唯讀軟體資料)、電子系統、或上述裝置的組合等方式實現。硬體可包含類比、數位及混合電路(即微電路、微晶片或矽晶片)。例如,硬體可爲特定應用集成電路(ASIC)、現場可程序邏輯閘陣列(field programmable gate array,FPGA)、可程序化邏輯元件、耦接的硬體元件,或上述硬體的組合。在其他實施例中,硬件可包括通用處理器、微處理器、控制器、數字信號處理器(digital signal processor,DSP),或上述硬件的組合。軟體可爲程式碼的組合、指令的組合及/或函數(功能)的組合,其儲存在一儲存裝置中,例如一電腦可讀取記錄媒體或一非瞬時性電腦可讀取介質(non-transitory computer-readable medium)。舉例來說,電腦可讀取記錄媒體可包括唯讀記憶體(read-only memory,ROM)、快閃記憶體(Flash Memory)、隨機存取記憶體(random-access memory,RAM)、用戶識別模組(Subscriber Identity Module,SIM)、硬碟、軟碟或光碟唯讀記憶體(CD-ROM/DVD-ROM/BD-ROM),但不以此為限。本發明實施例可包括一電子裝置,電子裝置包括處理電路以及儲存裝置。本發明之流程步驟與實施例可被編譯成程式碼或指令的型態存在而儲存於所述電子裝置之儲存裝置中。所述電子裝置之處理電路可用於讀取與執行儲存裝置所儲存的程式碼或指令以實現前述所有步驟與功能。A person skilled in the art may combine, modify or vary the above-described embodiments in accordance with the spirit of the present invention, without limitation. All of the above statements, steps, and/or processes (including recommended steps) may be implemented through hardware, software, firmware (i.e., a combination of a hardware device and computer instructions, where the data in the hardware device is read-only software data), an electronic system, or a combination of the above devices. The hardware may include analog, digital, and hybrid circuits (i.e., microcircuits, microchips, or silicon chips). For example, the hardware may be an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a programmable logic element, coupled hardware elements, or a combination of the above hardware. In other embodiments, the hardware may include a general-purpose processor, a microprocessor, a controller, a digital signal processor (DSP), or a combination of the foregoing. The software may be a combination of program codes, instructions, and/or functions 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, but are not limited to, read-only memory (ROM), flash memory, random-access memory (RAM), subscriber identity module (SIM), hard drive, floppy disk, or optical disc read-only memory (CD-ROM/DVD-ROM/BD-ROM). Embodiments of the present invention may include an electronic device comprising a processing circuit 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 circuit 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.
綜上所述, 本發明實施例利用移動相鄰元件與碰撞點偵測來準準地判斷出正確尺寸路徑以達到閉迴圈路徑偵測的目的,而能有效地優化產品設計、減少元件的製造成本並提供穩定的產品製造品質。以上所述僅為本發明之較佳實施例,凡依本發明申請專利範圍所做之均等變化與修飾,皆應屬本發明之涵蓋範圍。In summary, the present invention utilizes moving adjacent components and collision point detection to accurately determine the correct path size for closed-loop path detection, effectively optimizing product design, reducing component manufacturing costs, and providing stable product manufacturing quality. The foregoing is merely a preferred embodiment of the present invention, and all equivalent variations and modifications made within the scope of the patent application of this invention are intended to be covered by this invention.
1:流程10:第一元件20:第二元件a0,a1,a2,b1,b2,Ta,Tb:位置CP1,CP2:碰觸點D1,D2:方向S100,S102,S104,S106,S108,S110,S112,S114,S116:步驟TP1,TP2:目標點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: Steps TP1, TP2: Target Point
第1圖為本發明實施例之一流程之示意圖。第2圖為本發明實施例之偵測出相鄰幾何圖形元件之示意圖。第3圖為本發明實施例之第一元件沿第一方向移動而碰觸第二元件之示意圖。第4圖為本發明實施例之第一元件處於初始位置時第一碰觸點的位置之示意圖。第5圖為本發明實施例之第一元件沿第二方向移動而碰觸第二元件之示意圖。第6圖為本發明實施例之第一元件處於初始位置時第二碰觸點的位置之示意圖。第7圖為本發明實施例之第一元件與第二元件之尺寸路徑之示意圖。第8圖為本發明實施例之相鄰元件非軸孔配情況之尺寸路徑之示意圖。Figure 1 is a schematic diagram of a process of an embodiment of the present invention. Figure 2 is a schematic diagram of the detection of adjacent geometric elements in an embodiment of the present invention. Figure 3 is a schematic diagram of the first element of an embodiment of the present invention moving along the first direction and touching the second element. Figure 4 is a schematic diagram of the position of the first touch point when the first element of an embodiment of the present invention is in an initial position. Figure 5 is a schematic diagram of the first element of an embodiment of the present invention moving along the second direction and touching the second element. Figure 6 is a schematic diagram of the position of the second touch point when the first element of an embodiment of the present invention is in an initial position. Figure 7 is a schematic diagram of the dimensional path of the first element and the second element of an embodiment of the present invention. Figure 8 is a schematic diagram of the dimensional path of the adjacent elements in a non-axial hole matching situation in an embodiment of the present invention.
1:流程 1: Process
S100,S102,S104,S106,S108,S110,S112,S114,S116:步驟 S100, S102, S104, S106, S108, S110, S112, S114, S116: Steps
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW113135365A TWI901357B (en) | 2024-09-19 | 2024-09-19 | Closed-loop path detection method for geometric pattern and electronic device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW113135365A TWI901357B (en) | 2024-09-19 | 2024-09-19 | Closed-loop path detection method for geometric pattern and electronic device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| TWI901357B true TWI901357B (en) | 2025-10-11 |
Family
ID=98263805
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW113135365A TWI901357B (en) | 2024-09-19 | 2024-09-19 | Closed-loop path detection method for geometric pattern and electronic device |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI901357B (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100114519A1 (en) * | 2008-11-05 | 2010-05-06 | Paul Charles Hollingshead | Method and apparatus for identifying gaps between parts |
| TWI547031B (en) * | 2014-08-20 | 2016-08-21 | 絡達科技股份有限公司 | Electrical contact detection circuit and portable electrical system using the same |
| US10339370B2 (en) * | 2015-12-11 | 2019-07-02 | Hanwha Defense Co., Ltd. | Method and apparatus for determining obstacle collision by using object moving path |
| US20240221385A1 (en) * | 2021-09-08 | 2024-07-04 | The Boeing Company | Enhanced Vehicle Navigation Using Non-Destructive Inspection One-Dimensional Sensor Arrays |
-
2024
- 2024-09-19 TW TW113135365A patent/TWI901357B/en active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100114519A1 (en) * | 2008-11-05 | 2010-05-06 | Paul Charles Hollingshead | Method and apparatus for identifying gaps between parts |
| TWI547031B (en) * | 2014-08-20 | 2016-08-21 | 絡達科技股份有限公司 | Electrical contact detection circuit and portable electrical system using the same |
| US10339370B2 (en) * | 2015-12-11 | 2019-07-02 | Hanwha Defense Co., Ltd. | Method and apparatus for determining obstacle collision by using object moving path |
| US20240221385A1 (en) * | 2021-09-08 | 2024-07-04 | The Boeing Company | Enhanced Vehicle Navigation Using Non-Destructive Inspection One-Dimensional Sensor Arrays |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR102718637B1 (en) | Process design method, system, medium and device based on system packaging technology | |
| US9760671B2 (en) | Rule checking | |
| US20050086618A1 (en) | Apparatus and method for verifying an integrated circuit pattern | |
| CN114770946A (en) | Method and device for detecting printing quality of 3D printer and 3D printer | |
| US20170050380A1 (en) | Printing correction method and three-dimensional printing device | |
| US20090031267A1 (en) | Layout correcting method for semiconductor integrated circuit and layout correcting device for semiconductor integrated circuit | |
| TWI901357B (en) | Closed-loop path detection method for geometric pattern and electronic device | |
| JP3988588B2 (en) | 3D measuring device | |
| KR102154075B1 (en) | Methods of inspecting a semiconductor device and semiconductor inspection systems | |
| US9869538B2 (en) | Measuring device and related methods | |
| EP3736733B1 (en) | Tracking device, tracking method, and tracking system | |
| CN102540977B (en) | Method for estimating error in numerical control processing | |
| CN108873611A (en) | The method of lithographic equipment and manufacture article | |
| CN112426105B (en) | Charging stand, method and device for calibrating the position of charging stand, and sweeping system | |
| CN114330207B (en) | Chip pad information extraction method, system and electronic device | |
| JP4335563B2 (en) | Mask pattern verification method, mask pattern verification program, and mask manufacturing method | |
| CN113408236A (en) | Process detection method, system, device and storage medium | |
| CN112838021B (en) | A method for judging the relative position of device and cut-off layer | |
| JP4409363B2 (en) | Semiconductor device design system and cost evaluation method | |
| CN108937702A (en) | Boundary detection method and device for robot, robot and medium | |
| JP2011034505A (en) | Design support apparatus and design support method | |
| US20240312023A1 (en) | Contour line processing method and electronic device | |
| CN111563358B (en) | Method, apparatus and storage medium for inserting pairing graph | |
| JP7537360B2 (en) | ROBOT CONTROL SYSTEM, MOBILE ROBOT, ROBOT CONTROL METHOD, AND ROBOT CONTROL PROGRAM | |
| CN111341712B (en) | Wafer position calibration device and method |