def ortonormal_axis(axis_1, axis_2, axis_3):
    if (fc_isperp(axis_1, axis_2) == 0) or (fc_isperp(
            axis_2, axis_3) == 0) or (fc_isperp(axis_1, axis_3) == 0):
        axis_message()
        return False
    else:
        return True
    def accept(self):
        self.v.removeEventCallback("SoEvent", self.track)

        for obj in FreeCAD.ActiveDocument.Objects:
            if 'Point_d_w_h' == obj.Name:
                FreeCAD.ActiveDocument.removeObject('Point_d_w_h')

        pos = FreeCAD.Vector(self.ThLed30.pos_x.value(),
                             self.ThLed30.pos_y.value(),
                             self.ThLed30.pos_z.value())
        axis_w = FreeCAD.Vector(self.ThLed30.axis_w_x.value(),
                                self.ThLed30.axis_w_y.value(),
                                self.ThLed30.axis_w_z.value())
        axis_h = FreeCAD.Vector(self.ThLed30.axis_h_x.value(),
                                self.ThLed30.axis_h_y.value(),
                                self.ThLed30.axis_h_z.value())

        if fc_isperp(axis_w, axis_h) == 1:
            ThLed30(
                fc_axis=axis_w,  # VY,
                fc_axis_cable=axis_h,  # VZN,
                pos=pos,
                name='thled30')

            FreeCADGui.activeDocument().activeView().viewAxonometric()
            FreeCADGui.Control.closeDialog()  # close the dialog
            FreeCADGui.SendMsgToActiveView("ViewFit")
        else:
            axis_message()
Example #3
0
    def accept(self):
        self.v.removeEventCallback("SoEvent",self.track)

        for obj in FreeCAD.ActiveDocument.Objects:
            if 'Point_d_w_h' == obj.Name:
                FreeCAD.ActiveDocument.removeObject('Point_d_w_h')

        length = self.BreadBoard.len.value()
        width = self.BreadBoard.wid.value()
        pos = FreeCAD.Vector(self.BreadBoard.pos_x.value(), self.BreadBoard.pos_y.value(), self.BreadBoard.pos_z.value())
        axis_w = FreeCAD.Vector(self.BreadBoard.axis_w_x.value(),self.BreadBoard.axis_w_y.value(),self.BreadBoard.axis_w_z.value())
        axis_h = FreeCAD.Vector(self.BreadBoard.axis_h_x.value(),self.BreadBoard.axis_h_y.value(),self.BreadBoard.axis_h_z.value())
        
        if fc_isperp(axis_w,axis_h) == 1:
            f_breadboard(kcomp_optic.BREAD_BOARD_M,
                                    length,
                                    width,
                                    cl = 1,
                                    cw = 1,
                                    ch = 1,
                                    fc_dir_h = axis_h ,#VZ,
                                    fc_dir_w = axis_w ,#VY,
                                    pos = pos,
                                    name = 'breadboard')
            
            FreeCADGui.activeDocument().activeView().viewAxonometric()
            FreeCADGui.Control.closeDialog() #close the dialog
            FreeCADGui.SendMsgToActiveView("ViewFit")
        else:
            axis_message()