Lines Matching full:curve
1198 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
1199 curve_extremes(curve, angleBounds);
1207 var curve = curvePartialByID(test, frags[0], frags[4], frags[5]);
1208 curve_extremes(curve, angleBounds);
1209 curve = curvePartialByID(test, frags[6], frags[10], frags[11]);
1210 curve_extremes(curve, angleBounds);
1211 curve = curvePartialByID(test, frags[12], frags[16], frags[17]);
1219 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
1220 curve_extremes(curve, angleBounds);
1228 var curve = curvePartialByID(test, frags[0], frags[6], frags[8]);
1229 curve_extremes(curve, angleBounds);
1237 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
1238 curve_extremes(curve, angleBounds);
1401 function curve_extremes(curve, bounds) {
1402 var length = curve.length == 7 ? 6 : curve.length;
1404 var x = curve[index];
1405 var y = curve[index + 1];
1441 function drawArc(curve, op, from, to) {
1442 var type = PATH_LINE + (curve.length / 2 - 2);
1443 var pt = pointAtT(curve, type, op ? 0.4 : 0.6);
1444 var dy = pt.y - curve[1];
1445 var dx = pt.x - curve[0];
1449 var _px = (curve[0] - srcLeft) * scale;
1450 var _py = (curve[1] - srcTop) * scale;
1487 var px = curve[0] + Math.cos(angle + index * Math.PI / divisor) * dist;
1488 var py = curve[1] + Math.sin(angle + index * Math.PI / divisor) * dist;
1550 function drawControlLines(curve, curveType, drawEnd) {
1555 drawLine(curve[0], curve[1], curve[2], curve[3]);
1556 drawLine(curve[2], curve[3], curve[4], curve[5]);
1558 drawLine(curve[4], curve[5], curve[6], curve[7]);
1560 drawLine(curve[6], curve[7], curve[0], curve[1]);
1562 drawLine(curve[0], curve[1], curve[4], curve[5]);
1563 drawLine(curve[6], curve[7], curve[2], curve[3]);
1567 drawLine(curve[4], curve[5], curve[0], curve[1]);
1571 function pointAtT(curve, curveType, t) {
1577 xy.x = a * curve[0] + b * curve[2];
1578 xy.y = a * curve[1] + b * curve[3];
1585 xy.x = a * curve[0] + b * curve[2] + c * curve[4];
1586 xy.y = a * curve[1] + b * curve[3] + c * curve[5];
1593 xy.x = a * curve[0] + b * curve[2] * curve[6] + c * curve[4];
1594 xy.y = a * curve[1] + b * curve[3] * curve[6] + c * curve[5];
1595 var d = a + b * curve[6] + c;
1607 xy.x = a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6];
1608 xy.y = a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7];
1614 function drawPointAtT(curve, curveType) {
1616 var xy = pointAtT(curve, curveType, curveT);
1821 function computeQuadPOW2(curve, tol) {
1822 var a = curve[6] - 1;
1824 var x = k * (curve[0] - 2 * curve[2] + curve[4]);
1825 var y = k * (curve[1] - 2 * curve[3] + curve[5]);
1842 function chop(curve, part1, part2) {
1843 var w = curve[6];
1845 part1[0] = curve[0];
1846 part1[1] = curve[1];
1847 part1[2] = (curve[0] + curve[2] * w) * scale;
1848 part1[3] = (curve[1] + curve[3] * w) * scale;
1849 part1[4] = part2[0] = (curve[0] + (curve[2] * w) * 2 + curve[4]) * scale * 0.5;
1850 part1[5] = part2[1] = (curve[1] + (curve[3] * w) * 2 + curve[5]) * scale * 0.5;
1851 part2[2] = (curve[2] * w + curve[4]) * scale;
1852 part2[3] = (curve[3] * w + curve[5]) * scale;
1853 part2[4] = curve[4];
1854 part2[5] = curve[5];
1858 function subdivide(curve, level, pts) {
1860 pts.push(curve[2]);
1861 pts.push(curve[3]);
1862 pts.push(curve[4]);
1863 pts.push(curve[5]);
1866 chop(curve, part1, part2);
1873 function chopIntoQuadsPOW2(curve, pow2, pts) {
1874 subdivide(curve, pow2, pts);
1886 var curve = [x1, y1, x2, y2, x3, y3, w];
1887 var pow2 = computeQuadPOW2(curve, tol);
1889 chopIntoQuadsPOW2(curve, pow2, pts);
2191 function dxy_at_t(curve, type, t) {
2194 dxy.x = curve[2] - curve[0];
2195 dxy.y = curve[3] - curve[1];
2200 dxy.x = a * curve[0] + b * curve[2] + c * curve[4];
2201 dxy.y = a * curve[1] + b * curve[3] + c * curve[5];
2203 var p20x = curve[4] - curve[0];
2204 var p20y = curve[5] - curve[1];
2205 var p10xw = (curve[2] - curve[0]) * curve[6];
2206 var p10yw = (curve[3] - curve[1]) * curve[6];
2207 var coeff0x = curve[6] * p20x - p20x;
2208 var coeff0y = curve[6] * p20y - p20y;
2215 var a = curve[0];
2216 var b = curve[2];
2217 var c = curve[4];
2218 var d = curve[6];
2220 a = curve[1];
2221 b = curve[3];
2222 c = curve[5];
2223 d = curve[7];
2229 function dpt_at_t(curve, t) {
2230 var type = PATH_LINE + (curve.length / 2 - 2);
2231 return dxy_at_t(curve, type, t);
2307 function x_at_t(curve, t) {
2309 if (curve.length == 4) {
2310 return one_t * curve[0] + t * curve[2];
2314 if (curve.length == 6) {
2315 return one_t2 * curve[0] + 2 * one_t * t * curve[2] + t2 * curve[4];
2317 if (curve.length == 7) {
2318 return (one_t2 * curve[0] + 2 * one_t * t * curve[2] * curve[6] + t2 * curve[4])
2319 / (one_t2 +2 * one_t * t * curve[6] + t2);
2325 return a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6];
2328 function y_at_t(curve, t) {
2330 if (curve.length == 4) {
2331 return one_t * curve[1] + t * curve[3];
2335 if (curve.length == 6) {
2336 return one_t2 * curve[1] + 2 * one_t * t * curve[3] + t2 * curve[5];
2338 if (curve.length == 7) {
2339 return (one_t2 * curve[1] + 2 * one_t * t * curve[3] * curve[6] + t2 * curve[5])
2340 / (one_t2 +2 * one_t * t * curve[6] + t2);
2346 return a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7];
2349 function pt_at_t(curve, t) {
2351 pt.x = x_at_t(curve, t);
2352 pt.y = y_at_t(curve, t);
2356 function drawOrder(curve, t, label) {
2357 var px = x_at_t(curve, t);
2358 var py = y_at_t(curve, t);
2380 function drawVisibleOrder(curve, label) {
2381 var s = pt_at_t(curve, 0);
2382 var e = pt_at_t(curve, 1);
2387 return drawOrder(curve, defaultT, label);
2396 var mid = pt_at_t(curve, t);
2398 return drawOrder(curve, t, label);
2402 drawOrder(curve, defaultT, label);
2413 var mid = pt_at_t(curve, t);
2415 return drawOrder(curve, t, label);
2419 drawOrder(curve, defaultT, label);
2429 function drawDirection(curve, t) {
2430 var d = dpt_at_t(curve, t);
2432 var pt = localToGlobal(pt_at_t(curve, t));
2441 function drawVisibleDirection(curve) {
2442 var s = pt_at_t(curve, 0);
2443 var e = pt_at_t(curve, 1);
2448 return drawDirection(curve, defaultT);
2458 var mid = pt_at_t(curve, t);
2460 return drawDirection(curve, t);
2464 drawDirection(curve, defaultT);
2475 var mid = pt_at_t(curve, t);
2477 return drawDirection(curve, t);
2481 drawDirection(curve, defaultT);
2484 function drawID(curve, t, id) {
2485 var px = x_at_t(curve, t);
2486 var py = y_at_t(curve, t);
2505 function drawVisibleID(curve, defaultT, id) {
2507 var s = pt_at_t(curve, 0);
2508 var e = pt_at_t(curve, 1);
2512 return drawID(curve, defaultT, id);
2518 var mid = pt_at_t(curve, t);
2520 return drawID(curve, t, id);
2524 drawID(curve, defaultT, id);
2532 var mid = pt_at_t(curve, t);
2534 return drawID(curve, t, id);
2538 drawID(curve, defaultT, id);
2557 var curve = [x1, y1, x2, y2];
2558 drawCurvePartialID(id, curve, t1, t2);
2566 var curve = [x1, y1, x2, y2, x3, y3];
2567 drawCurvePartialID(id, curve, t1, t2);
2575 var curve = [x1, y1, x2, y2, x3, y3, w];
2576 drawCurvePartialID(id, curve, t1, t2);
2584 var curve = [x1, y1, x2, y2, x3, y3, x4, y4];
2585 drawCurvePartialID(id, curve, t1, t2);
2592 function drawCurvePartialID(id, curve, t1, t2) {
2593 drawVisibleID(curve, (t1 + t2) / 2, id);
2596 function drawCurveSpecials(test, curve, type) {
2598 drawPoints(curve, type, pt_labels == 2);
2601 drawControlLines(curve, type, control_lines);
2604 drawPointAtT(curve, type);
2607 var mid = pointAtT(curve, type, 0.5);
2611 var id = idByCurve(test, curve, type);
2613 drawVisibleID(curve, 0.5, id);
2617 drawVisibleDirection(curve);
2623 var d = dxy_at_t(curve, type, 0);
2624 drawArrow(curve[0], curve[1], d.x, d.y, 1);
2626 d = dxy_at_t(curve, type, 1);
2628 drawArrow(curve[6], curve[7], d.x, d.y, 1);
2630 drawArrow(curve[4], curve[5], d.x, d.y, 1);
2634 var mid = pointAtT(curve, type, 0.5);
2635 d = dxy_at_t(curve, type, 0.5);
2643 var ymin = Math.min(curve[1], curve[3], curve[5], curve[7]);
2645 drawLabelX(ymin, i >> 1, curve[i]);
2647 var xmin = Math.min(curve[0], curve[2], curve[4], curve[6]);
2649 drawLabelY(xmin, i >> 1, curve[i]);
2656 var curve = test[curves];
2657 dumpCurve(curve);
2661 function curveToString(curve) {
2663 var length = curve.length == 7 ? 6 : curve.length;
2664 if (curve.length == 7) {
2668 str += curve[i].toFixed(decimal_places) + "," + curve[i + 1].toFixed(decimal_places);
2669 if (i < curve.length - 2) {
2674 if (curve.length == 7) {
2675 str += "}, " + curve[6].toFixed(decimal_places);
2681 function dumpCurve(curve) {
2682 console.log(curveToString(curve));
3075 var curve = [x1, y1, x2, y2];
3077 drawPoints(curve, PATH_LINE, pt_labels == 2);
3088 var curve = [x1, y1, x2, y2, x3, y3];
3090 drawPoints(curve, PATH_QUAD, pt_labels == 2);
3102 var curve = [x1, y1, x2, y2, x3, y3, w];
3104 drawPoints(curve, PATH_CONIC, pt_labels == 2);
3117 var curve = [x1, y1, x2, y2, x3, y3, x4, y4];
3119 drawPoints(curve, PATH_CUBIC, pt_labels == 2);
3135 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
3136 drawCurve(curve);
3138 drawArc(curve, false, frags[3], frags[4]);
3139 drawArc(curve, true, frags[5], frags[6]);
3221 var curve;
3225 curve = [ frags[0], frags[1], frags[2], frags[3] ];
3229 curve = [ frags[0], frags[1], frags[2], frags[3],
3234 curve = [ frags[0], frags[1], frags[2], frags[3],
3239 curve = [ frags[0], frags[1], frags[2], frags[3],
3247 drawCurve(curve);
3249 drawVisibleID(curve, 0.5, id);
3260 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
3261 drawCurve(curve);
3449 var curve;
3454 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]];
3455 id = idByCurve(test, curve, PATH_LINE);
3462 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
3464 id = idByCurve(test, curve, PATH_QUAD);
3471 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
3473 id = idByCurve(test, curve, PATH_CONIC);
3480 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
3482 id = idByCurve(test, curve, PATH_CUBIC);
3487 drawVisibleID(curve, 0.5, id);
3496 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]];
3497 id = idByCurve(test, curve, PATH_LINE);
3504 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
3506 id = idByCurve(test, curve, PATH_QUAD);
3513 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
3515 id = idByCurve(test, curve, PATH_CONIC);
3522 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
3524 id = idByCurve(test, curve, PATH_CUBIC);
3529 drawVisibleID(curve, 0.5, id);
3561 var curve = curvePartialByID(test, frags[0], frags[6], frags[8]);
3562 drawCurve(curve);
3577 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
3578 drawCurve(curve);
3579 var type = PATH_LINE + (curve.length / 2 - 2);
3580 var mid = pointAtT(curve, type, 0.5);
3581 var d = dxy_at_t(curve, type, 0.5);
3776 ctx.fillText("curve t : " + curveTKey, screenWidth - 10, pos * 50 + y++ * 10);
3780 ctx.fillText("log curve : " + logCurvesKey, screenWidth - 10, pos * 50 + y++ * 10);
3876 var curve = curveByID(test, id);
3877 var name = ["line", "quad", "cubic"][curve.length / 2 - 2];
3878 console.log("id=" + id + " " + name + "=" + curveToString(curve)
3884 var curve = curveByID(test, id);
3885 console.log(" { {" + curveToString(curve) + "}, "
3886 + curve.length / 2 + ", " + t0 + ", " + t1 + ", {} }, //");