Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Spline creation tangentlenght calculation

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 583 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

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

      On 17/03/2010 at 15:49, xxxxxxxx wrote:

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

      ---------
      Hy i write a plugin where i create a Spline connecting circles of different size as well as including their part in the new Spline too.
      Till yet i have all needed Points for my Spline but when it comes to the Tangents of those Points the Bezier-Curve is still giving me a headache.
      From normal circles i found that all 4 (90° to each other) Points have the Tangentlength of 0.415*Radius .. but if you cut the circle somewhere those values change ...

      Can someone tell me how to calculate the lenght please ... the formula would be great ... perhaps there is already a way to get that ...

      My idea yet is that it might be related to the arc of the circle but how to go on from there?

      Thanks for any suggestions,
      Patrick

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

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

        On 18/03/2010 at 05:44, xxxxxxxx wrote:

        EDIT: wrong information

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          On 18/03/2010 at 15:32, xxxxxxxx wrote:

          Thanks for the diagram, it definitely gave me something to think and try, but i still can't figure out how the tangents in a circle on the 4 main points are recalculated if you cut somewhere through it. You know just look at a converted (circle) Spline-Object in Point-Mode and then Cut it somewhere with the 4 points selected, you will see that the tangents around get shortened. So in my situation i need to find a solution based on the angle of the arc between my points and calculate the right tangentlenght to make it fit to a circular shape.

          Sorry, but as far as i was able to set in values in your formula and compare it, it would not explain to me the change of the already existing tangents like i mentioned before.

          Those changes i can only think are related on the length of the arc or in that case position on the bezier-curve.

          It would be great to know how Cinema is dealing with that special case (Circle <=> Bezier-Curve). Perhaps a part of calculation behind the Operation "Cut" which would be used for manual construction.

          Thanks for your time and any help you can give,
          Patrick

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

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

            On 18/03/2010 at 16:49, xxxxxxxx wrote:

            Ok so far i figured out that the result always differs from the results in Cinema if you use that formuar.

            BUT!

            If you use a arc and play around with the radius and look at the resulting 5 points and those tangents ... it's always a 1/x of 90° multiplied with those magical 0.415 * Radius.

            Means if you use to split a 90° arc (Radius 100) into 2 45° segments you get 4 tangents in there with 20.75 length each. Going to 3 30° Segments it's just the same (the 90° 41.5 tangent is divided through 1/3 giving 13.833333333 )

            I guess i can use that, but my original question and interest is still not satified

            I would say i just take the angle inside my arc and in relation to 90° i calculate the tangents.
            Seriously, that was a brain-drainer .. lol .. but thanks to the hint ... even if it is not what i will use .. it helped me to find a solution.

            Therefor thank you very much Matthias and keep up the good work

            Problem should be solved for me with that ... else "i'll be back"
            Patrick

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

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

              On 19/03/2010 at 02:48, xxxxxxxx wrote:

              Sorry, I made a mistake. Reading up on Bezier curves shows that the matter is more complicated. It involves so called "magic numbers".

              Please check following links:

              Approximation of a cubic Bezier curveand vice versa

              cubic spline & Bezier curves library

              cheers,
              Matthias

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

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

                On 19/03/2010 at 10:04, xxxxxxxx wrote:

                Thanks for the reply and of cause for the helpfull links.

                The solution i found is working fine for me as long as the angle of the arc between the points is within 90°. I will look in the material and try to find an easy way to come around that limitation too ... perhaps by adding just another point and reducing the angle under 90° again

                Thanks and cheers
                Patrick

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post