diff --git a/WorkFeature/Doc/WF_documentation.pdf b/WorkFeature/Doc/WF_documentation.pdf new file mode 100644 index 0000000..5749aa2 Binary files /dev/null and b/WorkFeature/Doc/WF_documentation.pdf differ diff --git a/WorkFeature/WFGui_2015.py b/WorkFeature/WFGui_2015.py index dd38c36..98ca6bf 100644 --- a/WorkFeature/WFGui_2015.py +++ b/WorkFeature/WFGui_2015.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'WFGui_2015_02_25.ui' +# Form implementation generated from reading ui file 'WFGui_2015_03_08.ui' # -# Created: Wed Feb 25 10:08:21 2015 +# Created: Sun Mar 8 15:24:14 2015 # by: PySide UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! @@ -17,7 +17,7 @@ except AttributeError: class Ui_Form(object): def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form")) - Form.resize(386, 767) + Form.resize(387, 838) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_Axes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) Form.setWindowIcon(icon) @@ -38,7 +38,7 @@ class Ui_Form(object): self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName(_fromUtf8("scrollArea")) self.scrollAreaWidgetContents_2 = QtGui.QWidget() - self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 350, 765)) + self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 351, 813)) self.scrollAreaWidgetContents_2.setObjectName(_fromUtf8("scrollAreaWidgetContents_2")) self.gridLayout_4 = QtGui.QGridLayout(self.scrollAreaWidgetContents_2) self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) @@ -47,8 +47,8 @@ class Ui_Form(object): self.tabWidget_0.setObjectName(_fromUtf8("tabWidget_0")) self.tab_2 = QtGui.QWidget() self.tab_2.setObjectName(_fromUtf8("tab_2")) - self.gridLayout_22 = QtGui.QGridLayout(self.tab_2) - self.gridLayout_22.setObjectName(_fromUtf8("gridLayout_22")) + self.gridLayout_30 = QtGui.QGridLayout(self.tab_2) + self.gridLayout_30.setObjectName(_fromUtf8("gridLayout_30")) self.tabWidget = QtGui.QTabWidget(self.tab_2) self.tabWidget.setTabPosition(QtGui.QTabWidget.West) self.tabWidget.setObjectName(_fromUtf8("tabWidget")) @@ -74,9 +74,19 @@ class Ui_Form(object): self.radioButton_verbose = QtGui.QRadioButton(self.groupBox_5) self.radioButton_verbose.setObjectName(_fromUtf8("radioButton_verbose")) self.gridLayout_7.addWidget(self.radioButton_verbose, 0, 0, 1, 1) + self.horizontalLayout_25 = QtGui.QHBoxLayout() + self.horizontalLayout_25.setObjectName(_fromUtf8("horizontalLayout_25")) + self.label_5 = QtGui.QLabel(self.groupBox_5) + self.label_5.setObjectName(_fromUtf8("label_5")) + self.horizontalLayout_25.addWidget(self.label_5) + self.tolerance_edit = QtGui.QLineEdit(self.groupBox_5) + self.tolerance_edit.setMaximumSize(QtCore.QSize(60, 16777215)) + self.tolerance_edit.setObjectName(_fromUtf8("tolerance_edit")) + self.horizontalLayout_25.addWidget(self.tolerance_edit) + self.gridLayout_7.addLayout(self.horizontalLayout_25, 1, 0, 1, 1) self.gridLayout_14.addWidget(self.groupBox_5, 0, 0, 1, 1) self.gridLayout_31.addWidget(self.frame_3, 1, 0, 1, 1) - spacerItem1 = QtGui.QSpacerItem(20, 539, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_31.addItem(spacerItem1, 2, 0, 1, 1) self.tabWidget.addTab(self.Origin_Tab, icon, _fromUtf8("")) self.Point_Tab = QtGui.QWidget() @@ -223,15 +233,15 @@ class Ui_Form(object): self.tabWidget.addTab(self.Point_Tab, icon15, _fromUtf8("")) self.Axis_Tab = QtGui.QWidget() self.Axis_Tab.setObjectName(_fromUtf8("Axis_Tab")) - self.gridLayout_30 = QtGui.QGridLayout(self.Axis_Tab) - self.gridLayout_30.setObjectName(_fromUtf8("gridLayout_30")) + self.gridLayout_22 = QtGui.QGridLayout(self.Axis_Tab) + self.gridLayout_22.setObjectName(_fromUtf8("gridLayout_22")) self.button_object_axis = QtGui.QPushButton(self.Axis_Tab) icon16 = QtGui.QIcon() icon16.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_centerObjectsAxes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.button_object_axis.setIcon(icon16) self.button_object_axis.setIconSize(QtCore.QSize(32, 32)) self.button_object_axis.setObjectName(_fromUtf8("button_object_axis")) - self.gridLayout_30.addWidget(self.button_object_axis, 0, 0, 1, 1) + self.gridLayout_22.addWidget(self.button_object_axis, 0, 0, 1, 1) self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) self.button_twopoints_axis = QtGui.QPushButton(self.Axis_Tab) @@ -250,7 +260,7 @@ class Ui_Form(object): self.extension_twopoints_axis.setMaximumSize(QtCore.QSize(40, 16777215)) self.extension_twopoints_axis.setObjectName(_fromUtf8("extension_twopoints_axis")) self.horizontalLayout_2.addWidget(self.extension_twopoints_axis) - self.gridLayout_30.addLayout(self.horizontalLayout_2, 1, 0, 1, 1) + self.gridLayout_22.addLayout(self.horizontalLayout_2, 1, 0, 1, 1) self.horizontalLayout_5 = QtGui.QHBoxLayout() self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5")) self.verticalLayout = QtGui.QVBoxLayout() @@ -298,7 +308,7 @@ class Ui_Form(object): self.extension_face_normal.setObjectName(_fromUtf8("extension_face_normal")) self.gridLayout.addWidget(self.extension_face_normal, 0, 0, 1, 1) self.horizontalLayout_5.addWidget(self.frame_4) - self.gridLayout_30.addLayout(self.horizontalLayout_5, 2, 0, 1, 1) + self.gridLayout_22.addLayout(self.horizontalLayout_5, 2, 0, 1, 1) self.horizontalLayout_20 = QtGui.QHBoxLayout() self.horizontalLayout_20.setObjectName(_fromUtf8("horizontalLayout_20")) self.button_point_line_axis = QtGui.QPushButton(self.Axis_Tab) @@ -315,7 +325,7 @@ class Ui_Form(object): self.point_loc_comboBox.addItem(_fromUtf8("")) self.point_loc_comboBox.addItem(_fromUtf8("")) self.horizontalLayout_20.addWidget(self.point_loc_comboBox) - self.gridLayout_30.addLayout(self.horizontalLayout_20, 3, 0, 1, 1) + self.gridLayout_22.addLayout(self.horizontalLayout_20, 3, 0, 1, 1) self.horizontalLayout_7 = QtGui.QHBoxLayout() self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7")) self.button_line_point_axis = QtGui.QPushButton(self.Axis_Tab) @@ -334,20 +344,27 @@ class Ui_Form(object): self.extension_line_point_axis.setMaximumSize(QtCore.QSize(40, 16777215)) self.extension_line_point_axis.setObjectName(_fromUtf8("extension_line_point_axis")) self.horizontalLayout_7.addWidget(self.extension_line_point_axis) - self.gridLayout_30.addLayout(self.horizontalLayout_7, 4, 0, 1, 1) + self.gridLayout_22.addLayout(self.horizontalLayout_7, 4, 0, 1, 1) self.button_twolines_axis = QtGui.QPushButton(self.Axis_Tab) icon23 = QtGui.QIcon() icon23.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_twoLinesAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.button_twolines_axis.setIcon(icon23) self.button_twolines_axis.setIconSize(QtCore.QSize(32, 32)) self.button_twolines_axis.setObjectName(_fromUtf8("button_twolines_axis")) - self.gridLayout_30.addWidget(self.button_twolines_axis, 5, 0, 1, 1) + self.gridLayout_22.addWidget(self.button_twolines_axis, 5, 0, 1, 1) + self.button_plane_point_line_axis = QtGui.QPushButton(self.Axis_Tab) + icon24 = QtGui.QIcon() + icon24.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_planeLinePointAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_plane_point_line_axis.setIcon(icon24) + self.button_plane_point_line_axis.setIconSize(QtCore.QSize(32, 32)) + self.button_plane_point_line_axis.setObjectName(_fromUtf8("button_plane_point_line_axis")) + self.gridLayout_22.addWidget(self.button_plane_point_line_axis, 6, 0, 1, 1) self.horizontalLayout_21 = QtGui.QHBoxLayout() self.horizontalLayout_21.setObjectName(_fromUtf8("horizontalLayout_21")) self.button_cut_axis = QtGui.QPushButton(self.Axis_Tab) - icon24 = QtGui.QIcon() - icon24.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_cutAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_cut_axis.setIcon(icon24) + icon25 = QtGui.QIcon() + icon25.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_cutAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_cut_axis.setIcon(icon25) self.button_cut_axis.setIconSize(QtCore.QSize(32, 32)) self.button_cut_axis.setObjectName(_fromUtf8("button_cut_axis")) self.horizontalLayout_21.addWidget(self.button_cut_axis) @@ -359,74 +376,85 @@ class Ui_Form(object): self.spin_axis_cut.setSingleStep(1) self.spin_axis_cut.setObjectName(_fromUtf8("spin_axis_cut")) self.horizontalLayout_21.addWidget(self.spin_axis_cut) - self.gridLayout_30.addLayout(self.horizontalLayout_21, 6, 0, 1, 1) + self.gridLayout_22.addLayout(self.horizontalLayout_21, 7, 0, 1, 1) self.button_line_plane_axis = QtGui.QPushButton(self.Axis_Tab) - icon25 = QtGui.QIcon() - icon25.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_linePlaneAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_line_plane_axis.setIcon(icon25) + icon26 = QtGui.QIcon() + icon26.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_linePlaneAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_line_plane_axis.setIcon(icon26) self.button_line_plane_axis.setIconSize(QtCore.QSize(32, 32)) self.button_line_plane_axis.setObjectName(_fromUtf8("button_line_plane_axis")) - self.gridLayout_30.addWidget(self.button_line_plane_axis, 7, 0, 1, 1) + self.gridLayout_22.addWidget(self.button_line_plane_axis, 8, 0, 1, 1) self.button_twoplanes_axis = QtGui.QPushButton(self.Axis_Tab) - icon26 = QtGui.QIcon() - icon26.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_2PlanesAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_twoplanes_axis.setIcon(icon26) + icon27 = QtGui.QIcon() + icon27.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_2PlanesAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_twoplanes_axis.setIcon(icon27) self.button_twoplanes_axis.setIconSize(QtCore.QSize(32, 32)) self.button_twoplanes_axis.setObjectName(_fromUtf8("button_twoplanes_axis")) - self.gridLayout_30.addWidget(self.button_twoplanes_axis, 8, 0, 1, 1) + self.gridLayout_22.addWidget(self.button_twoplanes_axis, 9, 0, 1, 1) self.button_click_for_axis = QtGui.QRadioButton(self.Axis_Tab) - icon27 = QtGui.QIcon() - icon27.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_clickLine.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_click_for_axis.setIcon(icon27) + icon28 = QtGui.QIcon() + icon28.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_clickLine.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_click_for_axis.setIcon(icon28) self.button_click_for_axis.setIconSize(QtCore.QSize(32, 32)) self.button_click_for_axis.setObjectName(_fromUtf8("button_click_for_axis")) - self.gridLayout_30.addWidget(self.button_click_for_axis, 9, 0, 1, 1) + self.gridLayout_22.addWidget(self.button_click_for_axis, 10, 0, 1, 1) self.button_object_base_axes = QtGui.QPushButton(self.Axis_Tab) - icon28 = QtGui.QIcon() - icon28.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_baseObjectsAxes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_object_base_axes.setIcon(icon28) + icon29 = QtGui.QIcon() + icon29.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_baseObjectsAxes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_object_base_axes.setIcon(icon29) self.button_object_base_axes.setIconSize(QtCore.QSize(32, 32)) self.button_object_base_axes.setObjectName(_fromUtf8("button_object_base_axes")) - self.gridLayout_30.addWidget(self.button_object_base_axes, 10, 0, 1, 1) + self.gridLayout_22.addWidget(self.button_object_base_axes, 11, 0, 1, 1) self.button_line_to_sketch = QtGui.QPushButton(self.Axis_Tab) self.button_line_to_sketch.setIcon(icon14) self.button_line_to_sketch.setIconSize(QtCore.QSize(32, 32)) self.button_line_to_sketch.setObjectName(_fromUtf8("button_line_to_sketch")) - self.gridLayout_30.addWidget(self.button_line_to_sketch, 11, 0, 1, 1) - icon29 = QtGui.QIcon() - icon29.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_axis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.Axis_Tab, icon29, _fromUtf8("")) + self.gridLayout_22.addWidget(self.button_line_to_sketch, 12, 0, 1, 1) + icon30 = QtGui.QIcon() + icon30.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_axis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.Axis_Tab, icon30, _fromUtf8("")) self.tab_4 = QtGui.QWidget() self.tab_4.setObjectName(_fromUtf8("tab_4")) self.gridLayout_5 = QtGui.QGridLayout(self.tab_4) self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) - self.button_3points_circle = QtGui.QPushButton(self.tab_4) - icon30 = QtGui.QIcon() - icon30.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_3pointsCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_3points_circle.setIcon(icon30) - self.button_3points_circle.setIconSize(QtCore.QSize(32, 32)) - self.button_3points_circle.setObjectName(_fromUtf8("button_3points_circle")) - self.gridLayout_5.addWidget(self.button_3points_circle, 2, 0, 1, 1) - self.button_3points_ellipse = QtGui.QPushButton(self.tab_4) - icon31 = QtGui.QIcon() - icon31.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_3pointsEllipse.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_3points_ellipse.setIcon(icon31) - self.button_3points_ellipse.setIconSize(QtCore.QSize(32, 32)) - self.button_3points_ellipse.setObjectName(_fromUtf8("button_3points_ellipse")) - self.gridLayout_5.addWidget(self.button_3points_ellipse, 3, 0, 1, 1) self.button_linepoint_circle = QtGui.QPushButton(self.tab_4) - icon32 = QtGui.QIcon() - icon32.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_linePointCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_linepoint_circle.setIcon(icon32) + icon31 = QtGui.QIcon() + icon31.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_linePointCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_linepoint_circle.setIcon(icon31) self.button_linepoint_circle.setIconSize(QtCore.QSize(32, 32)) self.button_linepoint_circle.setObjectName(_fromUtf8("button_linepoint_circle")) self.gridLayout_5.addWidget(self.button_linepoint_circle, 1, 0, 1, 1) + self.horizontalLayout_24 = QtGui.QHBoxLayout() + self.horizontalLayout_24.setObjectName(_fromUtf8("horizontalLayout_24")) + self.button_cut_circle = QtGui.QPushButton(self.tab_4) + icon32 = QtGui.QIcon() + icon32.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_cutCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_cut_circle.setIcon(icon32) + self.button_cut_circle.setIconSize(QtCore.QSize(32, 32)) + self.button_cut_circle.setObjectName(_fromUtf8("button_cut_circle")) + self.horizontalLayout_24.addWidget(self.button_cut_circle) + self.spin_circle_cut = QtGui.QSpinBox(self.tab_4) + self.spin_circle_cut.setMinimumSize(QtCore.QSize(40, 0)) + self.spin_circle_cut.setMaximumSize(QtCore.QSize(50, 16777215)) + self.spin_circle_cut.setMinimum(2) + self.spin_circle_cut.setMaximum(10) + self.spin_circle_cut.setSingleStep(1) + self.spin_circle_cut.setObjectName(_fromUtf8("spin_circle_cut")) + self.horizontalLayout_24.addWidget(self.spin_circle_cut) + self.gridLayout_5.addLayout(self.horizontalLayout_24, 3, 0, 1, 1) + self.button_3points_circle = QtGui.QPushButton(self.tab_4) + icon33 = QtGui.QIcon() + icon33.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_3pointsCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_3points_circle.setIcon(icon33) + self.button_3points_circle.setIconSize(QtCore.QSize(32, 32)) + self.button_3points_circle.setObjectName(_fromUtf8("button_3points_circle")) + self.gridLayout_5.addWidget(self.button_3points_circle, 2, 0, 1, 1) self.horizontalLayout_11 = QtGui.QHBoxLayout() self.horizontalLayout_11.setObjectName(_fromUtf8("horizontalLayout_11")) self.button_linecenter_circle = QtGui.QPushButton(self.tab_4) - icon33 = QtGui.QIcon() - icon33.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_lineCenterCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_linecenter_circle.setIcon(icon33) + icon34 = QtGui.QIcon() + icon34.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_lineCenterCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_linecenter_circle.setIcon(icon34) self.button_linecenter_circle.setIconSize(QtCore.QSize(32, 32)) self.button_linecenter_circle.setObjectName(_fromUtf8("button_linecenter_circle")) self.horizontalLayout_11.addWidget(self.button_linecenter_circle) @@ -436,58 +464,43 @@ class Ui_Form(object): self.radius_circle.setObjectName(_fromUtf8("radius_circle")) self.horizontalLayout_11.addWidget(self.radius_circle) self.gridLayout_5.addLayout(self.horizontalLayout_11, 0, 0, 1, 1) + self.button_3points_ellipse = QtGui.QPushButton(self.tab_4) + icon35 = QtGui.QIcon() + icon35.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_3pointsEllipse.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_3points_ellipse.setIcon(icon35) + self.button_3points_ellipse.setIconSize(QtCore.QSize(32, 32)) + self.button_3points_ellipse.setObjectName(_fromUtf8("button_3points_ellipse")) + self.gridLayout_5.addWidget(self.button_3points_ellipse, 4, 0, 1, 1) spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_5.addItem(spacerItem2, 4, 0, 1, 1) - icon34 = QtGui.QIcon() - icon34.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_circle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.tab_4, icon34, _fromUtf8("")) + self.gridLayout_5.addItem(spacerItem2, 5, 0, 1, 1) + icon36 = QtGui.QIcon() + icon36.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_circle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.tab_4, icon36, _fromUtf8("")) self.Plane_Tab = QtGui.QWidget() self.Plane_Tab.setObjectName(_fromUtf8("Plane_Tab")) self.gridLayout_9 = QtGui.QGridLayout(self.Plane_Tab) self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) self.button_axis_point_plane = QtGui.QPushButton(self.Plane_Tab) - icon35 = QtGui.QIcon() - icon35.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_linePointPlane2.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_axis_point_plane.setIcon(icon35) + icon37 = QtGui.QIcon() + icon37.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_linePointPlane2.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_axis_point_plane.setIcon(icon37) self.button_axis_point_plane.setIconSize(QtCore.QSize(32, 32)) self.button_axis_point_plane.setObjectName(_fromUtf8("button_axis_point_plane")) self.gridLayout_9.addWidget(self.button_axis_point_plane, 2, 0, 1, 1) self.button_axisandpoint_plane = QtGui.QPushButton(self.Plane_Tab) - icon36 = QtGui.QIcon() - icon36.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_linePointPlane.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_axisandpoint_plane.setIcon(icon36) + icon38 = QtGui.QIcon() + icon38.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_linePointPlane.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_axisandpoint_plane.setIcon(icon38) self.button_axisandpoint_plane.setIconSize(QtCore.QSize(32, 32)) self.button_axisandpoint_plane.setObjectName(_fromUtf8("button_axisandpoint_plane")) self.gridLayout_9.addWidget(self.button_axisandpoint_plane, 1, 0, 1, 1) - self.button_object_center_planes = QtGui.QPushButton(self.Plane_Tab) - icon37 = QtGui.QIcon() - icon37.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_centerObjectsPlanes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_object_center_planes.setIcon(icon37) - self.button_object_center_planes.setIconSize(QtCore.QSize(32, 32)) - self.button_object_center_planes.setObjectName(_fromUtf8("button_object_center_planes")) - self.gridLayout_9.addWidget(self.button_object_center_planes, 9, 0, 1, 1) self.button_threepoints_plane = QtGui.QPushButton(self.Plane_Tab) - icon38 = QtGui.QIcon() - icon38.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_threePointsPlane.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_threepoints_plane.setIcon(icon38) + icon39 = QtGui.QIcon() + icon39.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_threePointsPlane.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_threepoints_plane.setIcon(icon39) self.button_threepoints_plane.setIconSize(QtCore.QSize(32, 32)) self.button_threepoints_plane.setObjectName(_fromUtf8("button_threepoints_plane")) self.gridLayout_9.addWidget(self.button_threepoints_plane, 0, 0, 1, 1) - self.gridLayout_16 = QtGui.QGridLayout() - self.gridLayout_16.setObjectName(_fromUtf8("gridLayout_16")) - self.button_planeandpoint_plane = QtGui.QPushButton(self.Plane_Tab) - icon39 = QtGui.QIcon() - icon39.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_pointPlanePoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_planeandpoint_plane.setIcon(icon39) - self.button_planeandpoint_plane.setIconSize(QtCore.QSize(32, 32)) - self.button_planeandpoint_plane.setObjectName(_fromUtf8("button_planeandpoint_plane")) - self.gridLayout_16.addWidget(self.button_planeandpoint_plane, 0, 0, 1, 1) - self.extension_planePointPlane = QtGui.QLineEdit(self.Plane_Tab) - self.extension_planePointPlane.setMinimumSize(QtCore.QSize(40, 0)) - self.extension_planePointPlane.setMaximumSize(QtCore.QSize(60, 16777215)) - self.extension_planePointPlane.setObjectName(_fromUtf8("extension_planePointPlane")) - self.gridLayout_16.addWidget(self.extension_planePointPlane, 0, 1, 1, 1) - self.gridLayout_9.addLayout(self.gridLayout_16, 3, 0, 1, 1) self.horizontalLayout_12 = QtGui.QHBoxLayout() self.horizontalLayout_12.setObjectName(_fromUtf8("horizontalLayout_12")) self.button_face_tangent = QtGui.QPushButton(self.Plane_Tab) @@ -523,6 +536,23 @@ class Ui_Form(object): self.width_plane_2.setObjectName(_fromUtf8("width_plane_2")) self.horizontalLayout_12.addWidget(self.width_plane_2) self.gridLayout_9.addLayout(self.horizontalLayout_12, 5, 0, 1, 1) + spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_9.addItem(spacerItem3, 6, 0, 1, 1) + self.gridLayout_16 = QtGui.QGridLayout() + self.gridLayout_16.setObjectName(_fromUtf8("gridLayout_16")) + self.button_planeandpoint_plane = QtGui.QPushButton(self.Plane_Tab) + icon41 = QtGui.QIcon() + icon41.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_pointPlanePoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_planeandpoint_plane.setIcon(icon41) + self.button_planeandpoint_plane.setIconSize(QtCore.QSize(32, 32)) + self.button_planeandpoint_plane.setObjectName(_fromUtf8("button_planeandpoint_plane")) + self.gridLayout_16.addWidget(self.button_planeandpoint_plane, 0, 0, 1, 1) + self.extension_planePointPlane = QtGui.QLineEdit(self.Plane_Tab) + self.extension_planePointPlane.setMinimumSize(QtCore.QSize(40, 0)) + self.extension_planePointPlane.setMaximumSize(QtCore.QSize(60, 16777215)) + self.extension_planePointPlane.setObjectName(_fromUtf8("extension_planePointPlane")) + self.gridLayout_16.addWidget(self.extension_planePointPlane, 0, 1, 1, 1) + self.gridLayout_9.addLayout(self.gridLayout_16, 3, 0, 1, 1) self.gridLayout_8 = QtGui.QGridLayout() self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) self.button_planeandaxis_plane = QtGui.QPushButton(self.Plane_Tab) @@ -531,9 +561,9 @@ class Ui_Form(object): sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.button_planeandaxis_plane.sizePolicy().hasHeightForWidth()) self.button_planeandaxis_plane.setSizePolicy(sizePolicy) - icon41 = QtGui.QIcon() - icon41.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_planeLinePlane.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_planeandaxis_plane.setIcon(icon41) + icon42 = QtGui.QIcon() + icon42.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_planeLinePlane.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_planeandaxis_plane.setIcon(icon42) self.button_planeandaxis_plane.setIconSize(QtCore.QSize(32, 32)) self.button_planeandaxis_plane.setObjectName(_fromUtf8("button_planeandaxis_plane")) self.gridLayout_8.addWidget(self.button_planeandaxis_plane, 0, 0, 1, 1) @@ -548,8 +578,15 @@ class Ui_Form(object): self.angle_planeandaxis_plane.setObjectName(_fromUtf8("angle_planeandaxis_plane")) self.gridLayout_8.addWidget(self.angle_planeandaxis_plane, 0, 1, 1, 1) self.gridLayout_9.addLayout(self.gridLayout_8, 4, 0, 1, 1) - spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_9.addItem(spacerItem3, 8, 0, 1, 1) + self.button_object_center_planes = QtGui.QPushButton(self.Plane_Tab) + icon43 = QtGui.QIcon() + icon43.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_centerObjectsPlanes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_object_center_planes.setIcon(icon43) + self.button_object_center_planes.setIconSize(QtCore.QSize(32, 32)) + self.button_object_center_planes.setObjectName(_fromUtf8("button_object_center_planes")) + self.gridLayout_9.addWidget(self.button_object_center_planes, 9, 0, 1, 1) + spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_9.addItem(spacerItem4, 8, 0, 1, 1) self.horizontalLayout_3 = QtGui.QHBoxLayout() self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) self.button_click_for_plane = QtGui.QPushButton(self.Plane_Tab) @@ -558,9 +595,9 @@ class Ui_Form(object): sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.button_click_for_plane.sizePolicy().hasHeightForWidth()) self.button_click_for_plane.setSizePolicy(sizePolicy) - icon42 = QtGui.QIcon() - icon42.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_clickPlane.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_click_for_plane.setIcon(icon42) + icon44 = QtGui.QIcon() + icon44.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_clickPlane.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_click_for_plane.setIcon(icon44) self.button_click_for_plane.setIconSize(QtCore.QSize(32, 32)) self.button_click_for_plane.setObjectName(_fromUtf8("button_click_for_plane")) self.horizontalLayout_3.addWidget(self.button_click_for_plane) @@ -585,11 +622,9 @@ class Ui_Form(object): self.width_plane.setObjectName(_fromUtf8("width_plane")) self.horizontalLayout_3.addWidget(self.width_plane) self.gridLayout_9.addLayout(self.horizontalLayout_3, 7, 0, 1, 1) - spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_9.addItem(spacerItem4, 6, 0, 1, 1) - icon43 = QtGui.QIcon() - icon43.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_plane.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.Plane_Tab, icon43, _fromUtf8("")) + icon45 = QtGui.QIcon() + icon45.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_plane.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.Plane_Tab, icon45, _fromUtf8("")) self.Objects_Tab2 = QtGui.QWidget() self.Objects_Tab2.setEnabled(True) self.Objects_Tab2.setMinimumSize(QtCore.QSize(0, 0)) @@ -599,9 +634,9 @@ class Ui_Form(object): self.gridLayout_6 = QtGui.QGridLayout() self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) self.button_cylinder_create = QtGui.QPushButton(self.Objects_Tab2) - icon44 = QtGui.QIcon() - icon44.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_cylinder.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_cylinder_create.setIcon(icon44) + icon46 = QtGui.QIcon() + icon46.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_cylinder.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_cylinder_create.setIcon(icon46) self.button_cylinder_create.setIconSize(QtCore.QSize(32, 32)) self.button_cylinder_create.setObjectName(_fromUtf8("button_cylinder_create")) self.gridLayout_6.addWidget(self.button_cylinder_create, 0, 0, 1, 1) @@ -629,9 +664,9 @@ class Ui_Form(object): self.horizontalLayout_4 = QtGui.QHBoxLayout() self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) self.button_cube_create = QtGui.QPushButton(self.Objects_Tab2) - icon45 = QtGui.QIcon() - icon45.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_cube.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_cube_create.setIcon(icon45) + icon47 = QtGui.QIcon() + icon47.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_cube.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_cube_create.setIcon(icon47) self.button_cube_create.setIconSize(QtCore.QSize(32, 32)) self.button_cube_create.setObjectName(_fromUtf8("button_cube_create")) self.horizontalLayout_4.addWidget(self.button_cube_create) @@ -657,18 +692,18 @@ class Ui_Form(object): self.horizontalLayout_4.addWidget(self.height_cube) self.gridLayout_12.addLayout(self.horizontalLayout_4, 4, 0, 1, 1) self.button_boundingboxes = QtGui.QPushButton(self.Objects_Tab2) - icon46 = QtGui.QIcon() - icon46.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_boundingBoxes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_boundingboxes.setIcon(icon46) + icon48 = QtGui.QIcon() + icon48.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_boundingBoxes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_boundingboxes.setIcon(icon48) self.button_boundingboxes.setIconSize(QtCore.QSize(32, 32)) self.button_boundingboxes.setObjectName(_fromUtf8("button_boundingboxes")) self.gridLayout_12.addWidget(self.button_boundingboxes, 0, 0, 1, 1) spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_12.addItem(spacerItem5, 5, 0, 1, 1) self.button_boundingbox = QtGui.QPushButton(self.Objects_Tab2) - icon47 = QtGui.QIcon() - icon47.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_boundingBox.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_boundingbox.setIcon(icon47) + icon49 = QtGui.QIcon() + icon49.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_boundingBox.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_boundingbox.setIcon(icon49) self.button_boundingbox.setIconSize(QtCore.QSize(32, 32)) self.button_boundingbox.setObjectName(_fromUtf8("button_boundingbox")) self.gridLayout_12.addWidget(self.button_boundingbox, 1, 0, 1, 1) @@ -680,9 +715,9 @@ class Ui_Form(object): self.line.setFrameShadow(QtGui.QFrame.Sunken) self.line.setObjectName(_fromUtf8("line")) self.gridLayout_12.addWidget(self.line, 2, 0, 1, 1) - icon48 = QtGui.QIcon() - icon48.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_box.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.Objects_Tab2, icon48, _fromUtf8("")) + icon50 = QtGui.QIcon() + icon50.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_box.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.Objects_Tab2, icon50, _fromUtf8("")) self.View_Tab = QtGui.QWidget() self.View_Tab.setObjectName(_fromUtf8("View_Tab")) self.gridLayout_13 = QtGui.QGridLayout(self.View_Tab) @@ -693,17 +728,17 @@ class Ui_Form(object): sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.button_alignview.sizePolicy().hasHeightForWidth()) self.button_alignview.setSizePolicy(sizePolicy) - icon49 = QtGui.QIcon() - icon49.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlign.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_alignview.setIcon(icon49) + icon51 = QtGui.QIcon() + icon51.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlign.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_alignview.setIcon(icon51) self.button_alignview.setIconSize(QtCore.QSize(32, 32)) self.button_alignview.setObjectName(_fromUtf8("button_alignview")) self.gridLayout_13.addWidget(self.button_alignview, 0, 0, 1, 1) spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_13.addItem(spacerItem6, 1, 0, 1, 1) - icon50 = QtGui.QIcon() - icon50.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_view.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.View_Tab, icon50, _fromUtf8("")) + icon52 = QtGui.QIcon() + icon52.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_view.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.View_Tab, icon52, _fromUtf8("")) self.Modif_Tab = QtGui.QWidget() self.Modif_Tab.setObjectName(_fromUtf8("Modif_Tab")) self.gridLayout_11 = QtGui.QGridLayout(self.Modif_Tab) @@ -826,30 +861,30 @@ class Ui_Form(object): self.gridLayout_35 = QtGui.QGridLayout(self.tab_3) self.gridLayout_35.setObjectName(_fromUtf8("gridLayout_35")) self.button_isPerpendicular = QtGui.QPushButton(self.tab_3) - icon51 = QtGui.QIcon() - icon51.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isPerpendicular.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isPerpendicular.setIcon(icon51) + icon53 = QtGui.QIcon() + icon53.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isPerpendicular.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isPerpendicular.setIcon(icon53) self.button_isPerpendicular.setIconSize(QtCore.QSize(32, 32)) self.button_isPerpendicular.setObjectName(_fromUtf8("button_isPerpendicular")) self.gridLayout_35.addWidget(self.button_isPerpendicular, 1, 0, 1, 1) self.button_isParallel = QtGui.QPushButton(self.tab_3) - icon52 = QtGui.QIcon() - icon52.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isParallel.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isParallel.setIcon(icon52) + icon54 = QtGui.QIcon() + icon54.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isParallel.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isParallel.setIcon(icon54) self.button_isParallel.setIconSize(QtCore.QSize(32, 32)) self.button_isParallel.setObjectName(_fromUtf8("button_isParallel")) self.gridLayout_35.addWidget(self.button_isParallel, 0, 0, 1, 1) self.button_isCoplanar = QtGui.QPushButton(self.tab_3) - icon53 = QtGui.QIcon() - icon53.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isCoplanar.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isCoplanar.setIcon(icon53) + icon55 = QtGui.QIcon() + icon55.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isCoplanar.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isCoplanar.setIcon(icon55) self.button_isCoplanar.setIconSize(QtCore.QSize(32, 32)) self.button_isCoplanar.setObjectName(_fromUtf8("button_isCoplanar")) self.gridLayout_35.addWidget(self.button_isCoplanar, 2, 0, 1, 1) spacerItem9 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_35.addItem(spacerItem9, 3, 0, 1, 1) self.tabWidget.addTab(self.tab_3, _fromUtf8("")) - self.gridLayout_22.addWidget(self.tabWidget, 0, 1, 1, 1) + self.gridLayout_30.addWidget(self.tabWidget, 0, 0, 1, 1) self.tabWidget_0.addTab(self.tab_2, _fromUtf8("")) self.gridLayout_4.addWidget(self.tabWidget_0, 0, 0, 1, 1) self.scrollArea.setWidget(self.scrollAreaWidgetContents_2) @@ -857,7 +892,7 @@ class Ui_Form(object): self.retranslateUi(Form) self.tabWidget_0.setCurrentIndex(0) - self.tabWidget.setCurrentIndex(8) + self.tabWidget.setCurrentIndex(1) self.point_loc_comboBox.setCurrentIndex(1) self.tabWidget_2.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(Form) @@ -871,6 +906,8 @@ class Ui_Form(object): self.groupBox_5.setTitle(QtGui.QApplication.translate("Form", "Preferences :", None, QtGui.QApplication.UnicodeUTF8)) self.radioButton_verbose.setToolTip(QtGui.QApplication.translate("Form", "Toggle here if you want a lot of information printed into report View.", None, QtGui.QApplication.UnicodeUTF8)) self.radioButton_verbose.setText(QtGui.QApplication.translate("Form", "Verbose", None, QtGui.QApplication.UnicodeUTF8)) + self.label_5.setText(QtGui.QApplication.translate("Form", "Tolerance", None, QtGui.QApplication.UnicodeUTF8)) + self.tolerance_edit.setText(QtGui.QApplication.translate("Form", "1e-10", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.Origin_Tab), QtGui.QApplication.translate("Form", "Ori. Pref.", None, QtGui.QApplication.UnicodeUTF8)) self.button_object_center.setToolTip(QtGui.QApplication.translate("Form", "Create a Point at center location of all selected Object(s).\n" " if BBox is not toggled\n" @@ -941,7 +978,8 @@ class Ui_Form(object): " If zero In case of cylinder axis the extension will be a percentage of the object length.\n" " If zero and plane of face Normal, the extension will be 10 units.", None, QtGui.QApplication.UnicodeUTF8)) self.extension_face_normal.setText(QtGui.QApplication.translate("Form", "0.0", None, QtGui.QApplication.UnicodeUTF8)) - self.button_point_line_axis.setToolTip(QtGui.QApplication.translate("Form", "Create an Axis parallel to an Axis and crossing a Point.", None, QtGui.QApplication.UnicodeUTF8)) + self.button_point_line_axis.setToolTip(QtGui.QApplication.translate("Form", "Create an Axis Parallel to an Axis and crossing a Point.\n" +"-Select one Axis and one Point NOT on the previous Axis.", None, QtGui.QApplication.UnicodeUTF8)) self.button_point_line_axis.setText(QtGui.QApplication.translate("Form", "Axis=(Point,Axis)", None, QtGui.QApplication.UnicodeUTF8)) self.point_loc_comboBox.setToolTip(QtGui.QApplication.translate("Form", "The Point will be at :\n" "Start of the line;\n" @@ -950,12 +988,17 @@ class Ui_Form(object): self.point_loc_comboBox.setItemText(0, QtGui.QApplication.translate("Form", "Start", None, QtGui.QApplication.UnicodeUTF8)) self.point_loc_comboBox.setItemText(1, QtGui.QApplication.translate("Form", "Mid", None, QtGui.QApplication.UnicodeUTF8)) self.point_loc_comboBox.setItemText(2, QtGui.QApplication.translate("Form", "End", None, QtGui.QApplication.UnicodeUTF8)) - self.button_line_point_axis.setToolTip(QtGui.QApplication.translate("Form", "Create an Axis perpendicular to an Axis and crossing a Point.", None, QtGui.QApplication.UnicodeUTF8)) + self.button_line_point_axis.setToolTip(QtGui.QApplication.translate("Form", "Create an Axis Perpendicular to an Axis and crossing a Point\n" +"-Select one Axis and one Point NOT on the previous Axis.", None, QtGui.QApplication.UnicodeUTF8)) self.button_line_point_axis.setText(QtGui.QApplication.translate("Form", "Axis=(Axis,Point)", None, QtGui.QApplication.UnicodeUTF8)) self.extension_line_point_axis.setToolTip(QtGui.QApplication.translate("Form", "Distance for the extensions on extrema.", None, QtGui.QApplication.UnicodeUTF8)) self.extension_line_point_axis.setText(QtGui.QApplication.translate("Form", "0.0", None, QtGui.QApplication.UnicodeUTF8)) - self.button_twolines_axis.setToolTip(QtGui.QApplication.translate("Form", "Create an Axis between 2 Axes.", None, QtGui.QApplication.UnicodeUTF8)) + self.button_twolines_axis.setToolTip(QtGui.QApplication.translate("Form", "Create an Axis between two Axes.\n" +"-Select two Axes.", None, QtGui.QApplication.UnicodeUTF8)) self.button_twolines_axis.setText(QtGui.QApplication.translate("Form", "Axis=(Line,Line)", None, QtGui.QApplication.UnicodeUTF8)) + self.button_plane_point_line_axis.setToolTip(QtGui.QApplication.translate("Form", "Create an Axis Perpendicular to an Axis, crossing a Point and Parallel to a Plane.\n" +"-Select one Plane, one Axis and one Point ON the previous Axis.", None, QtGui.QApplication.UnicodeUTF8)) + self.button_plane_point_line_axis.setText(QtGui.QApplication.translate("Form", "Axis=(Plane,Point,Axis)", None, QtGui.QApplication.UnicodeUTF8)) self.button_cut_axis.setToolTip(QtGui.QApplication.translate("Form", "Create Axes:\n" "Cut the selected Line in 2(n) parts and create 2(n) Axes.\n" "The number indicates in how many parts to cut.", None, QtGui.QApplication.UnicodeUTF8)) @@ -977,32 +1020,34 @@ class Ui_Form(object): "Then click on this button.", None, QtGui.QApplication.UnicodeUTF8)) self.button_line_to_sketch.setText(QtGui.QApplication.translate("Form", "Axis(es) to Sketch", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.Axis_Tab), QtGui.QApplication.translate("Form", "Axis", None, QtGui.QApplication.UnicodeUTF8)) - self.button_3points_circle.setToolTip(QtGui.QApplication.translate("Form", "Select 3 Points to create a Circle.", None, QtGui.QApplication.UnicodeUTF8)) - self.button_3points_circle.setText(QtGui.QApplication.translate("Form", "Circle=(3 points)", None, QtGui.QApplication.UnicodeUTF8)) - self.button_3points_ellipse.setToolTip(QtGui.QApplication.translate("Form", "Select a center and 2 Points to create an Ellipse.", None, QtGui.QApplication.UnicodeUTF8)) - self.button_3points_ellipse.setText(QtGui.QApplication.translate("Form", "Ellipse=(3 points)", None, QtGui.QApplication.UnicodeUTF8)) self.button_linepoint_circle.setToolTip(QtGui.QApplication.translate("Form", "Select an Axis and a Point to create a Circle\n" "centered on the Axis and tangenting the Point.", None, QtGui.QApplication.UnicodeUTF8)) self.button_linepoint_circle.setText(QtGui.QApplication.translate("Form", "Circle=(Axis, point)", None, QtGui.QApplication.UnicodeUTF8)) + self.button_cut_circle.setToolTip(QtGui.QApplication.translate("Form", "Create Arcs:\n" +"Cut the selected Circle(s) or Arc(s) in 2(n) parts and create 2(n) Arcs.\n" +"The number indicates in how many parts to cut.\n" +"- First select as many Circles and Arcs you want\n" +"- Second set the number of parts\n" +"- Third push this button", None, QtGui.QApplication.UnicodeUTF8)) + self.button_cut_circle.setText(QtGui.QApplication.translate("Form", "Arcs=Cut(Circle)", None, QtGui.QApplication.UnicodeUTF8)) + self.spin_circle_cut.setToolTip(QtGui.QApplication.translate("Form", "The number indicates in how many parts the selected Circle will be cut.", None, QtGui.QApplication.UnicodeUTF8)) + self.button_3points_circle.setToolTip(QtGui.QApplication.translate("Form", "Select 3 Points to create a Circle.", None, QtGui.QApplication.UnicodeUTF8)) + self.button_3points_circle.setText(QtGui.QApplication.translate("Form", "Circle=(3 points)", None, QtGui.QApplication.UnicodeUTF8)) self.button_linecenter_circle.setToolTip(QtGui.QApplication.translate("Form", "Select an Axis and a Point to create a Circle\n" "centered on the Point, perpendicular to the Axis \n" "with the given radius.", None, QtGui.QApplication.UnicodeUTF8)) self.button_linecenter_circle.setText(QtGui.QApplication.translate("Form", "Circle=(Axis, center)", None, QtGui.QApplication.UnicodeUTF8)) self.radius_circle.setToolTip(QtGui.QApplication.translate("Form", "Radius of the Circle.", None, QtGui.QApplication.UnicodeUTF8)) self.radius_circle.setText(QtGui.QApplication.translate("Form", "10.0", None, QtGui.QApplication.UnicodeUTF8)) + self.button_3points_ellipse.setToolTip(QtGui.QApplication.translate("Form", "Select a center and 2 Points to create an Ellipse.", None, QtGui.QApplication.UnicodeUTF8)) + self.button_3points_ellipse.setText(QtGui.QApplication.translate("Form", "Ellipse=(3 points)", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QtGui.QApplication.translate("Form", "Circle", None, QtGui.QApplication.UnicodeUTF8)) self.button_axis_point_plane.setToolTip(QtGui.QApplication.translate("Form", "Create a plane perpendicular to a Line and crossing a Point.", None, QtGui.QApplication.UnicodeUTF8)) self.button_axis_point_plane.setText(QtGui.QApplication.translate("Form", "Plane=(Point, _|Axis)", None, QtGui.QApplication.UnicodeUTF8)) self.button_axisandpoint_plane.setToolTip(QtGui.QApplication.translate("Form", "Create a plane crossing a Line and a Point.", None, QtGui.QApplication.UnicodeUTF8)) self.button_axisandpoint_plane.setText(QtGui.QApplication.translate("Form", "Plane=(Point, Axis)", None, QtGui.QApplication.UnicodeUTF8)) - self.button_object_center_planes.setToolTip(QtGui.QApplication.translate("Form", "Create 3 Planes (XY, XZ and YZ) at center location of all selected Object(s).", None, QtGui.QApplication.UnicodeUTF8)) - self.button_object_center_planes.setText(QtGui.QApplication.translate("Form", "Object(s) Center Planes", None, QtGui.QApplication.UnicodeUTF8)) self.button_threepoints_plane.setToolTip(QtGui.QApplication.translate("Form", "Create a Plane crossing 3 Points.", None, QtGui.QApplication.UnicodeUTF8)) self.button_threepoints_plane.setText(QtGui.QApplication.translate("Form", "Three Points Plane", None, QtGui.QApplication.UnicodeUTF8)) - self.button_planeandpoint_plane.setToolTip(QtGui.QApplication.translate("Form", "Create a plane crossing a Point and parallel to a Plane.", None, QtGui.QApplication.UnicodeUTF8)) - self.button_planeandpoint_plane.setText(QtGui.QApplication.translate("Form", "Plane=(Point, Plane)", None, QtGui.QApplication.UnicodeUTF8)) - self.extension_planePointPlane.setToolTip(QtGui.QApplication.translate("Form", "Distance for the extensions of the new Plane compared to initial one.", None, QtGui.QApplication.UnicodeUTF8)) - self.extension_planePointPlane.setText(QtGui.QApplication.translate("Form", "0.0", None, QtGui.QApplication.UnicodeUTF8)) self.button_face_tangent.setToolTip(QtGui.QApplication.translate("Form", "Create a tanget Plane at click location of a Face.\n" "Click first in the view to select and object,\n" "then push the button, \n" @@ -1012,10 +1057,16 @@ class Ui_Form(object): self.length_plane_2.setText(QtGui.QApplication.translate("Form", "10.0", None, QtGui.QApplication.UnicodeUTF8)) self.width_plane_2.setToolTip(QtGui.QApplication.translate("Form", "Width of the Plane.", None, QtGui.QApplication.UnicodeUTF8)) self.width_plane_2.setText(QtGui.QApplication.translate("Form", "10.0", None, QtGui.QApplication.UnicodeUTF8)) + self.button_planeandpoint_plane.setToolTip(QtGui.QApplication.translate("Form", "Create a plane crossing a Point and parallel to a Plane.", None, QtGui.QApplication.UnicodeUTF8)) + self.button_planeandpoint_plane.setText(QtGui.QApplication.translate("Form", "Plane=(Point, Plane)", None, QtGui.QApplication.UnicodeUTF8)) + self.extension_planePointPlane.setToolTip(QtGui.QApplication.translate("Form", "Distance for the extensions of the new Plane compared to initial one.", None, QtGui.QApplication.UnicodeUTF8)) + self.extension_planePointPlane.setText(QtGui.QApplication.translate("Form", "0.0", None, QtGui.QApplication.UnicodeUTF8)) self.button_planeandaxis_plane.setToolTip(QtGui.QApplication.translate("Form", "Create a Plane crossing a Line and perpendicular to a Plane.", None, QtGui.QApplication.UnicodeUTF8)) self.button_planeandaxis_plane.setText(QtGui.QApplication.translate("Form", "Plane=(Plane, Axis)", None, QtGui.QApplication.UnicodeUTF8)) self.angle_planeandaxis_plane.setToolTip(QtGui.QApplication.translate("Form", "Angle relative to the Plane (in degrees).", None, QtGui.QApplication.UnicodeUTF8)) self.angle_planeandaxis_plane.setText(QtGui.QApplication.translate("Form", "0.0", None, QtGui.QApplication.UnicodeUTF8)) + self.button_object_center_planes.setToolTip(QtGui.QApplication.translate("Form", "Create 3 Planes (XY, XZ and YZ) at center location of all selected Object(s).", None, QtGui.QApplication.UnicodeUTF8)) + self.button_object_center_planes.setText(QtGui.QApplication.translate("Form", "Object(s) Center Planes", None, QtGui.QApplication.UnicodeUTF8)) self.button_click_for_plane.setToolTip(QtGui.QApplication.translate("Form", "Create a rectangular Plane perpendicular to the view at location of one mouse click.\n" "Define the width and the length of the Plane if needed.\n" "- Click first on the Button then click once on the View.\n" @@ -1088,18 +1139,18 @@ class Ui_Form(object): self.button_cut_select_plane.setText(QtGui.QApplication.translate("Form", "Select Ref. Plane", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.cutting_tab), QtGui.QApplication.translate("Form", "Cutting", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.Modif_Tab), QtGui.QApplication.translate("Form", "Modif.", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isPerpendicular.setToolTip(QtGui.QApplication.translate("Form", "Check if two faces are Perpendicular:\n" -"- Select the 2 faces/planes and\n" + self.button_isPerpendicular.setToolTip(QtGui.QApplication.translate("Form", "Check if two faces or two Edges are Perpendicular:\n" +"- Select the 2 faces/planes or 2 Edges/Lines and\n" "Click this button", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isPerpendicular.setText(QtGui.QApplication.translate("Form", "Faces Perpendicular", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isParallel.setToolTip(QtGui.QApplication.translate("Form", "Check if two faces are Parallel:\n" -"- Select the 2 faces/planes and\n" + self.button_isPerpendicular.setText(QtGui.QApplication.translate("Form", "are Perpendicular ?", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isParallel.setToolTip(QtGui.QApplication.translate("Form", "Check if two faces or two Edges are Parallel:\n" +"- Select the 2 faces/planes or 2 Edges/Lines and\n" "Click this button", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isParallel.setText(QtGui.QApplication.translate("Form", "Faces Parallel", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isCoplanar.setToolTip(QtGui.QApplication.translate("Form", "Check if two faces are Coplanar:\n" -"- Select the 2 faces/planes and\n" + self.button_isParallel.setText(QtGui.QApplication.translate("Form", "are Parallel ?", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isCoplanar.setToolTip(QtGui.QApplication.translate("Form", "Check if two faces or two Edges are Coplanar:\n" +"- Select the 2 faces/planes or 2 Edges/Lines and\n" "Click this button", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isCoplanar.setText(QtGui.QApplication.translate("Form", "Faces Coplanar", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isCoplanar.setText(QtGui.QApplication.translate("Form", "are Coplanar ?", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QtGui.QApplication.translate("Form", "Check", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget_0.setTabText(self.tabWidget_0.indexOf(self.tab_2), QtGui.QApplication.translate("Form", "W. F.", None, QtGui.QApplication.UnicodeUTF8)) diff --git a/WorkFeature/WFGui_2015.ui b/WorkFeature/WFGui_2015.ui index 1436d16..f622a68 100644 --- a/WorkFeature/WFGui_2015.ui +++ b/WorkFeature/WFGui_2015.ui @@ -6,8 +6,8 @@ 0 0 - 386 - 767 + 387 + 838 @@ -59,8 +59,8 @@ 0 0 - 350 - 765 + 351 + 813 @@ -76,14 +76,14 @@ W. F. - - + + QTabWidget::West - 8 + 1 @@ -139,6 +139,30 @@ + + + + + + Tolerance + + + + + + + + 60 + 16777215 + + + + 1e-10 + + + + + @@ -153,7 +177,7 @@ 20 - 539 + 40 @@ -574,7 +598,7 @@ Then click on this button. Axis - + @@ -780,7 +804,8 @@ then click on a location on the selected object. - Create an Axis parallel to an Axis and crossing a Point. + Create an Axis Parallel to an Axis and crossing a Point. +-Select one Axis and one Point NOT on the previous Axis. Axis=(Point,Axis) @@ -844,7 +869,8 @@ End of the line. - Create an Axis perpendicular to an Axis and crossing a Point. + Create an Axis Perpendicular to an Axis and crossing a Point +-Select one Axis and one Point NOT on the previous Axis. Axis=(Axis,Point) @@ -882,7 +908,8 @@ End of the line. - Create an Axis between 2 Axes. + Create an Axis between two Axes. +-Select two Axes. Axis=(Line,Line) @@ -900,6 +927,27 @@ End of the line. + + + Create an Axis Perpendicular to an Axis, crossing a Point and Parallel to a Plane. +-Select one Plane, one Axis and one Point ON the previous Axis. + + + Axis=(Plane,Point,Axis) + + + + ../Icons/WF_planeLinePointAxis.svg../Icons/WF_planeLinePointAxis.svg + + + + 32 + 32 + + + + + @@ -953,7 +1001,7 @@ The number indicates in how many parts to cut. - + Create an Axis on a Plane by projection from anoher Axis. @@ -973,7 +1021,7 @@ The number indicates in how many parts to cut. - + Create an Axis by intersect of 2 Planes. @@ -993,7 +1041,7 @@ The number indicates in how many parts to cut. - + Create a set of Lines on a Plane perpendicular to the view at location of 2 mouse clicks. @@ -1015,7 +1063,7 @@ The number indicates in how many parts to cut. - + Create 3 Axes at Base location of all selected Object(s). @@ -1035,7 +1083,7 @@ The number indicates in how many parts to cut. - + Transform Line(s) in Sketch's Line(s) by projection onto the Sketch's Plane: @@ -1069,46 +1117,6 @@ Then click on this button. Circle - - - - Select 3 Points to create a Circle. - - - Circle=(3 points) - - - - ../Icons/WF_3pointsCircle.svg../Icons/WF_3pointsCircle.svg - - - - 32 - 32 - - - - - - - - Select a center and 2 Points to create an Ellipse. - - - Ellipse=(3 points) - - - - ../Icons/WF_3pointsEllipse.svg../Icons/WF_3pointsEllipse.svg - - - - 32 - 32 - - - - @@ -1130,6 +1138,83 @@ centered on the Axis and tangenting the Point. + + + + + + Create Arcs: +Cut the selected Circle(s) or Arc(s) in 2(n) parts and create 2(n) Arcs. +The number indicates in how many parts to cut. +- First select as many Circles and Arcs you want +- Second set the number of parts +- Third push this button + + + Arcs=Cut(Circle) + + + + ../Icons/WF_cutCircle.svg../Icons/WF_cutCircle.svg + + + + 32 + 32 + + + + + + + + + 40 + 0 + + + + + 50 + 16777215 + + + + The number indicates in how many parts the selected Circle will be cut. + + + 2 + + + 10 + + + 1 + + + + + + + + + Select 3 Points to create a Circle. + + + Circle=(3 points) + + + + ../Icons/WF_3pointsCircle.svg../Icons/WF_3pointsCircle.svg + + + + 32 + 32 + + + + @@ -1179,7 +1264,27 @@ with the given radius. - + + + Select a center and 2 Points to create an Ellipse. + + + Ellipse=(3 points) + + + + ../Icons/WF_3pointsEllipse.svg../Icons/WF_3pointsEllipse.svg + + + + 32 + 32 + + + + + + Qt::Vertical @@ -1242,26 +1347,6 @@ with the given radius. - - - - Create 3 Planes (XY, XZ and YZ) at center location of all selected Object(s). - - - Object(s) Center Planes - - - - Icons/WF_centerObjectsPlanes.svgIcons/WF_centerObjectsPlanes.svg - - - - 32 - 32 - - - - @@ -1282,52 +1367,6 @@ with the given radius. - - - - - - Create a plane crossing a Point and parallel to a Plane. - - - Plane=(Point, Plane) - - - - Icons/WF_pointPlanePoint.svgIcons/WF_pointPlanePoint.svg - - - - 32 - 32 - - - - - - - - - 40 - 0 - - - - - 60 - 16777215 - - - - Distance for the extensions of the new Plane compared to initial one. - - - 0.0 - - - - - @@ -1417,6 +1456,65 @@ then click on a location on the selected object. + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Create a plane crossing a Point and parallel to a Plane. + + + Plane=(Point, Plane) + + + + Icons/WF_pointPlanePoint.svgIcons/WF_pointPlanePoint.svg + + + + 32 + 32 + + + + + + + + + 40 + 0 + + + + + 60 + 16777215 + + + + Distance for the extensions of the new Plane compared to initial one. + + + 0.0 + + + + + @@ -1475,6 +1573,26 @@ then click on a location on the selected object. + + + + Create 3 Planes (XY, XZ and YZ) at center location of all selected Object(s). + + + Object(s) Center Planes + + + + Icons/WF_centerObjectsPlanes.svgIcons/WF_centerObjectsPlanes.svg + + + + 32 + 32 + + + + @@ -1580,19 +1698,6 @@ Define the width and the length of the Plane if needed. - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -2231,12 +2336,12 @@ and push this button to accept... - Check if two faces are Perpendicular: -- Select the 2 faces/planes and + Check if two faces or two Edges are Perpendicular: +- Select the 2 faces/planes or 2 Edges/Lines and Click this button - Faces Perpendicular + are Perpendicular ? @@ -2253,12 +2358,12 @@ Click this button - Check if two faces are Parallel: -- Select the 2 faces/planes and + Check if two faces or two Edges are Parallel: +- Select the 2 faces/planes or 2 Edges/Lines and Click this button - Faces Parallel + are Parallel ? @@ -2275,12 +2380,12 @@ Click this button - Check if two faces are Coplanar: -- Select the 2 faces/planes and + Check if two faces or two Edges are Coplanar: +- Select the 2 faces/planes or 2 Edges/Lines and Click this button - Faces Coplanar + are Coplanar ? diff --git a/WorkFeature/WF_centerObjectsPlanes.png b/WorkFeature/WF_centerObjectsPlanes.png deleted file mode 100755 index 16288ee..0000000 Binary files a/WorkFeature/WF_centerObjectsPlanes.png and /dev/null differ diff --git a/WorkFeature/WF_wf.svg b/WorkFeature/WF_wf.svg new file mode 100644 index 0000000..6682d03 --- /dev/null +++ b/WorkFeature/WF_wf.svg @@ -0,0 +1,417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + W + + diff --git a/WorkFeature/__init__.py b/WorkFeature/__init__.py index 3d4b3ba..07b2b88 100644 --- a/WorkFeature/__init__.py +++ b/WorkFeature/__init__.py @@ -10,7 +10,7 @@ * galou_breizh for macro which creates a circle from 3 selected points * * Eriossoltero for macro Ellipse-Center+2Points * * Many Thanks to wmayer for his active help on testing and debbuging * -* Special thanks to Mario52 for FCCamera code * +* Special thanks to Mario52 for FCCamera code, cutCircle... * * for bounding box codes, advices, diverse pieces of codes * * and all discussions...merci Mario * *************************************************************************** @@ -51,7 +51,7 @@ if not sys.path.__contains__("/usr/lib/freecad/lib"): import WFGui_2015 as WFGui global myRelease -myRelease = "2105_02_28" +myRelease = "2105_03_08" import os.path import math @@ -87,9 +87,12 @@ global centerOfMass centerOfMass=True global verbose verbose=0 +global tolerance +tolerance=1e-10 m_numberLinePart = 2 m_numberLineCut = 2 +m_numberCircleCut = 2 m_distanceLinePoint = 0.0 m_extensionTwoPointsAxis = 0.0 m_extensionLinePointAxis = 0.0 @@ -115,7 +118,7 @@ m_clickForPoint = True m_clickForAxis = True m_stack = [] -error_msg = "Not yet Developped !" +error_msg_not_yet = "Not yet Developped !" #################################################################################### @@ -677,7 +680,7 @@ def distanceBetween(A, B): return edge.Length -def colinearVectors(A, B, C, info=0, precision=1e-12): +def colinearVectors(A, B, C, info=0, tolerance=1e-12): """ Return true if the 3 points are aligned. """ Vector_1 = B - A @@ -689,7 +692,7 @@ def colinearVectors(A, B, C, info=0, precision=1e-12): if info != 0: print_point(Vector_3, msg="Vector_1.cross(Vector_2) : ") - if abs(Vector_3.x) <= precision and abs(Vector_3.y) <= precision and abs(Vector_3.z) <= precision: + if abs(Vector_3.x) <= tolerance and abs(Vector_3.y) <= tolerance and abs(Vector_3.z) <= tolerance: if info != 0: print_msg("Colinear Vectors !") return True @@ -1221,7 +1224,7 @@ def plot_axis(Vector_A, Vector_B, part, name, grp="WorkAxis"): return axis_User_Name, axis -def plot_circle(Radius, Position, Direction, part= "Part::Feature", name= "Circle", grp="Circles"): +def plot_circle(Radius, Position, Direction, part= "Part::Feature", name= "Circle", grp="WorkCircles"): if not(App.ActiveDocument.getObject( grp )): App.ActiveDocument.addObject("App::DocumentObjectGroup", grp) circle = App.ActiveDocument.addObject(part, name) @@ -1230,8 +1233,39 @@ def plot_circle(Radius, Position, Direction, part= "Part::Feature", name= "Circl circle_User_Name = circle.Label Gui.ActiveDocument.getObject(circle_User_Name).LineColor = (1.00,0.67,0.00) return circle_User_Name, circle - + +def plot_arc(center, normal, radius, startangle, endangle, part= "Part::Feature", name= "Circle", grp="WorkCircles"): + if not(App.ActiveDocument.getObject( grp )): + App.ActiveDocument.addObject("App::DocumentObjectGroup", grp) + arc = App.ActiveDocument.addObject(part, name) + c = Part.Circle(center, normal, radius) + start = math.radians(startangle) + end = math.radians(endangle) + Arc = Part.Arc(c,start,end) + arc.Shape = Arc.toShape() + App.ActiveDocument.getObject( grp ).addObject(arc) + arc_User_Name = arc.Label + Gui.ActiveDocument.getObject(arc_User_Name).LineColor = (1.00,0.67,0.00) + return arc_User_Name, arc + + +def plot_arc2(Radius, Placem, Face, Startangle, Endangle, Support, part= "Part::Feature", name= "Circle", grp="WorkCircles"): + if not(App.ActiveDocument.getObject( grp )): + App.ActiveDocument.addObject("App::DocumentObjectGroup", grp) + arc = App.ActiveDocument.addObject(part, name) + print_msg(str(Placem)) + #arc.Shape = Part.makeCircle(Radius, Position, Direction) + toto = Draft.makeCircle(radius=Radius,placement=Placem,face=Face,startangle=Startangle,endangle=Endangle,support=Support) + print_msg(str(toto)) + return + #arc.Shape = + App.ActiveDocument.getObject( grp ).addObject(arc) + arc_User_Name = arc.Label + Gui.ActiveDocument.getObject(arc_User_Name).LineColor = (1.00,0.67,0.00) + return arc_User_Name, arc + + def plot_ellipse(S1, S2, Center, part= "Part::Feature", name= "Ellipse", grp="Circles"): """Creates an ellipse centered on the point Center, where the plane of the ellipse is defined by Center, S1 and S2, @@ -1452,6 +1486,8 @@ def bounding_box(grp,ori_X,ori_Y,ori_Z,length_X,length_Y,length_Z,info=0): def plot_originObject(): + global verbose + msg=verbose m_actDoc = get_ActiveDocument(info=msg) if m_actDoc == None: return None @@ -1570,6 +1606,7 @@ def plot_originObject(): except: printError_msg("Could not Create Origin objects !") + def bBox_toggled(flag): """ Respond to the change of bounding box flag. """ @@ -1577,7 +1614,23 @@ def bBox_toggled(flag): centerOfMass = True if flag == True: centerOfMass = False - + + +def setTolerance(value): + """ Respond to the change in tolerance value from the text box. + """ + try: + # First we check if a valid number have been entered + global tolerance + if str(value) == '-': + return + tolerance = float(value) + print_msg("New tolerance is :" + str(tolerance)) + #plot_alongLinePoint() + except ValueError: + printError_msg("Tolerance must be valid number !") + + def plot_centerObjectPoint(): """ Create a Point at center location of all selected Object(s). if flag centerOfMass=True @@ -1708,9 +1761,10 @@ def plot_extremaLinePoint(): if Number_of_Edges >= 1: Edge_List = SelectedObjects[4] for i in range( Number_of_Edges ): - if msg != 0: - print_msg(str(Edge_List[i])) edge = Edge_List[i] + if msg != 0: + print_msg(str(edge)) + Vector_A = edge.Vertexes[0].Point Vector_B = edge.Vertexes[-1].Point if msg != 0: @@ -1776,10 +1830,11 @@ def plot_centerLinePoint(): if Number_of_Edges >= 1: Edge_List = SelectedObjects[4] for i in range( Number_of_Edges ): + edge = Edge_List[i] if m_numberLinePart == 2: if msg != 0: - print_msg(str(Edge_List[i])) - Vector_Line_Center = centerLinePoint(Edge_List[i],info=msg) + print_msg(str(edge)) + Vector_Line_Center = centerLinePoint(edge,info=msg) if msg != 0: print_point(Vector_Line_Center, msg="MidPoint : ") @@ -1787,7 +1842,7 @@ def plot_centerLinePoint(): print_point(Vector_Line_Center,str(Center_User_Name) + result_msg + " at :") else: for j in range( 1, m_numberLinePart ): - Vector_Line_Center = centerLinePoints(Edge_List[i], j , m_numberLinePart, info=msg) + Vector_Line_Center = centerLinePoints(edge, j , m_numberLinePart, info=msg) Center_User_Name = plot_point(Vector_Line_Center, part, name) print_point(Vector_Line_Center,str(Center_User_Name) + result_msg + " at :") else: @@ -2652,17 +2707,20 @@ def plot_cutAxis(): if (Number_of_Edges >= 1): Edge_List = SelectedObjects[4] for i in range( Number_of_Edges ): + edge = Edge_List[i] if msg != 0: - print_msg(str(Edge_List[i])) - Vector_A = Edge_List[i].valueAt( 0.0 ) + print_msg(str(edge)) + #Vector_A = edge.valueAt( 0.0 ) + Vector_A = edge.Vertexes[0].Point for j in range( 1, m_numberLineCut ): - Vector_B = centerLinePoints(Edge_List[i], j , m_numberLineCut, info=msg) + Vector_B = centerLinePoints(edge, j , m_numberLineCut, info=msg) if msg != 0: print_point(Vector_A,"Vector_A is : ") print_point(Vector_B,"Vector_B is : ") Axis_User_Name, axis = plot_axis(Vector_A, Vector_B, part, name) Vector_A = Vector_B - Vector_B = Edge_List[i].valueAt( Edge_List[i].Length ) + #Vector_B = edge.valueAt( edge.Length ) + Vector_B = edge.Vertexes[-1].Point if msg != 0: print_point(Vector_A,"Vector_A is : ") print_point(Vector_B,"Vector_B is : ") @@ -2689,7 +2747,6 @@ def extensionLinePointAxis(value): printError_msg("Extension must be valid number !") - def plot_linePointAxis(): """ Plot an Axis Perpendicular to an Axis and crossing a Point @@ -2701,7 +2758,7 @@ def plot_linePointAxis(): "Select one Point and one Line only !\n" + \ "The Point is NOT on the Line!" result_msg = " : Perpendicular Axis created !" - name = "Perpendicular Line" + name = "Perpendicular_Line" part = "Part::Feature" Selection = get_SelectedObjects(info=msg, printError=False) try: @@ -2743,6 +2800,164 @@ def plot_linePointAxis(): printError_msg(error_msg) except: printError_msg(error_msg) + + +def plot_planeLinePointAxis(): + """ + Plot an Axis Perpendicular to an Axis, crossing a Point and Parallel to a Plane. + -Select one Plane, one Axis and one Point ON the previous Axis. + """ + global verbose + msg=verbose + m_actDoc = get_ActiveDocument(info=msg) + if m_actDoc == None: + return None + createFolders('WorkAxis') + error_msg = "Unable to create Perpendicular Axis : \nSelect one Plane, one Axis and one Point ON the previous Axis !" + result_msg = " : Perpendicular Axis created !" + name = "Perpendicular_Line_on_plane" + part = "Part::Feature" + Selection = get_SelectedObjects(info=msg, printError=False) + m_num, m_selEx, m_objs, m_objNames = get_InfoObjects(info=0) + m_xmax, m_xmin, m_ymax, m_ymin, m_zmax, m_zmin = minMaxObjectsLimits(m_objs,info=0) + try: + SelectedObjects = Selection + Number_of_Points = SelectedObjects[0] + Number_of_Edges = SelectedObjects[1] + Number_of_Planes = SelectedObjects[2] + if msg != 0: + print_msg("Number_of_Points=" + str(Number_of_Points) + \ + "\nNumber_of_Edges=" + str(Number_of_Edges) + \ + "\nNumber_of_Planes=" + str(Number_of_Planes)) + if (Number_of_Points == 1 ) and (Number_of_Edges == 1) and (Number_of_Planes) == 1 : + Point_List = SelectedObjects[3] + Edge_List = SelectedObjects[4] + Plane_List = SelectedObjects[5] + # Create a Perpendicular plane to selected line and crossing the point + Vector_A = Edge_List[0].Vertexes[0].Point + Vector_B = Edge_List[0].Vertexes[-1].Point + Vector_C = Point_List[0].Point + if msg != 0: + print_point(Vector_A, msg="Vector_A : ") + print_point(Vector_B, msg="Vector_B : ") + print_point(Vector_C, msg="Vector_C : ") + # Intersection point T on a Line given one Line and One Point C. + if colinearVectors(Vector_A, Vector_B, Vector_C, info=msg, tolerance=1e-10): + Vector_T = Vector_C + Distance = Vector_B.sub(Vector_A).Length + else: + Vector_T, Distance, Vector_Tprime = intersecPerpendicularLine(Vector_A, Vector_B, Vector_C, info=msg) + if msg != 0: + print_point(Vector_T, msg="Intersection point T : ") + Plane_Normal = Vector_B.sub(Vector_A) + Plane_Point = Vector_T + (Vector_C - Vector_T).multiply(0.5) + #Edge_Length = Distance * 1.5 + + #Plane_User_Name, plane = plot_plane(Edge_Length, Edge_Length, Plane_Point, Plane_Normal, part, name) + #print_msg(str(Plane_User_Name) + result_msg ) + + # Then intersection of the 2 planes + Selected_Plane1 = Plane_List[0] + Selected_Plane2 = plane.Shape + Plane_Normal1 = Selected_Plane1.normalAt(0,0) + Plane_Normal2 = Plane_Normal + if msg != 0: + print_point(Plane_Normal1, msg="Normal1 : ") + print_point(Plane_Normal2, msg="Normal2 : ") + Plane_Point1 = Selected_Plane1.CenterOfMass + Plane_Point2 = Plane_Point + if msg != 0: + print_point(Plane_Point1 , msg="Plane_Point1 : ") + print_point(Plane_Point2 , msg="Plane_Point2 : ") + + Axis_dir = intersecPlanePlane(Plane_Normal1, Plane_Point1, Plane_Normal2, Plane_Point2, info=msg) + if msg != 0: + print_point(Axis_dir , msg="Axis_dir : ") + + # Intersection Line found + if Axis_dir != None: + if msg != 0: + print_msg("Selected_Plane1=" + str(Selected_Plane1)) + print_msg("Selected_Plane1.Edges=" + str(Selected_Plane1.Edges)) + Number_of_Edges = len(Selected_Plane1.Edges) + if msg != 0: + print_msg("Number_of_Edges=" + str(Number_of_Edges)) + Vertx = [] + Vertx.append(App.Vector(0.0, 0.0, 0.0)) + Vertx.append(App.Vector(0.0, 0.0, 0.0)) + + min_val, max_val = init_min_max() + dist_to_center_min = max_val + # For the first plane look after all edges and look at + # intersections of the edges with the second plane + for j in range(Number_of_Edges): + A = Selected_Plane1.Edges[j].Vertexes[0].Point + B = Selected_Plane1.Edges[j].Vertexes[-1].Point + if msg != 0: + print_point(A , msg="A : ") + print_point(B , msg="B : ") + T = intersecLinePlane(A, B, Plane_Normal2, Plane_Point2, info=0) + if T != None: + if msg != 0: + print_point(T , msg="T : ") + D = T - Plane_Point1 + dist_to_center = math.sqrt(D.dot(D)) + if msg != 0: + print_msg("D=" + str(D)) + print_msg("dist_to_center=" + str(dist_to_center)) + if dist_to_center < dist_to_center_min: + dist_to_center_min = dist_to_center + Vertx[0] = T + + if msg != 0: + print_msg("Selected_Plane2=" + str(Selected_Plane2)) + print_msg("Selected_Plane2.Edges=" + str(Selected_Plane2.Edges)) + + Number_of_Edges = len(Selected_Plane2.Edges) + if msg != 0: + print_msg("Number_of_Edges=" + str(Number_of_Edges)) + + dist_to_center_min = max_val + for j in range(Number_of_Edges): + A = Selected_Plane2.Edges[j].valueAt( 0.0 ) + B = Selected_Plane2.Edges[j].valueAt(Selected_Plane2.Edges[j].Length ) + if msg != 0: + print_point(A , msg="A : ") + print_point(B , msg="B : ") + T = intersecLinePlane(A, B, Plane_Normal1, Plane_Point1, info=0) + if T != None: + if msg != 0: + print_point(T , msg="T : ") + D = T - Plane_Point2 + dist_to_center = math.sqrt(D.dot(D)) + if msg != 0: + print_msg("D=" + str(D)) + print_msg("dist_to_center=" + str(dist_to_center)) + if dist_to_center < dist_to_center_min: + dist_to_center_min = dist_to_center + Vertx[1] = T + + C = meanVectorsPoint(Vertx,info=1) + + if C != None: + extension = m_xmax - m_xmin + if extension < m_ymax - m_ymin: + extension = m_ymax - m_ymin + if extension < m_zmax - m_zmin: + extension = m_zmax - m_zmin + extension = extension/2 + A = C - Axis_dir.normalize().multiply(extension*1.3) + B = C + Axis_dir + Axis_User_Name, axis = plot_axis(A, B, part, name) + print_msg(str(Axis_User_Name) + result_msg ) + else: + printError_msg(error_msg) + else: + printError_msg(error_msg) + else: + printError_msg(error_msg) + except: + printError_msg(error_msg) def plot_pointLineAxis(): @@ -3099,25 +3314,30 @@ def line_toSketch(): # Get Point(s) from the selection for m_i in range(1,m_num): m_obj = m_selEx[m_i] - SubObject = m_obj.SubObjects[0] - if SubObject.ShapeType == "Edge": - if msg != 0: - print_msg("Found a Edge object!") - m_Vertex1 = SubObject.Vertexes[0] - m_Vertex2 = SubObject.Vertexes[1] - # Get the Point - m_p1 = m_Vertex1.Point - m_p2 = m_Vertex2.Point - # Projection of the Point selected onto the Sketch Plane - Projection1 = m_p1.projectToPlane(m_sketch.Placement.Base, m_recN) - Projection2 = m_p2.projectToPlane(m_sketch.Placement.Base, m_recN) - # Append the Projection - geoList.append(Part.Line(Projection1,Projection2)) - # Add the geometry list to the Sketch - m_sketch.addGeometry(geoList) - m_num_line = m_num_line + 1 - else: - continue + #SubObject = m_obj.SubObjects[0] + for SubObject in m_obj.SubObjects: + if SubObject.ShapeType == "Edge": + if msg != 0: + print_msg("Found a Edge object!") + if len(SubObject.Vertexes) ==2: + m_Vertex1 = SubObject.Vertexes[0] + m_Vertex2 = SubObject.Vertexes[1] + else: + printError_msg(error_msg) + return + # Get the Point + m_p1 = m_Vertex1.Point + m_p2 = m_Vertex2.Point + # Projection of the Point selected onto the Sketch Plane + Projection1 = m_p1.projectToPlane(m_sketch.Placement.Base, m_recN) + Projection2 = m_p2.projectToPlane(m_sketch.Placement.Base, m_recN) + # Append the Projection + geoList.append(Part.Line(Projection1,Projection2)) + # Add the geometry list to the Sketch + m_sketch.addGeometry(geoList) + m_num_line = m_num_line + 1 + else: + continue # Refresh App.getDocument(str(m_actDoc.Name)).recompute() print_msg(str(m_num_line) + result_msg ) @@ -3277,7 +3497,166 @@ def plot_3pointsCircle(): except: printError_msg(error_msg) + +def numberCircleCut(value): + """ Respond to the change in number of cut value from the spin box. + """ + global verbose + msg=verbose + + try: + # First we check if a valid number have been entered + global m_numberCircleCut + if str(value) == '-': + return + m_numberCircleCut = int(value) + if msg != 0: + print_msg("New number is :" + str(m_numberCircleCut)) + except ValueError: + printError_msg("Number must be valid !") + + +def plot_cutCircle(): + """Create Arcs: + Cut the selected Circle in 2(n) parts and create 2(n) Arcs. + The number indicates in how many parts to cut. + Original code from Mario52, 24/02/2015 + """ + global verbose + msg=verbose + + m_actDoc = get_ActiveDocument(info=msg) + if m_actDoc == None: + return None + + createFolders('WorkCircles') + error_msg = "Unable to cut the Circle : \nSelect at least one Circle !" + result_msg = " : is last arc created from Circle cut !" + name = "Arc_from_circle" + part = "Part::Feature" + + global m_numberCircleCut + if not (m_numberCircleCut >= 2 and m_numberCircleCut <= 10) : + m_numberCircleCut = 2 + if msg != 0: + print_msg("Number of cuts=" + str(m_numberCircleCut)) + + selection = Gui.Selection.getSelection() + if msg != 0: + print_msg("Number of selected objects=" + str(len(selection))) + for piece in selection: + if msg != 0: + print_msg("Processing object=" + str(piece)) + + if hasattr(piece, 'Name') and hasattr(piece, 'Placement'): + label = str(piece.Name) + circonference = 0.0 + if (label[:6] == "Circle"): + if msg != 0: + print_msg("Object is Circle") + + if hasattr(piece.Shape, 'Length'): + circonference = piece.Shape.Length + if circonference == 0.0 : + printError_msg("Null circonference for this object !") + continue + + # Part::Part2DObject + if (label[:6] == "Circle") and hasattr(piece, 'Radius'): + radius = piece.Radius + if len(piece.Shape.Edges) ==1: + edge = piece.Shape.Edges[0] + center = edge.Curve.Center + normal = edge.Curve.Axis + else: + printError_msg("No edge for this object !") + continue + # Part::PartFeature + elif (label[:6] == "Circle") and hasattr(piece.Shape, 'Curve') and hasattr(piece.Shape.Curve, 'Radius'): + radius = piece.Shape.Curve.Radius + center = piece.Shape.Curve.Center + normal = piece.Shape.Curve.Axis + else: + printError_msg("No radius for this object !") + continue + + pivot1 = 0.0 + pivot0 = float(360/m_numberCircleCut) + if msg != 0: + print_msg("Circonference =" +str(circonference)) + print_msg("Radius =" +str(radius)) + print_msg("Center =" +str(center)) + print_msg("Normal =" +str(normal)) + + for i in range(m_numberCircleCut): + pivot2 = pivot1 + pivot0 + if msg != 0: + print_msg("Start at =" +str(pivot1)) + print_msg("End at =" +str(pivot2)) + Arc_User_Name, arc = plot_arc(center, normal, radius, pivot1, pivot2, part, name) + pivot1 += pivot0 + + print_msg(str(Arc_User_Name) + result_msg ) + + elif (label[:8] == "Cylinder"): + if msg != 0: + print_msg("Object is Cylinder") + + pivot0 = float(piece.Angle/m_numberCircleCut) + printError_msg(error_msg_not_yet) + + elif label[:3] == "Arc": + if msg != 0: + print_msg("Object is Arc") + + if hasattr(piece.Shape, 'Length'): + circonference = piece.Shape.Length + if circonference == 0.0 : + printError_msg("Null circonference for this object !") + continue + + # Part::Part2DObject + if (label[:3] == "Arc") and hasattr(piece, 'Radius'): + radius = piece.Radius + if len(piece.Shape.Edges) ==1: + edge = piece.Shape.Edges[0] + center = edge.Curve.Center + normal = edge.Curve.Axis + else: + printError_msg("No edge for this object !") + continue + First = float(piece.FirstAngle) + Last = float(piece.LastAngle) + # Part::PartFeature + elif (label[:3] == "Arc") and hasattr(piece.Shape, 'Curve') and hasattr(piece.Shape.Curve, 'Radius'): + radius = piece.Shape.Curve.Radius + center = piece.Shape.Curve.Center + normal = piece.Shape.Curve.Axis + First = float(piece.Shape.FirstParameter) + Last = float(piece.Shape.LastParameter) + First = math.degrees(First) + Last = math.degrees(Last) + else: + printError_msg("No radius for this object !") + continue + + pivot0 = abs((First - Last) / m_numberCircleCut) + pivot1 = First + for i in range(m_numberCircleCut): + pivot2 = pivot1 + pivot0 + if msg != 0: + print_msg("Start at =" +str(pivot1)) + print_msg("End at =" +str(pivot2)) + Arc_User_Name, arc = plot_arc(center, normal, radius, pivot1, pivot2, part, name) + pivot1 += pivot0 + + print_msg(str(Arc_User_Name) + result_msg ) + Gui.ActiveDocument.getObject(label).Visibility=False + else: + printError_msg(error_msg) + + def plot_3pointsEllipse(): """Select a center and 2 Points to create an Ellipse. """ @@ -3373,7 +3752,8 @@ def plot_3PointsPlane(): def plot_axisPointPlane(): """ Create a plane passing trougth a Line and a Point. """ - msg=0 + global verbose + msg=verbose createFolders('WorkPlanes') error_msg = "Unable to create Plane : \nSelect one Line and one Point only !" result_msg = " : Plane created !" @@ -3384,26 +3764,30 @@ def plot_axisPointPlane(): SelectedObjects = Selection Number_of_Points = SelectedObjects[0] Number_of_Edges = SelectedObjects[1] - #print_msg("Number_of_Points=" + str(Number_of_Points) + " Number_of_Edges=" + str(Number_of_Edges)) + if msg !=0: + print_msg("Number_of_Points=" + str(Number_of_Points) + \ + "\nNumber_of_Edges=" + str(Number_of_Edges)) points = [] if (Number_of_Points == 1) and (Number_of_Edges == 1): Points_List = SelectedObjects[3] Edge_List = SelectedObjects[4] - #print_msg(str(Points_List)) - #print_msg(str(Edge_List)) + if msg !=0: + print_msg(str(Points_List)) + print_msg(str(Edge_List)) Point_C = Points_List[0].Point points.append(Point_C) Point_A = Edge_List[0].valueAt(0.0) points.append(Point_A) Point_B = Edge_List[0].valueAt(Edge_List[0].Length) points.append(Point_B) - #print_point(Point_A, msg="Point_A : ") - #print_point(Point_B, msg="Point_B : ") - #print_point(Point_C, msg="Point_C : ") + if msg !=0: + print_point(Point_A, msg="Point_A : ") + print_point(Point_B, msg="Point_B : ") + print_point(Point_C, msg="Point_C : ") #Vector_Center = centerBBVectorsPoint(points, info=0) - Vector_Center = meanVectorsPoint(points,info=0) - xmax, xmin, ymax, ymin, zmax, zmin = minMaxVectorsLimits(points,info=0) + Vector_Center = meanVectorsPoint(points,info=msg) + xmax, xmin, ymax, ymin, zmax, zmin = minMaxVectorsLimits(points,info=msg) #print_point(Vector_Center, msg="Center of A, B and C : ") length = xmax - xmin @@ -3689,7 +4073,7 @@ def plot_centerObjectPlanes(): """ msg=0 createFolders('WorkPlanes') - error_msg = "Unable to create Planes : \nSelect at least one objec !" + error_msg = "Unable to create Planes : \nSelect at least one object !" result_msg = " : Planes created !" m_actDoc = get_ActiveDocument(info=msg) @@ -4742,7 +5126,7 @@ def plot_cutObject(): if msg == 1: Axis_User_Name, Axis = plot_axis(BB_Edges[m_i][2][0], BB_Edges[m_i][2][1], part, "bb_edge", grp=str(m_dir)) BB_edges_names.append(str(Axis_User_Name)) - if colinearVectors(BB_Edges[m_i][2][0], Point_A2, BB_Edges[m_i][2][1], info=0, precision=1e-10): + if colinearVectors(BB_Edges[m_i][2][0], Point_A2, BB_Edges[m_i][2][1], info=0, tolerance=1e-10): # Plot them if msg == 1: Point_A2_prime_User_Name = plot_point(BB_Edges[m_i][2][0], part, "Point_A2_prime", grp=str(m_dir)) @@ -4759,7 +5143,7 @@ def plot_cutObject(): if msg == 1: Axis_User_Name, Axis = plot_axis(BB_Edges[m_i][2][0], BB_Edges[m_i][2][1], part, "bb_edge", grp=str(m_dir)) BB_edges_names.append(str(Axis_User_Name)) - if colinearVectors(BB_Edges[m_i][2][0], Point_B2, BB_Edges[m_i][2][1], info=0, precision=1e-10): + if colinearVectors(BB_Edges[m_i][2][0], Point_B2, BB_Edges[m_i][2][1], info=0, tolerance=1e-10): # Plot them if msg == 1: Point_A2_prime_User_Name = plot_point(BB_Edges[m_i][2][0], part, "Point_B2_prime", grp=str(m_dir)) @@ -4939,57 +5323,137 @@ def plot_cutObject(): cut_reset() -def object_parallel(): - """ +def two_objects_are(case): """ # Javier Martinez Garcia 2015 - SelObj = Gui.Selection.getSelectionEx() - try: - NormalA = SelObj[0].SubObjects[0].normalAt(0,0) - NormalB = SelObj[1].SubObjects[0].normalAt(0,0) - if NormalA.cross(NormalB).Length == 0.0: - print_gui_msg("\nFaces are parallel\n") - else: - print_gui_msg("\nNon parallel faces\n") + # Adapted by Rentlau_64 2015 + """ + global verbose + msg=verbose + global tolerance + + if case == "parallel": + error_msg = "Unable to check paralelism : \nSelect 2 objects \n(either 2 Planes or 2 Edges) !" + elif case == "perpendicular": + error_msg = "Unable to check perpendicularity : \nSelect 2 objects \n(either 2 Planes or 2 Edges) !" + elif case == "coplanar": + error_msg = "Unable to check coplanarity : \nSelect 2 objects \n(either 2 Planes or 2 Edges) !" + try: + SelObj = Gui.Selection.getSelectionEx() + + if len(SelObj) == 1: + if SelObj[0].HasSubObjects: + if len(SelObj[0].SubObjects) == 2: + sub01 = SelObj[0].SubObjects[0] + sub02 = SelObj[0].SubObjects[1] + else: + printError_msg(error_msg) + else: + printError_msg(error_msg) + return + elif len(SelObj) == 2: + if SelObj[0].HasSubObjects: + sub01 = SelObj[0].SubObjects[0] + sub02 = SelObj[1].SubObjects[0] + else: + printError_msg(error_msg) + else: + printError_msg(error_msg) + return + + if sub01.ShapeType != sub02.ShapeType: + printError_msg(error_msg) + return + + if msg: + print_msg("Tolerance = " + str(tolerance)) + m_tol_msg = "\n(for tolerance of " + str(tolerance) +")" + if sub01.ShapeType == 'Edge' : + if msg: + print_msg("Comparing two Edges") + EdgeA = sub01 + EdgeB = sub02 + VA = (EdgeA.Curve.EndPoint - EdgeA.Curve.StartPoint).normalize() + VB = (EdgeB.Curve.EndPoint - EdgeB.Curve.StartPoint).normalize() + #parallel + if case == "parallel": + #if (VA.cross(VB)).Length == 0.0: + if abs((VA.cross(VB)).Length) <= tolerance: + print_gui_msg("Edges are parallel" + m_tol_msg ) + else: + print_gui_msg("Non parallel edges" + m_tol_msg ) + #perpendicular + elif case == "perpendicular": + #if VA.dot(VB) == 0.0: + if abs(VA.dot(VB)) <= tolerance: + print_gui_msg("Edges are perpendicular" + m_tol_msg ) + else: + print_gui_msg("Non perpendicular edges" + m_tol_msg ) + #coplanar + elif case == "coplanar": + VC = EdgeB.Curve.StartPoint - EdgeA.Curve.StartPoint + VD = EdgeB.Curve.EndPoint - EdgeA.Curve.EndPoint + #if ((VA.cross(VB)).cross((VC.cross(VD)))).Length == 0.0: + if abs(((VA.cross(VB)).cross((VC.cross(VD)))).Length) <= tolerance: + print_gui_msg("Edges are coplanar" + m_tol_msg ) + else: + print_gui_msg("Non coplanar edges" + m_tol_msg ) + + + if sub01.ShapeType == 'Face' : + if msg: + print_msg("Comparing two Faces") + NormalA = sub01.normalAt(0,0) + NormalB = sub02.normalAt(0,0) + #parallel + if case == "parallel": + #if NormalA.cross(NormalB).Length == 0.0: + if msg: + print_msg("abs(NormalA.cross(NormalB).Length) = " + str(abs(NormalA.cross(NormalB).Length))) + + if abs(NormalA.cross(NormalB).Length) <= tolerance: + print_gui_msg("Faces are parallel" + m_tol_msg ) + else: + print_gui_msg("Non parallel faces" + m_tol_msg ) + #perpendicular + elif case == "perpendicular": + #if NormalA.dot(NormalB) == 0.0: + if msg: + print_msg("abs(NormalA.dot(NormalB)) = " + str(abs(NormalA.dot(NormalB)))) + + if abs(NormalA.dot(NormalB)) <= tolerance: + print_gui_msg("Faces are perpendicular" + m_tol_msg ) + else: + print_gui_msg("Non perpendicular faces" + m_tol_msg ) + #coplanar + elif case == "coplanar": + NormalA = sub01.normalAt(0,0) + VAB = (sub02.CenterOfMass-sub01.CenterOfMass).normalize() + if msg: + print_msg("abs(NormalA.dot(VAB)) = " + str(abs(NormalA.dot(VAB)))) + print_msg("abs(NormalB.dot(VAB)) = " + str(abs(NormalB.dot(VAB)))) + #if NormalA.dot(VAB) == 0.0: + if abs(NormalA.dot(VAB)) <= tolerance and abs(NormalB.dot(VAB)) <= tolerance: + print_gui_msg("Coplanar faces" + m_tol_msg ) + else: + print_gui_msg("Non coplanar faces" + m_tol_msg ) + except: - printError_msg("\nWrong selection!\n") + printError_msg(error_msg) + + +def object_parallel(): + two_objects_are("parallel") def object_perpendicular(): - """ - """ - # Javier Martinez Garcia 2015 - SelObj = Gui.Selection.getSelectionEx() - try: - NormalA = SelObj[0].SubObjects[0].normalAt(0,0) - NormalB = SelObj[1].SubObjects[0].normalAt(0,0) - if NormalA.dot(NormalB) == 0.0: - print_gui_msg("\nFaces are perpendicular\n") - else: - print_gui_msg("\nNon perpendicular faces\n") - - except: - printError_msg("\nWrong selection!\n") + two_objects_are("perpendicular") def object_coplanar(): - """ - """ - # Javier Martinez Garcia 2015 - SelObj = Gui.Selection.getSelectionEx() - try: - NormalA = SelObj[0].SubObjects[0].normalAt(0,0) - VAB = (SelObj[1].SubObjects[0].CenterOfMass-SelObj[0].SubObjects[0].CenterOfMass).normalize() - if NormalA.dot(VAB) == 0.0: - print_gui_msg("\nCoplanar faces\n") + two_objects_are("coplanar") - else: - print_gui_msg("\nNon coplanar faces\n") - - except: - printError_msg("\nWrong selection!\n") - ####################################################################################