Tutorial | Nội suy Tài liệu này hướng dẫn bạn cách dùng phần mở rộng Nội suy của Inkscape Giới thiệu Nội suy tức là tạo ra một phép nội suy tuyến tính giữa 2 hoặc nhiều đường nét. Nói cách khác, phép nội suy “lấp chỗ trống” giữa các đường nét và chuyển dạng chúng tương ứng với số bước được cho. To use the Interpolate extension, select the paths that you wish to transform, and choose ExtensionsGenerate From PathInterpolate from the menu. Before invoking the extension, the objects that you are going to transform need to be paths. This is done by selecting the object and using PathObject to Path or Shift+Ctrl+C. If your objects are not paths, the extension will do nothing. Interpolation between two identical paths The simplest use of the Interpolate extension is to interpolate between two paths that are identical. When the extension is called, the result is that the space between the two paths is filled with duplicates of the original paths. The number of steps defines how many of these duplicates are placed. Ví dụ, lấy 2 đường nét sau: Now, select the two paths, and run the Interpolate extension with the settings shown in the following image. Luỹ thừa: 0.0Bước nội suy: 6Phương pháp nội suy: 2Nhân đôi đường nét cuối: không chọnNội suy kiểu dáng: không chọn As can be seen from the above result, the space between the two circle-shaped paths has been filled with 6 (the number of interpolation steps) other circle-shaped paths. Also note that the extension groups these shapes together. Nội suy giữa 2 đường nét khác biệt Khi áp dụng hiệu ứng Nội suy lên 2 đường nét khác biệt, Inkscape tạo các đường nét nội suy biến đổi từ hình dạng nét thứ nhất đến nét còn lại. Kết quả là bạn có nhiều nét có hình dạng biến đổi từ nét này đến nét kia, và tham số Bước nội suy điều chỉnh mức độ biến đổi giữa 2 nét liên tiếp. Ví dụ, lấy 2 đường nét sau: Now, select the two paths, and run the Interpolate extension. The result should be like this: Luỹ thừa: 0.0Bước nội suy: 6Phương pháp nội suy: 2Nhân đôi đường nét cuối: không chọnNội suy kiểu dáng: không chọn Như trên, khoảng cách giữa đường nét hình tròn và đường nét hình tam giác đã được lấp đầy bằng 6 đường nét có hình dạng chuyển dần từ hình tròn về hình tam giác. When using the Interpolate extension on two different paths, the position of the starting node of each path is important. To find the starting node of a path, select the path, then choose the Node Tool so that the nodes appear and press TAB. The first node that is selected is the starting node of that path. Xem ảnh bên dưới, giống với ví dụ bên trên, nhưng khác nút được hiển thị. Nút màu xanh trong mỗi đường nét là nút đầu tiên. Ví dụ trên (lặp lại bên dưới) được thực hiện với các nút này được đặt làm nút đầu tiên. Luỹ thừa: 0.0Bước nội suy: 6Phương pháp nội suy: 2Nhân đôi đường nét cuối: không chọnNội suy kiểu dáng: không chọn Giờ, hãy quan sát sự thay đổi trong kết quả của phép nội suy khi đường nét hình tam giác được lật đối xứng, khiến cho nút đầu tiên nằm ở vị trí khác: Các phương pháp nội suy One of the parameters of the Interpolate extension is the Interpolation Method. There are 2 interpolation methods implemented, and they differ in the way that they calculate the curves of the new shapes. The choices are either Interpolation Method 1 or 2. Trong ví dụ trên, ta dùng Phương pháp nội suy 2, và kết quả là: Giờ, hãy so sánh với kết quả của Phương thức Nội suy 1: Sự khác biệt về mặt phương pháp tính toán giữa 2 phương thức nằm ngoài phạm vi của tài liệu này, nên bạn hãy thử cả 2 phương thức, và dùng phương thức nào cho kết quả tốt nhất mà bạn muốn. Tham số Luỹ thừa điều chỉnh khoảng cách giữa 2 bước của phép nội suy. Luỹ thừa bằng 0 sẽ làm cho khoảng cách giữa 2 đường nét nội suy là giống nhau. Đây là kết quả thu được khi tham số Lũy thừa bằng 0. Luỹ thừa: 0.0Bước nội suy: 6Phương pháp nội suy: 2Nhân đôi đường nét cuối: không chọnNội suy kiểu dáng: không chọn Còn đây là khi Luỹ thừa bằng 1: Luỹ thừa bằng 2: và Luỹ thừa bằng -1: When dealing with exponents in the Interpolate extension, the order that you select the objects is important. In the examples above, the star-shaped path on the left was selected first, and the hexagon-shaped path on the right was selected second. Xem kết quả của phép nội suy khi chọn nét bên phải trước. Luỹ thừa trong ví dụ này được đặt bằng 1: Nhân đôi đường nét cuối This parameter defines whether the group of paths that is generated by the extension includes a copy of the original paths that interpolate was applied on. Nội suy kiểu dáng This parameter is one of the neat functions of the interpolate extension. It tells the extension to attempt to change the style of the paths at each step. So if the start and end paths are different colors, the paths that are generated will incrementally change as well. Đây là 1 ví dụ khi chọn Nội suy Kiểu dáng áp dụng lên màu tô của đường nét: Nội suy Kiểu dáng cũng có tác dụng đối với nét viền của đường nét: Tất nhiên, đường nét đầu và cuối không nhất thiết phải giống nhau: Dùng Nội suy để làm giả các chuyển sắc độc đáo At the time when gradient meshes were not implemented in Inkscape, it was not possible to create a gradient other than linear (straight line) or radial (round). However, it could be faked using the Interpolate extension and Interpolate Style. A simple example follows — draw two lines of different strokes: Và nội suy giữa 2 đường này để tạo ra chuyển sắc bạn cần: Kết luận As demonstrated above, the Inkscape Interpolate extension is a powerful tool. This tutorial covers the basics of this extension, but experimentation is the key to exploring interpolation further. Josh Andler; Ryan Lerch; Colin Marquardt; Kris De Gussem; Nicolas Dufour; Sylvain Chiron; Gellért Gyuris Nguyen Dinh Trung — 2007, 2008 Esteban Capella — 2019