TWI501098B - Three-dimensional model adjustment system and method - Google Patents

Three-dimensional model adjustment system and method Download PDF

Info

Publication number
TWI501098B
TWI501098B TW100102218A TW100102218A TWI501098B TW I501098 B TWI501098 B TW I501098B TW 100102218 A TW100102218 A TW 100102218A TW 100102218 A TW100102218 A TW 100102218A TW I501098 B TWI501098 B TW I501098B
Authority
TW
Taiwan
Prior art keywords
product
coordinate system
dimensional model
dimensional
matrix
Prior art date
Application number
TW100102218A
Other languages
Chinese (zh)
Other versions
TW201232307A (en
Inventor
Chih Kuang Chang
Xin-Yuan Wu
Wei Wang
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 TW100102218A priority Critical patent/TWI501098B/en
Publication of TW201232307A publication Critical patent/TW201232307A/en
Application granted granted Critical
Publication of TWI501098B publication Critical patent/TWI501098B/en

Links

Landscapes

  • Numerical Control (AREA)
  • Processing Or Creating Images (AREA)

Description

產品三維模型自動擺正系統及方法 Product three-dimensional model automatic square system and method

本發明涉及一種電腦輔助設計系統及方法,尤其是一種應用於影像量測領域中的產品三維模型自動擺正系統及方法。 The invention relates to a computer aided design system and method, in particular to a three-dimensional model automatic square system and method applied in the field of image measurement.

在影像量測領域中,離線編程是指利用離線編程軟體及產品的三維模型在電腦上編寫影像測量程式。離線編寫的影像測量程式用於控制影像測量機台對產品進行測量。產品三維模型的工件座標系是編程人員在編制程式時用來確定刀具和程式起點的座標系,自的是用數位形式把產品上測量點的位置告知影像測量機台。在影像測量程式中,工件座標系和影像測量機台的機械座標系的座標軸方向需保持一致,使得影像測量機台能準確地判斷出產品上測量點的位置。然而,從儲存裝置導入的產品三維模型的工件座標系可能與機械座標系的座標軸方向不一致。所以,在離線編程的前期準備過程中需要將產品三維模型擺正,即將產品三維模型經過多次空間旋轉和平移操作,使得產品三維模型的工件座標系和影像測量機台的機械座標系的座標軸方向一致。目前,產品三維模型的擺正操作是手動執行的,容易出錯。 In the field of image measurement, offline programming refers to the use of off-line programming software and 3D models of products to write image measurement programs on a computer. An image measurement program written offline is used to control the image measuring machine to measure the product. The workpiece coordinate system of the product 3D model is the coordinate system used by the programmer to determine the starting point of the tool and the program when programming. It is to digitally inform the image measuring machine of the position of the measuring point on the product. In the image measurement program, the coordinate axes of the workpiece coordinate system and the mechanical coordinate system of the image measuring machine must be consistent, so that the image measuring machine can accurately determine the position of the measuring point on the product. However, the workpiece coordinate system of the three-dimensional model of the product introduced from the storage device may not coincide with the coordinate axis direction of the mechanical coordinate system. Therefore, in the pre-preparation process of off-line programming, the three-dimensional model of the product needs to be squared, that is, the three-dimensional model of the product is subjected to multiple spatial rotation and translation operations, so that the workpiece coordinate system of the product three-dimensional model and the coordinate axis of the mechanical coordinate system of the image measuring machine The direction is the same. At present, the squared operation of the product 3D model is performed manually and is error-prone.

鑒於以上內容,有必要提供一種產品三維模型自動擺正系統及方 法,可以自動擺正產品三維模型。 In view of the above, it is necessary to provide a three-dimensional model automatic square system and square The method can automatically align the 3D model of the product.

一種產品三維模型自動擺正系統,應用於電子裝置。該系統包括三角網格化模組、座標系確定模組及變換資訊計算模組。三角網格化模組從儲存設備中讀取產品三維模型,並對產品三維模型進行三角網格化。座標系確定模組根據產品的二維尺寸圖中的資訊確定產品三維模型的工件座標系。變換資訊計算模組根據機械座標系的原點座標及X、Y、Z軸方向的向量生成機械座標系的齊次單位矩陣A2,根據工件座標系的原點在機械座標系中的座標計算工件座標系相對於機械座標系的平移齊次變換矩陣A1,計算平移齊次變換矩陣A1的逆矩陣,並根據機械座標系的齊次單位矩陣A2、平移齊次變換矩陣A1的逆矩陣計算產品三維模型的旋轉齊次變換矩陣R;及將網格化後的產品三維模型上各三角形的頂點座標乘以旋轉齊次變換矩陣R得到產品三維模型擺正後各三角形的頂點在機械座標系中的座標。 A product three-dimensional model automatic square system for electronic devices. The system includes a triangular meshing module, a coordinate system determining module, and a transformation information computing module. The triangular meshing module reads the product 3D model from the storage device and triangulates the product 3D model. The coordinate system determination module determines the workpiece coordinate system of the product three-dimensional model based on the information in the two-dimensional size map of the product. The transformation information calculation module generates a homogeneous unit matrix A2 of the mechanical coordinate system according to the origin coordinate of the mechanical coordinate system and the vector in the X, Y, and Z axis directions, and calculates the workpiece according to the coordinates of the origin of the workpiece coordinate system in the mechanical coordinate system. The coordinate system is calculated relative to the translational homogeneous transformation matrix A1 of the mechanical coordinate system, and the inverse matrix of the translational homogeneous transformation matrix A1 is calculated, and the three-dimensional product is calculated according to the homogeneous matrix of the mechanical coordinate system A2 and the inverse matrix of the translational homogeneous transformation matrix A1. Rotating the homogeneous transformation matrix R of the model; and multiplying the vertex coordinates of the triangles on the meshed product 3D model by the rotation homogeneous transformation matrix R to obtain the vertices of the triangles in the mechanical coordinate system after the product 3D model is squared coordinate.

一種產品三維模型自動擺正方法,應用於電子裝置。該方法包括:(A)三角網格化步驟:從儲存設備中讀取產品三維模型,並對產品三維模型進行三角網格化;(B)工件座標系確定步驟:從儲存設備中讀取產品的二維尺寸圖,根據產品的二維尺寸圖中的標注資訊確定產品三維模型的工件座標系;(C)單位矩陣生成步驟:根據機械座標系的原點座標及X、Y、Z軸方向的向量生成機械座標系的齊次單位矩陣A2;(D)第一變換矩陣計算步驟:根據工件座標系的原點在機械座標系中的座標計算工件座標系相對於機械座標系的平移齊次變換矩陣A1;(E)第二變換矩陣計算步驟:計算平移齊次變換矩陣A1的逆矩陣,並根據機械座標系的齊次單 位矩陣A2、平移齊次變換矩陣A1的逆矩陣計算產品三維模型的旋轉齊次變換矩陣R;及(F)三角形頂點座標計算步驟:將網格化後的產品三維模型上各三角形的頂點座標乘以旋轉齊次變換矩陣R得到產品三維模型擺正後各三角形的頂點在機械座標系中的座標。 A product three-dimensional model automatic square method is applied to an electronic device. The method comprises: (A) a triangular meshing step: reading a product three-dimensional model from a storage device, and triangulating the product three-dimensional model; (B) a workpiece coordinate system determining step: reading the product from the storage device The two-dimensional size map determines the workpiece coordinate system of the product three-dimensional model according to the annotation information in the two-dimensional dimension drawing of the product; (C) the unit matrix generation step: according to the origin coordinate of the mechanical coordinate system and the X, Y, Z axis directions The vector generates a homogeneous unit matrix A2 of the mechanical coordinate system; (D) the first transformation matrix calculation step: calculating the translational homology of the workpiece coordinate system relative to the mechanical coordinate system according to the coordinates of the origin of the workpiece coordinate system in the mechanical coordinate system Transformation matrix A1; (E) second transformation matrix calculation step: calculating the inverse matrix of the translational homogeneous transformation matrix A1, and according to the homogeneous order of the mechanical coordinate system The inverse matrix of the bit matrix A2 and the translational homogeneous transformation matrix A1 calculates the rotational homogeneous transformation matrix R of the product three-dimensional model; and (F) the triangle vertex coordinates calculation step: the vertex coordinates of each triangle on the meshed product three-dimensional model Multiply by the rotation homogeneous transformation matrix R to obtain the coordinates of the vertices of the triangles in the mechanical coordinate system after the product three-dimensional model is squared.

相較於習知技術,本發明所提供之產品三維模型自動擺正系統及方法,可以自動擺正產品三維模型,速度快且避免了手動操作容易產生的錯誤。 Compared with the prior art, the three-dimensional model automatic square system and method of the product provided by the invention can automatically align the three-dimensional model of the product, and the speed is fast and the error easily caused by the manual operation is avoided.

100‧‧‧電子裝置 100‧‧‧Electronic devices

10‧‧‧產品三維模型自動擺正系統 10‧‧‧Product 3D model automatic alignment system

11‧‧‧三角網格化模組 11‧‧‧Triangular grid module

12‧‧‧座標系確定模組 12‧‧‧ coordinate system determination module

13‧‧‧變換資訊計算模組 13‧‧‧Transformation Information Computing Module

14‧‧‧圖形繪製模組 14‧‧‧Graphic drawing module

20‧‧‧儲存設備 20‧‧‧Storage equipment

30‧‧‧處理器 30‧‧‧ Processor

40‧‧‧顯示設備 40‧‧‧Display equipment

圖1係本發明產品三維模型自動擺正系統較佳實施例之功能模組圖。 1 is a functional block diagram of a preferred embodiment of a three-dimensional model automatic square system of the product of the present invention.

圖2係本發明方產品三維模型自動擺正法較佳實施例之流程圖。 2 is a flow chart of a preferred embodiment of a three-dimensional model automatic square method of the present invention.

圖3係產品二維尺寸圖之部分示意圖。 Figure 3 is a partial schematic view of a two-dimensional dimensional view of the product.

圖4係機械座標系和產品三維模型的工件座標系之示意圖。 Figure 4 is a schematic diagram of the workpiece coordinate system of the mechanical coordinate system and the product three-dimensional model.

參閱圖1所示,係本發明產品三維模型自動擺正系統10較佳實施例之功能模組圖。該產品三維模型自動擺正系統10安裝並運行於電子裝置100。該電子裝置100還可以與對產品進行影像測量的影像測量機台(圖中未示出)相連接。該電子裝置100包括儲存設備20、處理器30及顯示設備40。該電子裝置100可以為電腦或其他任何具有資料處理功能的裝置。 Referring to FIG. 1, a functional module diagram of a preferred embodiment of the three-dimensional model automatic square system 10 of the present invention is shown. The product three-dimensional model automatic square system 10 is installed and operated on the electronic device 100. The electronic device 100 can also be connected to an image measuring machine (not shown) that performs image measurement on the product. The electronic device 100 includes a storage device 20, a processor 30, and a display device 40. The electronic device 100 can be a computer or any other device having data processing functions.

儲存設備20用於儲存產品三維模型、產品的二維尺寸圖檔及產品三維模型自動擺正系統10的電腦化程式碼。儲存設備20可以為電 子裝置100內置的儲存器,也可以為電子裝置100外接的儲存器。 The storage device 20 is configured to store a three-dimensional model of the product, a two-dimensional size image of the product, and a computerized code of the product three-dimensional model automatic square system 10. The storage device 20 can be powered The memory built in the sub-device 100 may also be a storage device external to the electronic device 100.

處理器30執行產品三維模型自動擺正系統10的電腦化程式碼,根據產品二維尺寸圖檔在產品三維模型上建立工件座標系,計算工件座標系與機械座標系的變換矩陣,根據變換矩陣自動對產品三維模型進行擺正操作(即平移和旋轉操作),使得產品三維模型上的工件座標系與機械座標系座標軸方向一致。 The processor 30 executes the computerized code of the product three-dimensional model automatic square system 10, and establishes a workpiece coordinate system on the product three-dimensional model according to the two-dimensional size image of the product, and calculates a transformation matrix of the workpiece coordinate system and the mechanical coordinate system, according to the transformation matrix. Automatically align the product 3D model (ie, translation and rotation operations), so that the workpiece coordinate system on the product 3D model is consistent with the coordinate axis of the mechanical coordinate system.

顯示設備40用於顯示擺正前後的產品三維模型、產品的二維尺寸圖、機械座標系及工件座標系。 The display device 40 is used to display a three-dimensional model of the product before and after the square, a two-dimensional size map of the product, a mechanical coordinate system, and a workpiece coordinate system.

該產品三維模型自動擺正系統10包括:三角網格化模組11、座標系確定模組12、變換資訊計算模組13及圖形繪製模組14。 The product three-dimensional model automatic square system 10 includes a triangular meshing module 11, a coordinate system determining module 12, a transformation information computing module 13, and a graphic drawing module 14.

三角網格化模組11用於從儲存設備20中讀取產品三維模型,並對產品三維模型進行三角網格化。 The triangular meshing module 11 is configured to read a three-dimensional model of the product from the storage device 20 and triangulate the three-dimensional model of the product.

圖形繪製模組14用於根據網格化後產品三維模型上的三角形頂點在工件座標系中的三維座標繪製三角網格化後的產品三維模型。 The graphic drawing module 14 is configured to draw a triangular three-dimensional product product three-dimensional model according to the three-dimensional coordinates of the triangular vertices on the three-dimensional model of the meshed product in the workpiece coordinate system.

座標系確定模組12用於根據產品的二維尺寸圖中的資訊確定產品三維模型的工件座標系。產品的二維尺寸圖包括產品的尺寸基準的標注資訊。產品的尺寸基準是在設計、加工、測量和裝配時,用來確定產品尺寸的一些點、線、面。 The coordinate system determining module 12 is configured to determine a workpiece coordinate system of the three-dimensional model of the product based on the information in the two-dimensional size map of the product. The 2D dimension drawing of the product includes the labeling information of the product's dimensional basis. The product's dimensional basis is the point, line, and surface used to determine the size of the product during design, processing, measurement, and assembly.

例如,座標系確定模組12可以從產品的二維尺寸圖中選擇兩條互相垂直的基準線分別作為工件座標系的X、Y軸,以該兩條互相垂直的基準線的交點作為工件座標系的原點,以該兩條基準線所在的平面為基準面,並以基準面的法向量為工件座標系的Z軸。之後,座標系確定模組12確定產品的二維尺寸圖中的基準面在產品 三維模型上對應的平面,在產品三維模型上相應位置建立所述工件座標系。如圖3所示,產品的二維尺寸圖上標注有互相垂直的基準線L1及L2,基準線L1及L2分別代表不同基準的線,例如L1的延長線上以實體三角形引出的矩形中標注L1為B基準,L2的延長線上以實體三角形引出的矩形中標注標注L2為C基準。則可以基準線L1為工件座標系的X軸、基準線L2為工件座標系的Y軸,以基準線L1、L2的交點為工件座標系的原點,並以基準線L1、L2所在平面A的法向量為Z軸。之後,座標系確定模組12確定產品的二維尺寸圖中的平面A在產品三維模型上對應的平面,在產品三維模型上建立如圖4所示的工件座標系。 For example, the coordinate system determining module 12 can select two mutually perpendicular reference lines from the two-dimensional size map of the product as the X and Y axes of the workpiece coordinate system, and the intersection of the two mutually perpendicular reference lines as the workpiece coordinate. The origin of the system is based on the plane where the two reference lines are located, and the normal vector of the reference plane is the Z axis of the workpiece coordinate system. Thereafter, the coordinate system determining module 12 determines the reference surface in the two-dimensional dimensional drawing of the product in the product The corresponding coordinate plane on the three-dimensional model establishes the workpiece coordinate system at a corresponding position on the three-dimensional model of the product. As shown in FIG. 3, the two-dimensional dimension drawing of the product is marked with mutually perpendicular reference lines L1 and L2, and the reference lines L1 and L2 respectively represent lines of different reference. For example, the extension line of L1 is marked with L1 in a rectangle drawn by a solid triangle. For the B-reference, the rectangle drawn from the solid triangle on the extension line of L2 is marked with the mark L2 as the C reference. The reference line L1 is the X axis of the workpiece coordinate system, the reference line L2 is the Y axis of the workpiece coordinate system, and the intersection of the reference lines L1 and L2 is the origin of the workpiece coordinate system, and the plane A of the reference line L1, L2 is located. The normal vector is the Z axis. Thereafter, the coordinate system determining module 12 determines a plane corresponding to the plane A in the two-dimensional size map of the product on the three-dimensional model of the product, and establishes a workpiece coordinate system as shown in FIG. 4 on the three-dimensional model of the product.

變換資訊計算模組13用於根據機械座標系的原點座標及X、Y、Z軸方向的向量生成機械座標系的齊次單位矩陣A2,根據工件座標系的原點在機械座標系中的座標計算工件座標系相對於機械座標系的平移齊次變換矩陣A1,計算平移齊次變換矩陣A1的逆矩陣,並根據機械座標系的齊次單位矩陣A2、平移齊次變換矩陣A1的逆矩陣計算產品三維模型的旋轉齊次變換矩陣R。 The transformation information calculation module 13 is configured to generate a homogeneous unit matrix A2 of the mechanical coordinate system according to the origin coordinate of the mechanical coordinate system and the vector in the X, Y, and Z axis directions, according to the origin of the workpiece coordinate system in the mechanical coordinate system. The coordinate is calculated by the translational homogeneous transformation matrix A1 of the workpiece coordinate system relative to the mechanical coordinate system, and the inverse matrix of the translational homogeneous transformation matrix A1 is calculated, and the inverse matrix of the homogeneous transformation matrix A1 is translated according to the homogeneous unit matrix A2 of the mechanical coordinate system. Calculate the rotational homogeneous transformation matrix R of the three-dimensional model of the product.

例如,機械座標系的原點座標為(0,0,0),X向量(X軸方向)為(1,0,0);Y向量(Y軸方向)為(0,1,0),Z向量(Z軸方向)為(0,0,1),則機械座標系的齊次單位矩陣A2為: For example, the origin coordinate of the mechanical coordinate system is (0,0,0), the X vector (X-axis direction) is (1,0,0); the Y vector (Y-axis direction) is (0,1,0), The Z vector (Z-axis direction) is (0, 0, 1), and the homogeneous unit matrix A2 of the mechanical coordinate system is:

假設工件座標系的原點在機械座標系中的座標為(1,1,1),則 平移齊次變換矩陣A1為: Assuming that the origin of the workpiece coordinate system is (1, 1, 1) in the mechanical coordinate system, the translational homogeneous transformation matrix A1 is:

平移齊次變換矩陣A1的逆矩陣A1’為: The inverse matrix A1' of the translational homogeneous transformation matrix A1 is:

產品三維模型的旋轉齊次變換矩陣R=A2*A1’,例如 The rotational homogeneous transformation matrix of the product 3D model R=A2*A1', for example

變換資訊計算模組13還用於將網格化後的產品三維模型上各三角形的頂點座標乘以旋轉齊次變換矩陣R得到產品三維模型擺正後各三角形的頂點在機械座標系中的座標。 The transformation information calculation module 13 is further configured to multiply the vertex coordinates of the triangles on the three-dimensional model of the meshed product by the rotation homogeneous transformation matrix R to obtain the coordinates of the vertices of the triangles in the mechanical coordinate system after the product three-dimensional model is squared. .

圖形繪製模組14還用於根據產品三維模型擺正後各三角形的頂點在機械座標系中的座標重新繪製擺正後的產品三維模型。 The graphic drawing module 14 is further configured to redraw the three-dimensional model of the product after being squared according to the coordinates of the vertices of the triangles in the mechanical coordinate system after the three-dimensional model of the product is squared.

參閱圖2所示,係本發明產品三維模型自動擺正方法較佳實施例之流程圖。 Referring to FIG. 2, it is a flow chart of a preferred embodiment of the method for automatically correcting the three-dimensional model of the product of the present invention.

步驟S201,三角網格化模組11從儲存設備20中讀取產品三維模型 ,並對產品三維模型進行三角網格化。圖形繪製模組14根據網格化後產品三維模型上的三角形頂點在工件座標系中的三維座標繪製三角網格化後的產品三維模型。 Step S201, the triangular meshing module 11 reads the product three-dimensional model from the storage device 20. And triangulate the 3D model of the product. The graphic drawing module 14 draws a triangular meshed product three-dimensional model according to the three-dimensional coordinates of the triangular vertices on the three-dimensional model of the meshed product in the workpiece coordinate system.

步驟S203,座標系確定模組12從儲存設備20中讀取產品的二維尺寸圖,根據產品的二維尺寸圖中的標注資訊確定產品三維模型的工件座標系。產品的二維尺寸圖包括產品的尺寸基準的標注資訊。產品的尺寸基準是在設計、加工、測量和裝配時,用來確定產品尺寸的一些點、線、面。 In step S203, the coordinate system determining module 12 reads the two-dimensional size map of the product from the storage device 20, and determines the workpiece coordinate system of the three-dimensional model of the product according to the labeling information in the two-dimensional size map of the product. The 2D dimension drawing of the product includes the labeling information of the product's dimensional basis. The product's dimensional basis is the point, line, and surface used to determine the size of the product during design, processing, measurement, and assembly.

例如,座標系確定模組12可以從產品的二維尺寸圖中選擇兩條互相垂直的基準線分別作為工件座標系的X、Y軸(如圖3中所示的基準線L1及L2),以該兩條互相垂直的基準線的交點作為工件座標系的原點,以該兩條基準線所在的平面為基準面,並以基準面的法向量為工件座標系的Z軸。之後,座標系確定模組12確定產品的二維尺寸圖中的基準面在產品三維模型上對應的平面,在產品三維模型上相應位置建立所述工件座標系(如圖4所示)。 For example, the coordinate system determining module 12 can select two mutually perpendicular reference lines from the two-dimensional size map of the product as the X and Y axes of the workpiece coordinate system (such as the reference lines L1 and L2 shown in FIG. 3). The intersection of the two mutually perpendicular reference lines is used as the origin of the workpiece coordinate system, and the plane where the two reference lines are located is used as a reference plane, and the normal vector of the reference plane is the Z axis of the workpiece coordinate system. Thereafter, the coordinate system determining module 12 determines a plane corresponding to the reference surface in the two-dimensional size map of the product on the three-dimensional model of the product, and establishes the workpiece coordinate system at a corresponding position on the three-dimensional model of the product (as shown in FIG. 4).

步驟S205,變換資訊計算模組13根據機械座標系的原點座標及X、Y、Z軸方向的向量生成機械座標系的齊次單位矩陣A2。A2為: In step S205, the transformation information calculation module 13 generates a homogeneous unit matrix A2 of the mechanical coordinate system based on the origin coordinate of the mechanical coordinate system and the vector in the X, Y, and Z axis directions. A2 is:

步驟S207,變換資訊計算模組13根據工件座標系的原點在機械座標系中的座標計算工件座標系相對於機械座標系的平移齊次變換 矩陣A1。假設工件座標系的原點在機械座標系中的座標為(1,1,1),則平移齊次變換矩陣A1為: In step S207, the transformation information calculation module 13 calculates the translational homogeneous transformation matrix A1 of the workpiece coordinate system relative to the mechanical coordinate system according to the coordinates of the origin of the workpiece coordinate system in the mechanical coordinate system. Assuming that the origin of the workpiece coordinate system is (1, 1, 1) in the mechanical coordinate system, the translational homogeneous transformation matrix A1 is:

步驟S209,變換資訊計算模組13計算平移齊次變換矩陣A1的逆矩陣,並根據機械座標系的齊次單位矩陣A2、平移齊次變換矩陣A1的逆矩陣計算產品三維模型的旋轉齊次變換矩陣R。例如,若平移齊次變換矩陣A1的逆矩陣A1’為: 則產品三維模型的旋轉齊次變換矩陣R=A2* A1’,為: Step S209, the transformation information calculation module 13 calculates the inverse matrix of the translational homogeneous transformation matrix A1, and calculates the rotational homogeneous transformation of the product three-dimensional model according to the homogeneous matrix matrix A2 of the mechanical coordinate system and the inverse matrix of the translational homogeneous transformation matrix A1. Matrix R. For example, if the inverse matrix A1' of the translational homogeneous transformation matrix A1 is: Then, the rotational homogeneous transformation matrix R=A2* A1' of the three-dimensional model of the product is:

步驟S211,變換資訊計算模組13將網格化後的產品三維模型上各三角形的頂點座標乘以旋轉齊次變換矩陣R得到產品三維模型擺正後各三角形的頂點在機械座標系中的座標。 Step S211, the transformation information calculation module 13 multiplies the vertex coordinates of the triangles on the three-dimensional model of the meshed product by the rotation homogeneous transformation matrix R to obtain the coordinates of the vertices of the triangles in the mechanical coordinate system after the product three-dimensional model is squared. .

步驟S213,圖形繪製模組14根據產品三維模型擺正後各三角形的 頂點在機械座標系中的座標重新繪製擺正後的產品三維模型。 Step S213, the graphic drawing module 14 is squared according to the three-dimensional model of the product. The coordinates of the vertices in the mechanical coordinate system redraw the three-dimensional model of the product after the alignment.

最後應說明的是,以上實施方式僅用以說明本發明的技術方案而非限制,儘管參照較佳實施方式對本發明進行了詳細說明,本領域的普通技術人員應當理解,可以對本發明的技術方案進行修改或等同替換,而不脫離本發明技術方案的精神和範圍。 It should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and the present invention is not limited thereto. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that Modifications or equivalents are made without departing from the spirit and scope of the invention.

100‧‧‧電子裝置 100‧‧‧Electronic devices

10‧‧‧產品三維模型自動擺正系統 10‧‧‧Product 3D model automatic alignment system

11‧‧‧三角網格化模組 11‧‧‧Triangular grid module

12‧‧‧座標系確定模組 12‧‧‧ coordinate system determination module

13‧‧‧變換資訊計算模組 13‧‧‧Transformation Information Computing Module

14‧‧‧圖形繪製模組 14‧‧‧Graphic drawing module

20‧‧‧儲存設備 20‧‧‧Storage equipment

30‧‧‧處理器 30‧‧‧ Processor

40‧‧‧顯示設備 40‧‧‧Display equipment

Claims (8)

一種產品三維模型自動擺正方法,應用於電子裝置,該方法包括:三角網格化步驟:從儲存設備中讀取產品三維模型,並對產品三維模型進行三角網格化;工件座標系確定步驟:從儲存設備中讀取產品的二維尺寸圖,根據產品的二維尺寸圖中的標注資訊確定產品三維模型的工件座標系;單位矩陣生成步驟:根據機械座標系的原點座標及X、Y、Z軸方向的向量生成機械座標系的齊次單位矩陣A2;第一變換矩陣計算步驟:根據工件座標系的原點在機械座標系中的座標計算工件座標系相對於機械座標系的平移齊次變換矩陣A1;第二變換矩陣計算步驟:計算平移齊次變換矩陣A1的逆矩陣,並根據機械座標系的齊次單位矩陣A2、平移齊次變換矩陣A1的逆矩陣計算產品三維模型的旋轉齊次變換矩陣R;及三角形頂點座標計算步驟:將網格化後的產品三維模型上各三角形的頂點座標乘以旋轉齊次變換矩陣R得到產品三維模型擺正後各三角形的頂點在機械座標系中的座標。 A product three-dimensional model automatic square method is applied to an electronic device, and the method comprises: a triangle meshing step: reading a product three-dimensional model from a storage device, and performing triangle meshing on the product three-dimensional model; the workpiece coordinate system determining step : reading the 2D dimension drawing of the product from the storage device, determining the workpiece coordinate system of the 3D model of the product according to the labeling information in the 2D dimension drawing of the product; the unit matrix generating step: according to the origin coordinate of the mechanical coordinate system and X, The vector in the Y and Z directions generates the homogeneous unit matrix A2 of the mechanical coordinate system; the first transformation matrix calculation step: calculates the translation of the workpiece coordinate system relative to the mechanical coordinate system according to the coordinates of the origin of the workpiece coordinate system in the mechanical coordinate system Homogeneous transformation matrix A1; second transformation matrix calculation step: calculating the inverse matrix of the translational homogeneous transformation matrix A1, and calculating the product three-dimensional model according to the homogeneous matrix matrix A2 of the mechanical coordinate system and the inverse matrix of the translation homogeneous transformation matrix A1 Rotating homogeneous transformation matrix R; and triangle vertex coordinates calculation step: each triangle of the meshed product 3D model Multiplying the vertex coordinate rotation homogeneous transformation matrix R obtained coordinates of each vertex of a triangle in the coordinate system of the mechanical three-dimensional model to straighten the product. 如申請專利範圍第1項所述的產品三維模型自動擺正方法,在三角網格化步驟後還包括步驟:根據網格化後產品三維模型上的三角形頂點在工件座標系中的三維座標繪製三角網格化後的產品三維模型。 For example, the automatic three-dimensional model square method of the product described in claim 1 further comprises the following steps: drawing the three-dimensional coordinates of the triangle vertices on the three-dimensional model of the product in the workpiece coordinate system according to the meshed product. A three-dimensional model of the product after triangular meshing. 如申請專利範圍第2項所述的產品三維模型自動擺正方法,在三角形頂點座標計算步驟後還包括步驟:根據產品三維模型擺正後各三角形的頂點在機械座標系中的座標重新繪製擺正後的產品三維模型。 For example, the method for automatically arranging the three-dimensional model of the product according to the second aspect of the patent application includes the steps of calculating the coordinates of the vertices of the triangles in the mechanical coordinate system according to the vertices of the triangular vertices after the three-dimensional model of the product is squared. A three-dimensional model of the product. 如申請專利範圍第1項所述的產品三維模型自動擺正方法,其中,工件座 標系確定步驟包括:從產品的二維尺寸圖中選擇兩條互相垂直的基準線分別作為工件座標系的X、Y軸;以該兩條互相垂直的基準線的交點作為工件座標系的原點,以該兩條基準線所在的平面為基準面,並以基準面的法向量為工件座標系的Z軸;及確定產品的二維尺寸圖中的基準面在產品三維模型上對應的平面,在產品三維模型上相應位置建立所述工件座標系。 The method for automatically arranging a three-dimensional model of a product according to claim 1, wherein the workpiece holder The marking system determining step comprises: selecting two mutually perpendicular reference lines from the two-dimensional dimension drawing of the product as the X and Y axes of the workpiece coordinate system; and the intersection of the two mutually perpendicular reference lines as the original of the workpiece coordinate system Point, the plane where the two reference lines are located as a reference plane, and the normal vector of the reference plane is the Z axis of the workpiece coordinate system; and the plane corresponding to the reference plane in the two-dimensional dimension diagram of the product is determined on the product three-dimensional model The workpiece coordinate system is established at a corresponding position on the three-dimensional model of the product. 一種產品三維模型自動擺正系統,應用於電子裝置,該系統包括:三角網格化模組,用於從儲存設備中讀取產品三維模型,並對產品三維模型進行三角網格化;座標系確定模組,用於根據產品的二維尺寸圖中的資訊確定產品三維模型的工件座標系;變換資訊計算模組,用於根據機械座標系的原點座標及X、Y、Z軸方向的向量生成機械座標系的齊次單位矩陣A2,根據工件座標系的原點在機械座標系中的座標計算工件座標系相對於機械座標系的平移齊次變換矩陣A1,計算平移齊次變換矩陣A1的逆矩陣,並根據機械座標系的齊次單位矩陣A2、平移齊次變換矩陣A1的逆矩陣計算產品三維模型的旋轉齊次變換矩陣R;及變換資訊計算模組,還用於將網格化後的產品三維模型上各三角形的頂點座標乘以旋轉齊次變換矩陣R得到產品三維模型擺正後各三角形的頂點在機械座標系中的座標。 A three-dimensional model automatic square system for products, which is applied to an electronic device, the system comprises: a triangular meshing module, which is used for reading a three-dimensional model of a product from a storage device, and triangulating the three-dimensional model of the product; Determining a module for determining a workpiece coordinate system of the three-dimensional model of the product according to the information in the two-dimensional size map of the product; and transforming the information calculation module for using the origin coordinate of the mechanical coordinate system and the X, Y, and Z axis directions The homogeneous unit matrix A2 of the vector generation mechanical coordinate system calculates the translational homogeneous transformation matrix A1 of the workpiece coordinate system relative to the mechanical coordinate system according to the coordinates of the origin of the workpiece coordinate system in the mechanical coordinate system, and calculates the translational homogeneous transformation matrix A1. The inverse matrix, and the rotation homogeneous transformation matrix R of the product three-dimensional model is calculated according to the homogeneous unit matrix A2 of the mechanical coordinate system and the inverse matrix of the translation homogeneous transformation matrix A1; and the transformation information calculation module is also used for the grid The vertices of each triangle on the 3D model of the product are multiplied by the rotational homogeneous transformation matrix R to obtain the vertices of the triangles after the product is modeled by the 3D model. Coordinates in the coordinate system. 如申請專利範圍第5項所述的產品三維模型自動擺正系統,還包括圖形繪製模組,用於根據網格化後產品三維模型上的三角形頂點在工件座標系中的三維座標繪製三角網格化後的產品三維模型。 The three-dimensional model automatic square system of the product mentioned in claim 5, further comprising a graphic drawing module, which is configured to draw a triangulation according to the three-dimensional coordinates of the triangle vertices on the three-dimensional model of the meshed product in the workpiece coordinate system. A personalized 3D model of the product. 如申請專利範圍第6項所述的產品三維模型自動擺正系統,其中,該圖形 繪製模組還用於根據產品三維模型擺正後各三角形的頂點在機械座標系中的座標重新繪製擺正後的產品三維模型。 The three-dimensional model automatic square system of the product of claim 6, wherein the graphic The drawing module is also used to redraw the three-dimensional model of the product after the squares of the triangles in the mechanical coordinate system according to the three-dimensional model of the product. 如申請專利範圍第5項所述的產品三維模型自動擺正系統,其中,座標系確定模組根據產品的二維尺寸圖中的資訊確定產品三維模型的工件座標系包括:從產品的二維尺寸圖中選擇兩條互相垂直的基準線分別作為工件座標系的X、Y軸;以該兩條互相垂直的基準線的交點作為工件座標系的原點,以該兩條基準線所在的平面為基準面,並以基準面的法向量為工件座標系的Z軸;及確定產品的二維尺寸圖中的基準面在產品三維模型上對應的平面,在產品三維模型上相應位置建立所述工件座標系。 The three-dimensional model automatic square positioning system according to claim 5, wherein the coordinate system determining module determines the workpiece coordinate system of the product three-dimensional model according to the information in the two-dimensional size map of the product, including: two-dimensional from the product In the dimension drawing, two mutually perpendicular reference lines are selected as the X and Y axes of the workpiece coordinate system; the intersection of the two mutually perpendicular reference lines is used as the origin of the workpiece coordinate system, and the plane where the two reference lines are located The reference plane, and the normal vector of the reference plane is the Z axis of the workpiece coordinate system; and the plane corresponding to the reference plane in the two-dimensional dimension map of the product is determined on the product three-dimensional model, and the corresponding position is established on the product three-dimensional model. Workpiece coordinate system.
TW100102218A 2011-01-21 2011-01-21 Three-dimensional model adjustment system and method TWI501098B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW100102218A TWI501098B (en) 2011-01-21 2011-01-21 Three-dimensional model adjustment system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW100102218A TWI501098B (en) 2011-01-21 2011-01-21 Three-dimensional model adjustment system and method

Publications (2)

Publication Number Publication Date
TW201232307A TW201232307A (en) 2012-08-01
TWI501098B true TWI501098B (en) 2015-09-21

Family

ID=47069554

Family Applications (1)

Application Number Title Priority Date Filing Date
TW100102218A TWI501098B (en) 2011-01-21 2011-01-21 Three-dimensional model adjustment system and method

Country Status (1)

Country Link
TW (1) TWI501098B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5951475A (en) * 1997-09-25 1999-09-14 International Business Machines Corporation Methods and apparatus for registering CT-scan data to multiple fluoroscopic images
TWI258716B (en) * 2004-11-16 2006-07-21 Ind Tech Res Inst Image capturing platform of measuring for 3-D material, and correcting compensation method
WO2009155525A2 (en) * 2008-06-19 2009-12-23 University Of Utah Research Foundation Implementing and interpolating rotations from a computing input device
CN101476881B (en) * 2009-01-23 2010-09-15 清华大学 Line-shaped laser vertical rotation type three-dimensional appearance measuring apparatus and method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5951475A (en) * 1997-09-25 1999-09-14 International Business Machines Corporation Methods and apparatus for registering CT-scan data to multiple fluoroscopic images
TWI258716B (en) * 2004-11-16 2006-07-21 Ind Tech Res Inst Image capturing platform of measuring for 3-D material, and correcting compensation method
WO2009155525A2 (en) * 2008-06-19 2009-12-23 University Of Utah Research Foundation Implementing and interpolating rotations from a computing input device
CN101476881B (en) * 2009-01-23 2010-09-15 清华大学 Line-shaped laser vertical rotation type three-dimensional appearance measuring apparatus and method thereof

Also Published As

Publication number Publication date
TW201232307A (en) 2012-08-01

Similar Documents

Publication Publication Date Title
CN102609550B (en) Product three-dimensional model ajusts system and method automatically
US7724380B2 (en) Method and system for three-dimensional measurement
TWI672207B (en) Posture positioning system for machine and the method thereof
JP5113666B2 (en) Robot teaching system and display method of robot operation simulation result
CN110842901A (en) Robot hand-eye calibration method and device based on novel three-dimensional calibration block
TW201317937A (en) System and method for generating an image measurement program of a product
CN107063060A (en) A kind of method and device for determining surface planarity
JP2006289524A (en) Workpiece placement error measuring device
US10684609B2 (en) Program code generating method for tilted plane machining by multi-axis machine tool and device thereof
Swornowski A critical look at the coordinate measuring technique
JP5481397B2 (en) 3D coordinate measuring device
TWI492080B (en) System and method for establishing three-dimension safety level
TWI501098B (en) Three-dimensional model adjustment system and method
TWI506566B (en) System and method for outputting measure results automatically
CN111915666A (en) Volume measurement method and device based on mobile terminal
Yang et al. Inspection path generation in haptic virtual CMM
JP2009086842A (en) Harness design support device, method and program
TWI510758B (en) System and method for measuring contour line of object
TW201514644A (en) Computing device, system and method for simulating product manufacturing
JP2004286571A (en) Method and program for supporting preparation of measurement program
TWI409430B (en) System and method for simulating the movement of an image measuring apparatus
Hou et al. Survey of vision-based augmented reality 3D registration technology
JP2007094902A (en) Three-dimensional image display device, method, and program
JP2006267026A (en) Image processing method, and image processor
US20230405730A1 (en) Inspection system for welded portion

Legal Events

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