Some additional constraint definitions

Hi,

I’d like to ask how to define some additional constraint definitions

  1. Point on Line constraint
    An AnyRefNode should be (nearly) on a line. So this constraint should be defined as a soft constraint. The line I’d like to use should be defined with some existing AnyRefNode objects.

  2. Point on Plane constraint
    An AnyRefNode should be (nearly) on a plane. The three points that should be used to define a plane may change their positions continually according to kinematics because those three points may be AnyRefNode objects on different segments.

What I’m concerning is that because the AnyRefNode objects that should be used to define a line or a plane may change their positions continually, so I don’t know how I can define these kinds of constraints.

I hope to get your advice.

Best regards and thanks in advance,
Moonki

Hi Moonki,

There are no problems in defining those constraint with nodes moving in time, you can do it like this by using a dummy segment in both cases:

  1. Point on line: The line is defined by nodes A and B. In node A attach a segment with a universal joint (2 rotations) and drive the two rotations with linear measures so that one of the segment axis (X for example) is always pointing at node B. Now the point you want to be on the line can be driven with a linear measure in the segment local coordinate as Y=0 and Z=0.

  2. Point on plane: The plane is defined by nodes A, B and C. In node A attach a segment with a revolute joint, drive two of the rotations so that X axis points at node B and drive the last rotation so that Y axis points at node C (all that by linear measures in the segment local ref frame). So the point on the plane can be driven in the local segment ref frame as Z=0.

Best regards, Sylvain.

Hi, Sylvain.

Thank you very much for your explanation.
I’d like to ask of you additionally.

According to your answers, I have to define a dummy segment in an AnyRefNode object.

But I can’t understand how I can attach a segment within an AnyRefNode.

And I’d like to know how I can connect the dummy segment with respect to its parent AnyRefNode.

I’m very sorry to say but would you please show an example code for your answer?

I’d very appreciate it in advance.

Best regards and thanks again,

Hi Moonki,

Maybe the explanation was not very clear. The dummy seg is not defined inside the AnyRefNode but outside and then connected to it by a joint.

I have uploaded an example for both cases in the wiki:
http://wiki.anyscript.org/index.php/Tips_and_tricks#Define_a_constraint_point_on_line_or_point_on_plane

Best regards, Sylvain.

Hi Sylvain,

Thank you very much for your excellent example! I’m trying to analyze your code and put it to my code.

Best regards and thanks again,
Moonki