You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2322 lines
44 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Curve</title>
  6. <base target="class-frame">
  7. <link href="../assets/css/docs.css" rel="stylesheet" type="text/css">
  8. <script src="../assets/js/paper.js"></script>
  9. <script src="../assets/js/jquery.js"></script>
  10. <script src="../assets/js/codemirror.js"></script>
  11. <script src="../assets/js/docs.js"></script>
  12. </head>
  13. <body>
  14. <article class="reference">
  15. <div class="reference-class">
  16. <h1>Curve</h1>
  17. <p>The Curve object represents the parts of a path that are connected by two following <a href="../classes/Segment.html"><tt>Segment</tt></a> objects. The curves of a path can be accessed through its <a href="../classes/Path.html#curves"><tt>path.curves</tt></a> array.</p>
  18. <p>While a segment describe the anchor point and its incoming and outgoing handles, a Curve object describes the curve passing between two such segments. Curves and segments represent two different ways of looking at the same thing, but focusing on different aspects. Curves for example offer many convenient ways to work with parts of the path, finding lengths, positions or tangents at given offsets.</p>
  19. </div>
  20. <!-- =============================== constructors ========================== -->
  21. <div class="reference-members">
  22. <h2>Constructors</h2>
  23. <div id="curve-segment1-segment2" class="member">
  24. <div class="member-link">
  25. <a name="curve-segment1-segment2" href="#curve-segment1-segment2"><tt><b>Curve</b>(segment1, segment2)</tt></a>
  26. </div>
  27. <div class="member-description hidden">
  28. <div class="member-text">
  29. <p>Creates a new curve object.</p>
  30. <ul class="member-list">
  31. <h4>Parameters:</h4>
  32. <li>
  33. <tt>segment1:</tt>
  34. <a href="../classes/Segment.html"><tt>Segment</tt></a>
  35. </li>
  36. <li>
  37. <tt>segment2:</tt>
  38. <a href="../classes/Segment.html"><tt>Segment</tt></a>
  39. </li>
  40. </ul>
  41. <ul class="member-list">
  42. <h4>Returns:</h4>
  43. <li>
  44. <tt><a href="../classes/Curve.html"><tt>Curve</tt></a></tt>
  45. </li>
  46. </ul>
  47. </div>
  48. </div>
  49. </div>
  50. <div id="curve-point1-handle1-handle2-point2" class="member">
  51. <div class="member-link">
  52. <a name="curve-point1-handle1-handle2-point2" href="#curve-point1-handle1-handle2-point2"><tt><b>Curve</b>(point1, handle1, handle2, point2)</tt></a>
  53. </div>
  54. <div class="member-description hidden">
  55. <div class="member-text">
  56. <p>Creates a new curve object.</p>
  57. <ul class="member-list">
  58. <h4>Parameters:</h4>
  59. <li>
  60. <tt>point1:</tt>
  61. <a href="../classes/Point.html"><tt>Point</tt></a>
  62. </li>
  63. <li>
  64. <tt>handle1:</tt>
  65. <a href="../classes/Point.html"><tt>Point</tt></a>
  66. </li>
  67. <li>
  68. <tt>handle2:</tt>
  69. <a href="../classes/Point.html"><tt>Point</tt></a>
  70. </li>
  71. <li>
  72. <tt>point2:</tt>
  73. <a href="../classes/Point.html"><tt>Point</tt></a>
  74. </li>
  75. </ul>
  76. <ul class="member-list">
  77. <h4>Returns:</h4>
  78. <li>
  79. <tt><a href="../classes/Curve.html"><tt>Curve</tt></a></tt>
  80. </li>
  81. </ul>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <!-- ================================ properties =========================== -->
  87. <div class="reference-members">
  88. <h2>Properties</h2>
  89. <div id="point1" class="member">
  90. <div class="member-link">
  91. <a name="point1" href="#point1"><tt><b>point1</b></tt></a>
  92. </div>
  93. <div class="member-description hidden">
  94. <div class="member-text">
  95. <p>The first anchor point of the curve.</p>
  96. <ul class="member-list">
  97. <h4>Type:</h4>
  98. <li>
  99. <a href="../classes/Point.html"><tt>Point</tt></a>
  100. </li>
  101. </ul>
  102. </div>
  103. </div>
  104. </div>
  105. <div id="point2" class="member">
  106. <div class="member-link">
  107. <a name="point2" href="#point2"><tt><b>point2</b></tt></a>
  108. </div>
  109. <div class="member-description hidden">
  110. <div class="member-text">
  111. <p>The second anchor point of the curve.</p>
  112. <ul class="member-list">
  113. <h4>Type:</h4>
  114. <li>
  115. <a href="../classes/Point.html"><tt>Point</tt></a>
  116. </li>
  117. </ul>
  118. </div>
  119. </div>
  120. </div>
  121. <div id="handle1" class="member">
  122. <div class="member-link">
  123. <a name="handle1" href="#handle1"><tt><b>handle1</b></tt></a>
  124. </div>
  125. <div class="member-description hidden">
  126. <div class="member-text">
  127. <p>The handle point that describes the tangent in the first anchor point.</p>
  128. <ul class="member-list">
  129. <h4>Type:</h4>
  130. <li>
  131. <a href="../classes/Point.html"><tt>Point</tt></a>
  132. </li>
  133. </ul>
  134. </div>
  135. </div>
  136. </div>
  137. <div id="handle2" class="member">
  138. <div class="member-link">
  139. <a name="handle2" href="#handle2"><tt><b>handle2</b></tt></a>
  140. </div>
  141. <div class="member-description hidden">
  142. <div class="member-text">
  143. <p>The handle point that describes the tangent in the second anchor point.</p>
  144. <ul class="member-list">
  145. <h4>Type:</h4>
  146. <li>
  147. <a href="../classes/Point.html"><tt>Point</tt></a>
  148. </li>
  149. </ul>
  150. </div>
  151. </div>
  152. </div>
  153. <div id="segment1" class="member">
  154. <div class="member-link">
  155. <a name="segment1" href="#segment1"><tt><b>segment1</b></tt></a>
  156. </div>
  157. <div class="member-description hidden">
  158. <div class="member-text">
  159. <p>The first segment of the curve.</p>
  160. <p>Read only.</p>
  161. <ul class="member-list">
  162. <h4>Type:</h4>
  163. <li>
  164. <a href="../classes/Segment.html"><tt>Segment</tt></a>
  165. </li>
  166. </ul>
  167. </div>
  168. </div>
  169. </div>
  170. <div id="segment2" class="member">
  171. <div class="member-link">
  172. <a name="segment2" href="#segment2"><tt><b>segment2</b></tt></a>
  173. </div>
  174. <div class="member-description hidden">
  175. <div class="member-text">
  176. <p>The second segment of the curve.</p>
  177. <p>Read only.</p>
  178. <ul class="member-list">
  179. <h4>Type:</h4>
  180. <li>
  181. <a href="../classes/Segment.html"><tt>Segment</tt></a>
  182. </li>
  183. </ul>
  184. </div>
  185. </div>
  186. </div>
  187. <div id="path" class="member">
  188. <div class="member-link">
  189. <a name="path" href="#path"><tt><b>path</b></tt></a>
  190. </div>
  191. <div class="member-description hidden">
  192. <div class="member-text">
  193. <p>The path that the curve belongs to.</p>
  194. <p>Read only.</p>
  195. <ul class="member-list">
  196. <h4>Type:</h4>
  197. <li>
  198. <a href="../classes/Path.html"><tt>Path</tt></a>
  199. </li>
  200. </ul>
  201. </div>
  202. </div>
  203. </div>
  204. <div id="index" class="member">
  205. <div class="member-link">
  206. <a name="index" href="#index"><tt><b>index</b></tt></a>
  207. </div>
  208. <div class="member-description hidden">
  209. <div class="member-text">
  210. <p>The index of the curve in the <a href="../classes/Path.html#curves"><tt>path.curves</tt></a> array.</p>
  211. <p>Read only.</p>
  212. <ul class="member-list">
  213. <h4>Type:</h4>
  214. <li>
  215. <tt>Number</tt>
  216. </li>
  217. </ul>
  218. </div>
  219. </div>
  220. </div>
  221. <div id="next" class="member">
  222. <div class="member-link">
  223. <a name="next" href="#next"><tt><b>next</b></tt></a>
  224. </div>
  225. <div class="member-description hidden">
  226. <div class="member-text">
  227. <p>The next curve in the <a href="../classes/Path.html#curves"><tt>path.curves</tt></a> array that the curve belongs to.</p>
  228. <p>Read only.</p>
  229. <ul class="member-list">
  230. <h4>Type:</h4>
  231. <li>
  232. <a href="../classes/Curve.html"><tt>Curve</tt></a>
  233. </li>
  234. </ul>
  235. </div>
  236. </div>
  237. </div>
  238. <div id="previous" class="member">
  239. <div class="member-link">
  240. <a name="previous" href="#previous"><tt><b>previous</b></tt></a>
  241. </div>
  242. <div class="member-description hidden">
  243. <div class="member-text">
  244. <p>The previous curve in the <a href="../classes/Path.html#curves"><tt>path.curves</tt></a> array that the curve belongs to.</p>
  245. <p>Read only.</p>
  246. <ul class="member-list">
  247. <h4>Type:</h4>
  248. <li>
  249. <a href="../classes/Curve.html"><tt>Curve</tt></a>
  250. </li>
  251. </ul>
  252. </div>
  253. </div>
  254. </div>
  255. <div id="selected" class="member">
  256. <div class="member-link">
  257. <a name="selected" href="#selected"><tt><b>selected</b></tt></a>
  258. </div>
  259. <div class="member-description hidden">
  260. <div class="member-text">
  261. <p>Specifies whether the points and handles of the curve are selected.</p>
  262. <ul class="member-list">
  263. <h4>Type:</h4>
  264. <li>
  265. <tt>Boolean</tt>
  266. </li>
  267. </ul>
  268. </div>
  269. </div>
  270. </div>
  271. <div id="values-matrix" class="member">
  272. <div class="member-link">
  273. <a name="values-matrix" href="#values-matrix"><tt><b>values</b></tt></a>
  274. </div>
  275. <div class="member-description hidden">
  276. <div class="member-text">
  277. <p>An array of 8 float values, describing this curve&rsquo;s geometry in four absolute x/y pairs (point1, handle1, handle2, point2). This format is used internally for efficient processing of curve geometries, e.g. when calculating intersections or bounds.</p>
  278. <p>Note that the handles are converted to absolute coordinates.</p>
  279. <p>Read only.</p>
  280. <ul class="member-list">
  281. <h4>Type:</h4>
  282. <li>
  283. Array of <tt>Numbers</tt>
  284. </li>
  285. </ul>
  286. </div>
  287. </div>
  288. </div>
  289. <div id="points" class="member">
  290. <div class="member-link">
  291. <a name="points" href="#points"><tt><b>points</b></tt></a>
  292. </div>
  293. <div class="member-description hidden">
  294. <div class="member-text">
  295. <p>An array of 4 point objects, describing this curve&rsquo;s geometry in absolute coordinates (point1, handle1, handle2, point2).</p>
  296. <p>Note that the handles are converted to absolute coordinates.</p>
  297. <p>Read only.</p>
  298. <ul class="member-list">
  299. <h4>Type:</h4>
  300. <li>
  301. Array of <a href="../classes/Point.html"><tt>Point</tt></a> objects
  302. </li>
  303. </ul>
  304. </div>
  305. </div>
  306. </div>
  307. <div id="length" class="member">
  308. <div class="member-link">
  309. <a name="length" href="#length"><tt><b>length</b></tt></a>
  310. </div>
  311. <div class="member-description hidden">
  312. <div class="member-text">
  313. <p>The approximated length of the curve.</p>
  314. <p>Read only.</p>
  315. <ul class="member-list">
  316. <h4>Type:</h4>
  317. <li>
  318. <tt>Number</tt>
  319. </li>
  320. </ul>
  321. </div>
  322. </div>
  323. </div>
  324. <div id="area" class="member">
  325. <div class="member-link">
  326. <a name="area" href="#area"><tt><b>area</b></tt></a>
  327. </div>
  328. <div class="member-description hidden">
  329. <div class="member-text">
  330. <p>The area that the curve&rsquo;s geometry is covering.</p>
  331. <p>Read only.</p>
  332. <ul class="member-list">
  333. <h4>Type:</h4>
  334. <li>
  335. <tt>Number</tt>
  336. </li>
  337. </ul>
  338. </div>
  339. </div>
  340. </div>
  341. <h3>Bounding Boxes</h3>
  342. <div id="bounds" class="member">
  343. <div class="member-link">
  344. <a name="bounds" href="#bounds"><tt><b>bounds</b></tt></a>
  345. </div>
  346. <div class="member-description hidden">
  347. <div class="member-text">
  348. <p>The bounding rectangle of the curve excluding stroke width.</p>
  349. <ul class="member-list">
  350. <h4>Type:</h4>
  351. <li>
  352. <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
  353. </li>
  354. </ul>
  355. </div>
  356. </div>
  357. </div>
  358. <div id="strokebounds" class="member">
  359. <div class="member-link">
  360. <a name="strokebounds" href="#strokebounds"><tt><b>strokeBounds</b></tt></a>
  361. </div>
  362. <div class="member-description hidden">
  363. <div class="member-text">
  364. <p>The bounding rectangle of the curve including stroke width.</p>
  365. <ul class="member-list">
  366. <h4>Type:</h4>
  367. <li>
  368. <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
  369. </li>
  370. </ul>
  371. </div>
  372. </div>
  373. </div>
  374. <div id="handlebounds" class="member">
  375. <div class="member-link">
  376. <a name="handlebounds" href="#handlebounds"><tt><b>handleBounds</b></tt></a>
  377. </div>
  378. <div class="member-description hidden">
  379. <div class="member-text">
  380. <p>The bounding rectangle of the curve including handles.</p>
  381. <ul class="member-list">
  382. <h4>Type:</h4>
  383. <li>
  384. <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
  385. </li>
  386. </ul>
  387. </div>
  388. </div>
  389. </div>
  390. </div>
  391. <!-- ============================== methods ================================ -->
  392. <div class="reference-members">
  393. <h2>Methods</h2>
  394. <div id="clone" class="member">
  395. <div class="member-link">
  396. <a name="clone" href="#clone"><tt><b>clone</b>()</tt></a>
  397. </div>
  398. <div class="member-description hidden">
  399. <div class="member-text">
  400. <p>Returns a copy of the curve.</p>
  401. <ul class="member-list">
  402. <h4>Returns:</h4>
  403. <li>
  404. <tt><a href="../classes/Curve.html"><tt>Curve</tt></a></tt>
  405. </li>
  406. </ul>
  407. </div>
  408. </div>
  409. </div>
  410. <div id="tostring" class="member">
  411. <div class="member-link">
  412. <a name="tostring" href="#tostring"><tt><b>toString</b>()</tt></a>
  413. </div>
  414. <div class="member-description hidden">
  415. <div class="member-text">
  416. <ul class="member-list">
  417. <h4>Returns:</h4>
  418. <li>
  419. <tt><tt>String</tt></tt>&nbsp;&mdash;&nbsp;a string representation of the curve
  420. </li>
  421. </ul>
  422. </div>
  423. </div>
  424. </div>
  425. <div id="classify" class="member">
  426. <div class="member-link">
  427. <a name="classify" href="#classify"><tt><b>classify</b>()</tt></a>
  428. </div>
  429. <div class="member-description hidden">
  430. <div class="member-text">
  431. <p>Determines the type of cubic Bézier curve via discriminant classification, as well as the curve-time parameters of the associated points of inflection, loops, cusps, etc.</p>
  432. <ul class="member-list">
  433. <h4>Returns:</h4>
  434. <li>
  435. <tt><tt>Object</tt></tt>&nbsp;&mdash;&nbsp;the curve classification information as an object, see options
  436. </li>
  437. </ul>
  438. <ul class="member-list">
  439. <li><tt>info.type: <tt>String</tt></tt> &mdash; the type of Bézier curve, possible values are: <tt>&lsquo;line&rsquo;</tt>, <tt>&lsquo;quadratic&rsquo;</tt>, <tt>&lsquo;serpentine&rsquo;</tt>, <tt>&lsquo;cusp&rsquo;</tt>, <tt>&lsquo;loop&rsquo;</tt>, <tt>&lsquo;arch&rsquo;</tt></li>
  440. <li><tt>info.roots: Array of <tt>Numbers</tt></tt> &mdash; the curve-time parameters of the associated points of inflection for serpentine curves, loops, cusps, etc</li>
  441. </ul>
  442. </div>
  443. </div>
  444. </div>
  445. <div id="remove" class="member">
  446. <div class="member-link">
  447. <a name="remove" href="#remove"><tt><b>remove</b>()</tt></a>
  448. </div>
  449. <div class="member-description hidden">
  450. <div class="member-text">
  451. <p>Removes the curve from the path that it belongs to, by removing its second segment and merging its handle with the first segment.</p>
  452. <ul class="member-list">
  453. <h4>Returns:</h4>
  454. <li>
  455. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the curve was removed, <tt>false</tt> otherwise
  456. </li>
  457. </ul>
  458. </div>
  459. </div>
  460. </div>
  461. <div id="isfirst" class="member">
  462. <div class="member-link">
  463. <a name="isfirst" href="#isfirst"><tt><b>isFirst</b>()</tt></a>
  464. </div>
  465. <div class="member-description hidden">
  466. <div class="member-text">
  467. <p>Checks if the this is the first curve in the <a href="../classes/Path.html#curves"><tt>path.curves</tt></a> array.</p>
  468. <ul class="member-list">
  469. <h4>Returns:</h4>
  470. <li>
  471. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if this is the first curve, <tt>false</tt> otherwise
  472. </li>
  473. </ul>
  474. </div>
  475. </div>
  476. </div>
  477. <div id="islast" class="member">
  478. <div class="member-link">
  479. <a name="islast" href="#islast"><tt><b>isLast</b>()</tt></a>
  480. </div>
  481. <div class="member-description hidden">
  482. <div class="member-text">
  483. <p>Checks if the this is the last curve in the <a href="../classes/Path.html#curves"><tt>path.curves</tt></a> array.</p>
  484. <ul class="member-list">
  485. <h4>Returns:</h4>
  486. <li>
  487. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if this is the last curve, <tt>false</tt> otherwise
  488. </li>
  489. </ul>
  490. </div>
  491. </div>
  492. </div>
  493. <div id="getpart-from-to" class="member">
  494. <div class="member-link">
  495. <a name="getpart-from-to" href="#getpart-from-to"><tt><b>getPart</b>(from, to)</tt></a>
  496. </div>
  497. <div class="member-description hidden">
  498. <div class="member-text">
  499. <p>Creates a new curve as a sub-curve from this curve, its range defined by the given curve-time parameters. If <code>from</code> is larger than <code>to</code>, then the resulting curve will have its direction reversed.</p>
  500. <ul class="member-list">
  501. <h4>Parameters:</h4>
  502. <li>
  503. <tt>from:</tt>
  504. <tt>Number</tt>
  505. &mdash;&nbsp;the curve-time parameter at which the sub-curve starts
  506. </li>
  507. <li>
  508. <tt>to:</tt>
  509. <tt>Number</tt>
  510. &mdash;&nbsp;the curve-time parameter at which the sub-curve ends
  511. </li>
  512. </ul>
  513. <ul class="member-list">
  514. <h4>Returns:</h4>
  515. <li>
  516. <tt><a href="../classes/Curve.html"><tt>Curve</tt></a></tt>&nbsp;&mdash;&nbsp;the newly create sub-curve
  517. </li>
  518. </ul>
  519. </div>
  520. </div>
  521. </div>
  522. <div id="divideat-location" class="member">
  523. <div class="member-link">
  524. <a name="divideat-location" href="#divideat-location"><tt><b>divideAt</b>(location)</tt></a>
  525. </div>
  526. <div class="member-description hidden">
  527. <div class="member-text">
  528. <p>Divides the curve into two curves at the given offset or location. The curve itself is modified and becomes the first part, the second part is returned as a new curve. If the curve belongs to a path item, a new segment is inserted into the path at the given location, and the second part becomes a part of the path as well.</p>
  529. <ul class="member-list">
  530. <h4>Parameters:</h4>
  531. <li>
  532. <tt>location:</tt>
  533. <tt>Number</tt>⟋<a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a>
  534. &mdash;&nbsp;the offset or location on the curve at which to divide
  535. </li>
  536. </ul>
  537. <ul class="member-list">
  538. <h4>Returns:</h4>
  539. <li>
  540. <tt><a href="../classes/Curve.html"><tt>Curve</tt></a></tt>&nbsp;&mdash;&nbsp;the second part of the divided curve if the location is valid, {code null} otherwise
  541. </li>
  542. </ul>
  543. <ul class="member-list">
  544. <h4>See also:</h4>
  545. <li><tt><a href="../classes/Curve.html#divideattime-time"><tt>divideAtTime(time)</tt></a></tt></li>
  546. </ul>
  547. </div>
  548. </div>
  549. </div>
  550. <div id="divideattime-time" class="member">
  551. <div class="member-link">
  552. <a name="divideattime-time" href="#divideattime-time"><tt><b>divideAtTime</b>(time)</tt></a>
  553. </div>
  554. <div class="member-description hidden">
  555. <div class="member-text">
  556. <p>Divides the curve into two curves at the given curve-time parameter. The curve itself is modified and becomes the first part, the second part is returned as a new curve. If the modified curve belongs to a path item, the second part is also added to the path.</p>
  557. <ul class="member-list">
  558. <h4>Parameters:</h4>
  559. <li>
  560. <tt>time:</tt>
  561. <tt>Number</tt>
  562. &mdash;&nbsp;the curve-time parameter on the curve at which to divide
  563. </li>
  564. </ul>
  565. <ul class="member-list">
  566. <h4>Returns:</h4>
  567. <li>
  568. <tt><a href="../classes/Curve.html"><tt>Curve</tt></a></tt>&nbsp;&mdash;&nbsp;the second part of the divided curve, if the offset is within the valid range, {code null} otherwise.
  569. </li>
  570. </ul>
  571. <ul class="member-list">
  572. <h4>See also:</h4>
  573. <li><tt><a href="../classes/Curve.html#divideat-offset"><tt>divideAt(offset)</tt></a></tt></li>
  574. </ul>
  575. </div>
  576. </div>
  577. </div>
  578. <div id="splitat-location" class="member">
  579. <div class="member-link">
  580. <a name="splitat-location" href="#splitat-location"><tt><b>splitAt</b>(location)</tt></a>
  581. </div>
  582. <div class="member-description hidden">
  583. <div class="member-text">
  584. <p>Splits the path this curve belongs to at the given offset. After splitting, the path will be open. If the path was open already, splitting will result in two paths.</p>
  585. <ul class="member-list">
  586. <h4>Parameters:</h4>
  587. <li>
  588. <tt>location:</tt>
  589. <tt>Number</tt>⟋<a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a>
  590. &mdash;&nbsp;the offset or location on the curve at which to split
  591. </li>
  592. </ul>
  593. <ul class="member-list">
  594. <h4>Returns:</h4>
  595. <li>
  596. <tt><a href="../classes/Path.html"><tt>Path</tt></a></tt>&nbsp;&mdash;&nbsp;the newly created path after splitting, if any
  597. </li>
  598. </ul>
  599. <ul class="member-list">
  600. <h4>See also:</h4>
  601. <li><tt><a href="../classes/Path.html#splitat-offset"><tt>path.splitAt(offset)</tt></a></tt></li>
  602. </ul>
  603. </div>
  604. </div>
  605. </div>
  606. <div id="splitattime-time" class="member">
  607. <div class="member-link">
  608. <a name="splitattime-time" href="#splitattime-time"><tt><b>splitAtTime</b>(time)</tt></a>
  609. </div>
  610. <div class="member-description hidden">
  611. <div class="member-text">
  612. <p>Splits the path this curve belongs to at the given offset. After splitting, the path will be open. If the path was open already, splitting will result in two paths.</p>
  613. <ul class="member-list">
  614. <h4>Parameters:</h4>
  615. <li>
  616. <tt>time:</tt>
  617. <tt>Number</tt>
  618. &mdash;&nbsp;the curve-time parameter on the curve at which to split
  619. </li>
  620. </ul>
  621. <ul class="member-list">
  622. <h4>Returns:</h4>
  623. <li>
  624. <tt><a href="../classes/Path.html"><tt>Path</tt></a></tt>&nbsp;&mdash;&nbsp;the newly created path after splitting, if any
  625. </li>
  626. </ul>
  627. <ul class="member-list">
  628. <h4>See also:</h4>
  629. <li><tt><a href="../classes/Path.html#splitat-offset"><tt>path.splitAt(offset)</tt></a></tt></li>
  630. </ul>
  631. </div>
  632. </div>
  633. </div>
  634. <div id="reversed" class="member">
  635. <div class="member-link">
  636. <a name="reversed" href="#reversed"><tt><b>reversed</b>()</tt></a>
  637. </div>
  638. <div class="member-description hidden">
  639. <div class="member-text">
  640. <p>Returns a reversed version of the curve, without modifying the curve itself.</p>
  641. <ul class="member-list">
  642. <h4>Returns:</h4>
  643. <li>
  644. <tt><a href="../classes/Curve.html"><tt>Curve</tt></a></tt>&nbsp;&mdash;&nbsp;a reversed version of the curve
  645. </li>
  646. </ul>
  647. </div>
  648. </div>
  649. </div>
  650. <div id="clearhandles" class="member">
  651. <div class="member-link">
  652. <a name="clearhandles" href="#clearhandles"><tt><b>clearHandles</b>()</tt></a>
  653. </div>
  654. <div class="member-description hidden">
  655. <div class="member-text">
  656. <p>Clears the curve&rsquo;s handles by setting their coordinates to zero, turning the curve into a straight line.</p>
  657. </div>
  658. </div>
  659. </div>
  660. <h3>Curve Tests</h3>
  661. <div id="hashandles" class="member">
  662. <div class="member-link">
  663. <a name="hashandles" href="#hashandles"><tt><b>hasHandles</b>()</tt></a>
  664. </div>
  665. <div class="member-description hidden">
  666. <div class="member-text">
  667. <p>Checks if this curve has any curve handles set.</p>
  668. <ul class="member-list">
  669. <h4>Returns:</h4>
  670. <li>
  671. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the curve has handles set, <tt>false</tt> otherwise
  672. </li>
  673. </ul>
  674. <ul class="member-list">
  675. <h4>See also:</h4>
  676. <li><tt><a href="../classes/Curve.html#handle1"><tt>curve.handle1</tt></a></tt></li>
  677. <li><tt><a href="../classes/Curve.html#handle2"><tt>curve.handle2</tt></a></tt></li>
  678. <li><tt><a href="../classes/Segment.html#hashandles"><tt>segment.hasHandles</tt></a>()</tt></li>
  679. <li><tt><a href="../classes/Path.html#hashandles"><tt>path.hasHandles</tt></a>()</tt></li>
  680. </ul>
  681. </div>
  682. </div>
  683. </div>
  684. <div id="haslength" class="member">
  685. <div class="member-link">
  686. <a name="haslength" href="#haslength"><tt><b>hasLength</b>([epsilon])</tt></a>
  687. </div>
  688. <div class="member-description hidden">
  689. <div class="member-text">
  690. <p>Checks if this curve has any length.</p>
  691. <ul class="member-list">
  692. <h4>Parameters:</h4>
  693. <li>
  694. <tt>epsilon:</tt>
  695. <tt>Number</tt>
  696. &mdash;&nbsp;the epsilon against which to compare the curve&rsquo;s length
  697. &mdash;&nbsp;optional, default: <tt>0</tt>
  698. </li>
  699. </ul>
  700. <ul class="member-list">
  701. <h4>Returns:</h4>
  702. <li>
  703. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the curve is longer than the given epsilon, <tt>false</tt> otherwise
  704. </li>
  705. </ul>
  706. </div>
  707. </div>
  708. </div>
  709. <div id="isstraight" class="member">
  710. <div class="member-link">
  711. <a name="isstraight" href="#isstraight"><tt><b>isStraight</b>()</tt></a>
  712. </div>
  713. <div class="member-description hidden">
  714. <div class="member-text">
  715. <p>Checks if this curve appears as a straight line. This can mean that it has no handles defined, or that the handles run collinear with the line that connects the curve&rsquo;s start and end point, not falling outside of the line.</p>
  716. <ul class="member-list">
  717. <h4>Returns:</h4>
  718. <li>
  719. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the curve is straight, <tt>false</tt> otherwise
  720. </li>
  721. </ul>
  722. </div>
  723. </div>
  724. </div>
  725. <div id="islinear" class="member">
  726. <div class="member-link">
  727. <a name="islinear" href="#islinear"><tt><b>isLinear</b>()</tt></a>
  728. </div>
  729. <div class="member-description hidden">
  730. <div class="member-text">
  731. <p>Checks if this curve is parametrically linear, meaning that it is straight and its handles are positioned at 1/3 and 2/3 of the total length of the curve.</p>
  732. <ul class="member-list">
  733. <h4>Returns:</h4>
  734. <li>
  735. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the curve is parametrically linear, <tt>false</tt> otherwise
  736. </li>
  737. </ul>
  738. </div>
  739. </div>
  740. </div>
  741. <div id="iscollinear-curve" class="member">
  742. <div class="member-link">
  743. <a name="iscollinear-curve" href="#iscollinear-curve"><tt><b>isCollinear</b>(curve)</tt></a>
  744. </div>
  745. <div class="member-description hidden">
  746. <div class="member-text">
  747. <p>Checks if the the two curves describe straight lines that are collinear, meaning they run in parallel.</p>
  748. <ul class="member-list">
  749. <h4>Parameters:</h4>
  750. <li>
  751. <tt>curve:</tt>
  752. <a href="../classes/Curve.html"><tt>Curve</tt></a>
  753. &mdash;&nbsp;the other curve to check against
  754. </li>
  755. </ul>
  756. <ul class="member-list">
  757. <h4>Returns:</h4>
  758. <li>
  759. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the two lines are collinear, <tt>false</tt> otherwise
  760. </li>
  761. </ul>
  762. </div>
  763. </div>
  764. </div>
  765. <div id="ishorizontal" class="member">
  766. <div class="member-link">
  767. <a name="ishorizontal" href="#ishorizontal"><tt><b>isHorizontal</b>()</tt></a>
  768. </div>
  769. <div class="member-description hidden">
  770. <div class="member-text">
  771. <p>Checks if the curve is a straight horizontal line.</p>
  772. <ul class="member-list">
  773. <h4>Returns:</h4>
  774. <li>
  775. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the line is horizontal, <tt>false</tt> otherwise
  776. </li>
  777. </ul>
  778. </div>
  779. </div>
  780. </div>
  781. <div id="isvertical" class="member">
  782. <div class="member-link">
  783. <a name="isvertical" href="#isvertical"><tt><b>isVertical</b>()</tt></a>
  784. </div>
  785. <div class="member-description hidden">
  786. <div class="member-text">
  787. <p>Checks if the curve is a straight vertical line.</p>
  788. <ul class="member-list">
  789. <h4>Returns:</h4>
  790. <li>
  791. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the line is vertical, <tt>false</tt> otherwise
  792. </li>
  793. </ul>
  794. </div>
  795. </div>
  796. </div>
  797. <h3>Positions on Curves</h3>
  798. <div id="getlocationat-offset" class="member">
  799. <div class="member-link">
  800. <a name="getlocationat-offset" href="#getlocationat-offset"><tt><b>getLocationAt</b>(offset)</tt></a>
  801. </div>
  802. <div class="member-description hidden">
  803. <div class="member-text">
  804. <p>Calculates the curve location at the specified offset on the curve.</p>
  805. <ul class="member-list">
  806. <h4>Parameters:</h4>
  807. <li>
  808. <tt>offset:</tt>
  809. <tt>Number</tt>
  810. &mdash;&nbsp;the offset on the curve
  811. </li>
  812. </ul>
  813. <ul class="member-list">
  814. <h4>Returns:</h4>
  815. <li>
  816. <tt><a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a></tt>&nbsp;&mdash;&nbsp;the curve location at the specified the offset
  817. </li>
  818. </ul>
  819. </div>
  820. </div>
  821. </div>
  822. <div id="getlocationattime-time" class="member">
  823. <div class="member-link">
  824. <a name="getlocationattime-time" href="#getlocationattime-time"><tt><b>getLocationAtTime</b>(time)</tt></a>
  825. </div>
  826. <div class="member-description hidden">
  827. <div class="member-text">
  828. <p>Calculates the curve location at the specified curve-time parameter on the curve.</p>
  829. <ul class="member-list">
  830. <h4>Parameters:</h4>
  831. <li>
  832. <tt>time:</tt>
  833. <tt>Number</tt>
  834. &mdash;&nbsp;the curve-time parameter on the curve
  835. </li>
  836. </ul>
  837. <ul class="member-list">
  838. <h4>Returns:</h4>
  839. <li>
  840. <tt><a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a></tt>&nbsp;&mdash;&nbsp;the curve location at the specified the location
  841. </li>
  842. </ul>
  843. </div>
  844. </div>
  845. </div>
  846. <div id="gettimeat-offset" class="member">
  847. <div class="member-link">
  848. <a name="gettimeat-offset" href="#gettimeat-offset"><tt><b>getTimeAt</b>(offset[, start])</tt></a>
  849. </div>
  850. <div class="member-description hidden">
  851. <div class="member-text">
  852. <p>Calculates the curve-time parameter of the specified offset on the path, relative to the provided start parameter. If offset is a negative value, the parameter is searched to the left of the start parameter. If no start parameter is provided, a default of <code>0</code> for positive values of <code>offset</code> and <code>1</code> for negative values of <code>offset</code>.</p>
  853. <ul class="member-list">
  854. <h4>Parameters:</h4>
  855. <li>
  856. <tt>offset:</tt>
  857. <tt>Number</tt>
  858. &mdash;&nbsp;the offset at which to find the curve-time, in curve length units
  859. </li>
  860. <li>
  861. <tt>start:</tt>
  862. <tt>Number</tt>
  863. &mdash;&nbsp;the curve-time in relation to which the offset is determined
  864. &mdash;&nbsp;optional
  865. </li>
  866. </ul>
  867. <ul class="member-list">
  868. <h4>Returns:</h4>
  869. <li>
  870. <tt><tt>Number</tt></tt>&nbsp;&mdash;&nbsp;the curve-time parameter at the specified location
  871. </li>
  872. </ul>
  873. </div>
  874. </div>
  875. </div>
  876. <div id="gettimeswithtangent-tangent" class="member">
  877. <div class="member-link">
  878. <a name="gettimeswithtangent-tangent" href="#gettimeswithtangent-tangent"><tt><b>getTimesWithTangent</b>(tangent)</tt></a>
  879. </div>
  880. <div class="member-description hidden">
  881. <div class="member-text">
  882. <p>Calculates the curve-time parameters where the curve is tangential to provided tangent. Note that tangents at the start or end are included.</p>
  883. <ul class="member-list">
  884. <h4>Parameters:</h4>
  885. <li>
  886. <tt>tangent:</tt>
  887. <a href="../classes/Point.html"><tt>Point</tt></a>
  888. &mdash;&nbsp;the tangent to which the curve must be tangential
  889. </li>
  890. </ul>
  891. <ul class="member-list">
  892. <h4>Returns:</h4>
  893. <li>
  894. <tt>Array of <tt>Numbers</tt></tt>&nbsp;&mdash;&nbsp;at most two curve-time parameters, where the curve is tangential to the given tangent
  895. </li>
  896. </ul>
  897. </div>
  898. </div>
  899. </div>
  900. <div id="getoffsetattime-time" class="member">
  901. <div class="member-link">
  902. <a name="getoffsetattime-time" href="#getoffsetattime-time"><tt><b>getOffsetAtTime</b>(time)</tt></a>
  903. </div>
  904. <div class="member-description hidden">
  905. <div class="member-text">
  906. <p>Calculates the curve offset at the specified curve-time parameter on the curve.</p>
  907. <ul class="member-list">
  908. <h4>Parameters:</h4>
  909. <li>
  910. <tt>time:</tt>
  911. <tt>Number</tt>
  912. &mdash;&nbsp;the curve-time parameter on the curve
  913. </li>
  914. </ul>
  915. <ul class="member-list">
  916. <h4>Returns:</h4>
  917. <li>
  918. <tt><tt>Number</tt></tt>&nbsp;&mdash;&nbsp;the curve offset at the specified the location
  919. </li>
  920. </ul>
  921. </div>
  922. </div>
  923. </div>
  924. <div id="getlocationof-point" class="member">
  925. <div class="member-link">
  926. <a name="getlocationof-point" href="#getlocationof-point"><tt><b>getLocationOf</b>(point)</tt></a>
  927. </div>
  928. <div class="member-description hidden">
  929. <div class="member-text">
  930. <p>Returns the curve location of the specified point if it lies on the curve, <code>null</code> otherwise.</p>
  931. <ul class="member-list">
  932. <h4>Parameters:</h4>
  933. <li>
  934. <tt>point:</tt>
  935. <a href="../classes/Point.html"><tt>Point</tt></a>
  936. &mdash;&nbsp;the point on the curve
  937. </li>
  938. </ul>
  939. <ul class="member-list">
  940. <h4>Returns:</h4>
  941. <li>
  942. <tt><a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a></tt>&nbsp;&mdash;&nbsp;the curve location of the specified point
  943. </li>
  944. </ul>
  945. </div>
  946. </div>
  947. </div>
  948. <div id="getoffsetof-point" class="member">
  949. <div class="member-link">
  950. <a name="getoffsetof-point" href="#getoffsetof-point"><tt><b>getOffsetOf</b>(point)</tt></a>
  951. </div>
  952. <div class="member-description hidden">
  953. <div class="member-text">
  954. <p>Returns the length of the path from its beginning up to up to the specified point if it lies on the path, <code>null</code> otherwise.</p>
  955. <ul class="member-list">
  956. <h4>Parameters:</h4>
  957. <li>
  958. <tt>point:</tt>
  959. <a href="../classes/Point.html"><tt>Point</tt></a>
  960. &mdash;&nbsp;the point on the path
  961. </li>
  962. </ul>
  963. <ul class="member-list">
  964. <h4>Returns:</h4>
  965. <li>
  966. <tt><tt>Number</tt></tt>&nbsp;&mdash;&nbsp;the length of the path up to the specified point
  967. </li>
  968. </ul>
  969. </div>
  970. </div>
  971. </div>
  972. <div id="gettimeof-point" class="member">
  973. <div class="member-link">
  974. <a name="gettimeof-point" href="#gettimeof-point"><tt><b>getTimeOf</b>(point)</tt></a>
  975. </div>
  976. <div class="member-description hidden">
  977. <div class="member-text">
  978. <p>Returns the curve-time parameter of the specified point if it lies on the curve, <code>null</code> otherwise. Note that if there is more than one possible solution in a self-intersecting curve, the first found result is returned.</p>
  979. <ul class="member-list">
  980. <h4>Parameters:</h4>
  981. <li>
  982. <tt>point:</tt>
  983. <a href="../classes/Point.html"><tt>Point</tt></a>
  984. &mdash;&nbsp;the point on the curve
  985. </li>
  986. </ul>
  987. <ul class="member-list">
  988. <h4>Returns:</h4>
  989. <li>
  990. <tt><tt>Number</tt></tt>&nbsp;&mdash;&nbsp;the curve-time parameter of the specified point
  991. </li>
  992. </ul>
  993. </div>
  994. </div>
  995. </div>
  996. <div id="getnearestlocation-point" class="member">
  997. <div class="member-link">
  998. <a name="getnearestlocation-point" href="#getnearestlocation-point"><tt><b>getNearestLocation</b>(point)</tt></a>
  999. </div>
  1000. <div class="member-description hidden">
  1001. <div class="member-text">
  1002. <p>Returns the nearest location on the curve to the specified point.</p>
  1003. <ul class="member-list">
  1004. <h4>Parameters:</h4>
  1005. <li>
  1006. <tt>point:</tt>
  1007. <a href="../classes/Point.html"><tt>Point</tt></a>
  1008. &mdash;&nbsp;the point for which we search the nearest location
  1009. </li>
  1010. </ul>
  1011. <ul class="member-list">
  1012. <h4>Returns:</h4>
  1013. <li>
  1014. <tt><a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a></tt>&nbsp;&mdash;&nbsp;the location on the curve that&rsquo;s the closest to the specified point
  1015. </li>
  1016. </ul>
  1017. </div>
  1018. </div>
  1019. </div>
  1020. <div id="getnearestpoint-point" class="member">
  1021. <div class="member-link">
  1022. <a name="getnearestpoint-point" href="#getnearestpoint-point"><tt><b>getNearestPoint</b>(point)</tt></a>
  1023. </div>
  1024. <div class="member-description hidden">
  1025. <div class="member-text">
  1026. <p>Returns the nearest point on the curve to the specified point.</p>
  1027. <ul class="member-list">
  1028. <h4>Parameters:</h4>
  1029. <li>
  1030. <tt>point:</tt>
  1031. <a href="../classes/Point.html"><tt>Point</tt></a>
  1032. &mdash;&nbsp;the point for which we search the nearest point
  1033. </li>
  1034. </ul>
  1035. <ul class="member-list">
  1036. <h4>Returns:</h4>
  1037. <li>
  1038. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the point on the curve that&rsquo;s the closest to the specified point
  1039. </li>
  1040. </ul>
  1041. </div>
  1042. </div>
  1043. </div>
  1044. <div id="getpointat-location" class="member">
  1045. <div class="member-link">
  1046. <a name="getpointat-location" href="#getpointat-location"><tt><b>getPointAt</b>(location)</tt></a>
  1047. </div>
  1048. <div class="member-description hidden">
  1049. <div class="member-text">
  1050. <p>Calculates the point on the curve at the given location.</p>
  1051. <ul class="member-list">
  1052. <h4>Parameters:</h4>
  1053. <li>
  1054. <tt>location:</tt>
  1055. <tt>Number</tt>⟋<a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a>
  1056. &mdash;&nbsp;the offset or location on the curve
  1057. </li>
  1058. </ul>
  1059. <ul class="member-list">
  1060. <h4>Returns:</h4>
  1061. <li>
  1062. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the point on the curve at the given location
  1063. </li>
  1064. </ul>
  1065. </div>
  1066. </div>
  1067. </div>
  1068. <div id="gettangentat-location" class="member">
  1069. <div class="member-link">
  1070. <a name="gettangentat-location" href="#gettangentat-location"><tt><b>getTangentAt</b>(location)</tt></a>
  1071. </div>
  1072. <div class="member-description hidden">
  1073. <div class="member-text">
  1074. <p>Calculates the normalized tangent vector of the curve at the given location.</p>
  1075. <ul class="member-list">
  1076. <h4>Parameters:</h4>
  1077. <li>
  1078. <tt>location:</tt>
  1079. <tt>Number</tt>⟋<a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a>
  1080. &mdash;&nbsp;the offset or location on the curve
  1081. </li>
  1082. </ul>
  1083. <ul class="member-list">
  1084. <h4>Returns:</h4>
  1085. <li>
  1086. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the normalized tangent of the curve at the given location
  1087. </li>
  1088. </ul>
  1089. </div>
  1090. </div>
  1091. </div>
  1092. <div id="getnormalat-location" class="member">
  1093. <div class="member-link">
  1094. <a name="getnormalat-location" href="#getnormalat-location"><tt><b>getNormalAt</b>(location)</tt></a>
  1095. </div>
  1096. <div class="member-description hidden">
  1097. <div class="member-text">
  1098. <p>Calculates the normal vector of the curve at the given location.</p>
  1099. <ul class="member-list">
  1100. <h4>Parameters:</h4>
  1101. <li>
  1102. <tt>location:</tt>
  1103. <tt>Number</tt>⟋<a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a>
  1104. &mdash;&nbsp;the offset or location on the curve
  1105. </li>
  1106. </ul>
  1107. <ul class="member-list">
  1108. <h4>Returns:</h4>
  1109. <li>
  1110. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the normal of the curve at the given location
  1111. </li>
  1112. </ul>
  1113. </div>
  1114. </div>
  1115. </div>
  1116. <div id="getweightedtangentat-location" class="member">
  1117. <div class="member-link">
  1118. <a name="getweightedtangentat-location" href="#getweightedtangentat-location"><tt><b>getWeightedTangentAt</b>(location)</tt></a>
  1119. </div>
  1120. <div class="member-description hidden">
  1121. <div class="member-text">
  1122. <p>Calculates the weighted tangent vector of the curve at the given location, its length reflecting the curve velocity at that location.</p>
  1123. <ul class="member-list">
  1124. <h4>Parameters:</h4>
  1125. <li>
  1126. <tt>location:</tt>
  1127. <tt>Number</tt>⟋<a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a>
  1128. &mdash;&nbsp;the offset or location on the curve
  1129. </li>
  1130. </ul>
  1131. <ul class="member-list">
  1132. <h4>Returns:</h4>
  1133. <li>
  1134. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the weighted tangent of the curve at the given location
  1135. </li>
  1136. </ul>
  1137. </div>
  1138. </div>
  1139. </div>
  1140. <div id="getweightednormalat-location" class="member">
  1141. <div class="member-link">
  1142. <a name="getweightednormalat-location" href="#getweightednormalat-location"><tt><b>getWeightedNormalAt</b>(location)</tt></a>
  1143. </div>
  1144. <div class="member-description hidden">
  1145. <div class="member-text">
  1146. <p>Calculates the weighted normal vector of the curve at the given location, its length reflecting the curve velocity at that location.</p>
  1147. <ul class="member-list">
  1148. <h4>Parameters:</h4>
  1149. <li>
  1150. <tt>location:</tt>
  1151. <tt>Number</tt>⟋<a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a>
  1152. &mdash;&nbsp;the offset or location on the curve
  1153. </li>
  1154. </ul>
  1155. <ul class="member-list">
  1156. <h4>Returns:</h4>
  1157. <li>
  1158. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the weighted normal of the curve at the given location
  1159. </li>
  1160. </ul>
  1161. </div>
  1162. </div>
  1163. </div>
  1164. <div id="getcurvatureat-location" class="member">
  1165. <div class="member-link">
  1166. <a name="getcurvatureat-location" href="#getcurvatureat-location"><tt><b>getCurvatureAt</b>(location)</tt></a>
  1167. </div>
  1168. <div class="member-description hidden">
  1169. <div class="member-text">
  1170. <p>Calculates the curvature of the curve at the given location. Curvatures indicate how sharply a curve changes direction. A straight line has zero curvature, where as a circle has a constant curvature. The curve&rsquo;s radius at the given location is the reciprocal value of its curvature.</p>
  1171. <ul class="member-list">
  1172. <h4>Parameters:</h4>
  1173. <li>
  1174. <tt>location:</tt>
  1175. <tt>Number</tt>⟋<a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a>
  1176. &mdash;&nbsp;the offset or location on the curve
  1177. </li>
  1178. </ul>
  1179. <ul class="member-list">
  1180. <h4>Returns:</h4>
  1181. <li>
  1182. <tt><tt>Number</tt></tt>&nbsp;&mdash;&nbsp;the curvature of the curve at the given location
  1183. </li>
  1184. </ul>
  1185. </div>
  1186. </div>
  1187. </div>
  1188. <div id="getpointattime-time" class="member">
  1189. <div class="member-link">
  1190. <a name="getpointattime-time" href="#getpointattime-time"><tt><b>getPointAtTime</b>(time)</tt></a>
  1191. </div>
  1192. <div class="member-description hidden">
  1193. <div class="member-text">
  1194. <p>Calculates the point on the curve at the given location.</p>
  1195. <ul class="member-list">
  1196. <h4>Parameters:</h4>
  1197. <li>
  1198. <tt>time:</tt>
  1199. <tt>Number</tt>
  1200. &mdash;&nbsp;the curve-time parameter on the curve
  1201. </li>
  1202. </ul>
  1203. <ul class="member-list">
  1204. <h4>Returns:</h4>
  1205. <li>
  1206. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the point on the curve at the given location
  1207. </li>
  1208. </ul>
  1209. </div>
  1210. </div>
  1211. </div>
  1212. <div id="gettangentattime-time" class="member">
  1213. <div class="member-link">
  1214. <a name="gettangentattime-time" href="#gettangentattime-time"><tt><b>getTangentAtTime</b>(time)</tt></a>
  1215. </div>
  1216. <div class="member-description hidden">
  1217. <div class="member-text">
  1218. <p>Calculates the normalized tangent vector of the curve at the given location.</p>
  1219. <ul class="member-list">
  1220. <h4>Parameters:</h4>
  1221. <li>
  1222. <tt>time:</tt>
  1223. <tt>Number</tt>
  1224. &mdash;&nbsp;the curve-time parameter on the curve
  1225. </li>
  1226. </ul>
  1227. <ul class="member-list">
  1228. <h4>Returns:</h4>
  1229. <li>
  1230. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the normalized tangent of the curve at the given location
  1231. </li>
  1232. </ul>
  1233. </div>
  1234. </div>
  1235. </div>
  1236. <div id="getnormalattime-time" class="member">
  1237. <div class="member-link">
  1238. <a name="getnormalattime-time" href="#getnormalattime-time"><tt><b>getNormalAtTime</b>(time)</tt></a>
  1239. </div>
  1240. <div class="member-description hidden">
  1241. <div class="member-text">
  1242. <p>Calculates the normal vector of the curve at the given location.</p>
  1243. <ul class="member-list">
  1244. <h4>Parameters:</h4>
  1245. <li>
  1246. <tt>time:</tt>
  1247. <tt>Number</tt>
  1248. &mdash;&nbsp;the curve-time parameter on the curve
  1249. </li>
  1250. </ul>
  1251. <ul class="member-list">
  1252. <h4>Returns:</h4>
  1253. <li>
  1254. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the normal of the curve at the given location
  1255. </li>
  1256. </ul>
  1257. </div>
  1258. </div>
  1259. </div>
  1260. <div id="getweightedtangentattime-time" class="member">
  1261. <div class="member-link">
  1262. <a name="getweightedtangentattime-time" href="#getweightedtangentattime-time"><tt><b>getWeightedTangentAtTime</b>(time)</tt></a>
  1263. </div>
  1264. <div class="member-description hidden">
  1265. <div class="member-text">
  1266. <p>Calculates the weighted tangent vector of the curve at the given location, its length reflecting the curve velocity at that location.</p>
  1267. <ul class="member-list">
  1268. <h4>Parameters:</h4>
  1269. <li>
  1270. <tt>time:</tt>
  1271. <tt>Number</tt>
  1272. &mdash;&nbsp;the curve-time parameter on the curve
  1273. </li>
  1274. </ul>
  1275. <ul class="member-list">
  1276. <h4>Returns:</h4>
  1277. <li>
  1278. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the weighted tangent of the curve at the given location
  1279. </li>
  1280. </ul>
  1281. </div>
  1282. </div>
  1283. </div>
  1284. <div id="getweightednormalattime-time" class="member">
  1285. <div class="member-link">
  1286. <a name="getweightednormalattime-time" href="#getweightednormalattime-time"><tt><b>getWeightedNormalAtTime</b>(time)</tt></a>
  1287. </div>
  1288. <div class="member-description hidden">
  1289. <div class="member-text">
  1290. <p>Calculates the weighted normal vector of the curve at the given location, its length reflecting the curve velocity at that location.</p>
  1291. <ul class="member-list">
  1292. <h4>Parameters:</h4>
  1293. <li>
  1294. <tt>time:</tt>
  1295. <tt>Number</tt>
  1296. &mdash;&nbsp;the curve-time parameter on the curve
  1297. </li>
  1298. </ul>
  1299. <ul class="member-list">
  1300. <h4>Returns:</h4>
  1301. <li>
  1302. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the weighted normal of the curve at the given location
  1303. </li>
  1304. </ul>
  1305. </div>
  1306. </div>
  1307. </div>
  1308. <div id="getcurvatureattime-time" class="member">
  1309. <div class="member-link">
  1310. <a name="getcurvatureattime-time" href="#getcurvatureattime-time"><tt><b>getCurvatureAtTime</b>(time)</tt></a>
  1311. </div>
  1312. <div class="member-description hidden">
  1313. <div class="member-text">
  1314. <p>Calculates the curvature of the curve at the given location. Curvatures indicate how sharply a curve changes direction. A straight line has zero curvature, where as a circle has a constant curvature. The curve&rsquo;s radius at the given location is the reciprocal value of its curvature.</p>
  1315. <ul class="member-list">
  1316. <h4>Parameters:</h4>
  1317. <li>
  1318. <tt>time:</tt>
  1319. <tt>Number</tt>
  1320. &mdash;&nbsp;the curve-time parameter on the curve
  1321. </li>
  1322. </ul>
  1323. <ul class="member-list">
  1324. <h4>Returns:</h4>
  1325. <li>
  1326. <tt><tt>Number</tt></tt>&nbsp;&mdash;&nbsp;the curvature of the curve at the given location
  1327. </li>
  1328. </ul>
  1329. </div>
  1330. </div>
  1331. </div>
  1332. <div id="getintersections-curve" class="member">
  1333. <div class="member-link">
  1334. <a name="getintersections-curve" href="#getintersections-curve"><tt><b>getIntersections</b>(curve)</tt></a>
  1335. </div>
  1336. <div class="member-description hidden">
  1337. <div class="member-text">
  1338. <p>Returns all intersections between two <a href="../classes/Curve.html"><tt>Curve</tt></a> objects as an array of <a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a> objects.</p>
  1339. <ul class="member-list">
  1340. <h4>Parameters:</h4>
  1341. <li>
  1342. <tt>curve:</tt>
  1343. <a href="../classes/Curve.html"><tt>Curve</tt></a>
  1344. &mdash;&nbsp;the other curve to find the intersections with (if the curve itself or <code>null</code> is passed, the self intersection of the curve is returned, if it exists)
  1345. </li>
  1346. </ul>
  1347. <ul class="member-list">
  1348. <h4>Returns:</h4>
  1349. <li>
  1350. <tt>Array of <a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the locations of all intersections between the curves
  1351. </li>
  1352. </ul>
  1353. </div>
  1354. </div>
  1355. </div>
  1356. </div>
  1357. <!-- =========================== copyright notice ========================== -->
  1358. <p class="footer">
  1359. Paper.js v0.12.15<br>
  1360. Copyright &#169; 2011—2021 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
  1361. <div class="content-end"></div>
  1362. </article>
  1363. </body>