What is path & subpath in Java2D?

Hope this is not a stupid question:

What is the path, subpath, and endpoint in Java2D?

+1
source share
1 answer

Most often, a path is a combination of lines and cubic Bezier segments. This is represented by the procedural sequence of the moveTo, lineTo, curveTo, and closePath methods. They correspond to operations with the same name in PostScript (but with lower case), from which the Java2D image model is obtained. (In addition, there is quadTo, which is a quadratic Bezier segment, but this is less important and is easily simulated by a curve, if necessary).

A subpath is a connected sequence of segments. It does not have its own class, but a GeneralPath object can contain several subfolders, each of which begins with its own moveTo ().

Endpoints are points at the ends of each line segment. Their coordinates (x, y) are arguments for moveTo and lineTo, and the last two arguments are for curveTo (the other arguments are “control points” that affect the shape of the curve segment, but not the end points).

Hope this enlightens.

+3
source

Source: https://habr.com/ru/post/950187/


All Articles