Beispiel #1
0
 def calcDOF(self, _dofPos, _dofRot, _pointconstraints=[]):
     #AxialConstraint:
     #    AxisAlignment()    needs to know the axis normal to circle (stored in dep as refpoint and refAxisEnd) and the dofrot array
     #    AxisDistance()     needs to know the axis normal to circle (stored in dep as refpoint and refAxisEnd) and the dofpos array
     #    LockRotation()     need to know if LockRotation is True or False and the array dofrot
     tmpaxis = cleanAxis(create_Axis2Points(self.refPoint, self.refAxisEnd))
     return _dofPos, AxisAlignment(tmpaxis, _dofRot)
Beispiel #2
0
    def calcDOF(self, _dofPos, _dofRot, _pointconstraints=[]):
        #PlaneCoincident:
        #    AxisAlignment()    needs to know the axis normal to the plane constrained (stored in dep as refpoint and refAxisEnd) and the dofrot array
        #    PlaneOffset()      needs to know the axis normal to the plane constrained (stored in dep as refpoint and refAxisEnd) and the dofpos array
        tmpaxis = cleanAxis(create_Axis2Points(self.refPoint, self.refAxisEnd))

        # the axis used on axisalignment isn't a real axis but a random axis normal to the plane
        #set it to length = 2 instead of normalize it
        pos = PlaneOffset(tmpaxis, _dofPos)
        tmpaxis.Direction.Length = 2.0
        return pos, AxisAlignment(tmpaxis, _dofRot)
 def calcDOF(self, _dofPos, _dofRot, _pointconstraints=[]):
     #PointIdentity, PointOnLine, PointOnPlane, Spherical Constraints:
     #    PointIdentityPos()    needs to know the point constrained as vector, the dofpos array, the rigid center point as vector and
     #                        the pointconstraints which stores all point constraints of the rigid
     #    PointIdentityRot()    needs to know the point constrained as vector, the dofrot array, and
     #                        the pointconstraints which stores all point constraints of the rigid
     # These constraint have to be the last evaluated in the chain of c    
     tmpaxis = cleanAxis(create_Axis(self.refPoint, self.currentRigid.getRigidCenter()))
     #dofpos = PointIdentityPos(tmpaxis,_dofPos,_pointconstraints)
     #dofrot = PointIdentityRot(tmpaxis,_dofRot,_pointconstraints)
     return PointIdentity(tmpaxis, _dofPos, _dofRot, _pointconstraints)
 def calcDOF(self, _dofPos, _dofRot, _pointconstraints=[]):
     #function used to determine the dof lost due to this constraint
     #CircularEdgeConstraint:
     #    AxisAlignment()    needs to know the axis normal to circle (stored in dep as refpoint and refAxisEnd) and the dofrot array
     #    AxisDistance()     needs to know the axis normal to circle (stored in dep as refpoint and refAxisEnd) and the dofpos array
     #    PlaneOffset()      needs to know the axis normal to circle (stored in dep as refpoint and refAxisEnd) and the dofpos array
     #    LockRotation()     need to know if LockRotation is True or False and the array dofrot
     #
     #    honestly speaking this would be simplified like this:
     #    if LockRotation:
     #        dofpos = []
     #        dofrot = []
     #    else:
     #        dofpos = []
     #        dofrot = AxisAlignment(ConstraintAxis, dofrot)
     if self.lockRotation:
         return [], []
     else:
         tmpaxis = cleanAxis(create_Axis2Points(self.refPoint,self.refAxisEnd))
         return [], AxisAlignment(tmpaxis,_dofRot)
Beispiel #5
0
 def calcDOF(self, _dofPos, _dofRot, _pointconstraints=[]):
     #AngleBetweenPlanesConstraint
     #    AngleAlignment()   needs to know the axis normal to plane constrained (stored in dep as refpoint and refAxisEnd) and the dofrot array
     tmpaxis = cleanAxis(create_Axis2Points(self.refPoint, self.refAxisEnd))
     tmpaxis.Direction.Length = 2.0
     return _dofPos, AngleAlignment(tmpaxis, _dofRot)