What I want:
What I have:
So basically I need to use curves to make a quarter circle. What is a good trick to do that?
What I want:
What I have:
So basically I need to use curves to make a quarter circle. What is a good trick to do that?
A slight warning, this will only approximate a quarter curve, but often this will be sufficient for graphics.
Here is a short script that might be of interest to future python coders, creating this curve through code: https://gist.github.com/zeffii/5775583
Here's how I made a quarter circle:
Since the line from each point to the control point attached to it is tangent to the curve, we know that the point at (1, 0, 0) will have a control point above it and the point at (0, 1, 0) will have a control point to the right of it.
And since the curve is a circle, we know that the control points will be the same distance from their respective points due to symmetry.
Result: My control points are at (1, 0.55, 0) and (0.55, 1, 0)
Note: This will only approximate a circle, but you can get close enough for most purposes.
This way is not the fastest way, clearly, but its method can be extended for creating other curved shapes.
But can you use something else for the process? What you can do (and what I usually do when I need something like that) is a nice workaround that gives perfect curves:
I did some visual only tests and came up with .552285 of the percentage of the Bezier curve vertex locations. I made a 200 inch diameter circle with 128 segments. A Bezier curve with 2 segments will have the 2 segments vertex hit the circle (as close as I could tell from my closest zoom) with control point 1 at 0, 0, 0 and control point two at 100, 100, 0.
Vertex control (on main part of curve side) from control point 1 is 55.2285, 0, 0. Vertex control (on main part of curve side) from control point 2 is 100, 44.7715, 0. (100-55.2285= 44.7715)
This is basically the same answer as Jason provided above, just a bit more precision on the vertex point. And again this is only by visual reference, not math or knowledge of the Bezier curve algorithm. I realize this thread is old, but I couldn't find a number for this on other threads. Hope it helps someone.
Edit- I found this site on everything Bezier curve-- https://pomax.github.io/bezierinfo/#arcapproximation
Section 42 does the math that comes up with the same number I came up with. In case anyone wants to verify the number and math...