bezier

splitting a bezier curve in actionscript3

Hi I would like to "grow" a path with bezier-curves. After the path has been drawn, it should be shaking a bit: Weave-like look and feel. visual example: weave example At the moment I use TweenMax.bezier, which let me move a point along this curve and at the same time (onEnterFrame) I draw lines to the current Position of the Point. Un...

Detect&find intersection ray vs. cubic bezier triangle

While writing a model editor, besides enabling raytracing I can think about couple of operations where I'd like to find an very good approximation about the intersection point between a ray and a triangular bezier patch. How to do this? I know couple of ways but likely there's better ones. Exact use-cases: I might want to use one bezie...

How can I draw the control points of a Bézier Path in Java?

I have created a Path of Bézier curves and it works fine to draw the path. But I don't know How I can draw the Control Points together with the Path. Is that possible or do I have to keep track of them in another datastructure? Update: The reason to why I want to draw the control points, is that I will let the user to edit the curves us...

Drawing a clamped uniform cubic B-spline using Cairo

I have a bunch of coordinates which are the control points of a clamped uniform cubic B-spline on the 2D plane. I would like to draw this curve using Cairo calls (in Python, using Cairo's Python bindings), but as far as I know, Cairo supports Bézier curves only. I also know that the segments of a B-spline between two control points can b...

Quadratic bezier curve: Y coordinate for a given X ?

Hello, I have a quadratic bezier curve and I need the Y coordinate of a point on the bezier curve for a given X coordinate. I know that in pure maths this can be easily done, but I'm wondering is there's a simple / another way for this in C# / WPF? Is it possible to get the single points used by C# / WPF for drawing the bezier curve and...

An extended Bezier Library or Algorithms of bezier operations

Hi, Is there a library of data structures and operations for quadratic bezier curves? I need to implement: bezier to bitmap converting with arbitrary quality optimizing bezier curves common operations like subtraction, extraction, rendering etc. languages: c,c++,.net,python Algorithms without implementation (pseudocode or etc) could ...

Quadratic Bezier Curve: Calculate Tangent

I have a quadratic bezier curve and I want to calculate the slope of the tangent in a given point. For example, let it be the middlepoint of the quadratic bezier curve, therefore t=0.5 (please see the link below for a picture of this). I've calculated the first derivative of the formula for the quadratic bezier curve; however I get 400 a...

How to write outline data into .otf files?

I need to edit or completely replace outline data (bezier curves) of OpenType fonts. the input data is an EPS file that i have to write it into one specified glyph of an otf file with a certain scaling. (The glyph is specified by PostScript name OR Unicode value.) I need something like an encoder (or just a library of file structure of ...

An algorithm to find bounding box of closed bezier curves?

I'm looking for an algorithm to find bounding box (max/min points) of a closed quadratic bezier curve in Cartesian axis: input: C (a closed bezier curve) output: A B C D points Note: above image shows a smooth curve. it could be not smooth. (have corners) ...

rendering an antialiased spiral

I have looked at this example using php and GD to piecewise-render a spiral with small arcs. What I would like to do is render an approximation to a spiral that is as mathematically accurate as possible. Inkscape has a spiral tool that looks pretty good, but I would like to do the spiral generation programmatically (preferably in Python...

Bezier Algoritms - an algorithm for inserting points

I'm looking for an algorithm to insert a new control point on a bezier curve, without deforming: did anybody knows a library or reference for bezier algorithms (insertion, optimize, de Casteljau ...) ...

Multiple circles -> One Polygon?

Using Google Maps API v3, I was able to create multiple google.maps.Circle objects on my map. However, I now need to "connect" them somehow. I have the following map with multiple circles: I now need to get it to look something like this: I've looked all over the Internet for solutions, but to no avail. Any ideas? ...

How to convert closed bezier curves to Bitmaps?

I need an algorithm to convert a closed bezier curve (perhaps self-crossing) to a binary bitmap: 0 for inside pixels and 1 for outside. I'm writing a code that needs to implement some operations on bezier curves, could anybody give me some resources or tutorials about beziere? Wikipedia and others didn't say anything about optimization, ...

calculating parameters for defining subsections of quadratic bezier curves

I have a quadratic bezier curve described as (startX, startY) to (anchorX, anchorY) and using a control point (controlX, controlY). I have two questions: (1) I want to determine y points on that curve based on an x point. (2) Then, given a line-segment on my bezier (defined by two intermediary points on my bezier curve (startX', start...

Calculate cubic bezier T value where tangent is perpendicular to anchor line.

Project a cubic bezier p1,p2,p3,p4 onto the line p1,p4. When p2 or p3 does not project onto the line segment between p1 and p4, the curve will bulge out from the anchor points. Is there a way to calculate the T value where the tangent of the curve is perpendicular to the anchor line? This could also be stated as finding the T values w...

Drawing Quadratic Bezier circles with a given radius: how to determine control points

Just to clarify; the code below works, but I don't understand where the formula for the variable "controlRadius" comes from. I wrote this function by dissecting an example I found elsewhere, but I can't find any explanation and the original code comments were not able to be translated. Thanks in advance //returns an array of quadrati...

What is the maximum distance from an anchor point to a bezier curve?

Given a cubic bezier curve P0,P1,P2,P3 with the following properties: Both P1 and P2 are on the same side of the line formed by P0 and P3. P2 can be projected onto the line segment formed by P0 and P3 but P1 cannot. What is the T value for the point on the curve farthest from P3? Here is an image with an example curve. The curve bu...

OpenGL: How to draw Bezier curve of degree higher then 8?

I am trying to draw high order Bezier Curve using OpenGL evaluators: glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 30, &points[0][0]); glMapGrid1f(30, 0, 1); glEvalMesh1(GL_LINE, 0, 30); or glBegin(GL_LINE_STRIP); for (int i = 0; i <= 30; i++) glEvalCoord1f((GLfloat) i/30.0); glEnd(); When number of points exceeds 8, curve disappears....

Closest point on a cubic Bezier curve?

How can I find the point B(t) along a cubic Bezier curve that is closest to an arbitrary point P in the plane? ...

How do I draw part of parabola using iText ? Or how do I create quadratic bezier curves from cubic bezier curves?

I need to draw a shape whose boundaries are parts of parabola (that is quadratic bezier curves) using iText. I have found only method for drawing cubic bezier curves in PdfContentByte class. So how do I draw quadratic bezier curves using iText ? One way would be to use method for cubic bezier curves. Is it possible to draw quadratic be...