Forgot password?

Create an account!

Forum

« back

RhinoScript – Check a curve for CCW or CW

Messages

Please log in to write a message.

  • 9. Khoda (Mar 28, 2009 00.10):

    Yes, thats a good trick though. Thank you.

  • 8. Hanno (Mar 24, 2009 18.15):

    Thats because your wave-like curve does change between cw and ccw directions at every turning point. If you want to look at a larger scale (like the general direction of a curve, no matter what it does locally) you have to get rid of the "curvature noise": you could for example draw another curve just with the start, middle and end points of your curve (for a closed curv eyou will need one more point) and perform the test on that curve.

  • 7. Khoda (Mar 24, 2009 14.22):

    Hi:
    I tried but I am not getting the expected result. I applied your method for a wave like curve, and depending upon the selected point the curvature varies. So if I take the point on a concave part then curvature is inward and if it is on the convex part then opposite. So that mean for the same curve the z-value changes.

  • 6. Hanno (Mar 20, 2009 14.48):

    Ok, so you do have a curve. Then you can use exactly the method I described. Just take an arbitrary point on your curve, use CurveCurvature to get the two vectors, cross them and see that the direction of your resulting vector changes when you flip your curve direction.

  • 5. Khoda (Mar 20, 2009 14.28):

    Hi:
    If you draw those circle then it would be easier. So if you consider the intersection points and draw a curve from intersection 1 to 2, then 2 to 3 and then 3 to 4 and then 4 to 1 and delete the remaining part of the circle then you will end up getting a closed curve but with irregular shape. Now i need the direction for that curve.

  • 4. Hanno (Mar 18, 2009 11.06):

    Hi,
    I don't know what you mean. If you draw several circles, you get some intersection areas etc., but where do you want to have some kind of direction?

  • 3. Khoda (Mar 16, 2009 15.26):

    Hi:

    Thank you for the solution. Yes but I am actually looking for CCW or CW direction for an irregular shape loop. For an example, if draw four circle intersecting each other with center (0,.5,0),(.7,0,0), (.7,1.1,0),(1.2, .5,0) and radius 0.5 then you will get an area enclosed by the circle. Now if you define a loop there and if you want to find its direction (CCW or CW) then the cross product method does not work.

    Thanks.

  • 2. Hanno (Mar 15, 2009 17.17):

    Hi,

    I assume you are talking 2D here: you can use CurveCurvature() to get curvature information for a specific point on a curve. If you take the cross product of the tangent vector and the curvature vector, the resulting vector faces in negative or positive z direction, depending on you clockwise or counterclockwise curve direction.

  • 1. Khoda (Mar 14, 2009 16.54):

    Hi:
    Can anyone tell me how to check the clockwise or Counter wise direction for a curve. Thanks.

Recommend

Why are these buttons gray?