what is path & subpath in Java2D?

一笑奈何 提交于 2019-12-24 08:33:10

问题


I hope it is not a silly question:

What is path, subpath, and endpoint in Java2D?


回答1:


Most commonly, a path is a combination of lines and cubic Bezier segments. This is represented procedurally by a sequence of moveTo, lineTo, curveTo, and closePath methods. These correspond to the operators of the same name in PostScript (but lowercased), from which the Java2D imaging model derives. (Also, there is quadTo, which is a quadratic Bezier segment, but this is less important and easily simulated by curveTo if needed).

A subpath is a connected sequence of segments. It doesn't have its own class, but a GeneralPath object can contain multiple subpaths, each beginning with its own moveTo().

Endpoints are the points at the ends of each line segment. Their (x, y) coordinates are the arguments to moveTo and lineTo, and the last two arguments to curveTo (the other arguments are "control points" which affect the shape of the curve segment but not the endpoints).

Hope this enlightens.



来源:https://stackoverflow.com/questions/4662295/what-is-path-subpath-in-java2d

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!