TW200820032A - System and method for automatically replacing graphs - Google Patents

System and method for automatically replacing graphs Download PDF

Info

Publication number
TW200820032A
TW200820032A TW95139821A TW95139821A TW200820032A TW 200820032 A TW200820032 A TW 200820032A TW 95139821 A TW95139821 A TW 95139821A TW 95139821 A TW95139821 A TW 95139821A TW 200820032 A TW200820032 A TW 200820032A
Authority
TW
Taiwan
Prior art keywords
graphic
replaced
graph
graphics
replacement
Prior art date
Application number
TW95139821A
Other languages
Chinese (zh)
Other versions
TWI385547B (en
Inventor
Jia-Bing Xiang
Original Assignee
Hon Hai Prec Ind Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hon Hai Prec Ind Co Ltd filed Critical Hon Hai Prec Ind Co Ltd
Priority to TW95139821A priority Critical patent/TWI385547B/en
Publication of TW200820032A publication Critical patent/TW200820032A/en
Application granted granted Critical
Publication of TWI385547B publication Critical patent/TWI385547B/en

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The present invention provides a system and method for automatically replacing graphs. The method includes the following steps: selecting a base graph and a graph to be replaced; obtaining attribute parameters of the base graph and the graph to be replaced; seeking two superposition sides in the base graph and the graph to be replaced according to the attribute parameters, wherein the two superposition sides are equal in length; seeking coincidence points in the superposition sides if the superposition sides exist, and orthocenter of the graph to be replaced and the base graph are on the same side of the superposition sides if the two superposition sides superpose together according to the coincidence points; getting a copy of the base graph, superposing the coincidence point of the copy of the base graph over the coincidence point of the graph to be replaced, calculating a rotation angle and a rotation direction, superposing the superposition side of the copy of the base graph over the superposition side of the graph to be replaced, and deleting the graph to be replaced. The invention can avoid fussy steps of manual graph replacement.

Description

200820032 九、發明說明: 礞 【發明所屬之技術領域】 本發明涉及一種圖形自動替換系統及方法。 【先前技術】 在模具圖形設計中,對設計的圖形進行修改需要佔據 很多的設計時間。在模具設計軟體中,一般都提供了很多 的修改命令,如複製、旋轉、鏡像等,這些基本的修改命 令基本上可以滿足簡單設計的要求,但是對於比較複雜的 設計,往往是多種修改方法共同使用,這樣操作步驟就比 較繁瑣。 比如,要實現將圖形A替換成圖形B,並保持圖形A 原來的位置關係,在傳統的操作中就要使用複製和旋轉組 合。複製需要手動尋找圖形替換的基準線和重合端點,旋 轉需要指定旋轉角度和旋轉方向,而旋轉角度的獲取又要 使用到查詢角度大小的命令,對於批量修改來說這將是很 t 大的工作量。 【發明内容】 鑒於以上内容,有必要提供一種圖形自動替換系統及 方法,其可透過選擇基準圖形和待替換圖形,自動進行圖 形替換。 一種圖形自動替換系統,包括主機及顯示器,所述主 機包括模具設計單元,用於生成待替換圖形和進行圖形替 換的基準圖形及建立圖形資料庫,所述圖形資料庫用於存 儲圖形及圖形的屬性參數,所述主機包含有圖形替換單 6 200820032 :二二m替換單元包括:圖形選擇模組,用於從模具設 片單兀的圖形貝料庫中選擇基準圖形和待替換圖形;圖形 屬f生獲取极組,用於從模具設計單元的圖形資料庫中獲取 選擇的待替換圖形和基準圖形的屬性參數;基準邊查找模 組’,用於根據獲取的圖形屬性參數尋找待替換圖形和基準 =形中長度相等的兩條邊,作爲圖形替換的基準邊;重合 端點查找模組,用於在所述基準邊中尋找用於圖形替換: 重合端點’使重合後的待替換圖形和基準圖形的重心在基 準邊的同一側;圖形替換模組,用於複製基準圖形,使複 製的基準圖形和待替換圖形的重合端點重合在一起,並計 异使所述複製的基準圖形的基準邊和待替換圖形的基準邊 重合的旋轉角度和旋轉方向,按照該旋轉角度和旋轉方向 使複製的基準圖形的基準邊和待替換圖形的基準邊完全重 合,然後刪除待替換圖形。 一種圖形自動替換方法,包括如下步驟:從模具設計 單兀的圖形資料庫中選擇基準圖形和待替換圖形;從模具 設計單元的圖形資料庫中獲取選擇的待替換圖形和基準圖 形的屬性參數;根據獲取的圖形屬性參數尋找待替換圖形 和基準圖形中長度相等的兩條邊,作爲圖形替換的基準 邊,判斷疋否有長度相等的基準邊;如果存在長度相等的 基準邊,則在所述基準邊中尋找用於圖形替換的重合端 點,使重合後的待替換圖形和基準圖形的重心在基準邊的 同一側;複製基準圖形,使複製的基準圖形和待替換圖形 的重合端點重合在一起,並計算使所述複製的基準圖形的 200820032 基♦準邊和待替換圖形的基準邊重合的旋轉角度和旋轉方 向,按照該旋轉角度和旋轉方向使複製的基準圖形的基準 邊和待替換圖形的基準邊完全重合,然後刪除待替換圖形。 相車乂于習知技術,所述的圖形自動替換系統及方法, 透過選擇基準圖形和待替換圖形,自動進行圖形替換,避 免了人爲替換的繁瑣步驟。 【實施方式】 參閱圖1所示,係本發明圖形自動替換系統較佳實施 例的系統架構11。該系統主要包括顯示器i、主機2、鍵盤 3及滑鼠4 ’所述主機2包含有模具設計單元20及圖形^ 換單元21。其中,模具設計單元20丨-種模具自動設; 軟體(如AUtGCAD),用於生成模具元件圖形。在用戶利 用拉具設計單元20進行緣圖時,模具設計單元20會建立 :個圖形資料庫’所述圖形資料庫用於存儲圖形及圖形 屬性f數等’所述圖形的屬性參數包括:圖形所包含的邊 2數里、母條邊的長度及圖形每—個頂點的座標等。圖形 替換單^ 2!用於根據·賴具設計單元 =圖形’對待替換圖形進行自動替換,並保持原來= 換圖形的位置關係。 所述主機2連接有顯示器i,用於顯示模具設計單元 換^成的牛圖形和圖形替換單元21生成的圖形替 和滑鼠4是輸入設備,可以在生成模 斤述圖心替換單凡21包括圖形選擇模組以〇,圖形屬 200820032 性‘獲取模組211,基準邊查找模組212,重合端點查找模組 213及圖形替換模組214。本發明所稱的模組是完成一特定 功志的電腦程式段,比程式更適合於描述軟體在電腦中的 執行過程,因此在本發明以下對軟體描述中都以模組描述。 其中,圖形選擇模組210用於從模具設計單元2〇的 圖形資料庫中選擇待替換圖形和基準圖形(即要將待替換 圖形曰換成的最終圖形)。圖形屬性獲取模組用於從模 具設計單元20的圖形資料庫中獲取選擇的待替換圖形和 基準圖形的屬性參數,如®形所包含的邊的數量、每條邊 、長又及圖形母一個頂點的座標等。其餘模組的功能纟士人 圖2至圖5 一一說明。 、Ό 口 參:圖2至圖5所示,係本發明圖形自動替換系統的 不思圖,整個圖形替換的步驟從圖2變化到圖5,在 ’所述圖形Α爲待替換圖形,圖形Β爲基準圖形, =、圖形Α和基準圖形Β透過模具設計單元2〇生成。 待替ΪΞΓΓ擇模組210先選擇基準圖形Β,然後選擇 t曰換圖形A和基準圖形B的屬性參數。 獲取根據圖形屬性獲取模組211 長产tr該鱗邊即㈣㈣料鱗圖形中 長;^目^ _料每—條邊的μ,直到找到 -相專的兩條邊作爲圖形替換的基準邊。如果沒有找 200820032 <’則=沒有找到符合條件的基準邊,流程結束。 如圖2中的m、n所示,即爲待替換圖 形B的基準彳嘉,甘士 *堆# 您卡_ 、 邊其中,基準邊m的兩個端點爲ml和m2,200820032 IX. INSTRUCTIONS: 礞 Technical Field of the Invention The present invention relates to a graphics automatic replacement system and method. [Prior Art] In the mold design, it takes a lot of design time to modify the design graphics. In the mold design software, a lot of modification commands are generally provided, such as copying, rotating, mirroring, etc. These basic modification commands can basically meet the requirements of simple design, but for more complicated designs, often a variety of modification methods are common. Use, such steps are more cumbersome. For example, to replace the graphic A with the graphic B and maintain the original positional relationship of the graphic A, the copying and rotating combination is used in the conventional operation. Copying needs to manually find the reference line and coincident end point of the graphic replacement. The rotation needs to specify the rotation angle and the rotation direction, and the rotation angle is obtained by using the command to query the angle size. This will be very big for batch modification. The amount of work. SUMMARY OF THE INVENTION In view of the above, it is desirable to provide a graphics automatic replacement system and method that automatically performs graphics replacement by selecting a reference graphic and a graphic to be replaced. A graphics automatic replacement system includes a host and a display, the host includes a mold design unit for generating a reference graphic to be replaced and a graphic replacement, and a graphic database for storing graphics and graphics The attribute parameter, the host includes a graphic replacement unit 6 200820032: the second m replacement unit includes: a graphic selection module, configured to select a reference graphic and a graphic to be replaced from a graphic bedding library of the mold setting unit; The f-acquisition group is used for obtaining the selected attribute of the graphic to be replaced and the reference graphic from the graphic database of the mold design unit; the reference edge searching module is configured to find the graphic to be replaced according to the acquired graphic attribute parameter and Base = two sides of equal length in the shape, as the reference edge of the graphic replacement; coincidence endpoint search module, used to find the graphics replacement in the reference edge: coincident endpoints to make the overlapping graphics and The center of gravity of the reference graphic is on the same side of the reference edge; the graphic replacement module is used to copy the reference graphic to make the copied reference image Coincident with the coincident end points of the graphic to be replaced, and differentiating the rotation angle and the rotation direction of the reference edge of the copied reference graphic and the reference edge of the graphic to be replaced, according to the rotation angle and the rotation direction The datum edge of the datum graphic completely coincides with the datum edge of the graphic to be replaced, and then the graphic to be replaced is deleted. A method for automatically replacing a graphic, comprising the steps of: selecting a reference graphic and a graphic to be replaced from a graphic database of a mold design unit; and obtaining attribute parameters of the selected graphic to be replaced and the reference graphic from a graphic database of the mold design unit; Finding two sides of equal length in the to-be-replaced figure and the reference figure according to the obtained graphic attribute parameter, as a reference edge of the graphic replacement, determining whether there is a reference edge of equal length; if there are reference edges of equal length, then the reference is Find the coincident endpoints for the graphics replacement in the edge, so that the coincidence of the to-be-replaced graphics and the center of gravity of the reference graphics are on the same side of the reference edge; copy the reference graphics so that the coincident endpoints of the copied reference graphics and the graphics to be replaced overlap Together, and calculating a rotation angle and a rotation direction of the 200820032 base ♦ quasi-edge of the copied reference pattern and the reference edge of the graphic to be replaced, and the reference edge of the copied reference pattern and the to-be-replaced according to the rotation angle and the rotation direction The datum edges of the graph are completely coincident, and then the graph to be replaced is deleted. According to the conventional technology, the automatic graphic replacement system and method automatically replace the graphic by selecting the reference graphic and the graphic to be replaced, thereby avoiding the cumbersome steps of artificial replacement. [Embodiment] Referring to Figure 1, there is shown a system architecture 11 of a preferred embodiment of the graphics automatic replacement system of the present invention. The system mainly includes a display i, a host 2, a keyboard 3, and a mouse 4'. The host 2 includes a mold design unit 20 and a graphic change unit 21. Among them, the mold design unit 20 is automatically set up; the soft body (such as AUtGCAD) is used to generate the mold component graphic. When the user uses the pull design unit 20 to perform the edge map, the mold design unit 20 creates a graphic database 'the graphic database for storing graphics and graphic attributes f number, etc.' The attribute parameters of the graphic include: graphics The number of edges included, the length of the parent side, and the coordinates of each vertex of the graph. The graphic replacement sheet ^ 2! is used to automatically replace the replacement pattern according to the design unit = graphic ', and keep the original = change the positional relationship of the graphic. The host 2 is connected with a display i for displaying a cow graphic formed by the mold design unit and a graphic replacement unit 21 generated by the graphic replacing unit 21 and the mouse 4 is an input device, and can replace the single figure 21 in the generation of the pattern. Including the graphics selection module, the graphics belong to the 200820032 sexual 'acquisition module 211, the reference edge search module 212, the coincidence endpoint search module 213 and the graphics replacement module 214. The module referred to in the present invention is a computer program segment that performs a specific task, and is more suitable for describing the execution process of the software in the computer than the program. Therefore, the following description of the software is described in the module. The graphic selection module 210 is configured to select a graphic to be replaced and a reference graphic (ie, a final graphic to be replaced with the graphic to be replaced) from the graphic database of the mold design unit 2〇. The graphic attribute obtaining module is configured to obtain the selected attribute of the graphic to be replaced and the reference graphic from the graphic database of the mold design unit 20, such as the number of edges included in the shape, each edge, the length, and a vertex of the graphic parent. Coordinates, etc. The functions of the remaining modules are shown in Figure 2 to Figure 5. Ό 参 :: Figure 2 to Figure 5, is the picture of the automatic replacement system of the present invention, the entire figure replacement step changes from Figure 2 to Figure 5 Β is the reference graph, and the =, graph Α and reference graph 〇 are generated by the mold design unit 2〇. The candidate module 210 first selects the reference pattern Β, and then selects the attribute parameters of the pattern A and the reference pattern B. Obtaining the module 211 according to the graphic attribute yielding the scale edge is (4) (four) the length of the scale pattern; ^ mesh ^ _ material per-edge μ, until the two sides of the - phase are used as the reference edge of the graphic replacement. If you do not find 200820032 <' then = no matching criteria is found, the process ends. As shown by m and n in Fig. 2, it is the reference of the pattern B to be replaced, and the two endpoints of the reference edge m are ml and m2.

土準邊η的兩個端點爲nl*以。在圖形替換時 J 條長度:等的基準邊作爲圖形替換的重合基準:' 一、點查找板組213用於在所述基準邊中尋 圖形替換的重人媳戥‘闰^&一 ^ 寸找用柃 垔口鳊點。如圖2所不,找到基準邊m和義準 邊η後’下-步就要確定㈣換圖形A巾基準邊⑼^ m2如何跟基準圖形B中基準邊n的兩個端 Μ和以重合。具體而言,重合端點查找模組213先拿 點ml跟端點nl重合,如果重合後待替換圖形a和基準 形B的重心在基準邊m的同一侧,則選擇端點W跟端: 重&、如果重合後待替換圖形A和基準圖形b的重: 不在基準邊m的同一側,則拿端點ml跟基準圖形B的另 外個端點n2 t合,直到找到重合後待替換圖形a和基 準圖形B的重心在基準邊m同一侧的重合端點爲止。如圖 2所不,重合端點查找模組213尋找到的重合端點爲(^、 nl) ’即端點ml跟端點nl重合。 圖形替換模組214用於複製基準圖形,使複製的基準 圖形和待替換圖形的重合端點重合在一起,並計算使所述 兩條基準邊重合的旋轉角度和旋轉方向,按照該旋轉角度 和旋轉方向使複製的基準圖形旋轉到兩條基準邊完全重 合’然後刪除待替換圖形(如果用戶同意替換)或刪除複 製的基準圖形(如果用戶不同意替換)。 200820032 二具體而言,首先,如圖3所示,圖形替換模組214複 製基準圖形B得到複製的基準圖形B1,其中,複製的基 準圖形B1的基準邊爲k,基準邊k的兩個端點爲kl和k2。 然後,圖形替換模組214使待替換圖形A中的基準邊m的 重合端點ml跟複製的基準圖形B1的基準邊k的重合端點 kl重合,並計算使所述基準邊m和基準邊k重合的旋轉角 度和旋轉方向,按照該旋轉角度和旋轉方向使複製的基準 圖形B1旋轉到基準邊m和基準邊k完全重合,即端點ml 跟端點kl重合,端點m2跟端點k2重合,如圖4所示。 如果用戶確認替換,則圖形替換模組214刪除待替換圖形 A,如圖5所示;如果用戶不進行替換,則圖形替換模組 214刪除複製的基準圖形B1,回到圖2所示的初始狀態。 參閱圖6所示,係本發明圖形自動替換方法較佳實施 例的流程圖,以下描述將結合圖2、圖3、圖4及圖5進行。 首先,步驟S401,用戶透過圖形選擇模組210從模具設計 單元20的圖形資料庫中先選擇基準圖形B(即要將待替換 圖形替換成的最終圖形),然後選擇待替換圖形A,圖形屬 性獲取模組211根據用戶選擇的圖形從模具設計單元20 的圖形資料庫中獲取待替換圖形A和基準圖形B的屬性參 數’如圖形所包含的邊的數量、每條邊的長度及圖形每一 個頂點的座標等。 步驟S402,基準邊查找模組212依次比較待替換圖形 A中每一條邊和基準圖形B中每一條邊的長度,直到找到 長度相等的兩條邊作爲圖形替換的基準邊。如圖2中的 11 200820032 m : η所示,即爲待替換圖形A和基準圖形B的基準邊, 其中,基準邊m的兩個端點爲ml和m2,基準邊η的兩個 端點爲nl和η2。 步驟S403,判斷是否有長度相等的基準邊。 步驟S404,如果基準邊查找模組212沒有找到長度相 等的基準邊,則提示沒有找到符合條件的基準邊,流程結 束。 步驟S405,如果基準邊查找模組212找到了長度相等 的基準邊,則重合端點查找模組213先拿端點ml跟端點 nl重合,如果重合後待替換圖形A和基準圖形B的重心 在基準邊m的同一侧,則選擇端點ml跟端點nl重合。如 果重合後待替換圖形A和基準圖形B的重心不在基準邊m 的同一側,則拿端點ml跟基準圖形B的另外一個端點n2 重合,直到找到重合後待替換圖形A和基準圖形B的重心 在基準邊m同一側的重合端點爲止。如圖2所示,重合端 點查找模組213尋找到的重合端點爲(ml、nl),即端點ml 跟端點nl重合。 步驟S406,圖形替換模組214複製基準圖形B得到複 製的基準圖形B1,其中,複製的基準圖形B1的基準邊爲 k,基準邊k的兩個端點爲kl和k2。然後,圖形替換模組 214使待替換圖形A中的基準邊m的重合端點ml跟複製 的基準圖形B1的基準邊k的重合端點kl重合,如圖3所 示。圖形替換模組214計算使所述基準邊m和基準邊k重 合的旋轉角度和旋轉方向,按照該旋轉角度和旋轉方向使 12 200820032 複.製的基準圖形B1旋轉到基準邊m和基準邊k完全重 合,即端點ml跟端點kl重合,端點m2跟端點k2重合, 如圖4所示。 步驟S407,用戶確認是否進行圖形替換。 步驟S408,如果用戶確認替換,則圖形替換模組214 刪除待替換圖形A,如圖5所示。 步驟S408,如果用戶不進行替換,則圖形替換模組 214刪除複製的基準圖形B1,回到圖2所示的初始狀態。 在本實施例中,基準邊的查找是根據基準圖形和待替 換圖形中兩條長度相等的邊作爲圖形替換的基準邊。除了 該實施例外,本發明還可以具有其他變化,例如基準邊的 查找也可以根據基準圖形和待替換圖形中兩條相差某一長 度單位的邊作爲圖形替換的基準邊,這種簡單變換仍落入 本發明的保護範圍。 本發明圖形自動替換系統及方法,雖以較佳實施例揭 露如上,然其並非用以限定本發明。任何熟悉此項技藝之 人士,在不脫離本發明之精神及範圍内,當可做更動與潤 飾,因此本發明之保護範圍當視後附之申請專利範圍所界 定者為準。 【圖式簡單說明】 圖1係本發明圖形自動替換系統較佳實施例的系統架 構圖。 圖2至圖5係本發明圖形自動替換系統的實體示意 圖0 13 200820032 : 圖6係本發明圖形自動替換方法較佳實施例的流程 圖。 【主要元件符號說明】 顯示器 1 主機 2 鍵盤 3 滑鼠 4 模具設計單元 20 圖形替換單元 21 圖形選擇模組 210 圖形屬性獲取模組 211 基準邊查找模組 212 重合端點查找模組 213 圖形替換模組 214 14The two endpoints of the soil boundary η are nl*. In the case of graphics replacement, J-length: equal reference edge as the coincidence reference of the graphic replacement: '1. The point search board group 213 is used to find the heavy person in the reference edge to replace the figure 闰'闰^& Inch look for a bite. As shown in Fig. 2, after finding the reference edge m and the sensed edge η, the next step is to determine (4) how to change the reference edge (9)^m2 of the pattern A to coincide with the two ends of the reference edge n in the reference pattern B. Specifically, the coincidence endpoint search module 213 first takes the point ml and the endpoint n1. If the center of gravity of the graph a and the reference B to be replaced are on the same side of the reference edge m, the endpoint W is selected: Weight & If the weight of the graph A and the reference graph b to be replaced after the coincidence: not on the same side of the reference edge m, the endpoint ml is combined with the other endpoint n2 of the reference graph B until the coincidence is found and is to be replaced. The center of gravity of the graph a and the reference pattern B is at the coincident end point on the same side of the reference side m. As shown in FIG. 2, the coincident endpoint search module 213 finds the coincident endpoint as (^, nl)', that is, the endpoint ml coincides with the endpoint nl. The graphic replacement module 214 is configured to copy the reference graphic, make the copied reference graphic and the coincident end point of the graphic to be replaced overlap, and calculate a rotation angle and a rotation direction that make the two reference edges coincide, according to the rotation angle and The direction of rotation rotates the copied reference graphic to exactly coincide with the two reference edges' and then deletes the graphic to be replaced (if the user agrees to replace) or deletes the copied reference graphic (if the user does not agree to the replacement). 200820032. Specifically, first, as shown in FIG. 3, the graphics replacement module 214 copies the reference pattern B to obtain a copied reference pattern B1, wherein the reference side of the copied reference pattern B1 is k, and both ends of the reference side k The points are kl and k2. Then, the graphic replacement module 214 causes the coincident end point ml of the reference edge m in the graphic A to be replaced to coincide with the coincident end point k1 of the reference side k of the copied reference graphic B1, and calculates the reference edge m and the reference edge. k coincides the rotation angle and the rotation direction, according to the rotation angle and the rotation direction, the copied reference figure B1 is rotated to the reference edge m and the reference edge k completely coincide, that is, the end point ml coincides with the end point k1, the end point m2 and the end point K2 coincides, as shown in Figure 4. If the user confirms the replacement, the graphic replacement module 214 deletes the graphic A to be replaced, as shown in FIG. 5; if the user does not perform the replacement, the graphic replacement module 214 deletes the copied reference graphic B1, and returns to the initial state shown in FIG. status. Referring to Fig. 6, there is shown a flow chart of a preferred embodiment of the automatic pattern replacing method of the present invention. The following description will be made in conjunction with Figs. 2, 3, 4 and 5. First, in step S401, the user selects the reference graphic B (ie, the final graphic to be replaced with the graphic to be replaced) from the graphic database of the mold design unit 20 through the graphic selection module 210, and then selects the graphic A to be replaced, the graphic attribute. The obtaining module 211 obtains the attribute parameters of the graphic A and the reference graphic B to be replaced from the graphic database of the mold design unit 20 according to the graphic selected by the user, such as the number of edges included in the graphic, the length of each edge, and each vertex of the graphic. Coordinates, etc. In step S402, the reference edge search module 212 sequentially compares the length of each edge of the pattern A to be replaced with each edge of the reference pattern B until two edges of equal length are found as reference edges for pattern replacement. As shown in FIG. 2, 11 200820032 m : η, which is the reference edge of the pattern A and the reference pattern B to be replaced, wherein the two endpoints of the reference edge m are ml and m2, and the two endpoints of the reference edge η For nl and η2. In step S403, it is determined whether there are reference edges of equal length. In step S404, if the reference edge search module 212 does not find a reference edge of equal length, it indicates that the reference edge that meets the condition is not found, and the process ends. In step S405, if the reference edge search module 212 finds the reference edges of equal length, the coincidence endpoint search module 213 first takes the endpoint ml and the endpoint n1, and if they overlap, the center of gravity of the graph A and the reference graph B to be replaced. On the same side of the reference edge m, the selection endpoint ml coincides with the endpoint nl. If the center of gravity of the pattern A to be replaced and the reference pattern B after the coincidence are not on the same side of the reference edge m, the endpoint ml is coincident with the other endpoint n2 of the reference pattern B until the pattern A and the reference pattern B to be replaced are found after the coincidence is found. The center of gravity is at the coincident end of the same side of the reference edge m. As shown in FIG. 2, the coincident end point finding module 213 finds the coincident end point as (ml, nl), that is, the end point ml coincides with the end point nl. In step S406, the graphics replacement module 214 copies the reference pattern B to obtain a copied reference pattern B1, wherein the reference side of the copied reference pattern B1 is k, and the two endpoints of the reference side k are k1 and k2. Then, the graphic replacement module 214 causes the coincident end point ml of the reference edge m in the pattern A to be replaced to coincide with the coincident end point k1 of the reference side k of the copied reference pattern B1, as shown in FIG. The graphic replacement module 214 calculates a rotation angle and a rotation direction in which the reference edge m and the reference edge k are coincident, and rotates the reference pattern B1 of the 12200820032 reproduction to the reference edge m and the reference edge k according to the rotation angle and the rotation direction. Fully coincident, that is, the endpoint ml coincides with the endpoint k1, and the endpoint m2 coincides with the endpoint k2, as shown in FIG. In step S407, the user confirms whether or not to perform graphics replacement. In step S408, if the user confirms the replacement, the graphic replacement module 214 deletes the graphic A to be replaced, as shown in FIG. In step S408, if the user does not perform the replacement, the graphic replacement module 214 deletes the copied reference graphic B1 and returns to the initial state shown in FIG. 2. In the present embodiment, the lookup of the reference edge is based on the reference pattern and the two edges of the same length in the pattern to be replaced as the reference edge for the pattern replacement. In addition to this implementation, the present invention may have other variations. For example, the search of the reference edge may also be based on the reference pattern and the edge of the image to be replaced that differ by a certain length unit as the reference edge of the graphic replacement. It is within the scope of protection of the present invention. The automatic graphics replacement system and method of the present invention are disclosed above in the preferred embodiments, but are not intended to limit the present invention. Any person skilled in the art will be able to make changes and modifications without departing from the spirit and scope of the invention, and the scope of the invention is defined by the scope of the appended claims. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a system architecture diagram of a preferred embodiment of the graphics automatic replacement system of the present invention. 2 to 5 are schematic diagrams showing the entity of the automatic graphics replacement system of the present invention. Figure 0 13 200820032: Figure 6 is a flow chart of a preferred embodiment of the automatic pattern replacement method of the present invention. [Main component symbol description] Display 1 Host 2 Keyboard 3 Mouse 4 Mold design unit 20 Graphic replacement unit 21 Graphic selection module 210 Graphic attribute acquisition module 211 Reference edge search module 212 Coincidence endpoint search module 213 Graphic replacement mode Group 214 14

Claims (1)

200820032 十 1 · 、申請專利範圍 奐系統,包括主機及顯示器,所述主機 換的爲進同/ 70肖於生成待替換11形和進行圖形替 及建立圖形資料庫,所述圖形資料庫用於 及圖形的屬性參數,其中,所述主機包含有圖 換早7^,該圖形替換單元包括: 模組,用於從模具設計單元的圖形資料庫中選 擇基準圖形和待替換圖形; =形屬性獲取模組,用於從模具設計單㈣圖形資料庫 中獲取選擇的待替換圖形和基準目形的屬性參數; 土準邊查找模組,用於根據獲取的圖形屬性參數尋找待 替換圖形和基準圖形中長度相等的兩條邊,作爲圖形替 換的基準邊; 重合端點查找模組,用於在所述基準邊中尋找用於圖形 替換的重合端點,使重合後的待替換圖形和基準圖形的 重心在基準邊的同一側;及 圖形替換模組,用於複製基準圖形,使複製的基準圖形 和待替換圖形的重合端點重合在一起,並計算使所述複 製的基準圖形的基準邊和待替換圖形的基準邊重合的 旋轉角度和旋轉方向,按照該旋轉角度和旋轉方向使複 製的基準圖形的基準邊和待替換圖形的基準邊完全重 合,然後刪除待替換圖形。 2·如申請專利範圍第1項所述的圖形自動替換系統,其 中’所述基準邊查找模組還用於在沒有找到長度相等的 15 200820032 '基準邊時提示沒有找到符合條件的基準邊。 3 ·如申請專利範圍第1項所述的圖形自動替換系統,其 中,所述圖形替換模組還用於在不進行圖形替換時刪除 複製的基準圖形。 4 · 一種圖形自動替換方法,該方法包括如下步驟: 從模具設計單元的⑽料庫巾選擇基準_和待替 換圖形; 從模具設計單元的圖形資料庫中獲取選擇的待替換圖 形和基準圖形的屬性參數; 根據獲取的圖形屬性參數尋找待替換圖形和基準圖形 中長度相等的兩條邊,作爲圖形替換的基準邊; 判斷是否有長度相等的基準邊; 如果存在長度相等的基準邊,則在所述基準邊中尋找用 於圖形替換的重合端點,使重合後的待替換圖形和基準 圖形的重心在基準邊的同一側;及 複製基準圖形’使複製的基準圖形和待替換圖形的重合 端點重合在一起,並計算使所述複製的基準圖形的基準 邊和待替換圖形的基準邊重合的旋轉角度和旋轉方 向,按照該旋轉角度和旋轉方向使複製的基準圖形的基 準邊和待替換圖形的基準邊完全重合,然後刪除待替換 圖形。 5 ·如申請專利範圍第4項所述的圖形自動替換方法,其 中,該方法還包括:如果沒有長度相等的基準邊,則提 示;又有找到付合條件的基準邊,流程結束。 16 200820032 6::如申請專利範圍第4項所述的圖形自動替換方法,其 中,該方法還包括:如果不進行圖形替換,則刪除複製 的基準圖形。200820032 XI · · Patent application scope system, including the host computer and the display, the host exchanges the same as the generation of the 11 shape to be replaced and the graphics for the establishment of a graphic database, the graphic database is used for And the attribute parameter of the graphic, wherein the host includes a picture early 7^, the graphic replacement unit includes: a module, configured to select a reference graphic and a graphic to be replaced from a graphic database of the mold design unit; The obtaining module is configured to obtain the selected attribute of the graphic to be replaced and the reference target shape from the mold design sheet (four) graphic database; the soil quasi-side searching module is configured to find the graphic and the reference to be replaced according to the obtained graphic attribute parameter Two edges of equal length in the graph as the reference edge of the graphic replacement; a coincident endpoint search module for finding coincident endpoints for graphics replacement in the reference edge, and the coincident graphics and reference graphics to be replaced The center of gravity is on the same side of the reference edge; and the graphics replacement module is used to copy the reference graphics so that the copied reference graphics and the graphics to be replaced The coincident end points are coincident, and a rotation angle and a rotation direction that coincide with a reference edge of the copied reference figure and a reference edge of the graphic to be replaced are calculated, and the reference edge of the copied reference figure is made according to the rotation angle and the rotation direction The reference edges of the graphic to be replaced are completely coincident, and then the graphic to be replaced is deleted. 2. The automatic graphics replacement system of claim 1, wherein the reference edge lookup module is further configured to prompt that no matching reference edge is found when no equal length 15 200820032 'reference edge is found. The graphics automatic replacement system of claim 1, wherein the graphics replacement module is further configured to delete the copied reference graphics without performing graphics replacement. 4) A method for automatically replacing a graphic, the method comprising the steps of: selecting a reference _ and a graphic to be replaced from a (10) magazine of the mold design unit; and obtaining a selected graphic to be replaced and a reference graphic from a graphic database of the mold design unit Attribute parameter; Find two edges of equal length in the graph to be replaced and the reference graph according to the obtained graph attribute parameter, as the reference edge of the graph replacement; determine whether there are reference edges of equal length; if there are reference edges of equal length, then Finding the coincident end point for the graphic replacement in the reference edge, so that the coincident image of the to-be-replaced figure and the reference figure are on the same side of the reference side; and copying the reference figure 'to make the copied reference figure and the overlapping end of the graphic to be replaced The points are coincident, and a rotation angle and a rotation direction of the reference edge of the copied reference pattern and the reference edge of the graphic to be replaced are calculated, and the reference edge of the copied reference pattern and the to-be-replaced are made according to the rotation angle and the rotation direction. The datum edges of the graph are completely coincident, and then the graph to be replaced is deleted. 5. The method of automatically replacing a graphic according to claim 4, wherein the method further comprises: if there is no reference edge of equal length, the prompt is provided; and the reference edge for finding the binding condition is found, and the process ends. The method of automatically replacing a graphic according to claim 4, wherein the method further comprises: if the graphic replacement is not performed, deleting the copied reference graphic. 1717
TW95139821A 2006-10-27 2006-10-27 System and method for automatically replacing graphs TWI385547B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW95139821A TWI385547B (en) 2006-10-27 2006-10-27 System and method for automatically replacing graphs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW95139821A TWI385547B (en) 2006-10-27 2006-10-27 System and method for automatically replacing graphs

