201028643 . 六、發明說明: 【發明所屬之技術領域】 本發明涉及一種二維量測系統及方法,尤其係關於一 * 種曲面檢測系統及方法。 【先前技術】 三座標測量機係於工業、科研中被廣泛應用於對產品 進行測量的一種測量裝置,一般的測量方法係將被測物件 • 置於三座標測量空間,利用三座標測量機的接觸探頭沿被 測物件的表面經過編程的路徑逐點捕捉資料,根據捕捉的 資料分析被測物件的曲面品質。然而,隨著產品曲面造型 , 越來越複雜,如手機、MP3、MP4,傳統的測量方法獲得 - 的測量資料很難反映曲面的真實情況,測量速度慢且效率 較低。 【發明内容】 鑒於以上内容,有必要提供一種曲面檢測系統及方 β 法,能夠對複雜曲面進行檢測,提高曲面檢測致率及精度。 -種曲面檢測系統,運行於電腦。所述電腦執行該曲 面檢測系統從資料庫接收曲面資料及點雲眘 农貝枓,接收用戶 的公差設置及顏色設置資訊,根據接收的曲面資料血點带 資料將點雲與曲面對齊,根據對齊後的曲面資料及點= 料計算點雲中的各點到曲面的最近距離,確定各最近 所對應的曲面上的各三角形,根據各最近^所落 差區間用相對應顏色標示該曲面上的各三 一 β啦。此外,所 述電腦執行該曲面檢測系統對曲面的顏色進行均衡處理 4 201028643 並依據均衡處理後的曲面資料生成檢測報告。 ❹ 一種曲面檢測方法,該方法包括以下步驟:(a)接收 物件CAD模型的三角網格曲面資料及掃描物件得到的點 雲資料;(b)將所述點雲與所述三角網格曲面對齊; 接收公差設置資訊及顏色設置資訊,包括允許的最大正公 差值、允許的最小負公差值、公差的分段區間及不同公差 區間的顏色值;(d)根據對齊後的三角網格曲面資料及點 雲資料計算對齊後點雲中各點到三角網格曲面的最近距 離,所述最近距離稱作原始最近距離;(e)根據各原始最 近距離確定與點雲中各點距離最近的三角網格曲面上的三 角形;(f)根據各原始最近距離所屬公差區間得到各三 =的原始顏色值’將該各原始最近距離及各原始顏色值儲 :至三角網格曲面上相對應三角形的資料結構 =角網格曲面上三角形的資料結構中的原: 值及用Μ置的向三角形周圍擴展的層離= =::=理,計算各三_均衡= 料二一資 相較於習知測量系統及方法 系統及方法可根據掃摇物件得到的實:點=之曲面檢測 CAD模型的三角 實際點农的點與物件的 段區間用不_色標示:^離^料同公差分 ⑽模型的三角網格曲面 的=網:曲面’並對 顏色均衡後的三㈣資料並生成直觀的 201028643 .對複雜曲面進行檢測的精度及速度。 【實施方式】 如圖1所示’係本發明曲面檢测系統較佳實施例之應 .用5哀境圖。所述曲面檢測系統200安裝並運行於電腦20。 該電腦沈與資料庫1〇及顯示設備3〇相連接。 二貝料庫10用於儲存物件的標準CAD模型的三角網袼 $面貝料(以下簡稱曲面資料)、掃描物件得到的實際點雲 ❹=貝料(以下簡稱點雲資料)以及曲面檢測過程中產生的 料。 電腦2〇執行該曲面檢測系、统200從資料庫10接收曲 面資料及點雲資料,接收用戶的公差設置及顏色設置資 Λ根據接收的曲面資料與點雲資料將點雲與曲面對齊, 根據對齊後的曲面資料及點雲資料計算點雲中的各點到曲 面的最近距離,確定各最近距離所對應的曲面上的各三角 ^根據各取近距離所落入的公差區間用相對應顏色標示 X :面上的各—角形。此外’電腦還用於執行該曲面檢 ^ .此 顏色進行均衡處理,並依據均衡處理 後的曲面資料生成檢測報告。 在對實際物件進行掃插時,由於光線或其它原因,有 二4位可ι沒有掃描到點,有些掃描得朗點誤差較大, 對曲面的顏色進行均衡處理的目的㈣了過濾掉點雲中的 個別誤差點、對沒有掃描到點的地方㈣圍的點來平衡, 降低在對曲面進行檢測過程中由於掃㈣差而導致的誤 差。 6 201028643 顯示設備30提供顯示介面用於顯示三角網格曲面、掃 描物件得到的點雲、利用該系統對曲面進行檢測得到的不 • 同顏色標示的曲面及檢測報告。 . 如圖2所示,係本發明曲面檢測方法較佳實施例之主 流程圖。 首先,步驟S101,接收用戶從資料庫10導入的曲面 資料及點雲資料。 步驟S102,根據接收的曲面資料與點雲資料將點雲與 馨 ... 曲面對齊。 步驟S103,接收公差設置資訊及顏色設置資訊。於本 實施例中,公差指的係點雲與曲面對齊後點雲中的點到曲 面的最近距離的值的波動範圍。所述公差設置資訊包括: 允許的最大正公差值(如0.350)、允許的最小負公差值(如 -0.350)及公差的分段區間,如將允許的最大正公差值與 允許的最小負公差值確定的區間[0.350,-0.350]分成若干個 ⑩ 公差區間[-0.350,-0.300] ,[-0.300,-0.250],..., [0.250,0·300],[0.300,0.350]。所述顏色設置資訊包括不同 公差區間的顏色,如公差區間[-0.350,-0.300]的顏色為深 藍,公差區間[-0.300,-0.250]的顏色為天藍,公差區間 [0.250,0.300]的顏色為粉紅,公差區間[0.300,0.350]的顏色 為深紅,大於允許的最大正公差值的區間[0·350,+叫的顏色 為紫色,小於允許的最小負公差值的區間[-00,-0.350]的顏 色為咖_色。 步驟S104,根據對齊後的曲面資料及點雲資料計算對 201028643 m 馨 雲中各闕該曲面的最近轉,各最近距離稱作原 2最近距離。所述對齊後㈣㈣料包括對齊後曲面上所 ^角形的資訊及曲面上所有三角形頂點的資訊。各三角 訊儲存於相對應三角形的資料結構,點 2存於相制頂關㈣結構。曲面切有三肖形的資料 I構誕成—㈣列,雜列稱作標記㈣;曲面上 =頂點的資料結構組成另-简列,該㈣稱作頂點ς 仵列;二 =ΓΓΓ用於儲存該三角形在該襟記 個頂=;:中:=個:點:連接順序,該三 :::原始顏色值、均衡最近距離二==^ 存該二 以兮TS 貝驛職彳了列巾的標記資訊以及 "頁點為頂點的三角形所述標記㈣中的標記資訊。 的曲根據各原始最近轉得職各點距離最近 相斜虛H為@潔起見,下文中稱與各最近㈣ ^應的點雲中的點“與各最近矩離對應的曲面上的二 ’ ’例如點雲中的點A1與曲面上的三角形al距離最 則稱點A1落入三角形ai。 步驟S1G6’根據杨始最近距離所落人的公差分 =到各三角形的顏色值,各顏色值稱作原始顏色值,並 心原始最近距離及各原始顏色值^相對應三角形的資 構。各縣最近麟及各原色值也稱作各相對應 —角形的原始最近距離及原始顏色值。 〜 8 201028643 步驟S107’對曲面進行顏色均衡,包括:根據用戶設 置的對曲面進行顏色均衡時曲面上三角形向外擴展的層數 N、各三角形的原始最近距離及原始顏色值重新計算得到 各三角形的均衡最近距離,根據各均衡最近距離得到各三 角形的均衡顏色值,將各均衡最近距離及各均衡顏色值寫 入相對應三角形的資料結構(具體介紹請參見圖3)。201028643. VI. Description of the Invention: [Technical Field] The present invention relates to a two-dimensional measuring system and method, and more particularly to a curved surface detecting system and method. [Prior Art] The three-coordinate measuring machine is widely used in industrial and scientific research to measure a product. The general measuring method is to place the object to be tested in a three-coordinate measuring space, using a three-coordinate measuring machine. The contact probe captures data point by point along a surface of the object to be tested through a programmed path, and analyzes the surface quality of the detected object according to the captured data. However, as the surface of the product is more and more complex, such as mobile phones, MP3, MP4, the measurement data obtained by the traditional measurement method is difficult to reflect the real situation of the surface, and the measurement speed is slow and the efficiency is low. SUMMARY OF THE INVENTION In view of the above, it is necessary to provide a curved surface detecting system and a square β method, which can detect complex curved surfaces and improve the detection rate and accuracy of the curved surface. - A surface inspection system that runs on a computer. The computer executes the surface detection system to receive surface data from the database and the point cloud Shennongbei, receives the user's tolerance setting and color setting information, and aligns the point cloud with the surface according to the received surface data blood point data, according to the alignment After the surface data and the point = material calculate the nearest distance from each point in the point cloud to the surface, determine the triangles on each of the nearest corresponding surfaces, and mark each surface on the surface with the corresponding color according to each recent interval Trinity beta. In addition, the computer performs the surface detection system to equalize the color of the surface 4 201028643 and generates a detection report according to the surface data after the equalization processing. ❹ A method for detecting a surface, the method comprising the steps of: (a) receiving a triangular mesh surface data of an object CAD model and a point cloud data obtained by scanning the object; (b) aligning the point cloud with the triangular mesh surface Receive tolerance setting information and color setting information, including the maximum allowable positive tolerance value, the minimum allowable negative tolerance value, the segmentation interval of the tolerance, and the color values of the different tolerance intervals; (d) according to the aligned triangular mesh The surface data and the point cloud data calculate the closest distance from each point in the point cloud to the triangular mesh surface, the closest distance is called the original closest distance; (e) the nearest distance to each point in the point cloud is determined according to each original closest distance The triangle on the triangular mesh surface; (f) obtain the original color value of each of the three = according to the tolerance interval of each original nearest distance'. Store the original nearest distance and each original color value: corresponding to the triangular mesh surface The data structure of the triangle = the original value in the data structure of the triangle on the angular mesh surface: the value and the delamination extended by the triangle around the triangle = =::=, calculate each three衡=料二一资 Compared to the conventional measuring system and method system and method can be obtained according to the swept object: the point = the surface of the CAD model, the actual point of the triangle and the segment of the object are not _ color Marking: ^ away from the same tolerance (10) model of the triangular mesh surface = net: surface 'and the color of the three (four) data and generate an intuitive 201028643. The accuracy and speed of the detection of complex surfaces. [Embodiment] As shown in Fig. 1, a preferred embodiment of the curved surface detecting system of the present invention is used. The curved surface detection system 200 is installed and operated on the computer 20. The computer sink is connected to the database 1 and the display device 3〇. The two-shell material library 10 is used to store the standard CAD model of the object. The triangular mesh 面 $ surface material (hereinafter referred to as the surface data), the actual point cloud obtained by scanning the object 贝 = shell material (hereinafter referred to as point cloud data) and the surface inspection process The material produced in the process. The computer 2 executes the surface detection system, and the system 200 receives the surface data and the point cloud data from the database 10, receives the user's tolerance setting and color setting information, and aligns the point cloud and the surface according to the received surface data and the point cloud data, according to The aligned surface data and the point cloud data are used to calculate the closest distance from each point in the point cloud to the surface, and determine the triangles on the surface corresponding to each nearest distance, and the corresponding intervals according to the tolerance distances of the respective close distances. Mark X: each corner on the face. In addition, the computer is also used to perform the surface inspection. This color is equalized, and a detection report is generated based on the surface data after the equalization processing. When sweeping the actual object, due to light or other reasons, there are two or four bits that can not be scanned to the point, some scans have a large error, and the color of the surface is balanced. (4) Filtering out the point cloud The individual error points in the balance are balanced against the points where the points are not scanned (4), and the errors caused by the sweep (four) difference during the detection of the curved surface are reduced. 6 201028643 Display device 30 provides a display interface for displaying triangular mesh surfaces, a point cloud obtained by scanning objects, a surface that is not color-coded using the system to detect surfaces, and a test report. As shown in Fig. 2, it is a main flow chart of a preferred embodiment of the curved surface detecting method of the present invention. First, in step S101, the surface data and the point cloud data imported by the user from the database 10 are received. Step S102, aligning the point cloud with the surface of the sin ... according to the received surface data and the point cloud data. Step S103, receiving tolerance setting information and color setting information. In the present embodiment, the tolerance refers to the fluctuation range of the value of the closest distance from the point to the curved surface in the point cloud after the point cloud is aligned with the curved surface. The tolerance setting information includes: the maximum allowable positive tolerance value (such as 0.350), the minimum allowable negative tolerance value (such as -0.350), and the segmentation interval of the tolerance, such as the maximum positive tolerance value allowed and the allowed The interval determined by the minimum negative tolerance value [0.350, -0.350] is divided into several 10 tolerance intervals [-0.350, -0.300], [-0.300, -0.250],..., [0.250, 0·300], [0.300 , 0.350]. The color setting information includes colors of different tolerance intervals, for example, the tolerance interval [-0.350, -0.300] is dark blue, the tolerance interval [-0.300, -0.250] is sky blue, and the tolerance interval [0.250, 0.300] is color. For pink, the color of the tolerance interval [0.300, 0.350] is dark red, the interval greater than the maximum allowable positive tolerance value [0·350, + the color of the call is purple, the interval smaller than the minimum allowable negative tolerance value [-00 , -0.350] The color is coffee_color. Step S104, calculating a recent turn of each surface in the 201028643 m sin cloud according to the aligned surface data and the point cloud data, and each nearest distance is called the original 2 closest distance. The aligned (four) (four) material after the alignment includes the information of the angular shape on the aligned curved surface and the information of all the triangle vertices on the curved surface. Each triangle is stored in the data structure of the corresponding triangle, and point 2 is stored in the structure of the phase (10). The surface of the surface is cut into three-dimensional shape I is formed into a (four) column, the miscellaneous column is called a mark (four); the data structure on the surface = vertex is composed of another - simple column, the (four) is called the vertex 仵 仵 column; the second = ΓΓΓ is used for storage The triangle is in the top =;: in: = one: point: connection order, the third::: original color value, the equilibrium closest distance two == ^ save the second to 兮TS Bessie job The tag information and the tag information in the tag (4) of the triangle of the vertices. The songs are based on the nearest distance from each original to the nearest point of the imaginary virtual H for @洁起见, hereinafter referred to as the point in the point cloud of each recent (four) ^ should be "two on the surface corresponding to each nearest moment ' ' For example, the point A1 in the point cloud and the triangle al on the surface are the distance A1 falls into the triangle ai. Step S1G6' according to the tolerance of the closest distance of Yang Shi = the color value of each triangle, each color The value is called the original color value, and the original nearest distance and the original color value ^ correspond to the triangle's structure. The nearest lin and the primary color values of each county are also called the original nearest distance and the original color value of each corresponding angle. ~ 8 201028643 Step S107' color balance the surface, including: recalculating the triangles according to the number N of the triangles on the surface when the color balance is performed by the user, the original nearest distance of each triangle and the original color value Equilibrium nearest distance, the equilibrium color value of each triangle is obtained according to each equilibrium closest distance, and each equilibrium closest distance and each balanced color value are written into the corresponding triangle data. Configuration (see Figure 3 specifically described).
步驟S108,分析顏色均衡後的曲面資料,生成曲面檢 測報告。 如圖3所示’係圖2中步驟S107之細化流程圖。首 先’在步驟S201’接收用戶設置的三角形向外擴展的層數 N。士角形向外擴展的層數N指的係取—個三角形周圍的 N層三角形’㈣N層三角形的平均最近距離表示點雲與 該三角形的最近距離。 一 步驟S202,初始化曲面上三角形的標記件列及頂點件 列’將各三角形於標記㈣中的標記資訊寫人頂點仔列中 相對應頂點的資料結構(具體介紹請參見圖4)。 步驟S203,從三角形標記狩列令取出一個三角形(為 方便區分,以下稱該三角形為種子三角形)的資料結構, 如圖7十的種子三角形(1)。 步驟S204,根據該種子三角形的資料結構中館存的該 種子二肖形各頂點於頂點糾巾的標記資訊從頂則宁列 ί =二形各頂點的資料結構,根據各頂點的資料 子、-貝訊得到該種子三角形周圍的Ν層三角形。 如圖7所示,由種早= 子一角形(1)的頂點A、B、c得到種 9 201028643 一層三角形的 直到得到種子 ::角形⑴周圍的第—層三角形,由該第 一可以得到第H形,依次類推, 二角形(1)的N層三角形。 步驟S205,檢查該]^層二& 點雲令的轉人的點,仍彳三角形中沒有Step S108, analyzing the surface data after the color balance, and generating a surface detection report. As shown in Fig. 3, the detailed flowchart of step S107 in Fig. 2 is shown. First, the number of layers N extended by the triangle set by the user is received in step S201. The number of layers N extended outwards refers to the N-layer triangle around a triangle. The average nearest distance of the N-layer triangle represents the closest distance of the point cloud to the triangle. In step S202, the marker column and the vertex block column of the triangle on the surface are initialized, and the mark information of each triangle in the mark (4) is written into the data structure of the corresponding vertex in the vertex column (refer to FIG. 4 for specific introduction). In step S203, a data structure of a triangle (for convenience of distinction, hereinafter referred to as a seed triangle) is taken from the triangle mark hunting order, as shown in the seed triangle of Fig. 70 (1). Step S204, according to the data structure of the seed triangle, the mark information of the vertices of the vertices of the vertices stored in the vertices of the seed is from the data structure of the vertices of the vertices according to the vertices of the vertices according to the vertices of the vertices. - Beixun gets a layer of triangles around the seed triangle. As shown in Fig. 7, the vertices A, B, and c of the seed early = sub-angle (1) are obtained. 9 201028643 A layer of triangles is obtained until the seed is obtained: the first layer triangle around the angle (1), which is obtained by the first The H-shape, and so on, the N-layer triangle of the digraph (1). Step S205, checking the point of the transfer of the layer 2 & point cloud order, still not in the triangle
則由種子三角形⑴的頂點A B =明,假設㈣’ 形旳頁點A、B、C可以得到12個三角 ,延12二角形中可能有點雲中 ) (3)、⑸、⑺、⑷、(9)、⑽、⑼, =落):為掃描時未掃描到點),如三二 於步驟S205,若判斷n層 入’則直接進入步驟S207。 二角形中都有點雲中的點落Then the vertex of the seed triangle (1) is AB = Ming, assuming (4) 'the shape of the page points A, B, C can get 12 triangles, and the extension of the 12-dimension may be a bit in the cloud) (3), (5), (7), (4), 9), (10), (9), = falling): the point is not scanned when scanning, for example, in step S205, if it is judged that the n layer is in, the process proceeds directly to step S207. There are points in the cloud in the dip
於步驟S2G5,若判斷N層三角形中有三角形中沒有點 =^點落人’則進人步驟纖,將該種子三角形的資料 、、·。構中的原始最近距離值暫時借給該三角形,例如將種子 二角形(1)的原始最近距離值暫時借給三角形 (11)、(13)。 步驟S207,計算該種子三角形周圍的N層三角形的原 始最近距離值的平均值,㈣平均值作為該種子三角形的 均衡最近距離值。 一步驟S208,檢查曲面上是否還有三角形未充當過種子 三角形。 於步驟S208,若判斷還有三角形未充當過種子三角 形,則流程返回步驟S203,直到得到曲面上所有三角形的 201028643 .均衡最近距離。需要注意的是,N的取值範圍不能過大(最 好不大於5),否則對曲面進行顏色均衡可能導致較大誤 '差。 、 . 如圖4所示,係圖3中步驟S202之細化流程圖。 步驟S301,獲取曲面上三角形的頂點佇列及標記佇 列。如頂點佇列[(χ0,Υ0,Ζ0),( Χ1,Υ1,Ζ1),( χ2,γ2,Ζ2), (X3,Y3,Z3 ) …(χη,γη,Ζη )]’其中n為整數,表示頂 鲁點^丁列中的第η個頂點,標記仔列[(1 ) - ( 2 ) …>(2,1,3) (3)…>(1,4,3),·.·,(„〇 …>(ml,m2,m3)]。 為方便理解,上述標記符列省略了三角形的原始距離值及 原始顏色值、均衡最近距離及均衡顏色值,以及 所在平面的法向量。其中,⑴、⑺、(3),(m)分別表 示該三角形為標記佇列中的第個三角形。(0,^) 表示一角形(1)的二個頂點分別係頂點仵列中的第〇、1、 2 個頂點:(X0,Y0,Z0)( xi,yi,zi ),及(Χ2,Υ2,Ζ2)。(2,u) 表示一角形(2 )的二個頂點分別係頂點仵列中的第2、1、 3 個頂點:(Χ2,Υ2,Ζ2),(Χ1,Υ1,ζ1),^χ3,γ3,Ζ3>(ι,4,3) 表示一角形(3 )的二個頂點分別係頂點件列中的第卜4、 3 個頂點(X1,Y1,Z1),( X4,Y4,Z4 ),及(χ3,γ3,ζ3 )。 步驟S302,從標記佇列中取出一個三角形,如三角形 (1) —>(0,1,2)。 步驟S303 ’根據該三角形三個頂點的標記資訊將該三 角形於標記仵列中的標記加入到頂點仔列中相對應頂點的 資料結構,如在頂點符列中第〇個頂點(χ〇,γ〇ζ〇)中加 11 201028643 •入二角形標記(1) ’第1個頂點(χι,γι,ζι)中加入三角形 標記⑴,第2個頂點(Χ2,Υ2,Ζ2)中加入三角形標記⑴: ‘ k步驟S304,檢查是否還有三角形在標記對列中的標記 .資訊未被加入到頂點佇列中相對應頂點的資料結構。若還 有三角形在標記佇列中的標記資訊未都被加入到頂點佇列 中相對應頂點的資料結構,則對該三角形自步驟S3〇2開 始重複流程直到標記#列中所有三角形的標記資訊都加入 ⑩到頂點對列中相對應頂點的資料結構,流程結束,如在 (幻刀及:^加入三角形標記⑺’以^刀^中加入 一角$ ‘汜(2) ’( X3,Y3,Z3 )中加入三角形標記(2);在 (乂1,丫1,71)中加入三角形標記(3),(又4,¥4,2:4)中加入 角幵/仏。己數(3)’(又3,丫3,乙3)中加入三角形標記(3),這 樣(Χ2,Υ2,Ζ2)中增加了三角形標記⑴,變為(χ2,γ2,ζ2, (1) ),頂點(Χ1,Υ1,Ζ1)中增加了三角形標記(〇、( 2)、 ® 中增加了二角形標記⑴、(2 ),變為(χ2,γ2,Ζ2,⑴, (2) )頂點(χ3,γ3,Ζ3)增加了三角形標記(2)、(3), 變為(X3,Y3,Z3,(2),⑶),透過查找頂點即可查找到 該頂點所在的所有三角形。 如圖5所示’係圖2中步驟sl〇8分析顏色均衡後之 曲面=貝料、生成檢測報告的一種方法之細化流程圖。 步驟S401 ’獲取三角形的標記佇列及公差設置中的允 許的最大正公差值、允許的最小負公差值。 步驟S402 ’從標記佇列中取出一個三角形(記該三角 12 201028643 .形為三角形B)的資料結構,根據該資料結構中儲存的該 二角形B二個頂點的標記資訊從頂點佇列中獲取該三角形 B的二個頂點的資料結構,從各頂點的資料結構令得到各 • 頂點的座標值。 γ驟S403 ’根據▲二角形b的三個頂點座標值計算得 到該三角形B中心點的座標值,如(xl,yl,zl)。 步驟S404,根據該三角形B的中心點的座標值及允許 ❹的最大正公差值、允許的最小負公差值計算得到該三角形 B的上公差二角形、下公差三角形的頂點座標值。 步驟S405,根據該三角形B中心點的座標值、該三角 形B所在平面的向量(如n〇rmal[〇] n〇mal⑴刪μ叩 及該三角形Β的均衡最近距離值(如d)計算得到該三角形β 的量測點座標值(X2,y2,z2),x2= normal[〇r d+ χ1,y2= normal[l]* d+ yl ’ z2= normal[2]* d+ zl。 步驟S406,連接該三角形B的中心點(xl,yl,zl)及 ❹ 置測點(x2,y2,z2 )得到該三角形β的量測趨勢線。 步驟S407,判斷三角形標記佇列中是否還有三角形未 生成量測趨勢線。若還有三角形未生成量測趨勢線,則自 步驟S402開始重複流程直到三角形標記佇列中所有三角 形都生成量測趨勢線後進入步驟S408,輸出曲面的量測趨 勢線圖示。 如圖8係圖5中生成量測趨勢線之圖示。曲面上所有 一角升’的上、下公差二角形組成曲面的上、下公差曲面, 若量測趨勢線伸出上、下公差曲面,則表明該量測趨勢線 13 201028643 所對應的三角形平面的誤差超出了允許的誤差範圍。 如圖6所示,係圖2中步驟S108分析顏色均衡後之 曲面資料、生成檢測報告的另一種方法之細化流程圖。 步驟S501,輸入各公差分段區間的取值範圍,如 0.300-0.350。 步驟S502,獲取各公差分段區間内均衡最近距離的數 量0In step S2G5, if it is determined that there is no point in the triangle in the N-layer triangle = ^ point is falling, then the step fiber is entered, and the data of the seed triangle, . The original nearest distance value in the construct is temporarily loaned to the triangle, for example, the original nearest distance value of the seed digraph (1) is temporarily loaned to the triangles (11), (13). Step S207, calculating an average value of the original nearest distance values of the N-layer triangles around the seed triangle, and (4) an average value as the equilibrium closest distance value of the seed triangle. In a step S208, it is checked whether there is a triangle on the curved surface that has not acted as a seed triangle. In step S208, if it is determined that the triangle does not act as a seed triangle, the flow returns to step S203 until the closest distance of all triangles on the surface is obtained. It should be noted that the value range of N cannot be too large (preferably not more than 5), otherwise color balance of the surface may result in a large error. As shown in FIG. 4, it is a refinement flowchart of step S202 in FIG. Step S301, acquiring a vertex array and a label queue of a triangle on the surface. For example, the vertex 伫 column [(χ0, Υ0, Ζ0), (Χ1, Υ1, Ζ1), (χ2, γ2, Ζ2), (X3, Y3, Z3) ... (χη, γη, Ζη)]' where n is an integer , indicating the nth vertex in the top row, marking the column [(1) - ( 2 ) ... > (2, 1, 3) (3) ... > (1, 4, 3), ···,(„〇...>(ml,m2,m3)]. For ease of understanding, the above-mentioned marker column omits the original distance value and original color value of the triangle, the equilibrium closest distance and the balanced color value, and the plane in which it is located. The normal vector, where (1), (7), (3), (m) respectively indicate that the triangle is the first triangle in the marker array. (0, ^) indicates that the two vertices of the angle (1) are respectively vertices 仵The third, first, and second vertices in the column: (X0, Y0, Z0) ( xi, yi, zi ), and (Χ2, Υ 2, Ζ 2). (2, u) represents two of the angles (2) The vertices are the 2nd, 1st, and 3rd vertices in the vertex : column: (Χ2, Υ2, Ζ2), (Χ1, Υ1, ζ1), ^χ3, γ3, Ζ3> (ι, 4, 3) represents a corner The two vertices of (3) are the 4th and 3rd vertices (X1, Y1) in the vertices column. Z1), (X4, Y4, Z4), and (χ3, γ3, ζ3). In step S302, a triangle such as a triangle (1) -> (0, 1, 2) is taken out from the marker queue. 'According to the mark information of the three vertices of the triangle, the mark of the triangle in the mark queue is added to the data structure of the corresponding vertex in the vertex column, such as the first vertex in the vertex column (χ〇, γ〇ζ) 〇)中加11 201028643 •Into the dich mark (1) Add the triangle mark (1) to the first vertex (χι,γι,ζι), and add the triangle mark (1) to the second vertex (Χ2,Υ2,Ζ2): ' Step S304, it is checked whether there is a mark of the triangle in the mark pair column. The information is not added to the data structure of the corresponding vertex in the vertex column. If there is a triangle, the mark information in the mark column is not added to The data structure of the corresponding vertex in the vertex queue, the process repeats the process from step S3〇2 until the mark information of all triangles in the mark# column is added to the data structure of the corresponding vertex in the vertex pair column, and the process ends. As in (the knives and :^Add a triangle mark (7)' Add a triangle $ '汜(2) '(X3,Y3,Z3) to the ^^^ and add a triangle mark (2); add a triangle mark to (乂1,丫1,71) (3), (4, ¥4, 2:4), add the corner 幵/仏. Add the triangle mark (3) to the number (3)' (again 3, 丫3, B3), so (Χ2,三角形2, Ζ2) added a triangle mark (1), which becomes (χ2, γ2, ζ2, (1)), and a triangle mark is added to the vertices (Χ1, Υ1, Ζ1) (〇, (2), ® added two The angular marks (1), (2) become (χ2, γ2, Ζ2, (1), (2)) vertices (χ3, γ3, Ζ3) increase the triangular marks (2), (3), and become (X3, Y3, Z3, (2), (3)), by looking up the vertex, you can find all the triangles where the vertex is located. As shown in Fig. 5, a detailed flow chart of a method for analyzing the surface of the color equalization after the color equalization and generating the detection report is performed in the step s1〇8 of Fig. 2. Step S401' obtains the maximum positive tolerance value allowed in the marker array of the triangle and the tolerance setting, and the minimum allowable negative tolerance value. Step S402 'Retrieve a data structure of a triangle (indicating the triangle 12 201028643. Shaped as a triangle B) from the marker queue, and obtain the information of the two vertices of the binary B stored in the data structure from the vertex queue The data structure of the two vertices of the triangle B obtains the coordinate values of the vertices from the data structure of each vertex. The gamma step S403' calculates the coordinate value of the center point of the triangle B from the three vertex coordinate values of the ▲ digraph b, such as (xl, yl, zl). Step S404, calculating a vertex coordinate value of the upper tolerance quadrilateral and the lower tolerance triangle of the triangle B according to the coordinate value of the center point of the triangle B and the maximum positive tolerance value of the allowable 、 and the minimum allowable negative tolerance value. Step S405, calculating the coordinate value according to the coordinate value of the center point of the triangle B, the vector of the plane of the triangle B (such as n〇rmal[〇] n〇mal(1) deleting μ叩 and the equilibrium closest distance value of the triangle ( (such as d) The coordinate point coordinate value of the triangle β (X2, y2, z2), x2 = normal[〇r d+ χ1, y2= normal[l]* d+ yl ' z2= normal[2]* d+ zl. Step S406, connect the The center point (xl, yl, zl) of the triangle B and the measured point (x2, y2, z2) of the triangle B obtain the measurement trend line of the triangle β. Step S407, it is determined whether there is a triangle ungenerated amount in the triangle mark queue. If the triangle does not generate the measurement trend line, repeat the process from step S402 until all the triangles in the triangle mark queue generate the measurement trend line, and then proceed to step S408, and the measurement trend line of the output surface is shown. Figure 8 is a graphical representation of the generated trend line in Figure 5. The upper and lower tolerances of all corners on the surface are the upper and lower tolerance surfaces of the surface. If the measurement trend line extends the upper and lower tolerances. The surface indicates the corresponding trend line 13 201028643 The error of the angular plane exceeds the allowable error range. As shown in Fig. 6, a detailed flowchart of analyzing the surface data after color equalization and another method for generating the detection report is performed in step S108 in Fig. 2. Step S501, inputting tolerances The value range of the segmentation interval is, for example, 0.300-0.350. Step S502, obtaining the number of equilibrium closest distances in each tolerance segmentation interval.
❹ 步驟S503,計算各公差分段區間内均衡最近距離的數 量與曲面上所有均衡最近距離數量的百分比。 步驟S504輸出比例圖。用戶可根據需要選擇以直方 圖、直條圖、圓形圖或其他圖式輸出所述比例圖。 對於圖2中步驟S108分析顏色均衡後的曲面資料、 生成檢測報告的方法還可用資料|聲華釋,如計算並輸 出机術举近果離的平均平方和^! ,、總平均距離 丨尤1 丨 + X2\ + *** + \Xnl\ \Xl \ + 1^21 + **· \Xml\ π ~~^Γ\、上平均距辦ΤΊ一"I 「、下平均距離 丨卞叶々…个丨 KM糾+-.+Μ-心 、平均偏差— 及標準偏差 ~~- V ηΐ 。其中,nl為均衡最近距離值的總數量,ml 為均衡最近距離值大於等於0的個數,k為均衡最近距離 值小於0的個數,nl=ml+k。 最後所應說明的是,以上實施例僅用以說明本發明的 技術方案而非限制,儘管參照以上較佳實施例對本發明進 行了詳細說明,本領域的普通技術人員應當理解,可以對 本發明的技術方案進行修改或等同替換,而不脫離本發明 技術方案的精神和範圍。 14 201028643 【圖式簡單說明】 圖1係本發明曲面檢測系統較佳實施例的應用環境 圖。 圖2係本發明曲面檢測方法較佳實施例之主流程圖。 圖3係圖2中步驟S107之細化流程圖。 圖4係圖3中步驟S202之細化流程圖。 圖5係圖2中步驟S108分析顏色均衡後之曲面資料, 生成檢測報告的一種方法之細化流程圖。 圖6係圖2中步驟S108分析顏色均衡後之曲面資料, 生成檢測報告的另一種方法之細化流程圖。 圖7係圖3中步驟S204根據三角形之頂點得到該三 角形周圍的一層三角形之示意圖。 圖8係圖5中生成量測趨勢線之示意圖。 【主要元件符號說明】 資料庫 10 電腦 20 顯示設備 30 曲面檢測系統 200 15❹ Step S503, calculating the percentage of the number of equilibrium closest distances in each tolerance segment interval to the number of all equilibrium closest distances on the surface. Step S504 outputs a scale map. The user can choose to output the scale map in histogram, bar graph, circle graph or other schema as needed. For the method of analyzing the surface data after the color balance in step S108 of FIG. 2, the method for generating the detection report can also be used for the data | sound release, such as calculating and outputting the average square sum of the machine and the approximate square distance ^!, the total average distance Chiyou 1 丨+ X2\ + *** + \Xnl\ \Xl \ + 1^21 + **· \Xml\ π ~~^Γ\, the upper average distance is 1 "I ", the average distance 丨卞Ye Wei...a KM correction +-.+Μ-heart, mean deviation—and standard deviation~~- V ηΐ , where nl is the total number of equilibrium nearest distance values, and ml is the equilibrium closest distance value greater than or equal to 0 The number k is the number of the equilibrium closest distance value less than 0, nl=ml+k. Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention and not limiting, although referring to the above preferred embodiment The present invention has been described in detail, and those skilled in the art will understand that the invention may be modified or equivalently substituted without departing from the spirit and scope of the invention. 14 201028643 [Simple description of the diagram] Application environment of a preferred embodiment of the curved surface detecting system of the present invention Fig. 2 is a main flow chart of a preferred embodiment of the surface detecting method of the present invention. Fig. 3 is a detailed flowchart of step S107 in Fig. 2. Fig. 4 is a detailed flowchart of step S202 in Fig. 3. Fig. 5 is a diagram Step S108 of step 2 analyzes the surface data after color equalization, and generates a detailed flow chart of a method for generating a detection report. FIG. 6 is a refinement of another method for analyzing the surface data after color equalization in step S108 of FIG. Fig. 7 is a schematic diagram of step S204 of Fig. 3 to obtain a layer of triangles around the triangle according to the vertices of the triangle. Fig. 8 is a schematic diagram of generating a trend line in Fig. 5. [Description of main component symbols] Database 10 Computer 20 Display device 30 curved surface detection system 200 15