Machining Tool Path Generation for Point Set - IJCC

17 downloads 7784 Views 1MB Size Report
to Polyhedral Machining”, Computer-Aided Design 34,. 379-389, 2002. [2] SC Park, “Sculptured Surface Machining Using Triangular. Mesh Slicing” ...
International Journal of CAD/CAM Vol. 8, No. 1, pp. 45~53 (2008)

Machining Tool Path Generation for Point Set Seyoun Park and Hayong Shin* Department of Industrial Engineering, KAIST, Korea Abstract − As the point sampling technology evolves rapidly, there has been increasing need in generating tool path from dense point set without creating intermediate models such as triangular meshes or surfaces. In this paper, we present a new tool path generation method from point set using Euclidean distance fields based on Algebraic Point Set Surfaces (APSS). Once an Euclidean distance field from the target shape is obtained, it is fairly easy to generate tool paths. In order to compute the distance from a point in the 3D space to the point set, we locally fit an algebraic sphere using moving least square method (MLS) for accurate and simple calculation. This process is repeated until it converges. The main advantages of our approach are : (1) tool paths are computed directly from point set without making triangular mesh or surfaces and their offsets, and (2) we do not have to worry about no local interference at concave region compared to the other methods using triangular mesh or surface model. Experimental results show that our approach can generate accurate enough tool paths from a point set in a robust manner and efficiently. Keywords: Point set, machining, distance field, offset, APSS

1. Introduction With the rapid development in 3D scanning technology, we can easily obtain a large amount of point data sampled from the surface of physical objects. There have been increasing needs of using point set in various applications such as rendering and manufacturing. Machining, often called a mother process for manufacturing, generally requires high accuracy compared to other processes. In this paper, we pursue the method of computing machining tool paths directly from a point set without making intermediate representations such as meshes, as shown in Figure 2. The major step in tool path computation is to obtain an offset model of the target shape. Once the offset model is given, tool path generation is to plan the tool movement on that model. A popular method of isoplanar tool path planning is to intersect a series of parallel planes, called driving plane, with the offset model. However, obtaining offset model of an arbitrary shape is not a trivial task. In practice, mesh model is widely used for the target shape and offset model representation [1,2,3]. Our approach is to compute Euclidean distance fields on the driving planes, instead. Euclidean distance field conveys more information than the offset model with the fixed offset distance. Figure 1 shows the input point set model and the tool paths generated from it along with the machining simulation results. In this paper, we present a direct tool path generation *Corresponding author: Tel: +82-(0)42-350-3124 Fax: +82-(0)42-350-3110 E-mail: [email protected] / Homepage: http://ieserver4.kaist.ac.kr/

method from point sets. We use Algebraic Point Set Surfaces [4] (APSS for short) as the underlying computational model for the surface covering the input point set. Note that APSS is an implicit surface, and instead of pre-computation of APSS, we evaluate APSS at a point in space whenever we need the distance to the point set surface. In order to obtain iso-planar tool paths, we compute 2D distance field on each driving plane. Within a driving plane, the 2D distance field is obtained at either a uniform grid structure or quadtree structure. For the moment, we assume that the tool to be used is the only ball-end milling tool. We also assume that the input point set is obtained from a smooth object and the noise has been removed in the preprocessing step. We will discuss about relaxing the assumption in the later part of this paper. The main advantages of our approach are as below. . No need to construct mesh or surface. No offset operation is required either. . Local interference free. We do not have to struggle with the local cutter interference around high curvature concave region. Though the offset results can be different by applied methods, the offset is suffered by self-intersection around concave region[5]. This causes cutter interferences at that region which may make the serious overcuts as well as longer machining time. Figure 3(a) shows the result of face-based offsetting with triangular mesh model, and overlapped triangles are in self-intersected region.

2. Related Works There have been extensive research efforts on the direct use of point set data. Since a point set is disconnected

46

International Journal of CAD/CAM Vol. 8, No. 1, pp. 45~53

Fig. 1. Mold model 1; (a) the point set sampled from CAD model; (b) semi-finish tool paths (offset distance: 6.0mm); (c) cutting simulation of (b); (d) finish tool paths (offset distance: 2.0mm); (e) cutting simulation of (d).