Publications (2)

Publication Number Publication Date
TW200820032A true TW200820032A (en) 2008-05-01
TWI385547B TWI385547B (en) 2013-02-11

Family

ID=44770029

Family Applications (1)

Application Number Title Priority Date Filing Date
TW95139821A TWI385547B (en) 2006-10-27 2006-10-27 System and method for automatically replacing graphs

Country Status (1)

Country Link
TW (1) TWI385547B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI417806B (en) * 2008-09-29 2013-12-01 Nvidia Corp Single pass tessellation

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6684376B1 (en) * 1997-01-27 2004-01-27 Unisys Corporation Method and apparatus for selecting components within a circuit design database
JP2003011128A (en) * 2001-07-02 2003-01-15 Futaba Corp Method and apparatus for designing press mold, and recording medium
JP3535483B2 (en) * 2001-07-19 2004-06-07 株式会社トヨタケーラム CAD system and design method using CAD system
TW200521880A (en) * 2003-12-23 2005-07-01 Inventec Corp Method and system for updating overlay computer graphic object

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI417806B (en) * 2008-09-29 2013-12-01 Nvidia Corp Single pass tessellation

Also Published As

Publication number Publication date
TWI385547B (en) 2013-02-11

Similar Documents

Publication Publication Date Title
JP6125747B2 (en) Designing modeled objects in a CAD system session that interacts with a database
JP6498872B2 (en) Designing 3D modeled objects using 2D views
WO2019196744A1 (en) Interaction method and apparatus
JPH05205012A (en) Method of changing cad data
JP2007066291A (en) Method, apparatus and system for image display, server, program, and recording medium
TW201011578A (en) Method and apparatus for copying objects in an object-oriented environment using a multiple-transaction technique
JPH11306224A (en) Three-dimensional model production device, its method and medium for recording three-dimensional model production program
TW201241657A (en) Dual-pattern coloring technique for mask design
WO2017147909A1 (en) Target device control method and apparatus
JP3647407B2 (en) Image processing device
JP2019094620A (en) Bridge inspection support device, bridge inspection support method, program, and mobile terminal device
TW200820032A (en) System and method for automatically replacing graphs
JP2003242186A (en) Cad data processing device
Ye et al. Puzzlefixer: A visual reassembly system for immersive fragments restoration
WO2013038460A1 (en) Image display system and method for same
JP2000268197A (en) Design system and recording medium
CN116308132A (en) Automatic office method and system based on workflow engine
JP2003263464A (en) Fillet preparing method and three-dimensional cad program
JP7313433B2 (en) Construction and Enforcement of Counterconstraints on CAD (Computer Aided Design) Models
JP2003504760A (en) How to assign IDs to objects in the database
JP2020064454A (en) Method for automatically correcting cad drawing element
JP2008299643A (en) Three-dimensional model forming device and program
Stierand et al. Flat and Easy: 2D Depiction of Protein‐Ligand Complexes
JP2002245099A (en) Design information management system, method for registering and providing three-dimensional data, and recording medium
JPH07152928A (en) Method and device for image processing

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees