Ejemplo n.º 1
0
    def writeJoint(self):
        App.Console.PrintMessage("write:")

        pconst = ""
        rconst = ""
        for count in range(0, 3):
            if self.Object.pos_constraint[
                    count] == False and self.Object.vel_constraint[
                        count] == True:
                pconst = pconst + " velocity,"
            elif self.Object.pos_constraint[
                    count] == False and self.Object.vel_constraint[
                        count] == False:
                pconst = pconst + " inactive,"
            else:
                pconst = pconst + " active,"
            if self.Object.rot_constraint[
                    count] == False and self.Object.angvel_constraint[
                        count] == True:
                rconst = rconst + " angular velocity,"
            elif self.Object.rot_constraint[
                    count] == False and self.Object.angvel_constraint[
                        count] == False:
                rconst = rconst + " inactive,"
            else:
                rconst = rconst + " active,"

        line = ("        joint: {}, total joint,\n"
                "                {},\n"
                "                        position, {},\n"
                "                        position orientation, {},\n"
                "                        rotation orientation, {},\n"
                "                {},\n"
                "                        position, {},\n"
                "                        position orientation, {},\n"
                "                        rotation orientation, {},\n"
                "                position constraint, {} null,\n"
                "                orientation constraint, {} null;\n").format(
                    self.Object.joint_label, self.Object.node1_label,
                    writeVect(self.Object.position1),
                    writeOrientationMatrix(self.Object.pos_orientation_des1,
                                           self.Object.pos_orientation1),
                    writeOrientationMatrix(self.Object.rot_orientation_des1,
                                           self.Object.rot_orientation1),
                    self.Object.node2_label, writeVect(self.Object.position2),
                    writeOrientationMatrix(self.Object.pos_orientation_des2,
                                           self.Object.pos_orientation2),
                    writeOrientationMatrix(self.Object.rot_orientation_des2,
                                           self.Object.rot_orientation2),
                    pconst, rconst)
        return line
Ejemplo n.º 2
0
    def writeJoint(self):
        #        writeVect(App.Vector(1,0,0))
        #        line = ("        joint: ").format(self.Object.joint_label, self.Object.node1_label)

        line = ("        joint: {}, prismatic,\n"
                "                {},\n"
                "                {},\n"
                "                {},\n"
                "                {};\n").format(
                    self.Object.joint_label, self.Object.node1_label,
                    writeOrientationMatrix(self.Object.orientation_des1,
                                           self.Object.orientation1),
                    self.Object.node2_label,
                    writeOrientationMatrix(self.Object.orientation_des2,
                                           self.Object.orientation2))
        return line
Ejemplo n.º 3
0
    def writeJoint(self):
        #        writeVect(App.Vector(1,0,0))
        #        line = ("        joint: ").format(self.Object.joint_label, self.Object.node1_label)

        line = ("        joint: {}, revolute pin,\n"
                "                {},\n"
                "                {},\n"
                "                hinge, {},\n"
                "                {},\n"
                "                hinge, {};\n").format(
                    self.Object.joint_label, self.Object.node1_label,
                    writeVect(self.Object.position1),
                    writeOrientationMatrix(self.Object.orientation_des1,
                                           self.Object.orientation1),
                    writeVect(self.Object.positionf),
                    writeOrientationMatrix(self.Object.orientation_desf,
                                           self.Object.orientationf))

        return line