Fig. 2. Overall procedure.

Fig. 3. Local interferences by self-intersected region; (a) Selfintersections in face-based offset; (b) self-intersection of line segments in 2D. Black line segments are original ones, and the upper grey curve is offset curve. The orange arrows show offset direction.

discrete sample of the object boundary, we need some kind of underlying computational model to interpret the empty space between points. For this purpose, Alexa et al [6] published a landmark paper which provides computational model of the surface covering given point set, called point set surface (PSS), using moving least squares (MLS) method. PSS computes a local reference domain plane and performs projection (along the normal of the reference domain plane) onto locally fitted polynomial surface. Levin [7] also reported a similar work. The resulting surface model is described in an implicit form, as the set of all stationary points under MLS projection operator. More recently, Guennebaud et al [4] proposed a more robust point set surface model, called algebraic point set surface, or APSS for

short. Instead of reference plane fitting and local polynomial surface computation, APSS uses a spherical fitting model. Our research was inspired by [4] and the motivation was to test the possibility of using APSS for tool path generation purpose, which turned out to be promising. APSS will be briefly reviewed in section 3. Another highly related area is about surface reconstruction by implicit surface, because we can obtain certain kinds of scalar fields from implicit surfaces, which are the key of our work. Ohtake et al [8] applied partition of unity with implicits hierarchically, which is one of the mesh-free modeling methods. However, their modeling scheme needs construction of whole surfaces using octree, and it is time-consuming work to obtain offset model by using gradients. On the other hands, for more accurate surface reconstruction, there are modified MLS approaches such as [9, 10]. Fleishman et al[9] tried statistical method, and Lipman et al[10] used local splines instead of polynomials in standard MLS. We use [9] for segmentation in section 4. Xie et al[11] also shows data-dependent approach at each octree cell. While points set surfaces and their variants have been receiving hot research focus in computer graphics area, there have been only a few of research activities of direct tool path generation from measured point set. Park and Chung [12] proposed a method to generate tool path from measured data under the assumption that

Machining Tool Path Generation for Point Set 47

Seyoun Park and Hayong Shin

(1)

φ is a decreasing function and hi(x) denotes the local feature size around x, which can be constant, or can depend on x or pi. In [6], the following function has been chosen for φ : 2 ⎧ φ(x) = ⎨(1 – x ) if x < 1 otherwise ⎩0

i

wi( x ) = e

T

p p]c = 0

(4)

arg min W (x)Ac 2 c(x) = lim c≠0

where

1

T pn

, A=

T

p1 p1

...

p1

...

… wn( x )

T

1

0

...

...

W( x ) =

w1 ( x ) …

(5)

T pn pn

Let S(c(x)) denote the sphere with coefficient c(x) as defined in eq. (4), where c(x) is obtained by solving eq. (5). The evaluation point x is projected onto the sphere obtained in eq. (5) by a spherical projection operator proj(xi,S(c(xi))) as shown in Figure 4. Starting from q0 = x, we can repeatedly apply qi+1 = proj(qi, S(c(qi))) until qi reaches the stationary condition, ||qi+1 − qi|| < ε, where ε is a user defined threshold. Let a(x)=[1 xT xTx]c(x), where c(x) is obtained by solving eq. (5). a(x) defines a scalar field in R3. APSS can also be viewed as the zero-set of the scalar field, i.e. APSS = {x| a(x) = 0}. For more details of the computation and the properties of APSS, the readers are referred [4]. Figure 5 shows a cross section of the scalar field defined by a(x). The most green region is the zero set of a(x). It is worth to note that a(x) is not Euclidean distance from x to APSS. Hence, we will modify the scalar field in the next section.

4. Distance Calculation (2)

Another popular choice for weight function is the following equation : – p –x 2 -------------------{h ( x ) } 2

T

where c is a 5 × 1 column vector representing the coefficients of the sphere. Note that f(p) in equation (4) denotes the algebraic distance from p to Sc. The algebraic sphere fitting can be solved by minimizing the weighted sum of the squared algebraic distance f(pi) for all pi ∈ N(x). In other words, the sphere coefficient c(x) for an evaluation point x can be obtained by :

