Point to surface constraint

Hi.
I am trying to make a constraint condition between two segments: A node on Segment 2 should be on the surface of Segment 1.
Assuming that the node of Segment 2 can translate on x, y axis, I think it may be possible by using AnyKinEqSimpleDriver like this;

    AnyKinEqSimpleDriver Driver = {
      AnyKinLinear lin  = {
        AnyRefFrame& ref1 = Seg1.node;
        AnyRefFrame& ref2 = Seg2.node;
        Ref = 0;
      };
      AnyKinRotational rot = {
        AnyRefFrame& ref1 = Seg1.node;
        AnyRefFrame& ref2 = Seg2.node;
        Type = RotAxesAngles;
        Axis1 = x;
        Axis2 = y;
        Axis3 = z;  
      };
      MeasureOrganizer = {0,1,3,4,5};
      DriverPos = {0,0,0,0,0};
      DriverVel = {0,0,0,0,0};
      Reaction.Type = {Off,Off,Off,Off,Off};
    };         

In this case, Segment 2 has 5 dof with this driver, but 1 dof of z translation is not be constrained; thus it is indeterminate. How can I give the constraint and make it a determinate system?

Hi,

What kind of surface are you considering to use?

Currently, AnyBody supports some analytic surface(AnyParamSurfAnalytical) such as AnySurfSphere, AnySurfEllipsoid and AnySurfCylinder.
And AnyBody has ‘AnyKinPointSurface’ kinematic measure. You can refer to this class.

Or, if you would like to describe what you want to do with some helpful pictures,
then we may be able to help you more.

Best regards,
Moonki

The surface is a plane. I just want to put a node of one segment on the plane of the other segment on the plane with x, y translation allowed.

The class of AnyKinPointSurface does also act as a constraint between two object?

Thanks.

Hi,

If you want to make a node moving on the plane of another segments, actually it contains only one constraint.

Let’s assume that the normal vector of the plane segment is ‘Z’. Then,

    AnyKinEqSimpleDriver Driver = {
      AnyKinLinear lin  = {
        AnyRefFrame& Plane_Segment = Seg1.node;
        AnyRefFrame& Target = Seg2.node;
        Ref = 0;
      };
      MeasureOrganizer = {2};
      DriverPos = {0};
      DriverVel = {0};
      Reaction.Type = {On};
    };

So there are still 5 DOFs between these two segments.(2 translation + 3 rotation).

Then you can put any kind of drivers to the target segment.

Best regards,
Moonki

Ahh… Then the code that I wrote on the first thread is making 5 constraints of fixation on the segment!
I thought a driver works only for making something move, but I found that it also works for making something not to move.

Thank you.