Grasshopper

algorithmic modeling for Rhino

Orient Direction component giving unexpected result at .5 position on curve.

I have a design where I'm moving and rotating an object along a circle using the Orient Direction component.  Everything seems to work out as expected except for the curve .5 position (pi).  At precisely that position the object flips to the wrong direction.  Seems to me that it's a bug in the Orient Direction component.  I've created a new gh file to demonstrate what I'm seeing.

In the image below,

  1. is the original object that I'm going to position.
  2. is the result when positioning at .48 of the circle.
  3. is the result when positioning at .50 of the circle.
  4. is the result when positioning at .52 of the circle.

Notice how at .5 of the circle the position of the object jumps.

Views: 2615

Attachments:

Replies to This Discussion

Your definition only works because of GH's intelligent internal data conversion. You use points as inputs to AlignPlane. that means that

a) the point in P is interpreted as a plane. GH creates a WorldXY with the origin set to the point location.

b) the point in D is interpreted as a vector. That's a vector pointing from World(0;0;0) to your point location.

Align plane rotates the plane to match Plane X direction to your vector D. Now for your position 3 the angle is either 0° or 180°. Since calculating the angle will always return both angle and reflex angle, you need to decide, which to use. AlignPlane uses minimal rotation. Hence your WorldXY will get no rotation at all for your position 3.

In order to get this working:

Use PFrames to get perpendicular planes along the curve, that are oriented in tangent and minimal curvature direction. PFrames orient Z along the tangent and x along curvature so you need to construct a new plane from those to get the plane orientation, you have now.

Oh and you should avoid orienting with single vectors only. The same problem with minimal angles applies.

Here's a file using Orient (Plane)

Attachments:

Hi Hannes, thanks for your feedback.  I agree 100% with you about the AlignPlane component and intelligent alignment of the plane to world xy given just a point for the D input.  I don't know if that is the way the component was designed, but I love it and have used it multiple times.

You state:

Now for your position 3 the angle is either 0° or 180°. Since calculating the angle will always return both angle and reflex angle, you need to decide, which to use. AlignPlane uses minimal rotation. Hence your WorldXY will get no rotation at all for your position 3.

However... that's not actually true or what is happening.  If you look closely at the image supplied in the original post you will see that the plane displayed at 180 is indeed rotated and the X vector is indeed pointing to -X.  To double verify that I extracted the X vector from those planes and displayed them... clearly you can see in the image below that the AlignPlane component is rotating the plane at 180.

Now... to get back to the original issue.  The problem I pointed out in my original post was not with the AlignPlane component, but rather with the OrientDirection component.  It seems to me that component has an issue when fed a target direction of -X {-1;0;0} for a target vector. 

To eliminate the confusion caused by the AlignPlane component I eliminated that component from the design and simply used rotated vectors as input to the target direction of OrientDirection.  You will see that the results are the same... when given a target direction of {-1;0;0} the object is not rotated, while any other vector input does rotate the object.

I've attached the updated gh file demonstrating the issue using rotated vectors as the input for dB target direction of the OrientDirection component.

Attachments:

I'm moving this to the bugs topic area as I believe this is a problem with the Fillet component.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service