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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Access to intermediate points

    Scheduled Pinned Locked Moved PYTHON Development
    8 Posts 0 Posters 653 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

      On 01/03/2013 at 19:30, xxxxxxxx wrote:

      Hello everybody,

      is it possible to get access to intermediate points of splines? Id like to round corners.

      Thanks and greetings
      rown

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

        On 02/03/2013 at 00:12, xxxxxxxx wrote:

        Look at SplineObject.GetSplinePoint().

        -Niklas

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

          On 02/03/2013 at 01:58, xxxxxxxx wrote:

          Originally posted by xxxxxxxx

          Look at SplineObject.GetSplinePoint().
          -Niklas

          first of all, i am not sure how intermediate points is meant to be red, i am reading
          it as interpolation subpoints/steps.

          i am also not sure if i am missing here something, but GetSplinePoint does not give 
          you access to the spline interpolation points, but just translates an 0-1 based offset
          along the spline into an vector at that point in object coordinates. To my knowledge 
          there is no (python) method which returns a splines interpolation subpoints.

          For any sort of chamfering you will have to add support points to the spline object,
          just like you would do it in the editor too. You could do this either by executing a 
          SMC Chamfer command on a programmatically created BaseSelect of your SplineObject 
          or by adding manually points to your PointObject (the class both polygon and spline 
          objects are being derived from).

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

            On 02/03/2013 at 02:14, xxxxxxxx wrote:

            Hi Ferdinand,

            I understood "intermediate points" as "any points of the spline that are not necessarily anchor
            points", like the ones you can find by using GetPoint().

            -N

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

              On 02/03/2013 at 04:33, xxxxxxxx wrote:

              If you want to get your hands on the spline points that result from the interpolation, you have to convert the spline using the modeling command MCOMMAND_CURRENTSTATETOOBJECT. This will give you a linear spline that contains all the interpolated points.

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

                On 04/03/2013 at 04:41, xxxxxxxx wrote:

                Hello you three,

                Im back. Thanks for replies and sorry for vague wording.
                Indeed I meant access to interpolation subpoints. So the question is how to create an own interpolation. Id like to write a plugin for rounding corners of linear splines. I know how to calcuate the right positions, but I have no idea how to draw the Spline along these right positions.

                Thank and greetings
                rown

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

                  On 04/03/2013 at 04:53, xxxxxxxx wrote:

                  Just to be clear: You want to calculate the interpolation on your own?
                  If so, google for bezier, b-spline or cubic spline interpolation. You may also
                  want to look at the pycurves module.

                  -Niklas

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

                    On 04/03/2013 at 10:38, xxxxxxxx wrote:

                    to get hold of the spline interpolation use CSTO as Jack suggested, which will convert the

                    interpolation points into control points. but accessing the interpolation points does not make
                    any sense for chamfering a spline. simply use the methods described above to add control
                    points.

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