Inkscape tutorial: Nội suy

Inkscape

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 Between Paths 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 Ctrl+Shift+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.

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:

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.

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 Split paths into segments of equal lengths or Discard extra nodes of longer path.

In the examples above, we used the first Interpolation Method (Split paths), and the result was:

Now compare this to Interpolation Method 2 (Ignore nodes):

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.

The exponent parameter controls the spacing between steps of the interpolation. An exponent of 1 makes the spacing between the copies all even.

Here is the result of another basic example with an exponent of 1.

The same example with an exponent of 0.5:

with an exponent of 0.3:

and with an exponent of 1.5:

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.

View the result when the path on the right was selected first. The exponent in this example was set to 0.5:

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.

Authors: Josh Andler; Ryan Lerch; Colin Marquardt; Kris De Gussem; Nicolas Dufour; Sylvain Chiron; Gellért Gyuris; Maren Hachmann

Translators: Nguyen Dinh Trung — 2007

Header / footer design: Esteban Capella — 2019