0

In this section, we will briefly review the main idea of APSS in [4]. Given a set of points P = {pi ∈ R3} which is sampled from the original surface Ψ ⊂ R3, a smooth surface Q approximating P can be defined with a moving least squares (MLS) scheme. In APSS, Q is defined by fitting an algebraic sphere (compared to geometric sphere). For any evaluation point x, a set of neighbor points N(x) Ã P is selected first. Each point pi in N(x) is given with the weight wi(x) based on the distance || pi – x || : pi – x ⎞ wi(x) = φ ⎛-------------⎝ hi ( x ) ⎠

f(p) = [ 1 p

...

3. Algebraic Point Set Surfaces

Because there is no big influence to the results by different weighting functions, we simply choose eq. (3). Then, the standard weighted least square method is applied to compute the best fitting sphere in algebraic distance sense. A sphere Sc can be defined as a set of points satisfying :

...

point data is organized as a set of point sequences. We believe this assumption is hardly achievable when a number of independent scans are registered to form the entire point set as in Digital Michelangelo project [13]. The work of Feng and Tend in [14] utilizes grouping of data point into small cells when positioning cutter locations. Shin et al proposes a method of directly utilizing point set data in rapid prototyping [15]. The works on sculpting in computer graphics area are closely related to machining. Though most of them deal with mesh models, there are a few recently published papers which handles point sets. They mainly extract iso-surfaces by generating distance fields [16] and obtain the zero-set iso-surface from the trivariate Bspline function representing the distance field [17]. However, it seems hard to directly apply their method to tool path generation application. In addition, there are several computing schemes for generate distance fields [18] which is not directly related to sculpting or machining. In these cases, almost works are not focusing on how to compute accurately, but how to compute efficiently. Therefore, we want to present our approach to generate tool paths for point set input models with acceptable accuracy and efficiency.

(3)

Let dist(x, Ψ) denote the distance from an evaluation point x to the surface Ψ. Since Ψ is unknown, it is obviously impossible to compute dist(x, Ψ) in exact manner. A naïve method of estimating dist(x, Ψ) is to select the nearest point p ∈ P and take || p–x || as dist(x, Ψ). This simple approach causes a large error especially when point density is low, and it is very sensitive to noise.

48

International Journal of CAD/CAM Vol. 8, No. 1, pp. 45~53

Fig. 4. Iterative projection (in 2D).

Fig. 5. APSS; (a) APSS by projection: q=proj(x, S(c(x))); (b) APSS from implicit representation - green color shows zero-set iso-surface.

Our approach is to repeat algebraic sphere fitting from the evaluation point x until the resulting sphere converges to a stationary one, and calculate the Euclidean distance from x to the stationary projected point, q = q∞ , with the sphere. That is, we compute dist(x, Ψ) as dist(x, q). Therefore, the projection scheme is critical for the quality in this work. The simple projection explained in previous section may cause wrong mapping if the first projection direction is not toward the input surface such as Figure 6(a). The estimated dist(x, q) can be quite longer than the distance from x to the exact shortest point on Ψ. For this reason, we use almost orthogonal projection method suggested by [4, 15]. The only difference from the almost orthogonal scheme is the projection step from the source point, qi+1=proj(x, S(c(qi))) instead of q i+1 = proj(qi,S(c(qi))) in the simple projection. Figure 6 shows the results with different projection scheme. Note that the almost orthogonal projection method corrects the initial wrong projection direction, and gives more accurate results in this experiment. In this manner, we can avoid the difference between algebraic distance defined in eq. (4) and Euclidean distance we need. Figure 7 shows two examples of the Euclidean (color-coded) distance fields cross sectioned by a plane.

4.1 Concave region While stable distance computation can be achieved with small errors in smooth region, the error of distance

Fig. 6. Projections in 2D; light grey regions represent neighbors of evaluation points.

Fig. 7. Distance Field.

estimation is relatively large in concave region, especially when neighbor points are located in more than two separated regions. In such regions, we found a tendency that the fitted sphere is a little bigger than necessary, shown as a green sphere in Figure 8. This over-estimation of distance can cause gouging in concave regions. To solve such a problem, if N(x) has two separate clusters within it, we re-fit a new sphere by adjusting the weights for the neighbor points : larger weights for those points inside the initially fitted sphere, and smaller weights for the outside ones. And this fitting repeats until the sphere converges.

Seyoun Park and Hayong Shin

Machining Tool Path Generation for Point Set 49

5. Tool-path Tracing

Fig. 8. Refitting in concave region; a outer sphere shows the initially fitted one, and an inner sphere is the adjusted one.

4.2 Segmentation Though we assumed a smooth point set as the input, we investigated the distance error around sharp edges. The sphere fitting often fails or results in a large error around the sharp edges as shown in Figure 9(a). Handling sharp feature is a task requiring further study. Our current, but incomplete, approach to mend this matter is to segment input point surfaces using [9] as a pre-processing. With segmented point surfaces along sharp edges, we use the neighbor points selected in one region only. However, this part is still remained as further work because [9] is extremely time consuming and almost engineering objects have more feature regions as well as sharp edges. Figure 9(b) shows the improved result with this method.

Fig. 9. Sharp edges; (a) the result when apply only spherical fitting; (b) the corrected result using nearest neighbors.

Once the distance computation method is fixed, tool path computation is relatively straightforward. The direction of driving planes is specified by the user. Let the normal direction of the planes parallel to the x-axis in this work. Then we can compute the intervals between driving planes from the given scallop height[20, 21]. In this section, we present how to trace a tool-path in one driving plane in section 5.1, and how to determine step sizes in section 5.2.

5.1 Tracing a path in one plane For each driving plane, Euclidean distance field is evaluated at the rough uniform grid points (Figure 10(a)). From this field, we can find the cells crossing the isodistance surface dist(x, S) = d, where d is the cutter radius assuming that we use the ball-end mill. At each edge of the uniform grid crossing the iso-distance surface, we perform a one-dimensional interpolation search to locate exact passing points as shown in Figure 11(a)~(c).

Fig. 11. Tool path tracing; d1-d4 represent the distance at each grid node, and d is the offset distance.

Fig. 10. Grids for tool paths; (a) rough grids at a driving plane; (b) grid refinement and tool path tracing with given offset distance; the view is magnified at the dotted rectangle (a) (d) (e).

50

International Journal of CAD/CAM Vol. 8, No. 1, pp. 45~53

In order to trace the iso-distance curve in the grid cell, we use marching-squares algorithm (2D version of marching cubes) with the square size equal to the specified step length as shown in Figure 11(d)~(e). Figure 12 shows two tool paths for different tool radius on a driving plane

5.2 Step-size determination When we generate tool-paths, there are two kinds of errors which we should consider. One is the scallop height which is affected by the interval of driving planes. Figure 13 shows scallop height h when the tool radius is d, the interval between the parallel tool paths is s, and the slope of the tangent vector on yz-plane is tan η. The relation between the allowable scallop height h and plane interval s can be easily obtained as eq. (6) [21]. Among the various slope values, when a tool-path at one plane is computed, we select and store the steepest one to evaluate the distance from the current plane to the next one. s ≤ 2 cos η 2dh – h

2

(6)

In our work, the slope information can be easily approximated since we fit a sphere at each evaluation point and find projected point on the sphere. As shown in Figure 14, let x a grid node at one driving plane, and finally fitted sphere S(c(q)) where q is the projected point. Then we easily evaluate the tangent vector t(q) at q on yz-plane which shows the slope value. The

Fig. 14. Slope approximation.

forward step size along the tool is initially determined by the size of the refined grid, and the consecutive line segments on the same line are merged as one line segment at the post-processing step.

6. Examples We have implemented the algorithm on a commodity level PC with Intel Pentium 4 3.0 GHz CPU, 2.00 GB of RAM running on MS Windows XP. We tested our system on several point sets. Table 1 show the runtime performance statistics for 3 mold models, whose point sets are obtained by sampling from the triangular mesh model. Mold 1, 2, 3, 4 are shown in Figure 15, 16, 17, 19 respectively. Figure 15 shows the point set sampled from a torus and the cross sections of the distance field. Tool-paths in Figure 16 are generated with different Table 1. Performance test

Fig. 12. Tool path tracing in one plane; the offset distances of lower curve and upper one are 20.0 mm and 40.0 mm.

Fig. 13. Scallop height.

No. Plane interval Offset distance Computation points (mm) (mm) Time (s) Mold 1 314,872 0.4 2.0 341 Mold 2 416,805 0.4 3.0 352 Mold 3 474,338 0.6 3.0 287

Fig. 15. Accuracy test of distance field with torus model.

Machining Tool Path Generation for Point Set 51

Seyoun Park and Hayong Shin

Fig. 16. Mold model 2; tool paths (d: 5.0 mm, scallop height: 0.01 mm, left); cutting simulation result (right).

Fig. 17. Mold model 3 (d: 3.0 mm, uniform Da: 0.6 mm).

Fig. 18. Mold model 4 (d: 6.0 mm, uniform Da: 0.6 mm). Table 2. Accuracy test for smooth region

Sphere Torus Box Mold 1 Mold 2 Mold 3

Average error (mm) 1.0e-11 1.0e-5 1.0e-5 0.00211 0.00138 0.00107

Max error (mm) 0.00005 0.00034 0.00047 0.00958 0.00603 0.00532

Model size (WxHxD, mm) 20 × 20 × 20 28 × 8 × 28 10 × 10 × 10 110 × 90 × 45 120 × 80 × 40 120 × 60 × 47

plane intervals by considering the scallop height. The density of point set plays an important role on the accuracy of the results in our test. Obviously, the denser the input data set is, the less error we get. Shown in Figure 19 is the decreasing graph of estimation error (at a given tool radius) as the function of the sampling density.

52

International Journal of CAD/CAM Vol. 8, No. 1, pp. 45~53

Fig. 19. errors along sampling density (Mold4).

7. Concluding Remarks In this paper, we have developed a novel method to generate machining tool paths from a point set using algebraic point set surfaces. The main contributions of the proposed method can be summarized as : (1) intermediate models such as meshes or B-spline surfaces are not required, and (2) our scheme is local interference free.

The accuracy and performance of the proposed method seems satisfactory. After finding tool paths in one plane, we can easily treat global interferences at the post-processing step by extracting extreme points along the x-axis. (For the simplicity, let us assume that the tool axis is parallel to the z-axis, and cutting planes are parallel to the zx-plane.) On the other hand, sharp feature handling, which is a typical drawback of moving least squares method, remains as a further research topic, though we have briefly explained a simple but incomplete solution to this issue. When the input model is noisy, it is inevitable to obtain imperfect tool paths, though the spherical fitting of APSS has some smoothing effect. Figure 20(a) shows the cutting simulation result for the tool path with artificial noise added to the point set in Figure 13, compared with the result from noise-free model in Figure 20 (b). (The size of noise term is 0.5% of the model size, and we use the neighbor size as 30 while 9 neighbor points are used in other cases.) Sampling density is another factor which can cause large errors. Unstable fittings are detected at the region with low sampling density as shown in Figure 21(b). One solution is to use the approximation to the continuous model such as [7, 8]. However, it should be considered

Fig. 20. Impact of noise (a) cutting simulation for noisy point set; (b) cutting simulation of the original point set.

Fig. 21. Impact of sampling density; bumpy shape appears at the sparse sampled area in the original model.

Machining Tool Path Generation for Point Set 53

Seyoun Park and Hayong Shin

with treating sharp edges at once, which still remains as ill-defined problem.

[11]

Acknowledgements This work was supported by Defense Acquisition Program Administration and Agency for Defense Development under the contract UD080042AD, Korea.

[12] [13]

References [1] CS Jun, DS Kim, S Park, “A New Curve-Based Approach to Polyhedral Machining”, Computer-Aided Design 34, 379-389, 2002. [2] SC Park, “Sculptured Surface Machining Using Triangular Mesh Slicing”, Computer-Aided Design 36, 279-288, 2004. [3] SJ Kim, DY Lee, MY Yang, “Offset Triangular Mesh Using the Multiple Normal Vectors of a Vertex”, Computer-Aided Design and Applications, 1(1-4), 285291, 2004. [4] G Guennebaud, M Gross, “Algebraic point set surfaces”, Proc. SIGGRAPH 2007, Article no. 23, 2007. [5] W Jung, H Shi, BK Choi, “Self-intersection removal in triangular mesh offsetting”, Computer-Aided Design & Applications, 1, 477-484, 2004. [6] M Alexa., J Behr, D Cohen-Or, S Fleishman, D Levin, CT Silva, “Point set surfaces”, Proc. Visualization ‘01, 21-28, 2001. [7] D Levin, “Mesh-independent surface interpolation”, Geometric Modeling for Scientific Visualization, 181-187, 2003. [8] Y Ohtake, A Belyaev, M Alexa, G Turk, HP Seidel, “Multi-level partition of unity implicits”, Proc. SIGGRAPH 2003, 463-470, 2003. [9] S Fleishman, D Cohen-Or, CT Silva, “Robust moving least-squares fitting with sharp features”, Proc. SIGGRAPH 2005, 544-552, 2005. [10] Y Lipman, D Cohen-Or, D Levin, “Data-dependent MLS

[14] [15] [16] [17] [18]

[19]

[20] [21]

for faithful surface approximation”, Proc. Eurographics Symposium on Geometry Processing, 59-67, 2007. H. Xie, KT McDonnell, H Qin, “Surface reconstruction of noisy and defective data sets”, Proc. Visualization ’04, 259-266, 2004. SC Park, YC Chung, “Tool-path generation from measured data”, Computer-Aided Design, 35(5), 467-475, 2003. M. Levoy, K. Pulli, B. Curless, S. Rusinkiewicz, D. Koller, L. Pereira, M. Ginzton, S. Anderson, J. Davis, J. Ginsberg, J. Shade, and D. Fulk, “The digital Michelangelo project: 3D scanning of large statues,” Proc. SIGGRAPH 2000, 131–144, 2000. HY Feng, Z Teng, “Iso-planar piecewise pinear NC tool Path generation from discrete measured data points”, Computer-Aided Design, 37, 55-64, 2005. H Shin, S Park, E Park, “Direct slicing of a point set model for rapid prototyping”, Computer Aided Design and Applications, 1, 109-115, 2004. X Guo, J Hua, H Qin, “Scalar-function-driven editing on point set surfaces”, IEEE Computer Graphics and Applications, 24(4), 43-52, 2004. A Raviv, G Elber, “Three dimensional freeform sculpting via zero sets of scalar trivariate Functions”, Proc. ACM Symposium on Solid and Physical Modeling, 246-257, 1999. MW Jones, A Baerentzen, M Sramek, “3D distance fields: A survey of techniques and applications”, IEEE Transactions on Visualization and Computer Graphics, 12(4), 581-599, 2006. M Alexa, A Adamson, “On normals and projection operators for surfaces defined by point sets”, Proc. Eurographics symposium on Point-based Graphics, 149156, 2004. G Elber, E Cohen, “Tool path generation for freeform surface models”, Proc. ACM Symposium on Solid modeling and Applications, 419-428, 199. HY Feng, N Su, “Integrated tool path and feed rate optimization for the finishing machining of 3D plane surfaces”, Int. J. Machine of Tools & Manufacture, 40(11), 1557-1572, 2000.

Hayong Shin is an associate professor in the Department of Industrial Engineering at KAIST (Korea Advanced Institute of Science and Technology). Before joining KAIST, He worked for DaimlerChrysler Corp., CubicTek Co. and LG Electronics, developing commercial and in-house CAD/CAM software. He received a BS from Seoul National University in 1985, an MS and a PhD from KAIST in 1987 and 1991, all in industrial engineering. His main research interests are in the area of geometric modeling, tool path generation, process planning, and computational geometry. He can be reached at [email protected]

Seyoun Park is a post-doctoral researcher in the Department of Industrial Engineering at KAIST (Korea Advanced Institute of Science and Technology). She received a BS degree (2002), a MS degree (2004) and a PhD degree (2009) all in industrial engineering from KAIST. Her main research interests are in the general geometric modeling, point-based modeling, and bio-CAD. For more information, please send a mail to [email protected]

Hayong Shin

Seyoun Park

Suggest Documents