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 intersection

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 220 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 31/05/2010 at 12:52, xxxxxxxx wrote:

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

      ---------
      Hi there,

      i am trying to check for a spline if a point is within a certain range to the spline.. this is what i thought should work, but it doesnt. so i guess my approach is wrong.
      the idea was to cycle thru all points of the spline and compare them to an ajustable number of points of the spline (the more points the more accuracy)..

      can anyone point out some source of information which may help me to get it work as i dont know what to look for?

        
      Real distance (Vector from, Vector to)  
      {  
        Real d = Abs(Len(from - to));  
        return d;  
      }  
      ...  
                //check if spline intersects  
                //accuracy defines how many points should be taken for the test  
                for (int i=1; i<steps; i++)  
                {                          
                    for(int sCheck=0; sCheck<accuracy; sCheck++)  
                    {  
                        cpos = (1.0/accuracy)*sCheck;  
                        vPosition = splineObj->GetSplinePoint(splineObj->UniformToNatural(cpos), 0, NULL);  
                        tempVec = splineObj->GetSplinePoint(splineObj->UniformToNatural((1.0/steps)*i), 0, NULL);  
                        if (distance(vPosition,tempVec)<sRange)  
                        {  
                            //just add some random value for now...  
                            padr[i] = tempVec + Vector(0.1*zufall(sRange,seed*i/100));  
                        }  
                    }  
                }  
      

      thanks,
      ello

      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 12/07/2012 at 13:07, xxxxxxxx wrote:

        I see this post was a long time ago, but did you or anybody else solve it?
        I'm also looking for a way to determine the intersection of two splines.

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