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 class="reference">
|
---|
14 | <div class="reference-class">
|
---|
15 | <h1>Curve</h1>
|
---|
16 |
|
---|
17 | <p>The Curve object represents the parts of a path that are connected by
|
---|
18 | two following <a href="../classes/Segment.html"><tt>Segment</tt></a> objects. The curves of a path can be accessed
|
---|
19 | through its <a href="../classes/Path.html#curves"><tt>path.curves</tt></a> array.</p>
|
---|
20 | <p>While a segment describe the anchor point and its incoming and outgoing
|
---|
21 | handles, a Curve object describes the curve passing between two such
|
---|
22 | segments. Curves and segments represent two different ways of looking at the
|
---|
23 | same thing, but focusing on different aspects. Curves for example offer many
|
---|
24 | convenient ways to work with parts of the path, finding lengths, positions or
|
---|
25 | tangents at given offsets.</p>
|
---|
26 |
|
---|
27 | </div>
|
---|
28 |
|
---|
29 | <!-- ============================== constructors ========================= -->
|
---|
30 | <div class="reference-members"><h2>Constructors</h2>
|
---|
31 |
|
---|
32 |
|
---|
33 | <div id="curve-segment1-segment2" class="member">
|
---|
34 | <div class="member-link">
|
---|
35 | <a name="curve-segment1-segment2" href="#curve-segment1-segment2"><tt><b>Curve</b>(segment1, segment2)</tt></a>
|
---|
36 | </div>
|
---|
37 | <div class="member-description hidden">
|
---|
38 | <div class="member-text">
|
---|
39 | <p>Creates a new curve object.</p>
|
---|
40 |
|
---|
41 | <ul><b>Parameters:</b>
|
---|
42 |
|
---|
43 | <li>
|
---|
44 | <tt>segment1:</tt>
|
---|
45 | <a href="../classes/Segment.html"><tt>Segment</tt></a>
|
---|
46 |
|
---|
47 |
|
---|
48 | </li>
|
---|
49 |
|
---|
50 | <li>
|
---|
51 | <tt>segment2:</tt>
|
---|
52 | <a href="../classes/Segment.html"><tt>Segment</tt></a>
|
---|
53 |
|
---|
54 |
|
---|
55 | </li>
|
---|
56 |
|
---|
57 | </ul>
|
---|
58 |
|
---|
59 |
|
---|
60 |
|
---|
61 |
|
---|
62 | </div>
|
---|
63 | </div>
|
---|
64 | </div>
|
---|
65 |
|
---|
66 |
|
---|
67 | <div id="curve-point1-handle1-handle2-point2" class="member">
|
---|
68 | <div class="member-link">
|
---|
69 | <a name="curve-point1-handle1-handle2-point2" href="#curve-point1-handle1-handle2-point2"><tt><b>Curve</b>(point1, handle1, handle2, point2)</tt></a>
|
---|
70 | </div>
|
---|
71 | <div class="member-description hidden">
|
---|
72 | <div class="member-text">
|
---|
73 | <p>Creates a new curve object.</p>
|
---|
74 |
|
---|
75 | <ul><b>Parameters:</b>
|
---|
76 |
|
---|
77 | <li>
|
---|
78 | <tt>point1:</tt>
|
---|
79 | <a href="../classes/Point.html"><tt>Point</tt></a>
|
---|
80 |
|
---|
81 |
|
---|
82 | </li>
|
---|
83 |
|
---|
84 | <li>
|
---|
85 | <tt>handle1:</tt>
|
---|
86 | <a href="../classes/Point.html"><tt>Point</tt></a>
|
---|
87 |
|
---|
88 |
|
---|
89 | </li>
|
---|
90 |
|
---|
91 | <li>
|
---|
92 | <tt>handle2:</tt>
|
---|
93 | <a href="../classes/Point.html"><tt>Point</tt></a>
|
---|
94 |
|
---|
95 |
|
---|
96 | </li>
|
---|
97 |
|
---|
98 | <li>
|
---|
99 | <tt>point2:</tt>
|
---|
100 | <a href="../classes/Point.html"><tt>Point</tt></a>
|
---|
101 |
|
---|
102 |
|
---|
103 | </li>
|
---|
104 |
|
---|
105 | </ul>
|
---|
106 |
|
---|
107 |
|
---|
108 |
|
---|
109 |
|
---|
110 | </div>
|
---|
111 | </div>
|
---|
112 | </div>
|
---|
113 |
|
---|
114 | </div>
|
---|
115 |
|
---|
116 |
|
---|
117 |
|
---|
118 |
|
---|
119 |
|
---|
120 | <div class="reference-members"><h2>Properties</h2>
|
---|
121 |
|
---|
122 |
|
---|
123 | <div id="point1" class="member">
|
---|
124 | <div class="member-link">
|
---|
125 | <a name="point1" href="#point1"><tt><b>point1</b></tt></a>
|
---|
126 | </div>
|
---|
127 | <div class="member-description hidden">
|
---|
128 |
|
---|
129 | <div class="member-text">
|
---|
130 | <p>The first anchor point of the curve.</p>
|
---|
131 |
|
---|
132 |
|
---|
133 | <ul><b>Type:</b>
|
---|
134 | <li>
|
---|
135 | <a href="../classes/Point.html"><tt>Point</tt></a>
|
---|
136 | </li>
|
---|
137 | </ul>
|
---|
138 |
|
---|
139 |
|
---|
140 | </div>
|
---|
141 |
|
---|
142 | </div>
|
---|
143 | </div>
|
---|
144 |
|
---|
145 |
|
---|
146 | <div id="point2" class="member">
|
---|
147 | <div class="member-link">
|
---|
148 | <a name="point2" href="#point2"><tt><b>point2</b></tt></a>
|
---|
149 | </div>
|
---|
150 | <div class="member-description hidden">
|
---|
151 |
|
---|
152 | <div class="member-text">
|
---|
153 | <p>The second anchor point of the curve.</p>
|
---|
154 |
|
---|
155 |
|
---|
156 | <ul><b>Type:</b>
|
---|
157 | <li>
|
---|
158 | <a href="../classes/Point.html"><tt>Point</tt></a>
|
---|
159 | </li>
|
---|
160 | </ul>
|
---|
161 |
|
---|
162 |
|
---|
163 | </div>
|
---|
164 |
|
---|
165 | </div>
|
---|
166 | </div>
|
---|
167 |
|
---|
168 |
|
---|
169 | <div id="handle1" class="member">
|
---|
170 | <div class="member-link">
|
---|
171 | <a name="handle1" href="#handle1"><tt><b>handle1</b></tt></a>
|
---|
172 | </div>
|
---|
173 | <div class="member-description hidden">
|
---|
174 |
|
---|
175 | <div class="member-text">
|
---|
176 | <p>The handle point that describes the tangent in the first anchor point.</p>
|
---|
177 |
|
---|
178 |
|
---|
179 | <ul><b>Type:</b>
|
---|
180 | <li>
|
---|
181 | <a href="../classes/Point.html"><tt>Point</tt></a>
|
---|
182 | </li>
|
---|
183 | </ul>
|
---|
184 |
|
---|
185 |
|
---|
186 | </div>
|
---|
187 |
|
---|
188 | </div>
|
---|
189 | </div>
|
---|
190 |
|
---|
191 |
|
---|
192 | <div id="handle2" class="member">
|
---|
193 | <div class="member-link">
|
---|
194 | <a name="handle2" href="#handle2"><tt><b>handle2</b></tt></a>
|
---|
195 | </div>
|
---|
196 | <div class="member-description hidden">
|
---|
197 |
|
---|
198 | <div class="member-text">
|
---|
199 | <p>The handle point that describes the tangent in the second anchor point.</p>
|
---|
200 |
|
---|
201 |
|
---|
202 | <ul><b>Type:</b>
|
---|
203 | <li>
|
---|
204 | <a href="../classes/Point.html"><tt>Point</tt></a>
|
---|
205 | </li>
|
---|
206 | </ul>
|
---|
207 |
|
---|
208 |
|
---|
209 | </div>
|
---|
210 |
|
---|
211 | </div>
|
---|
212 | </div>
|
---|
213 |
|
---|
214 |
|
---|
215 | <div id="segment1" class="member">
|
---|
216 | <div class="member-link">
|
---|
217 | <a name="segment1" href="#segment1"><tt><b>segment1</b></tt></a>
|
---|
218 | </div>
|
---|
219 | <div class="member-description hidden">
|
---|
220 |
|
---|
221 | <div class="member-text">
|
---|
222 | <p>The first segment of the curve.</p>
|
---|
223 |
|
---|
224 | <p>Read only.</p>
|
---|
225 |
|
---|
226 |
|
---|
227 | <ul><b>Type:</b>
|
---|
228 | <li>
|
---|
229 | <a href="../classes/Segment.html"><tt>Segment</tt></a>
|
---|
230 | </li>
|
---|
231 | </ul>
|
---|
232 |
|
---|
233 |
|
---|
234 | </div>
|
---|
235 |
|
---|
236 | </div>
|
---|
237 | </div>
|
---|
238 |
|
---|
239 |
|
---|
240 | <div id="segment2" class="member">
|
---|
241 | <div class="member-link">
|
---|
242 | <a name="segment2" href="#segment2"><tt><b>segment2</b></tt></a>
|
---|
243 | </div>
|
---|
244 | <div class="member-description hidden">
|
---|
245 |
|
---|
246 | <div class="member-text">
|
---|
247 | <p>The second segment of the curve.</p>
|
---|
248 |
|
---|
249 | <p>Read only.</p>
|
---|
250 |
|
---|
251 |
|
---|
252 | <ul><b>Type:</b>
|
---|
253 | <li>
|
---|
254 | <a href="../classes/Segment.html"><tt>Segment</tt></a>
|
---|
255 | </li>
|
---|
256 | </ul>
|
---|
257 |
|
---|
258 |
|
---|
259 | </div>
|
---|
260 |
|
---|
261 | </div>
|
---|
262 | </div>
|
---|
263 |
|
---|
264 |
|
---|
265 | <div id="path" class="member">
|
---|
266 | <div class="member-link">
|
---|
267 | <a name="path" href="#path"><tt><b>path</b></tt></a>
|
---|
268 | </div>
|
---|
269 | <div class="member-description hidden">
|
---|
270 |
|
---|
271 | <div class="member-text">
|
---|
272 | <p>The path that the curve belongs to.</p>
|
---|
273 |
|
---|
274 | <p>Read only.</p>
|
---|
275 |
|
---|
276 |
|
---|
277 | <ul><b>Type:</b>
|
---|
278 | <li>
|
---|
279 | <a href="../classes/Path.html"><tt>Path</tt></a>
|
---|
280 | </li>
|
---|
281 | </ul>
|
---|
282 |
|
---|
283 |
|
---|
284 | </div>
|
---|
285 |
|
---|
286 | </div>
|
---|
287 | </div>
|
---|
288 |
|
---|
289 |
|
---|
290 | <div id="index" class="member">
|
---|
291 | <div class="member-link">
|
---|
292 | <a name="index" href="#index"><tt><b>index</b></tt></a>
|
---|
293 | </div>
|
---|
294 | <div class="member-description hidden">
|
---|
295 |
|
---|
296 | <div class="member-text">
|
---|
297 | <p>The index of the curve in the <a href="../classes/Path.html#curves"><tt>path.curves</tt></a> array.</p>
|
---|
298 |
|
---|
299 | <p>Read only.</p>
|
---|
300 |
|
---|
301 |
|
---|
302 | <ul><b>Type:</b>
|
---|
303 | <li>
|
---|
304 | <tt>Number</tt>
|
---|
305 | </li>
|
---|
306 | </ul>
|
---|
307 |
|
---|
308 |
|
---|
309 | </div>
|
---|
310 |
|
---|
311 | </div>
|
---|
312 | </div>
|
---|
313 |
|
---|
314 |
|
---|
315 | <div id="next" class="member">
|
---|
316 | <div class="member-link">
|
---|
317 | <a name="next" href="#next"><tt><b>next</b></tt></a>
|
---|
318 | </div>
|
---|
319 | <div class="member-description hidden">
|
---|
320 |
|
---|
321 | <div class="member-text">
|
---|
322 | <p>The next curve in the <a href="../classes/Path.html#curves"><tt>path.curves</tt></a> array that the curve
|
---|
323 | belongs to.</p>
|
---|
324 |
|
---|
325 | <p>Read only.</p>
|
---|
326 |
|
---|
327 |
|
---|
328 | <ul><b>Type:</b>
|
---|
329 | <li>
|
---|
330 | <a href="../classes/Curve.html"><tt>Curve</tt></a>
|
---|
331 | </li>
|
---|
332 | </ul>
|
---|
333 |
|
---|
334 |
|
---|
335 | </div>
|
---|
336 |
|
---|
337 | </div>
|
---|
338 | </div>
|
---|
339 |
|
---|
340 |
|
---|
341 | <div id="previous" class="member">
|
---|
342 | <div class="member-link">
|
---|
343 | <a name="previous" href="#previous"><tt><b>previous</b></tt></a>
|
---|
344 | </div>
|
---|
345 | <div class="member-description hidden">
|
---|
346 |
|
---|
347 | <div class="member-text">
|
---|
348 | <p>The previous curve in the <a href="../classes/Path.html#curves"><tt>path.curves</tt></a> array that the curve
|
---|
349 | belongs to.</p>
|
---|
350 |
|
---|
351 | <p>Read only.</p>
|
---|
352 |
|
---|
353 |
|
---|
354 | <ul><b>Type:</b>
|
---|
355 | <li>
|
---|
356 | <a href="../classes/Curve.html"><tt>Curve</tt></a>
|
---|
357 | </li>
|
---|
358 | </ul>
|
---|
359 |
|
---|
360 |
|
---|
361 | </div>
|
---|
362 |
|
---|
363 | </div>
|
---|
364 | </div>
|
---|
365 |
|
---|
366 |
|
---|
367 | <div id="selected" class="member">
|
---|
368 | <div class="member-link">
|
---|
369 | <a name="selected" href="#selected"><tt><b>selected</b></tt></a>
|
---|
370 | </div>
|
---|
371 | <div class="member-description hidden">
|
---|
372 |
|
---|
373 | <div class="member-text">
|
---|
374 | <p>Specifies whether the handles of the curve are selected.</p>
|
---|
375 |
|
---|
376 |
|
---|
377 | <ul><b>Type:</b>
|
---|
378 | <li>
|
---|
379 | <tt>Boolean</tt>
|
---|
380 | </li>
|
---|
381 | </ul>
|
---|
382 |
|
---|
383 |
|
---|
384 | </div>
|
---|
385 |
|
---|
386 | </div>
|
---|
387 | </div>
|
---|
388 |
|
---|
389 |
|
---|
390 | <div id="length" class="member">
|
---|
391 | <div class="member-link">
|
---|
392 | <a name="length" href="#length"><tt><b>length</b></tt></a>
|
---|
393 | </div>
|
---|
394 | <div class="member-description hidden">
|
---|
395 |
|
---|
396 | <div class="member-text">
|
---|
397 | <p>The approximated length of the curve in points.</p>
|
---|
398 |
|
---|
399 | <p>Read only.</p>
|
---|
400 |
|
---|
401 |
|
---|
402 | <ul><b>Type:</b>
|
---|
403 | <li>
|
---|
404 | <tt>Number</tt>
|
---|
405 | </li>
|
---|
406 | </ul>
|
---|
407 |
|
---|
408 |
|
---|
409 | </div>
|
---|
410 |
|
---|
411 | </div>
|
---|
412 | </div>
|
---|
413 |
|
---|
414 |
|
---|
415 | <div id="bounds" class="member">
|
---|
416 | <div class="member-link">
|
---|
417 | <a name="bounds" href="#bounds"><tt><b>bounds</b></tt></a>
|
---|
418 | </div>
|
---|
419 | <div class="member-description hidden">
|
---|
420 |
|
---|
421 | <div class="member-text">
|
---|
422 | <p>The bounding rectangle of the curve excluding stroke width.</p>
|
---|
423 |
|
---|
424 | <p>Read only.</p>
|
---|
425 |
|
---|
426 |
|
---|
427 | <ul><b>Type:</b>
|
---|
428 | <li>
|
---|
429 | <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
---|
430 | </li>
|
---|
431 | </ul>
|
---|
432 |
|
---|
433 |
|
---|
434 | </div>
|
---|
435 |
|
---|
436 | </div>
|
---|
437 | </div>
|
---|
438 |
|
---|
439 |
|
---|
440 | <div id="strokebounds" class="member">
|
---|
441 | <div class="member-link">
|
---|
442 | <a name="strokebounds" href="#strokebounds"><tt><b>strokeBounds</b></tt></a>
|
---|
443 | </div>
|
---|
444 | <div class="member-description hidden">
|
---|
445 |
|
---|
446 | <div class="member-text">
|
---|
447 | <p>The bounding rectangle of the curve including stroke width.</p>
|
---|
448 |
|
---|
449 | <p>Read only.</p>
|
---|
450 |
|
---|
451 |
|
---|
452 | <ul><b>Type:</b>
|
---|
453 | <li>
|
---|
454 | <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
---|
455 | </li>
|
---|
456 | </ul>
|
---|
457 |
|
---|
458 |
|
---|
459 | </div>
|
---|
460 |
|
---|
461 | </div>
|
---|
462 | </div>
|
---|
463 |
|
---|
464 |
|
---|
465 | <div id="handlebounds" class="member">
|
---|
466 | <div class="member-link">
|
---|
467 | <a name="handlebounds" href="#handlebounds"><tt><b>handleBounds</b></tt></a>
|
---|
468 | </div>
|
---|
469 | <div class="member-description hidden">
|
---|
470 |
|
---|
471 | <div class="member-text">
|
---|
472 | <p>The bounding rectangle of the curve including handles.</p>
|
---|
473 |
|
---|
474 | <p>Read only.</p>
|
---|
475 |
|
---|
476 |
|
---|
477 | <ul><b>Type:</b>
|
---|
478 | <li>
|
---|
479 | <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
---|
480 | </li>
|
---|
481 | </ul>
|
---|
482 |
|
---|
483 |
|
---|
484 | </div>
|
---|
485 |
|
---|
486 | </div>
|
---|
487 | </div>
|
---|
488 |
|
---|
489 | </div>
|
---|
490 |
|
---|
491 |
|
---|
492 |
|
---|
493 | <!-- ============================== methods ================================ -->
|
---|
494 | <div class="reference-members"><h2>Methods</h2>
|
---|
495 |
|
---|
496 |
|
---|
497 | <div id="islinear" class="member">
|
---|
498 | <div class="member-link">
|
---|
499 | <a name="islinear" href="#islinear"><tt><b>isLinear</b>()</tt></a>
|
---|
500 | </div>
|
---|
501 | <div class="member-description hidden">
|
---|
502 | <div class="member-text">
|
---|
503 | <p>Checks if this curve is linear, meaning it does not define any curve
|
---|
504 | handle.</p>
|
---|
505 |
|
---|
506 |
|
---|
507 | <ul><b>Returns:</b>
|
---|
508 |
|
---|
509 | <li>
|
---|
510 | <tt><tt>Boolean</tt></tt> — <tt>true</tt> the curve is linear, <tt>false</tt> otherwise
|
---|
511 | </li>
|
---|
512 |
|
---|
513 | </ul>
|
---|
514 |
|
---|
515 |
|
---|
516 |
|
---|
517 | </div>
|
---|
518 | </div>
|
---|
519 | </div>
|
---|
520 |
|
---|
521 |
|
---|
522 | <div id="reverse" class="member">
|
---|
523 | <div class="member-link">
|
---|
524 | <a name="reverse" href="#reverse"><tt><b>reverse</b>()</tt></a>
|
---|
525 | </div>
|
---|
526 | <div class="member-description hidden">
|
---|
527 | <div class="member-text">
|
---|
528 | <p>Returns a reversed version of the curve, without modifying the curve
|
---|
529 | itself.</p>
|
---|
530 |
|
---|
531 |
|
---|
532 | <ul><b>Returns:</b>
|
---|
533 |
|
---|
534 | <li>
|
---|
535 | <tt><a href="../classes/Curve.html"><tt>Curve</tt></a></tt> — a reversed version of the curve
|
---|
536 | </li>
|
---|
537 |
|
---|
538 | </ul>
|
---|
539 |
|
---|
540 |
|
---|
541 |
|
---|
542 | </div>
|
---|
543 | </div>
|
---|
544 | </div>
|
---|
545 |
|
---|
546 |
|
---|
547 | <div id="divide" class="member">
|
---|
548 | <div class="member-link">
|
---|
549 | <a name="divide" href="#divide"><tt><b>divide</b>([offset[, isParameter]])</tt></a>
|
---|
550 | </div>
|
---|
551 | <div class="member-description hidden">
|
---|
552 | <div class="member-text">
|
---|
553 | <p>Divides the curve into two curves at the given offset. The curve itself
|
---|
554 | is modified and becomes the first part, the second part is returned as a
|
---|
555 | new curve. If the modified curve belongs to a path item, the second part
|
---|
556 | is also added to the path.</p>
|
---|
557 |
|
---|
558 | <ul><b>Parameters:</b>
|
---|
559 |
|
---|
560 | <li>
|
---|
561 | <tt>offset:</tt>
|
---|
562 | <tt>Number</tt>
|
---|
563 | — the offset on the curve at which to split,
|
---|
564 | or the curve time parameter if <tt>isParameter</tt> is <tt>true</tt>
|
---|
565 | — optional, default: <tt>0.5</tt>
|
---|
566 | </li>
|
---|
567 |
|
---|
568 | <li>
|
---|
569 | <tt>isParameter:</tt>
|
---|
570 | <tt>Boolean</tt>
|
---|
571 | — pass <tt>true</tt> if <tt>offset</tt>
|
---|
572 | is a curve time parameter.
|
---|
573 | — optional, default: <tt>false</tt>
|
---|
574 | </li>
|
---|
575 |
|
---|
576 | </ul>
|
---|
577 |
|
---|
578 |
|
---|
579 | <ul><b>Returns:</b>
|
---|
580 |
|
---|
581 | <li>
|
---|
582 | <tt><a href="../classes/Curve.html"><tt>Curve</tt></a></tt> — the second part of the divided curve
|
---|
583 | </li>
|
---|
584 |
|
---|
585 | </ul>
|
---|
586 |
|
---|
587 |
|
---|
588 |
|
---|
589 | </div>
|
---|
590 | </div>
|
---|
591 | </div>
|
---|
592 |
|
---|
593 |
|
---|
594 | <div id="split" class="member">
|
---|
595 | <div class="member-link">
|
---|
596 | <a name="split" href="#split"><tt><b>split</b>([offset[, isParameter]])</tt></a>
|
---|
597 | </div>
|
---|
598 | <div class="member-description hidden">
|
---|
599 | <div class="member-text">
|
---|
600 | <p>Splits the path this curve belongs to at the given offset. After
|
---|
601 | splitting, the path will be open. If the path was open already, splitting
|
---|
602 | will result in two paths.</p>
|
---|
603 |
|
---|
604 | <ul><b>Parameters:</b>
|
---|
605 |
|
---|
606 | <li>
|
---|
607 | <tt>offset:</tt>
|
---|
608 | <tt>Number</tt>
|
---|
609 | — the offset on the curve at which to split,
|
---|
610 | or the curve time parameter if <tt>isParameter</tt> is <tt>true</tt>
|
---|
611 | — optional, default: <tt>0.5</tt>
|
---|
612 | </li>
|
---|
613 |
|
---|
614 | <li>
|
---|
615 | <tt>isParameter:</tt>
|
---|
616 | <tt>Boolean</tt>
|
---|
617 | — pass <tt>true</tt> if <tt>offset</tt>
|
---|
618 | is a curve time parameter.
|
---|
619 | — optional, default: <tt>false</tt>
|
---|
620 | </li>
|
---|
621 |
|
---|
622 | </ul>
|
---|
623 |
|
---|
624 |
|
---|
625 | <ul><b>Returns:</b>
|
---|
626 |
|
---|
627 | <li>
|
---|
628 | <tt><a href="../classes/Path.html"><tt>Path</tt></a></tt> — the newly created path after splitting, if any
|
---|
629 | </li>
|
---|
630 |
|
---|
631 | </ul>
|
---|
632 |
|
---|
633 |
|
---|
634 | <p><b>See also:</b>
|
---|
635 | <tt><a href="../classes/Path.html#split-index-parameter"><tt>path.split(index, parameter)</tt></a></tt>
|
---|
636 | </p>
|
---|
637 |
|
---|
638 |
|
---|
639 | </div>
|
---|
640 | </div>
|
---|
641 | </div>
|
---|
642 |
|
---|
643 |
|
---|
644 | <div id="clone" class="member">
|
---|
645 | <div class="member-link">
|
---|
646 | <a name="clone" href="#clone"><tt><b>clone</b>()</tt></a>
|
---|
647 | </div>
|
---|
648 | <div class="member-description hidden">
|
---|
649 | <div class="member-text">
|
---|
650 | <p>Returns a copy of the curve.</p>
|
---|
651 |
|
---|
652 |
|
---|
653 | <ul><b>Returns:</b>
|
---|
654 |
|
---|
655 | <li>
|
---|
656 | <tt><a href="../classes/Curve.html"><tt>Curve</tt></a></tt>
|
---|
657 | </li>
|
---|
658 |
|
---|
659 | </ul>
|
---|
660 |
|
---|
661 |
|
---|
662 |
|
---|
663 | </div>
|
---|
664 | </div>
|
---|
665 | </div>
|
---|
666 |
|
---|
667 |
|
---|
668 | <div id="tostring" class="member">
|
---|
669 | <div class="member-link">
|
---|
670 | <a name="tostring" href="#tostring"><tt><b>toString</b>()</tt></a>
|
---|
671 | </div>
|
---|
672 | <div class="member-description hidden">
|
---|
673 | <div class="member-text">
|
---|
674 |
|
---|
675 |
|
---|
676 |
|
---|
677 | <ul><b>Returns:</b>
|
---|
678 |
|
---|
679 | <li>
|
---|
680 | <tt><tt>String</tt></tt> — a string representation of the curve
|
---|
681 | </li>
|
---|
682 |
|
---|
683 | </ul>
|
---|
684 |
|
---|
685 |
|
---|
686 |
|
---|
687 | </div>
|
---|
688 | </div>
|
---|
689 | </div>
|
---|
690 |
|
---|
691 |
|
---|
692 | <div id="getparameterat-offset" class="member">
|
---|
693 | <div class="member-link">
|
---|
694 | <a name="getparameterat-offset" href="#getparameterat-offset"><tt><b>getParameterAt</b>(offset[, start])</tt></a>
|
---|
695 | </div>
|
---|
696 | <div class="member-description hidden">
|
---|
697 | <div class="member-text">
|
---|
698 | <p>Calculates the curve time parameter of the specified offset on the path,
|
---|
699 | relative to the provided start parameter. If offset is a negative value,
|
---|
700 | the parameter is searched to the left of the start parameter. If no start
|
---|
701 | parameter is provided, a default of <tt>0</tt> for positive values of
|
---|
702 | <tt>offset</tt> and <tt>1</tt> for negative values of <tt>offset</tt>.</p>
|
---|
703 |
|
---|
704 | <ul><b>Parameters:</b>
|
---|
705 |
|
---|
706 | <li>
|
---|
707 | <tt>offset:</tt>
|
---|
708 | <tt>Number</tt>
|
---|
709 |
|
---|
710 |
|
---|
711 | </li>
|
---|
712 |
|
---|
713 | <li>
|
---|
714 | <tt>start:</tt>
|
---|
715 | <tt>Number</tt>
|
---|
716 |
|
---|
717 | — optional
|
---|
718 | </li>
|
---|
719 |
|
---|
720 | </ul>
|
---|
721 |
|
---|
722 |
|
---|
723 | <ul><b>Returns:</b>
|
---|
724 |
|
---|
725 | <li>
|
---|
726 | <tt><tt>Number</tt></tt> — the curve time parameter at the specified offset.
|
---|
727 | </li>
|
---|
728 |
|
---|
729 | </ul>
|
---|
730 |
|
---|
731 |
|
---|
732 |
|
---|
733 | </div>
|
---|
734 | </div>
|
---|
735 | </div>
|
---|
736 |
|
---|
737 |
|
---|
738 | <div id="getparameterof-point" class="member">
|
---|
739 | <div class="member-link">
|
---|
740 | <a name="getparameterof-point" href="#getparameterof-point"><tt><b>getParameterOf</b>(point)</tt></a>
|
---|
741 | </div>
|
---|
742 | <div class="member-description hidden">
|
---|
743 | <div class="member-text">
|
---|
744 | <p>Returns the curve time parameter of the specified point if it lies on the
|
---|
745 | curve, <tt>null</tt> otherwise.</p>
|
---|
746 |
|
---|
747 | <ul><b>Parameters:</b>
|
---|
748 |
|
---|
749 | <li>
|
---|
750 | <tt>point:</tt>
|
---|
751 | <a href="../classes/Point.html"><tt>Point</tt></a>
|
---|
752 | — the point on the curve.
|
---|
753 |
|
---|
754 | </li>
|
---|
755 |
|
---|
756 | </ul>
|
---|
757 |
|
---|
758 |
|
---|
759 | <ul><b>Returns:</b>
|
---|
760 |
|
---|
761 | <li>
|
---|
762 | <tt><tt>Number</tt></tt> — the curve time parameter of the specified point.
|
---|
763 | </li>
|
---|
764 |
|
---|
765 | </ul>
|
---|
766 |
|
---|
767 |
|
---|
768 |
|
---|
769 | </div>
|
---|
770 | </div>
|
---|
771 | </div>
|
---|
772 |
|
---|
773 |
|
---|
774 | <div id="getlocationat-offset" class="member">
|
---|
775 | <div class="member-link">
|
---|
776 | <a name="getlocationat-offset" href="#getlocationat-offset"><tt><b>getLocationAt</b>(offset[, isParameter])</tt></a>
|
---|
777 | </div>
|
---|
778 | <div class="member-description hidden">
|
---|
779 | <div class="member-text">
|
---|
780 | <p>Calculates the curve location at the specified offset or curve time
|
---|
781 | parameter.</p>
|
---|
782 |
|
---|
783 | <ul><b>Parameters:</b>
|
---|
784 |
|
---|
785 | <li>
|
---|
786 | <tt>offset:</tt>
|
---|
787 | <tt>Number</tt>
|
---|
788 | — the offset on the curve, or the curve time
|
---|
789 | parameter if <tt>isParameter</tt> is <tt>true</tt>
|
---|
790 |
|
---|
791 | </li>
|
---|
792 |
|
---|
793 | <li>
|
---|
794 | <tt>isParameter:</tt>
|
---|
795 | <tt>Boolean</tt>
|
---|
796 | — pass <tt>true</tt> if <tt>offset</tt>
|
---|
797 | is a curve time parameter.
|
---|
798 | — optional, default: <tt>false</tt>
|
---|
799 | </li>
|
---|
800 |
|
---|
801 | </ul>
|
---|
802 |
|
---|
803 |
|
---|
804 | <ul><b>Returns:</b>
|
---|
805 |
|
---|
806 | <li>
|
---|
807 | <tt><a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a></tt> — the curve location at the specified the offset.
|
---|
808 | </li>
|
---|
809 |
|
---|
810 | </ul>
|
---|
811 |
|
---|
812 |
|
---|
813 |
|
---|
814 | </div>
|
---|
815 | </div>
|
---|
816 | </div>
|
---|
817 |
|
---|
818 |
|
---|
819 | <div id="getlocationof-point" class="member">
|
---|
820 | <div class="member-link">
|
---|
821 | <a name="getlocationof-point" href="#getlocationof-point"><tt><b>getLocationOf</b>(point)</tt></a>
|
---|
822 | </div>
|
---|
823 | <div class="member-description hidden">
|
---|
824 | <div class="member-text">
|
---|
825 | <p>Returns the curve location of the specified point if it lies on the
|
---|
826 | curve, <tt>null</tt> otherwise.</p>
|
---|
827 |
|
---|
828 | <ul><b>Parameters:</b>
|
---|
829 |
|
---|
830 | <li>
|
---|
831 | <tt>point:</tt>
|
---|
832 | <a href="../classes/Point.html"><tt>Point</tt></a>
|
---|
833 | — the point on the curve.
|
---|
834 |
|
---|
835 | </li>
|
---|
836 |
|
---|
837 | </ul>
|
---|
838 |
|
---|
839 |
|
---|
840 | <ul><b>Returns:</b>
|
---|
841 |
|
---|
842 | <li>
|
---|
843 | <tt><a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a></tt> — the curve location of the specified point.
|
---|
844 | </li>
|
---|
845 |
|
---|
846 | </ul>
|
---|
847 |
|
---|
848 |
|
---|
849 |
|
---|
850 | </div>
|
---|
851 | </div>
|
---|
852 | </div>
|
---|
853 |
|
---|
854 |
|
---|
855 | <div id="getpointat-offset" class="member">
|
---|
856 | <div class="member-link">
|
---|
857 | <a name="getpointat-offset" href="#getpointat-offset"><tt><b>getPointAt</b>(offset[, isParameter])</tt></a>
|
---|
858 | </div>
|
---|
859 | <div class="member-description hidden">
|
---|
860 | <div class="member-text">
|
---|
861 | <p>Returns the point on the curve at the specified offset.</p>
|
---|
862 |
|
---|
863 | <ul><b>Parameters:</b>
|
---|
864 |
|
---|
865 | <li>
|
---|
866 | <tt>offset:</tt>
|
---|
867 | <tt>Number</tt>
|
---|
868 | — the offset on the curve, or the curve time
|
---|
869 | parameter if <tt>isParameter</tt> is <tt>true</tt>
|
---|
870 |
|
---|
871 | </li>
|
---|
872 |
|
---|
873 | <li>
|
---|
874 | <tt>isParameter:</tt>
|
---|
875 | <tt>Boolean</tt>
|
---|
876 | — pass <tt>true</tt> if <tt>offset</tt>
|
---|
877 | is a curve time parameter.
|
---|
878 | — optional, default: <tt>false</tt>
|
---|
879 | </li>
|
---|
880 |
|
---|
881 | </ul>
|
---|
882 |
|
---|
883 |
|
---|
884 | <ul><b>Returns:</b>
|
---|
885 |
|
---|
886 | <li>
|
---|
887 | <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt> — the point on the curve at the specified offset.
|
---|
888 | </li>
|
---|
889 |
|
---|
890 | </ul>
|
---|
891 |
|
---|
892 |
|
---|
893 |
|
---|
894 | </div>
|
---|
895 | </div>
|
---|
896 | </div>
|
---|
897 |
|
---|
898 |
|
---|
899 | <div id="gettangentat-offset" class="member">
|
---|
900 | <div class="member-link">
|
---|
901 | <a name="gettangentat-offset" href="#gettangentat-offset"><tt><b>getTangentAt</b>(offset[, isParameter])</tt></a>
|
---|
902 | </div>
|
---|
903 | <div class="member-description hidden">
|
---|
904 | <div class="member-text">
|
---|
905 | <p>Returns the tangent vector of the curve at the specified position.</p>
|
---|
906 |
|
---|
907 | <ul><b>Parameters:</b>
|
---|
908 |
|
---|
909 | <li>
|
---|
910 | <tt>offset:</tt>
|
---|
911 | <tt>Number</tt>
|
---|
912 | — the offset on the curve, or the curve time
|
---|
913 | parameter if <tt>isParameter</tt> is <tt>true</tt>
|
---|
914 |
|
---|
915 | </li>
|
---|
916 |
|
---|
917 | <li>
|
---|
918 | <tt>isParameter:</tt>
|
---|
919 | <tt>Boolean</tt>
|
---|
920 | — pass <tt>true</tt> if <tt>offset</tt>
|
---|
921 | is a curve time parameter.
|
---|
922 | — optional, default: <tt>false</tt>
|
---|
923 | </li>
|
---|
924 |
|
---|
925 | </ul>
|
---|
926 |
|
---|
927 |
|
---|
928 | <ul><b>Returns:</b>
|
---|
929 |
|
---|
930 | <li>
|
---|
931 | <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt> — the tangent of the curve at the specified offset.
|
---|
932 | </li>
|
---|
933 |
|
---|
934 | </ul>
|
---|
935 |
|
---|
936 |
|
---|
937 |
|
---|
938 | </div>
|
---|
939 | </div>
|
---|
940 | </div>
|
---|
941 |
|
---|
942 |
|
---|
943 | <div id="getnormalat-offset" class="member">
|
---|
944 | <div class="member-link">
|
---|
945 | <a name="getnormalat-offset" href="#getnormalat-offset"><tt><b>getNormalAt</b>(offset[, isParameter])</tt></a>
|
---|
946 | </div>
|
---|
947 | <div class="member-description hidden">
|
---|
948 | <div class="member-text">
|
---|
949 | <p>Returns the normal vector of the curve at the specified position.</p>
|
---|
950 |
|
---|
951 | <ul><b>Parameters:</b>
|
---|
952 |
|
---|
953 | <li>
|
---|
954 | <tt>offset:</tt>
|
---|
955 | <tt>Number</tt>
|
---|
956 | — the offset on the curve, or the curve time
|
---|
957 | parameter if <tt>isParameter</tt> is <tt>true</tt>
|
---|
958 |
|
---|
959 | </li>
|
---|
960 |
|
---|
961 | <li>
|
---|
962 | <tt>isParameter:</tt>
|
---|
963 | <tt>Boolean</tt>
|
---|
964 | — pass <tt>true</tt> if <tt>offset</tt>
|
---|
965 | is a curve time parameter.
|
---|
966 | — optional, default: <tt>false</tt>
|
---|
967 | </li>
|
---|
968 |
|
---|
969 | </ul>
|
---|
970 |
|
---|
971 |
|
---|
972 | <ul><b>Returns:</b>
|
---|
973 |
|
---|
974 | <li>
|
---|
975 | <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt> — the normal of the curve at the specified offset.
|
---|
976 | </li>
|
---|
977 |
|
---|
978 | </ul>
|
---|
979 |
|
---|
980 |
|
---|
981 |
|
---|
982 | </div>
|
---|
983 | </div>
|
---|
984 | </div>
|
---|
985 |
|
---|
986 |
|
---|
987 | <div id="getcurvatureat-offset" class="member">
|
---|
988 | <div class="member-link">
|
---|
989 | <a name="getcurvatureat-offset" href="#getcurvatureat-offset"><tt><b>getCurvatureAt</b>(offset[, isParameter])</tt></a>
|
---|
990 | </div>
|
---|
991 | <div class="member-description hidden">
|
---|
992 | <div class="member-text">
|
---|
993 | <p>Returns the curvature vector of the curve at the specified position.</p>
|
---|
994 | <p>Curvatures indicate how sharply a curve changes direction. A straight
|
---|
995 | line has zero curvature where as a circle has a constant curvature.</p>
|
---|
996 |
|
---|
997 | <ul><b>Parameters:</b>
|
---|
998 |
|
---|
999 | <li>
|
---|
1000 | <tt>offset:</tt>
|
---|
1001 | <tt>Number</tt>
|
---|
1002 | — the offset on the curve, or the curve time
|
---|
1003 | parameter if <tt>isParameter</tt> is <tt>true</tt>
|
---|
1004 |
|
---|
1005 | </li>
|
---|
1006 |
|
---|
1007 | <li>
|
---|
1008 | <tt>isParameter:</tt>
|
---|
1009 | <tt>Boolean</tt>
|
---|
1010 | — pass <tt>true</tt> if <tt>offset</tt>
|
---|
1011 | is a curve time parameter.
|
---|
1012 | — optional, default: <tt>false</tt>
|
---|
1013 | </li>
|
---|
1014 |
|
---|
1015 | </ul>
|
---|
1016 |
|
---|
1017 |
|
---|
1018 | <ul><b>Returns:</b>
|
---|
1019 |
|
---|
1020 | <li>
|
---|
1021 | <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt> — the curvature of the curve at the specified offset.
|
---|
1022 | </li>
|
---|
1023 |
|
---|
1024 | </ul>
|
---|
1025 |
|
---|
1026 |
|
---|
1027 |
|
---|
1028 | </div>
|
---|
1029 | </div>
|
---|
1030 | </div>
|
---|
1031 |
|
---|
1032 | </div>
|
---|
1033 |
|
---|
1034 |
|
---|
1035 |
|
---|
1036 |
|
---|
1037 | <!-- =========================== copyright notice ========================= -->
|
---|
1038 | <p class="footer">Copyright © 2011 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
---|
1039 | <div class="content-end"></div>
|
---|
1040 |
|
---|
1041 | </body> |
---|