circle and arc dont match



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 01/03/2011 at 11:55, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   r12 
    Platform:      
    Language(s) :     C++  ;

    ---------
    Hi,

    im not sure if this is the right place to ask, but since it's a problem that i'm struggling with while developing, it might fit in here ;-)

    So lets say i have a circle spline with radius 100, and an arc with the same radius and range of 0°-180°, so that the arc is half a circle.

    When i put both splines at the same spot, i can see by zoomnig in, that they *dont* match perfectly. Actually their points seem to be at the same position, but inbetween the points, they dont match.

    It looks to me like this is some bug with the tangents of the arcs, when the arc is not a full circle, but just a part of a circle.

    Is this a known bug and/or is there some way around this ?

    Or am I maybe missing something obvious ?

    thanks for any hints on this,
      Daniel



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 01/03/2011 at 12:24, xxxxxxxx wrote:

    If you convert them you will see that they do NOT use the same bezier tangents. Only if you make the arc a full circle they will match. That's just how it is and you don't miss anything. ;)



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 01/03/2011 at 12:43, xxxxxxxx wrote:

    ok, but then one of them must be wrong, right ?
    or at least less accurate than the other.

    I did a little test by pushing an object along the two different splines with the align to spline tag:
    When printing out that objects distance from the center, it seems that the circle primitive is closer to a perfect circle than the arc primitive, which has a greater variation from 100.0 than the circle primitive.

    I'm using the arc primitive in my WindowGenerator plugin , so naturally im interested in getting as precise as possible, and trying to figure out where the error is.

    So to get perfect arcs, i have to compute those tangents myself ?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 01/03/2011 at 13:50, xxxxxxxx wrote:

    I use perfect circles in my tools and early found the spline circle/arc error
    compared with a cos/sin calculated circle.

    The answer here then was that the Beziers aren't to be trusted….sorta
    as the interpolation can't be perfect.
    (I avoid and recommend my customers not to use them for anything
    related to animation.

    Cheers
    Lennart



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/03/2011 at 14:39, xxxxxxxx wrote:

    Pretty much, yeah. Bezier splines suck at recreating perfect circles. Actually, no kind of spline can generate a perfect circular arc; it's their largest limitation.

    The best you could do would be to increase the number of control points that define your circle/arc to reduce the margin of error, like what Lennart just mentioned.
    SinCos functions to arrange the points perfectly, then hope that the bezier interpolation generated would be close enough for your tolerances.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/03/2011 at 12:23, xxxxxxxx wrote:

    thanks guys, thats some interesting informatin here.

    All i want actually is to make my arc-spline (which is based on the src primitive) fit my circle spline primitive (both are half-circles from 0-180° ).

    I think i just have to adjust the tangent length for arc spline points, gonna read up a little and bezier splines now.. ;-)


Log in to reply