201001304 九、發明說明: 【發明所屬之技術領域】 本發明/步及-種圖形檢查系統及方法,特別係關於一 種小線段圖形檢查系統及方法。 【先前技術】 於圖形處理中,小線段係_個概括性之概念,具體資 料範圍沒有確切之規定’但就一般來講,長度小於〇1顏 之線段、圓孤、1/4圓弧等圖元均可稱為小線段。圖ι(&) -⑷為-個零件圖形中之小線段之簡單示例。圖丄⑴ 為小線段原圖,圖1⑴為小線段放大十倍數後之右端, 圖(c)為小線&放大一百倍後出現之明顯尖角。從圖1 中可乂發現原本視覺效果為直線之小線段,經過放大後於 f端部分出現了一個尖角圖形。當對零件進行線切割加工 時,就會導致線切割機不能加工具有此類尖角之零件。 ::割機係使用電極絲對金屬進行放電腐蝕以達到 的:由於其切割精度非常高,因此於高精度 今、包非吊廣泛。常用電極絲有鉬絲、鎢絲、黃銅 二般於0·03〜α1_之間’誤差範圍 之尖角情況時,mm級別。當加工圖形中出現上述小線段中 電極絲二插’ 絲可能無法進入尖角内部進行切割。 若於加貴重之金屬材料’而且不可重複使用。 間,電極絲之浪費也将―馨1不僅浪費了加工材料及時 零件加工之〜“…、4可硯之費用,因此需盡可能於 之别就保證加工路徑之正確性,也即需檢測出加 201001304 工圖形中是否有不可加工之部分存在,以提示加工者對此 類圖形進行處理。 然而,目前一般採用肉眼檢測加工圖形,但肉眼並不 能檢測到所有小於規定範圍之小線段圖形,因此不能保證 加工圖形是否滿足加工條件,從而導致加工過程中發生問 題帶來之損失。 【發明内容】 鑒於以上内容,有必要提供一種小線段檢查系統及方 法,能夠準確地檢測出待加工零件圖形是否滿足加工標 準,以提高零件圖形之品質,保證線切割機可以按照零件 圖形正確無誤之進行零件加工。 一種小線段圖形檢查系統,運行於電腦中,該電腦連 接有圖形庫及顯示裝置,該系統包括:參數設定模組,用 於設定零件圖形中小線段長度之允許值;圖形選取模組, 用於從所述圖形庫中讀取零件圖形,於所述之零件圖形中 選擇一個圖形檢查區域,並於該圖形檢查區域内確定需要 檢查之圖元,所述之圖元包括線、線段及圓弧;圖元分割 模組,用於將所述之圖元進行分類為線、線段及圓弧,將 線分割為線段及圓弧,並將分割之線段及圓弧併入該圖形 檢查區域;圖元檢測模組,用於計算所述之圖形檢查區域 内每一條線段之長度及圓弧之周長,並判斷每一條線段之 長度及圓弧之周長是否小於設定之允許值;圖元標識模 組,用於根據判斷結果用提示標誌標識出不符合加工標準 之小線段圖形,並於所述之顯示裝置中顯示該小線段圖形 7 201001304 於所述之零件圖形中之位置。 一種小線段圖形檢查方法包括步驟:設定零件圖形中 小線段長度之允許值;於該零件圖形中選擇一個圖形檢查 區域,並於該圖形檢查區域内確定需要檢查之圖元,所述 之圖元包括線、線段及圓弧;將所述圖元進行分類為線、 線段及圓弧;將線分割為線段及圓弧,並將分割之線段及 圓弧併入該圖形檢查區域,計鼻圖形檢查區域内每 條線 段之長度;判斷每一條線段之長度是否小於設定之允許 值;若線段之長度小於允許值,則用提示標誌標識出不符 合加工標準之線段;計算圖形檢查區域内每一條圓弧之周 長;判斷每一條圓弧之周長是否小於設定之允許值;若圓 弧之周長小於設定之允許值,則用提示標誌標識出不符合 加工標準之圓弧;顯示帶有提示標誌之線段及圓弧於所述 之零件圖形中之位置。 【實施方式】 參閱圖2所示,係本發明小線段圖形檢查系統較佳實 施例之實施環境圖。所述之小線段圖形檢查系統10運行於 電腦1中,用於從加工圖形中檢測出不符合加工標準之小 線段圖形。所述之小線段圖形係一個概括性之概念,具體 資料範圍沒有確切之規定,但一般來講,長度小於0.1mm 之線段、圓弧、1/4圓弧等圖元均可稱為小線段圖形。該 電腦1連接有一圖形庫2及顯示裝置3。其中,圖形庫2 用於存儲所需檢測之零件圖形,顯示裝置3用於顯示零件 圖形中帶有提示標誌之不符合加工標準之小線段圖形,並 8 201001304 顯示出不符合加工標準之小線段圖形於零件圖形中之位 置。所述之小線段圖形檢查系統ίο包括參數設定模組 101、圖形選取模組102、圖元分割模組103、圖元檢測模 組104以及圖元標識模組105。 參數設定模組101用於設定零件圖形中小線段長度之 允許值(例如長度為0.05mm),將該允許值作為小線段圖 形是否符合加工標準之判斷依據。若小線段長度大於等於 0.05mm,則該小線段圖形符合加工標準。若小線段長度小 於0.05mm,則該小線段圖形不符合加工標準。 圖形選取模組102用於從所述圖形庫2中讀取零件圖 形,於該零件圖形中選擇一個圖形檢查區域,並於該圖形 檢查區域内確定需要檢查之圖元。所述之圖元係指零件圖 形中之每一個圖形元素,包括線、線段及圓弧等。 圖元分割模組103用於將所述圖元進行分類為線、線 段及圓弧,於該線中之線段與圓弧之拐點處將線分割為線 段及圓弧,並將分割之線段及圓弧併入該圖形檢查區域, 判斷圖形檢查區域内是否存在重複之線段及圓弧,並將重 複之線段及圓弧從該圖形檢查區域中去除掉,只保留一份 重複之線段及圓弧,這樣可以保證於圖形檢查區域内之同 一位置不會出現重複之提示標誌。 圖元檢測模組104用於計算圖形檢查區域内每一條線 段之長度及圓弧之周長,並依次判斷每一條線段之長度及 圓弧之周長是否小於設定之允許值。 圖元標識模組105用於根據判斷結果用提示標誌標識 201001304 . 出不符合加工標準之小線段’並於顯示裝置3中顯示帶有 ,提示標誌之小線段圖形於零件圖形中之位置。例如’若線 段之長度小於允許值及圓孤之周長小於允許值’則用紅色 十字線標識出所述之線段及圓弧’以提示該小線段圖形不 符合加工標準。若所有線段之長度大於等於允許值或所有 圓弧之周長大於等於允許值’則確定該小線段圖形符合加 工標準。 參閱圖3所示’係本發明小線段圖形檢查方法較佳實 < 施例之流程圖。所述之小線段圖形係一個概括性之概念, 具體資料範圍沒有確切之規定,但一般來講,長度小於 O.lmm之線段、圓弧、1/4圓孤等圖元均可稱為小線段囷 形。 參數設定模組101設定零件圖形中小線段長度之允— 值(例如長度為0.05mm) ’將該允許值作為小線段圖 否符合加工標準之判斷依據(步驟S3〇〇)。若小線段是 大於等於0.05mm,則該小線段圖形符合加工標準。若又 線段長度小於0.05mm,則該小線段圖形不符合加工襟準> 圖形選取模組102從圖形庫2中讀取待檢查之^你。 形(步驟S301)。 圖形選取模組102於該零件圖形中選擇一個圖形 區域,並於該圖形檢查區域内確定需要檢查之圖元/查 S302)。所述之圖元係指零件圖形中之 &驟 包括線、線段及圓弧等。 圖元分割模組皿騎述之圖元進行分類為線、線段 201001304 及圓弧(步驟S303)。 圖元分割模組103於該線中之線段與圓弧之拐點處將 線分割為線段及圓弧,並將分割之線段及圓弧併入該圖形 檢查區域(步驟S304)。 圖元分割模組103判斷圖形檢查區域内是否存在重複 之線段及圓弧(步驟S305)。 於步驟S305中,若圖形檢查區域記憶體於重複之線 段及圓弧,則圖元分割模組103將重複之線段及圓弧從該 圖形檢查區域内去除掉,只保留一份重複之線段及圓弧(步 驟S306),這樣可以保證於圖形檢查區域内之同一位置不 會出現重複之提示標諸。 於步驟S305中,若圖形檢查區域内不存在重複之線 段及圓弧,則圖元檢測模組104計算圖形檢查區域内每一 條線段之長度(步驟S307)。 圖元檢測模組104判斷每一條線段之長度是否小於設 定之允許值,例如長度為0.05mm (步驟S308 )。 於步驟S308中,若線段長度小於允許值,則圖元標 識模組105用一種具有顏色之標誌(例如,紅色十字線) 標識出該線段以提示所述小線段圖形不符合加工標準,並 於顯示裝置3中顯示帶有提示標誌之線段於零件圖形中之 位置。(步驟S309)。 於步驟S306中,圖元檢測模組104計算圖形檢查區 域内每一條圓弧之周長(步驟S310)。 圖元檢測模組10 4判斷每一條圓弧之周長是否小於設 11 201001304 定之允許值,例如周長為0.05mm (步驟S311)。 於步驟S311中,若圓弧之周長小於設定之允許值, 則圖元標識模組105用一種具有顏色之標誌(例如,紅色 十字線)標識出該圓弧以提示所述之小線段圖形不符合加 工標準,並於顯示裝置3中顯示帶有提示標誌之圓弧於零 件圖形中之位置。(步驟S312)。 於步驟S308中,若線段之長度大於等於允許值,或 者,於步驟S311中,若圓弧之周長大於等於允許值,則 確定所述之小線段圖形符合加工標準(步驟S313)。 所述之小線段圖形檢查系統及方法係一種專門為二維 圖形設計軟體而設計之圖形檢測系統及方法,能夠準確地 檢測出待加工零件圖形是否滿足加工標準,運用於待加工 零件圖形中所有小於規定範圍之小線段圖形,以達到提高 零件圖形之品質,並保證線切割機可以按照零件圖形正確 無誤之進行零件加工之作用。 以上所述僅為本發明之較佳實施例而已,且已達廣泛 之使用功效,凡其他未脫離本發明所揭示之精神下所完成 之均等變化或修飾,均應包含在下述之申請專利範圍内。 【圖式簡單說明】 圖1係為零件圖形中之小線段之一個簡單示例。 圖2係為本發明小線段圖形檢查系統較佳實施例之實 施環境圖。 圖3係為本發明小線段圖形檢查方法較佳實施例之流 程圖。 12 201001304 - 【主要元件符號說明】 電腦 1 小線段圖形檢查系統 10 參數設定模組 101 圖形選取模組 102 圖元分割模組 103 圖元檢測模組 104 圖元標識模組 105 圖形庫 2 顯示裝置 3 13201001304 IX. Description of the Invention: [Technical Field] The present invention/step and graphical inspection system and method, in particular, relates to a small line segment pattern inspection system and method. [Prior Art] In the graphics processing, the small line segment is a general concept, and the specific data range has no exact definitions. 'But in general, the length is less than the line segment of 〇1, round, 1/4 arc, etc. The primitives can be called small segments. Figure (&) - (4) is a simple example of a small line segment in a part drawing. Figure 丄 (1) is the original image of the small line segment, Figure 1 (1) is the right end of the small line segment after magnifying ten times, and Figure (c) is the sharp angle of the small line & From Fig. 1, we can find a small line segment whose original visual effect is a straight line. After zooming in, a sharp angle pattern appears at the f-end portion. When the part is subjected to wire cutting, the wire cutter cannot process parts with such sharp corners. ::Cutting machine uses electrode wire to discharge and corrode metal to achieve: Because of its high cutting precision, it is widely used in high precision. Commonly used electrode wires are molybdenum wire, tungsten wire, brass, and the like, in the case of a sharp angle between 0·03 and α1_, the mm level. When the above-mentioned small line segment appears in the processing pattern, the wire may not enter the sharp corner for cutting. If it is expensive, it is not reusable. In the meantime, the waste of the electrode wire will also not only waste the processing material and timely processing of the parts. The cost of "..., 4 can be reduced, so it is necessary to ensure the correctness of the processing path as much as possible, that is, it needs to be detected. Add 201001304 whether there are unprocessable parts in the work pattern to remind the processor to process such graphics. However, the processing of the graphics is generally performed by the naked eye, but the naked eye can not detect all the small line segments smaller than the specified range, so It is not guaranteed whether the processing pattern satisfies the processing conditions, resulting in loss of problems during processing. [Invention] In view of the above, it is necessary to provide a small line inspection system and method capable of accurately detecting whether the part graphic to be processed is Meet the processing standard to improve the quality of the part graphic, and ensure that the wire cutting machine can process the part correctly according to the part graphic. A small line segment graphic inspection system runs in the computer, the computer is connected with a graphic library and a display device, the system Including: parameter setting module for setting parts The allowable value of the length of the small line segment in the graphic; the graphic selection module, configured to read the part graphic from the graphic library, select a graphic inspection area in the part graphic, and determine the need to check in the graphic inspection area The primitive, the graphic element includes a line, a line segment and an arc; the primitive segmentation module is configured to classify the graphic element into a line, a line segment and an arc, and divide the line into a line segment and an arc, and The segmented line segment and the arc are merged into the graphic inspection area; the primitive detection module is configured to calculate the length of each line segment and the circumference of the arc in the graphic inspection area, and determine the length of each line segment and Whether the circumference of the arc is less than the set allowable value; the primitive identification module is configured to identify a small line segment pattern that does not conform to the processing standard by using the prompt mark according to the judgment result, and display the small line segment graphic in the display device 7 201001304 Position in the part drawing. A small line segment graphic inspection method includes the steps of: setting the allowable value of the length of the small line segment in the part graphic; selecting one in the part graphic a graphic inspection area, and determining the primitives to be inspected in the graphic inspection area, the graphic elements including lines, line segments and arcs; classifying the primitives into lines, line segments and arcs; dividing the lines For the line segment and arc, and divide the segmented line segment and arc into the graphic inspection area, count the length of each line segment in the nose pattern; determine whether the length of each line segment is less than the set allowable value; if the length of the line segment If it is less than the allowable value, use the prompt mark to identify the line segment that does not meet the processing standard; calculate the perimeter of each arc in the graphic inspection area; determine whether the circumference of each arc is less than the set allowable value; If the length is less than the set allowable value, the arc indicating the machining standard is marked by the prompt mark; the line segment with the prompt mark and the position of the arc in the part graphic are displayed. [Embodiment] Referring to FIG. 2 It is an implementation environment diagram of a preferred embodiment of the small line segment pattern inspection system of the present invention. The small line segment pattern inspection system 10 is operated in the computer 1 for detecting a small line segment pattern that does not conform to the processing standard from the processing pattern. The small line segment graphic is a general concept, and the specific data range is not specified. However, in general, a line segment, an arc, a quarter arc, and the like having a length of less than 0.1 mm may be referred to as a small line segment. Graphics. The computer 1 is connected to a graphics library 2 and a display device 3. Wherein, the graphic library 2 is used for storing the part graphic of the required detection, and the display device 3 is used for displaying the small line segment pattern with the prompt mark in the part graphic which does not conform to the processing standard, and 8 201001304 shows a small line segment which does not meet the processing standard. The position of the graphic in the part drawing. The small line segment graphics inspection system ίο includes a parameter setting module 101, a graphics selection module 102, a primitive segmentation module 103, a primitive detection module 104, and a primitive identification module 105. The parameter setting module 101 is used to set the allowable value of the length of the small line segment in the part pattern (for example, the length is 0.05 mm), and the allowable value is used as the judgment basis for whether the small line segment pattern conforms to the processing standard. If the length of the small line segment is greater than or equal to 0.05 mm, the small line segment pattern conforms to the processing standard. If the length of the small line segment is less than 0.05 mm, the small line segment pattern does not meet the processing standard. The graphic selection module 102 is configured to read a part graphic from the graphic library 2, select a graphic inspection area in the part graphic, and determine an element to be inspected in the graphic inspection area. The graphic element refers to each graphic element in the part graphic, including lines, line segments and arcs. The primitive segmentation module 103 is configured to classify the primitives into lines, line segments, and arcs, and divide the lines into line segments and arcs at the inflection points of the line segments and the arcs, and divide the segment lines and The arc is merged into the graphic inspection area, and it is judged whether there are repeated line segments and arcs in the graphic inspection area, and the repeated line segments and arcs are removed from the graphic inspection area, and only one repeated line segment and arc are reserved. This ensures that there will be no repeated prompts at the same location in the graphical inspection area. The primitive detection module 104 is configured to calculate the length of each line segment in the pattern inspection area and the circumference of the arc, and sequentially determine whether the length of each line segment and the circumference of the arc are less than the set allowable value. The primitive identification module 105 is configured to use the prompt mark to mark 201001304 according to the judgment result, and display a small line segment that does not conform to the processing standard and display the position of the small line segment pattern with the prompt mark in the part graphic in the display device 3. For example, if the length of the line segment is less than the allowable value and the circumference of the circle is less than the allowable value, the line segment and the arc 'are identified by the red cross line to indicate that the small line pattern does not meet the processing standard. If the length of all line segments is greater than or equal to the allowable value or the circumference of all arcs is greater than or equal to the allowable value', then the small line segment pattern is determined to meet the processing criteria. Referring to Fig. 3, a method for inspecting a small line segment of the present invention is preferably a flow chart of the embodiment. The small line segment graphic is a general concept, and the specific data range is not specified. However, in general, a line segment, an arc, a quarter circle, and the like having a length less than 0.1 mm may be called small. Line segment shape. The parameter setting module 101 sets the allowable value of the length of the small line segment in the part pattern (for example, the length is 0.05 mm). ‘The allowable value is used as the judgment basis of the small line segment map according to the processing standard (step S3〇〇). If the small line segment is greater than or equal to 0.05 mm, the small line segment pattern conforms to the processing standard. If the length of the line segment is less than 0.05 mm, the pattern of the small line segment does not conform to the processing standard. The graphic selection module 102 reads the object to be inspected from the graphic library 2. Shape (step S301). The graphic selection module 102 selects a graphic area in the part graphic, and determines an element to be inspected in the graphic inspection area/check S302). The primitive refers to the & step in the part drawing, including lines, line segments, and arcs. The primitives of the primitive segmentation module are classified into a line, a line segment 201001304 and an arc (step S303). The primitive segmentation module 103 divides the line into line segments and arcs at the inflection point of the line segment and the arc in the line, and merges the segmented line segments and arcs into the pattern inspection region (step S304). The element dividing module 103 determines whether or not there are overlapping line segments and arcs in the pattern inspection area (step S305). In step S305, if the graphics check area memory is in the repeated line segments and arcs, the primitive segmentation module 103 removes the repeated line segments and arcs from the pattern inspection area, leaving only one repeated line segment and The arc (step S306) ensures that repeated gestures are not present at the same location within the graphical inspection area. In step S305, if there are no overlapping segments and arcs in the graphics inspection area, the primitive detection module 104 calculates the length of each line segment in the graphics inspection area (step S307). The primitive detecting module 104 determines whether the length of each line segment is smaller than a set allowable value, for example, a length of 0.05 mm (step S308). In step S308, if the line segment length is less than the allowable value, the primitive identification module 105 identifies the line segment with a color-colored flag (for example, a red cross line) to indicate that the small line segment pattern does not meet the processing standard, and The position of the line segment with the cue mark in the part pattern is displayed in the display device 3. (Step S309). In step S306, the primitive detection module 104 calculates the perimeter of each arc in the graphics inspection area (step S310). The primitive detecting module 104 determines whether the circumference of each arc is smaller than the allowable value of the setting 11 201001304, for example, the circumference is 0.05 mm (step S311). In step S311, if the circumference of the arc is less than the set allowable value, the primitive identification module 105 identifies the arc with a color flag (for example, a red cross line) to prompt the small line segment graphic. The processing standard is not met, and the position of the arc with the cue mark in the part graphic is displayed on the display device 3. (Step S312). In step S308, if the length of the line segment is greater than or equal to the allowable value, or if the circumference of the arc is greater than or equal to the allowable value in step S311, it is determined that the small line segment pattern conforms to the processing standard (step S313). The small line segment graphic inspection system and method is a graphic detection system and method specially designed for two-dimensional graphic design software, which can accurately detect whether the graphic of the part to be processed satisfies the processing standard and is applied to all the graphics of the part to be processed. The small line segment pattern is smaller than the specified range, so as to improve the quality of the part graphic, and ensure that the wire cutting machine can perform the part processing according to the part graphic correctly. The above is only the preferred embodiment of the present invention, and has been used in a wide range of applications. Any other equivalent changes or modifications which are not departing from the spirit of the present invention should be included in the following claims. Inside. [Simple description of the diagram] Figure 1 is a simple example of a small line segment in a part drawing. Fig. 2 is a perspective view showing the implementation of a preferred embodiment of the small line segment pattern inspection system of the present invention. Fig. 3 is a flow chart showing a preferred embodiment of the small line segment pattern inspection method of the present invention. 12 201001304 - [Main component symbol description] Computer 1 small line segment graphics inspection system 10 parameter setting module 101 graphics selection module 102 primitive segmentation module 103 primitive detection module 104 primitive identification module 105 graphics library 2 display device 3 13