CubicCurve2D connecting two JInternalFrame instances

Yes. Here’s an example using drawLine(int x1, int y1, int x2, int y2), but invoking draw(Shape s) on your curve is a straightforward extension. You may have to expand the ComponentAdapter to handle resize events, too. import java.awt.BasicStroke; import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Stroke; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import … Read more

Draw Quadratic Curve on GPU

For 3 control point Bezier curves I would: use triangles as primitives enlarge control points to include area around curve to avoid artifacts This way is fast and there is no problem to compute A’,B’,C’ from A,B,C and vice versa. If the scale is constant (for example scale=1.25) then the max usable curve thickness<=2.0*min(|control_point-M|)*(scale-1.0). For … Read more

Approximating data with a multi segment cubic bezier curve and a distance as well as a curvature contraint

I found the solution that fulfills my criterea. The solution is to first find a B-Spline that approximates the points in the least square sense and then convert that spline into a multi segment bezier curve. B-Splines do have the advantage that in contrast to bezier curves they will not pass through the control points … Read more

how to draw smooth curve through N points using javascript HTML5 canvas?

The problem with joining subsequent sample points together with disjoint “curveTo” type functions, is that where the curves meet is not smooth. This is because the two curves share an end point but are influenced by completely disjoint control points. One solution is to “curve to” the midpoints between the next 2 subsequent sample points. … Read more