diff --git a/WorkFeature/Doc/WF_releasesDocumentation.pdf b/WorkFeature/Doc/WF_releasesDocumentation.pdf index a093d3c..3543161 100644 Binary files a/WorkFeature/Doc/WF_releasesDocumentation.pdf and b/WorkFeature/Doc/WF_releasesDocumentation.pdf differ diff --git a/WorkFeature/Icons/WF_Revolve.svg b/WorkFeature/Icons/WF_Revolve.svg new file mode 100644 index 0000000..97f6a42 --- /dev/null +++ b/WorkFeature/Icons/WF_Revolve.svg @@ -0,0 +1,361 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WorkFeature/Icons/WF_isArea.svg b/WorkFeature/Icons/WF_isArea.svg new file mode 100644 index 0000000..349501b --- /dev/null +++ b/WorkFeature/Icons/WF_isArea.svg @@ -0,0 +1,488 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + ? + + + + + + + + A + + diff --git a/WorkFeature/Icons/WF_isLength.svg b/WorkFeature/Icons/WF_isLength.svg new file mode 100644 index 0000000..952e384 --- /dev/null +++ b/WorkFeature/Icons/WF_isLength.svg @@ -0,0 +1,472 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + ? + + + L + + + + + + + + diff --git a/WorkFeature/Icons/WF_objectJointPoints.svg b/WorkFeature/Icons/WF_objectJointPoints.svg new file mode 100644 index 0000000..56f0fc1 --- /dev/null +++ b/WorkFeature/Icons/WF_objectJointPoints.svg @@ -0,0 +1,505 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/WorkFeature/Icons/WF_trackCamera.svg b/WorkFeature/Icons/WF_trackCamera.svg new file mode 100644 index 0000000..6dfea0d --- /dev/null +++ b/WorkFeature/Icons/WF_trackCamera.svg @@ -0,0 +1,635 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WorkFeature/WFGui_2015.py b/WorkFeature/WFGui_2015.py index 860287a..c8829f3 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_05_31.ui' +# Form implementation generated from reading ui file 'WFGui_2015_06_22.ui' # -# Created: Sun May 31 14:43:07 2015 +# Created: Mon Jun 22 13:51:21 2015 # by: PySide UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! @@ -603,12 +603,41 @@ class Ui_Form(object): self.tab_4.setObjectName(_fromUtf8("tab_4")) self.gridLayout_22 = QtGui.QGridLayout(self.tab_4) self.gridLayout_22.setObjectName(_fromUtf8("gridLayout_22")) + self.horizontalLayout_11 = QtGui.QHBoxLayout() + self.horizontalLayout_11.setObjectName(_fromUtf8("horizontalLayout_11")) + self.button_linecenter_circle = QtGui.QPushButton(self.tab_4) + icon37 = QtGui.QIcon() + icon37.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_lineCenterCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_linecenter_circle.setIcon(icon37) + 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) + self.radius_circle = QtGui.QLineEdit(self.tab_4) + self.radius_circle.setMinimumSize(QtCore.QSize(40, 0)) + self.radius_circle.setMaximumSize(QtCore.QSize(60, 16777215)) + self.radius_circle.setObjectName(_fromUtf8("radius_circle")) + self.horizontalLayout_11.addWidget(self.radius_circle) + self.gridLayout_22.addLayout(self.horizontalLayout_11, 0, 0, 1, 2) + self.button_linepoint_circle = QtGui.QPushButton(self.tab_4) + icon38 = QtGui.QIcon() + icon38.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_linePointCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_linepoint_circle.setIcon(icon38) + self.button_linepoint_circle.setIconSize(QtCore.QSize(32, 32)) + self.button_linepoint_circle.setObjectName(_fromUtf8("button_linepoint_circle")) + self.gridLayout_22.addWidget(self.button_linepoint_circle, 1, 0, 1, 2) + self.button_3points_circle = QtGui.QPushButton(self.tab_4) + icon39 = QtGui.QIcon() + icon39.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_3pointsCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_3points_circle.setIcon(icon39) + self.button_3points_circle.setIconSize(QtCore.QSize(32, 32)) + self.button_3points_circle.setObjectName(_fromUtf8("button_3points_circle")) + self.gridLayout_22.addWidget(self.button_3points_circle, 2, 0, 1, 2) self.horizontalLayout_24 = QtGui.QHBoxLayout() self.horizontalLayout_24.setObjectName(_fromUtf8("horizontalLayout_24")) self.button_cut_circle = QtGui.QPushButton(self.tab_4) - icon37 = QtGui.QIcon() - icon37.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_cutCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_cut_circle.setIcon(icon37) + icon40 = QtGui.QIcon() + icon40.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_cutCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_cut_circle.setIcon(icon40) 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) @@ -620,45 +649,23 @@ class Ui_Form(object): 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_22.addLayout(self.horizontalLayout_24, 3, 0, 1, 1) - self.horizontalLayout_11 = QtGui.QHBoxLayout() - self.horizontalLayout_11.setObjectName(_fromUtf8("horizontalLayout_11")) - self.button_linecenter_circle = QtGui.QPushButton(self.tab_4) - icon38 = QtGui.QIcon() - icon38.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_lineCenterCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_linecenter_circle.setIcon(icon38) - 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) - self.radius_circle = QtGui.QLineEdit(self.tab_4) - self.radius_circle.setMinimumSize(QtCore.QSize(40, 0)) - self.radius_circle.setMaximumSize(QtCore.QSize(60, 16777215)) - self.radius_circle.setObjectName(_fromUtf8("radius_circle")) - self.horizontalLayout_11.addWidget(self.radius_circle) - self.gridLayout_22.addLayout(self.horizontalLayout_11, 0, 0, 1, 1) - self.button_linepoint_circle = QtGui.QPushButton(self.tab_4) - icon39 = QtGui.QIcon() - icon39.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_linePointCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_linepoint_circle.setIcon(icon39) - self.button_linepoint_circle.setIconSize(QtCore.QSize(32, 32)) - self.button_linepoint_circle.setObjectName(_fromUtf8("button_linepoint_circle")) - self.gridLayout_22.addWidget(self.button_linepoint_circle, 1, 0, 1, 1) - spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_22.addItem(spacerItem5, 5, 0, 1, 1) + self.gridLayout_22.addLayout(self.horizontalLayout_24, 3, 0, 1, 2) self.button_3points_ellipse = QtGui.QPushButton(self.tab_4) - icon40 = QtGui.QIcon() - icon40.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_3pointsEllipse.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_3points_ellipse.setIcon(icon40) + icon41 = QtGui.QIcon() + icon41.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_3pointsEllipse.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_3points_ellipse.setIcon(icon41) self.button_3points_ellipse.setIconSize(QtCore.QSize(32, 32)) self.button_3points_ellipse.setObjectName(_fromUtf8("button_3points_ellipse")) - self.gridLayout_22.addWidget(self.button_3points_ellipse, 4, 0, 1, 1) - self.button_3points_circle = QtGui.QPushButton(self.tab_4) - icon41 = QtGui.QIcon() - icon41.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_3pointsCircle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_3points_circle.setIcon(icon41) - self.button_3points_circle.setIconSize(QtCore.QSize(32, 32)) - self.button_3points_circle.setObjectName(_fromUtf8("button_3points_circle")) - self.gridLayout_22.addWidget(self.button_3points_circle, 2, 0, 1, 1) + self.gridLayout_22.addWidget(self.button_3points_ellipse, 4, 0, 1, 2) + spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_22.addItem(spacerItem5, 5, 0, 1, 1) + self.button_circle_to_sketch = QtGui.QPushButton(self.tab_4) + self.button_circle_to_sketch.setIcon(icon17) + self.button_circle_to_sketch.setIconSize(QtCore.QSize(32, 32)) + self.button_circle_to_sketch.setObjectName(_fromUtf8("button_circle_to_sketch")) + self.gridLayout_22.addWidget(self.button_circle_to_sketch, 6, 0, 1, 2) + spacerItem6 = QtGui.QSpacerItem(20, 121, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_22.addItem(spacerItem6, 7, 1, 1, 1) icon42 = QtGui.QIcon() icon42.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_circle.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.tabWidget.addTab(self.tab_4, icon42, _fromUtf8("")) @@ -666,8 +673,8 @@ class Ui_Form(object): self.Plane_Tab1.setObjectName(_fromUtf8("Plane_Tab1")) self.gridLayout_4 = QtGui.QGridLayout(self.Plane_Tab1) self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) - spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_4.addItem(spacerItem6, 9, 0, 1, 1) + spacerItem7 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_4.addItem(spacerItem7, 9, 0, 1, 1) self.horizontalLayout_3 = QtGui.QHBoxLayout() self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) self.button_click_for_plane = QtGui.QPushButton(self.Plane_Tab1) @@ -837,8 +844,8 @@ class Ui_Form(object): self.Plane_Tab11.setObjectName(_fromUtf8("Plane_Tab11")) self.gridLayout_37 = QtGui.QGridLayout(self.Plane_Tab11) self.gridLayout_37.setObjectName(_fromUtf8("gridLayout_37")) - spacerItem7 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_37.addItem(spacerItem7, 2, 0, 1, 1) + spacerItem8 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_37.addItem(spacerItem8, 2, 0, 1, 1) self.button_object_center_planes = QtGui.QPushButton(self.Plane_Tab11) icon52 = QtGui.QIcon() icon52.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_centerObjectsPlanes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) @@ -1011,11 +1018,55 @@ class Ui_Form(object): self.diameter_dome.setObjectName(_fromUtf8("diameter_dome")) self.horizontalLayout_20.addWidget(self.diameter_dome) self.gridLayout_12.addLayout(self.horizontalLayout_20, 6, 0, 1, 1) - spacerItem8 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_12.addItem(spacerItem8, 7, 0, 1, 1) + self.horizontalLayout_23 = QtGui.QHBoxLayout() + self.horizontalLayout_23.setObjectName(_fromUtf8("horizontalLayout_23")) + self.button_letter = QtGui.QPushButton(self.Objects_Tab2) icon60 = QtGui.QIcon() - icon60.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_box.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.Objects_Tab2, icon60, _fromUtf8("")) + icon60.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_pointText.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_letter.setIcon(icon60) + self.button_letter.setIconSize(QtCore.QSize(32, 32)) + self.button_letter.setObjectName(_fromUtf8("button_letter")) + self.horizontalLayout_23.addWidget(self.button_letter) + self.letter = QtGui.QLineEdit(self.Objects_Tab2) + self.letter.setMaximumSize(QtCore.QSize(70, 16777215)) + self.letter.setObjectName(_fromUtf8("letter")) + self.horizontalLayout_23.addWidget(self.letter) + self.size_letter = QtGui.QLineEdit(self.Objects_Tab2) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.size_letter.sizePolicy().hasHeightForWidth()) + self.size_letter.setSizePolicy(sizePolicy) + self.size_letter.setMinimumSize(QtCore.QSize(50, 0)) + self.size_letter.setMaximumSize(QtCore.QSize(50, 16777215)) + self.size_letter.setObjectName(_fromUtf8("size_letter")) + self.horizontalLayout_23.addWidget(self.size_letter) + self.gridLayout_12.addLayout(self.horizontalLayout_23, 7, 0, 1, 1) + self.horizontalLayout_34 = QtGui.QHBoxLayout() + self.horizontalLayout_34.setObjectName(_fromUtf8("horizontalLayout_34")) + self.button_revolve = QtGui.QPushButton(self.Objects_Tab2) + icon61 = QtGui.QIcon() + icon61.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_Revolve.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_revolve.setIcon(icon61) + self.button_revolve.setIconSize(QtCore.QSize(32, 32)) + self.button_revolve.setObjectName(_fromUtf8("button_revolve")) + self.horizontalLayout_34.addWidget(self.button_revolve) + self.angle_revolve = QtGui.QLineEdit(self.Objects_Tab2) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.angle_revolve.sizePolicy().hasHeightForWidth()) + self.angle_revolve.setSizePolicy(sizePolicy) + self.angle_revolve.setMinimumSize(QtCore.QSize(40, 0)) + self.angle_revolve.setMaximumSize(QtCore.QSize(40, 16777215)) + self.angle_revolve.setObjectName(_fromUtf8("angle_revolve")) + self.horizontalLayout_34.addWidget(self.angle_revolve) + self.gridLayout_12.addLayout(self.horizontalLayout_34, 8, 0, 1, 1) + spacerItem9 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_12.addItem(spacerItem9, 9, 0, 1, 1) + icon62 = QtGui.QIcon() + icon62.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_box.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.Objects_Tab2, icon62, _fromUtf8("")) self.Modif_Tab = QtGui.QWidget() self.Modif_Tab.setObjectName(_fromUtf8("Modif_Tab")) self.gridLayout_11 = QtGui.QGridLayout(self.Modif_Tab) @@ -1033,9 +1084,9 @@ class Ui_Form(object): sizePolicy.setHeightForWidth(self.button_alignface2view.sizePolicy().hasHeightForWidth()) self.button_alignface2view.setSizePolicy(sizePolicy) self.button_alignface2view.setMaximumSize(QtCore.QSize(220, 16777215)) - icon61 = QtGui.QIcon() - icon61.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlignFace.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_alignface2view.setIcon(icon61) + icon63 = QtGui.QIcon() + icon63.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlignFace.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_alignface2view.setIcon(icon63) self.button_alignface2view.setIconSize(QtCore.QSize(32, 32)) self.button_alignface2view.setObjectName(_fromUtf8("button_alignface2view")) self.gridLayout_51.addWidget(self.button_alignface2view, 0, 0, 1, 1) @@ -1043,9 +1094,9 @@ class Ui_Form(object): self.horizontalLayout_32.setObjectName(_fromUtf8("horizontalLayout_32")) self.button_align_faces = QtGui.QPushButton(self.align_tab) self.button_align_faces.setMaximumSize(QtCore.QSize(220, 16777215)) - icon62 = QtGui.QIcon() - icon62.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectAlignFaces.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_align_faces.setIcon(icon62) + icon64 = QtGui.QIcon() + icon64.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectAlignFaces.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_align_faces.setIcon(icon64) self.button_align_faces.setIconSize(QtCore.QSize(32, 32)) self.button_align_faces.setObjectName(_fromUtf8("button_align_faces")) self.horizontalLayout_32.addWidget(self.button_align_faces) @@ -1064,9 +1115,9 @@ class Ui_Form(object): self.horizontalLayout_33.setObjectName(_fromUtf8("horizontalLayout_33")) self.button_align_edges = QtGui.QPushButton(self.align_tab) self.button_align_edges.setMaximumSize(QtCore.QSize(220, 16777215)) - icon63 = QtGui.QIcon() - icon63.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectAlignAxes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_align_edges.setIcon(icon63) + icon65 = QtGui.QIcon() + icon65.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectAlignAxes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_align_edges.setIcon(icon65) self.button_align_edges.setIconSize(QtCore.QSize(32, 32)) self.button_align_edges.setObjectName(_fromUtf8("button_align_edges")) self.horizontalLayout_33.addWidget(self.button_align_edges) @@ -1082,14 +1133,14 @@ class Ui_Form(object): self.horizontalLayout_33.addWidget(self.angle_align_edges) self.gridLayout_51.addLayout(self.horizontalLayout_33, 2, 0, 1, 1) self.button_joint_points = QtGui.QPushButton(self.align_tab) - icon64 = QtGui.QIcon() - icon64.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectJointPoints.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_joint_points.setIcon(icon64) + icon66 = QtGui.QIcon() + icon66.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectJointPoints.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_joint_points.setIcon(icon66) self.button_joint_points.setIconSize(QtCore.QSize(32, 32)) self.button_joint_points.setObjectName(_fromUtf8("button_joint_points")) self.gridLayout_51.addWidget(self.button_joint_points, 3, 0, 1, 1) - spacerItem9 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_51.addItem(spacerItem9, 4, 0, 1, 1) + spacerItem10 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_51.addItem(spacerItem10, 4, 0, 1, 1) self.tabWidget_2.addTab(self.align_tab, _fromUtf8("")) self.cut_tab = QtGui.QWidget() self.cut_tab.setObjectName(_fromUtf8("cut_tab")) @@ -1199,8 +1250,8 @@ class Ui_Form(object): self.button_cut_reset.setMaximumSize(QtCore.QSize(60, 16777215)) self.button_cut_reset.setObjectName(_fromUtf8("button_cut_reset")) self.horizontalLayout_8.addWidget(self.button_cut_reset) - spacerItem10 = QtGui.QSpacerItem(18, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout_8.addItem(spacerItem10) + spacerItem11 = QtGui.QSpacerItem(18, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout_8.addItem(spacerItem11) self.button_cut_apply = QtGui.QPushButton(self.groupBox_6) self.button_cut_apply.setEnabled(False) self.button_cut_apply.setMaximumSize(QtCore.QSize(50, 16777215)) @@ -1211,8 +1262,8 @@ class Ui_Form(object): self.gridLayout_2.addLayout(self.gridLayout_17, 1, 0, 1, 1) self.gridLayout_36.addWidget(self.groupBox_6, 0, 0, 1, 1) self.gridLayout_38.addWidget(self.frame_7, 0, 0, 1, 1) - spacerItem11 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_38.addItem(spacerItem11, 1, 0, 1, 1) + spacerItem12 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_38.addItem(spacerItem12, 1, 0, 1, 1) self.tabWidget_2.addTab(self.cut_tab, _fromUtf8("")) self.rotate_tab = QtGui.QWidget() self.rotate_tab.setObjectName(_fromUtf8("rotate_tab")) @@ -1256,9 +1307,9 @@ class Ui_Form(object): self.ObjRot_button_select_axis.setMaximumSize(QtCore.QSize(80, 16777215)) self.ObjRot_button_select_axis.setObjectName(_fromUtf8("ObjRot_button_select_axis")) self.gridLayout_21.addWidget(self.ObjRot_button_select_axis, 1, 0, 1, 1) - icon65 = QtGui.QIcon() - icon65.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_rotationAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_3.addTab(self.tab_8, icon65, _fromUtf8("")) + icon67 = QtGui.QIcon() + icon67.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_rotationAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_3.addTab(self.tab_8, icon67, _fromUtf8("")) self.tab_9 = QtGui.QWidget() self.tab_9.setObjectName(_fromUtf8("tab_9")) self.gridLayout_23 = QtGui.QGridLayout(self.tab_9) @@ -1285,9 +1336,9 @@ class Ui_Form(object): self.ObjRot_button_select_center.setMaximumSize(QtCore.QSize(80, 16777215)) self.ObjRot_button_select_center.setObjectName(_fromUtf8("ObjRot_button_select_center")) self.gridLayout_23.addWidget(self.ObjRot_button_select_center, 1, 0, 1, 1) - icon66 = QtGui.QIcon() - icon66.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_rotationPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_3.addTab(self.tab_9, icon66, _fromUtf8("")) + icon68 = QtGui.QIcon() + icon68.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_rotationPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_3.addTab(self.tab_9, icon68, _fromUtf8("")) self.gridLayout_50.addWidget(self.tabWidget_3, 1, 0, 1, 1) self.groupBox_2 = QtGui.QGroupBox(self.frame) self.groupBox_2.setMinimumSize(QtCore.QSize(150, 67)) @@ -1323,9 +1374,9 @@ class Ui_Form(object): self.ObjRot_button_select_angle.setMaximumSize(QtCore.QSize(80, 16777215)) self.ObjRot_button_select_angle.setObjectName(_fromUtf8("ObjRot_button_select_angle")) self.gridLayout_24.addWidget(self.ObjRot_button_select_angle, 0, 0, 1, 1) - icon67 = QtGui.QIcon() - icon67.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_click.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_5.addTab(self.tab_10, icon67, _fromUtf8("")) + icon69 = QtGui.QIcon() + icon69.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_click.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_5.addTab(self.tab_10, icon69, _fromUtf8("")) self.gridLayout_29.addWidget(self.tabWidget_5, 0, 0, 1, 1) self.horizontalLayout_13 = QtGui.QHBoxLayout() self.horizontalLayout_13.setObjectName(_fromUtf8("horizontalLayout_13")) @@ -1353,8 +1404,8 @@ class Ui_Form(object): self.ObjRot_button_reset.setMaximumSize(QtCore.QSize(60, 16777215)) self.ObjRot_button_reset.setObjectName(_fromUtf8("ObjRot_button_reset")) self.horizontalLayout_14.addWidget(self.ObjRot_button_reset) - spacerItem12 = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout_14.addItem(spacerItem12) + spacerItem13 = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout_14.addItem(spacerItem13) self.ObjRot_button_apply = QtGui.QPushButton(self.frame) self.ObjRot_button_apply.setMinimumSize(QtCore.QSize(40, 0)) self.ObjRot_button_apply.setMaximumSize(QtCore.QSize(60, 16777215)) @@ -1362,8 +1413,8 @@ class Ui_Form(object): self.horizontalLayout_14.addWidget(self.ObjRot_button_apply) self.gridLayout_50.addLayout(self.horizontalLayout_14, 3, 0, 1, 1) self.gridLayout_52.addWidget(self.frame, 0, 0, 1, 1) - spacerItem13 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_52.addItem(spacerItem13, 1, 0, 1, 1) + spacerItem14 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_52.addItem(spacerItem14, 1, 0, 1, 1) self.tabWidget_2.addTab(self.rotate_tab, _fromUtf8("")) self.translate_tab = QtGui.QWidget() self.translate_tab.setObjectName(_fromUtf8("translate_tab")) @@ -1474,9 +1525,9 @@ class Ui_Form(object): self.gridLayout_27.addLayout(self.gridLayout_41, 2, 0, 1, 1) self.gridLayout_26.addLayout(self.gridLayout_27, 2, 0, 1, 1) self.gridLayout_15.addWidget(self.groupBox_3, 0, 0, 1, 1) - icon68 = QtGui.QIcon() - icon68.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_startPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_4.addTab(self.tab_5, icon68, _fromUtf8("")) + icon70 = QtGui.QIcon() + icon70.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_startPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_4.addTab(self.tab_5, icon70, _fromUtf8("")) self.tab_6 = QtGui.QWidget() self.tab_6.setObjectName(_fromUtf8("tab_6")) self.gridLayout_42 = QtGui.QGridLayout(self.tab_6) @@ -1551,9 +1602,9 @@ class Ui_Form(object): self.gridLayout_44.addLayout(self.gridLayout_47, 0, 0, 1, 1) self.gridLayout_43.addLayout(self.gridLayout_44, 2, 0, 1, 1) self.gridLayout_42.addWidget(self.groupBox_4, 0, 0, 1, 1) - icon69 = QtGui.QIcon() - icon69.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_endPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_4.addTab(self.tab_6, icon69, _fromUtf8("")) + icon71 = QtGui.QIcon() + icon71.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_endPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_4.addTab(self.tab_6, icon71, _fromUtf8("")) self.gridLayout_48.addWidget(self.tabWidget_4, 2, 0, 1, 1) self.horizontalLayout_16 = QtGui.QHBoxLayout() self.horizontalLayout_16.setObjectName(_fromUtf8("horizontalLayout_16")) @@ -1562,8 +1613,8 @@ class Ui_Form(object): self.ObjTrans_button_reset.setMaximumSize(QtCore.QSize(60, 16777215)) self.ObjTrans_button_reset.setObjectName(_fromUtf8("ObjTrans_button_reset")) self.horizontalLayout_16.addWidget(self.ObjTrans_button_reset) - spacerItem14 = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout_16.addItem(spacerItem14) + spacerItem15 = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout_16.addItem(spacerItem15) self.ObjTrans_button_apply = QtGui.QPushButton(self.frame_2) self.ObjTrans_button_apply.setMinimumSize(QtCore.QSize(40, 0)) self.ObjTrans_button_apply.setMaximumSize(QtCore.QSize(60, 16777215)) @@ -1571,8 +1622,8 @@ class Ui_Form(object): self.horizontalLayout_16.addWidget(self.ObjTrans_button_apply) self.gridLayout_48.addLayout(self.horizontalLayout_16, 3, 0, 1, 1) self.gridLayout_49.addWidget(self.frame_2, 0, 0, 1, 1) - spacerItem15 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_49.addItem(spacerItem15, 1, 0, 1, 1) + spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_49.addItem(spacerItem16, 1, 0, 1, 1) self.tabWidget_2.addTab(self.translate_tab, _fromUtf8("")) self.gridLayout_11.addWidget(self.tabWidget_2, 0, 0, 1, 1) self.tabWidget.addTab(self.Modif_Tab, _fromUtf8("")) @@ -1587,75 +1638,96 @@ class Ui_Form(object): sizePolicy.setHeightForWidth(self.button_alignview.sizePolicy().hasHeightForWidth()) self.button_alignview.setSizePolicy(sizePolicy) self.button_alignview.setMaximumSize(QtCore.QSize(16777215, 16777215)) - icon70 = QtGui.QIcon() - icon70.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlign.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_alignview.setIcon(icon70) + icon72 = QtGui.QIcon() + icon72.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlign.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_alignview.setIcon(icon72) 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) - spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_13.addItem(spacerItem16, 1, 0, 1, 1) - icon71 = QtGui.QIcon() - icon71.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_view.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.View_Tab, icon71, _fromUtf8("")) + spacerItem17 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_13.addItem(spacerItem17, 2, 0, 1, 1) + self.button_trackcamera = QtGui.QPushButton(self.View_Tab) + icon73 = QtGui.QIcon() + icon73.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_trackCamera.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_trackcamera.setIcon(icon73) + self.button_trackcamera.setIconSize(QtCore.QSize(32, 32)) + self.button_trackcamera.setObjectName(_fromUtf8("button_trackcamera")) + self.gridLayout_13.addWidget(self.button_trackcamera, 1, 0, 1, 1) + icon74 = QtGui.QIcon() + icon74.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_view.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.View_Tab, icon74, _fromUtf8("")) self.tab_3 = QtGui.QWidget() self.tab_3.setObjectName(_fromUtf8("tab_3")) self.gridLayout_35 = QtGui.QGridLayout(self.tab_3) self.gridLayout_35.setObjectName(_fromUtf8("gridLayout_35")) - self.button_isDistance = QtGui.QPushButton(self.tab_3) - icon72 = QtGui.QIcon() - icon72.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_distanceBetween.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isDistance.setIcon(icon72) - self.button_isDistance.setIconSize(QtCore.QSize(32, 32)) - self.button_isDistance.setObjectName(_fromUtf8("button_isDistance")) - self.gridLayout_35.addWidget(self.button_isDistance, 5, 0, 1, 1) + self.button_isView = QtGui.QPushButton(self.tab_3) + icon75 = QtGui.QIcon() + icon75.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_FCCamera_02.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isView.setIcon(icon75) + self.button_isView.setIconSize(QtCore.QSize(32, 32)) + self.button_isView.setObjectName(_fromUtf8("button_isView")) + self.gridLayout_35.addWidget(self.button_isView, 8, 0, 1, 1) + spacerItem18 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_35.addItem(spacerItem18, 9, 0, 1, 1) self.button_isParallel = QtGui.QPushButton(self.tab_3) - icon73 = QtGui.QIcon() - icon73.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isParallel.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isParallel.setIcon(icon73) + icon76 = QtGui.QIcon() + icon76.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isParallel.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isParallel.setIcon(icon76) 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) - icon74 = QtGui.QIcon() - icon74.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isCoplanar.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isCoplanar.setIcon(icon74) + icon77 = QtGui.QIcon() + icon77.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isCoplanar.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isCoplanar.setIcon(icon77) 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) - spacerItem17 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_35.addItem(spacerItem17, 7, 0, 1, 1) - self.button_isPerpendicular = QtGui.QPushButton(self.tab_3) - icon75 = QtGui.QIcon() - icon75.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isPerpendicular.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isPerpendicular.setIcon(icon75) - 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_isClearance = QtGui.QPushButton(self.tab_3) - icon76 = QtGui.QIcon() - icon76.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isClearance.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isClearance.setIcon(icon76) - self.button_isClearance.setIconSize(QtCore.QSize(32, 32)) - self.button_isClearance.setObjectName(_fromUtf8("button_isClearance")) - self.gridLayout_35.addWidget(self.button_isClearance, 3, 0, 1, 1) self.button_isAngle = QtGui.QPushButton(self.tab_3) - icon77 = QtGui.QIcon() - icon77.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_angleBetween.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isAngle.setIcon(icon77) + icon78 = QtGui.QIcon() + icon78.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_angleBetween.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isAngle.setIcon(icon78) self.button_isAngle.setIconSize(QtCore.QSize(32, 32)) self.button_isAngle.setObjectName(_fromUtf8("button_isAngle")) self.gridLayout_35.addWidget(self.button_isAngle, 4, 0, 1, 1) - self.button_isView = QtGui.QPushButton(self.tab_3) - icon78 = QtGui.QIcon() - icon78.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_FCCamera_02.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isView.setIcon(icon78) - self.button_isView.setIconSize(QtCore.QSize(32, 32)) - self.button_isView.setObjectName(_fromUtf8("button_isView")) - self.gridLayout_35.addWidget(self.button_isView, 6, 0, 1, 1) + self.button_isLength = QtGui.QPushButton(self.tab_3) icon79 = QtGui.QIcon() - icon79.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_check.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.tab_3, icon79, _fromUtf8("")) + icon79.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isLength.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isLength.setIcon(icon79) + self.button_isLength.setIconSize(QtCore.QSize(32, 32)) + self.button_isLength.setObjectName(_fromUtf8("button_isLength")) + self.gridLayout_35.addWidget(self.button_isLength, 6, 0, 1, 1) + self.button_isPerpendicular = QtGui.QPushButton(self.tab_3) + icon80 = QtGui.QIcon() + icon80.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isPerpendicular.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isPerpendicular.setIcon(icon80) + 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_isDistance = QtGui.QPushButton(self.tab_3) + icon81 = QtGui.QIcon() + icon81.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_distanceBetween.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isDistance.setIcon(icon81) + self.button_isDistance.setIconSize(QtCore.QSize(32, 32)) + self.button_isDistance.setObjectName(_fromUtf8("button_isDistance")) + self.gridLayout_35.addWidget(self.button_isDistance, 5, 0, 1, 1) + self.button_isClearance = QtGui.QPushButton(self.tab_3) + icon82 = QtGui.QIcon() + icon82.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isClearance.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isClearance.setIcon(icon82) + self.button_isClearance.setIconSize(QtCore.QSize(32, 32)) + self.button_isClearance.setObjectName(_fromUtf8("button_isClearance")) + self.gridLayout_35.addWidget(self.button_isClearance, 3, 0, 1, 1) + self.button_isArea = QtGui.QPushButton(self.tab_3) + icon83 = QtGui.QIcon() + icon83.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isArea.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isArea.setIcon(icon83) + self.button_isArea.setIconSize(QtCore.QSize(32, 32)) + self.button_isArea.setObjectName(_fromUtf8("button_isArea")) + self.gridLayout_35.addWidget(self.button_isArea, 7, 0, 1, 1) + icon84 = QtGui.QIcon() + icon84.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_check.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.tab_3, icon84, _fromUtf8("")) self.gridLayout_30.addWidget(self.tabWidget, 0, 0, 1, 1) self.tabWidget_0.addTab(self.tab_2, _fromUtf8("")) self.gridLayout_9.addWidget(self.tabWidget_0, 0, 0, 1, 1) @@ -1666,8 +1738,8 @@ class Ui_Form(object): self.button_WF_quit = QtGui.QPushButton(Form) self.button_WF_quit.setObjectName(_fromUtf8("button_WF_quit")) self.horizontalLayout_9.addWidget(self.button_WF_quit) - spacerItem18 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout_9.addItem(spacerItem18) + spacerItem19 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout_9.addItem(spacerItem19) self.label_release = QtGui.QLabel(Form) self.label_release.setObjectName(_fromUtf8("label_release")) self.horizontalLayout_9.addWidget(self.label_release) @@ -1677,7 +1749,7 @@ class Ui_Form(object): self.tabWidget_0.setCurrentIndex(0) self.tabWidget.setCurrentIndex(0) self.point_loc_comboBox.setCurrentIndex(1) - self.tabWidget_2.setCurrentIndex(3) + self.tabWidget_2.setCurrentIndex(2) self.tabWidget_3.setCurrentIndex(0) self.ObjRot_comboBox_axis.setCurrentIndex(0) self.ObjRot_comboBox_center.setCurrentIndex(2) @@ -1976,6 +2048,17 @@ 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_Tab2), QtGui.QApplication.translate("Form", "Axis 2/2", 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_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_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_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" @@ -1987,19 +2070,13 @@ class Ui_Form(object): "in \"Ori. Pref.\" TAB", 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 (Max 100).", 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_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_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_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_circle_to_sketch.setToolTip(QtGui.QApplication.translate("Form", "Transform Circle(s) and Arc(s) in Sketch\'s object(s) by projection onto the Sketch\'s Plane:\n" +"- First select an existing Skecth;\n" +"- Select as much as Circles and arcs needed;\n" +"Then click on this button.", None, QtGui.QApplication.UnicodeUTF8)) + self.button_circle_to_sketch.setText(QtGui.QApplication.translate("Form", "Circle(s) to Sketch", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QtGui.QApplication.translate("Form", "Circle", None, QtGui.QApplication.UnicodeUTF8)) self.button_click_for_plane.setToolTip(QtGui.QApplication.translate("Form", "Click:\n" "Create a rectangular Plane perpendicular to the view at location of one mouse click.\n" @@ -2100,24 +2177,26 @@ class Ui_Form(object): self.button_boundingboxes.setText(QtGui.QApplication.translate("Form", "Bounding Box(es)", None, QtGui.QApplication.UnicodeUTF8)) self.button_boundingbox.setToolTip(QtGui.QApplication.translate("Form", "Create one bounding box around all of selected object(s).", None, QtGui.QApplication.UnicodeUTF8)) self.button_boundingbox.setText(QtGui.QApplication.translate("Form", "Bounding Box", None, QtGui.QApplication.UnicodeUTF8)) - self.button_cylinder_create.setToolTip(QtGui.QApplication.translate("Form", "Create a Cylinder:\n" -"- First select an Axis and a Ref. Point. \n" + self.button_cylinder_create.setToolTip(QtGui.QApplication.translate("Form", "Create a Cylinder aligned on Axes:\n" +"- First select one or several couple of ( Axis and a Ref. Point). \n" "- Define Diameter and Length if needed.\n" "Then Click the button...\n" "It will create a Cylinder aligned on the selected axis \n" -"with one of the extremities at the Ref. point.", None, QtGui.QApplication.UnicodeUTF8)) +"with one of the extremities at the Ref. point,\n" +"for all couple selected.", None, QtGui.QApplication.UnicodeUTF8)) self.button_cylinder_create.setText(QtGui.QApplication.translate("Form", "Cylinder", None, QtGui.QApplication.UnicodeUTF8)) - self.diameter_cylinder.setToolTip(QtGui.QApplication.translate("Form", "Diameter of the Cylinder.", None, QtGui.QApplication.UnicodeUTF8)) + self.diameter_cylinder.setToolTip(QtGui.QApplication.translate("Form", "Radius of the Cylinder.", None, QtGui.QApplication.UnicodeUTF8)) self.diameter_cylinder.setText(QtGui.QApplication.translate("Form", "2.0", None, QtGui.QApplication.UnicodeUTF8)) self.length_cylinder.setToolTip(QtGui.QApplication.translate("Form", "Length of the Cylinder.\n" "Negative value will reverse the direction from Ref. Point", None, QtGui.QApplication.UnicodeUTF8)) self.length_cylinder.setText(QtGui.QApplication.translate("Form", "20.0", None, QtGui.QApplication.UnicodeUTF8)) - self.button_cube_create.setToolTip(QtGui.QApplication.translate("Form", "Create a Cuboid:\n" -"- First select an Axis and a Ref. Point. \n" + self.button_cube_create.setToolTip(QtGui.QApplication.translate("Form", "Create a Cuboid aligned on Axes:\n" +"- First select one or several couple of ( Axis and a Ref. Point). \n" "- Define Dimensions if needed.\n" "Then Click the button...\n" "It will create a Cube aligned on the selected axis \n" -"with one of the extremities at Ref. point.", None, QtGui.QApplication.UnicodeUTF8)) +"with one of the extremities at Ref. point,\n" +"for all couple selected.", None, QtGui.QApplication.UnicodeUTF8)) self.button_cube_create.setText(QtGui.QApplication.translate("Form", "Cube", None, QtGui.QApplication.UnicodeUTF8)) self.section_cube.setToolTip(QtGui.QApplication.translate("Form", "Section (Length, Width) of the Cube.", None, QtGui.QApplication.UnicodeUTF8)) self.section_cube.setText(QtGui.QApplication.translate("Form", "2.0,2.0", None, QtGui.QApplication.UnicodeUTF8)) @@ -2149,6 +2228,37 @@ class Ui_Form(object): self.spin_frequency_dome.setToolTip(QtGui.QApplication.translate("Form", "Frequency Parameter (Integer between 1 to 20).", None, QtGui.QApplication.UnicodeUTF8)) self.diameter_dome.setToolTip(QtGui.QApplication.translate("Form", "Diameter of the Dome.", None, QtGui.QApplication.UnicodeUTF8)) self.diameter_dome.setText(QtGui.QApplication.translate("Form", "10.0", None, QtGui.QApplication.UnicodeUTF8)) + self.button_letter.setToolTip(QtGui.QApplication.translate("Form", "AB:\n" +"Create 3D Text attached to a Point. \n" +"- First select a Plane\n" +"- Then push this button\n" +"in this case the center of the text is attached to center of the Plane;\n" +"or\n" +"- First select a Plane and a Point on the Plane\n" +"- Then push this button\n" +"NB:\n" +" Change the text and his size if needed", None, QtGui.QApplication.UnicodeUTF8)) + self.button_letter.setText(QtGui.QApplication.translate("Form", "AB", None, QtGui.QApplication.UnicodeUTF8)) + self.letter.setToolTip(QtGui.QApplication.translate("Form", "Put the desired text here", None, QtGui.QApplication.UnicodeUTF8)) + self.letter.setText(QtGui.QApplication.translate("Form", "A", None, QtGui.QApplication.UnicodeUTF8)) + self.size_letter.setToolTip(QtGui.QApplication.translate("Form", "Size of the font.", None, QtGui.QApplication.UnicodeUTF8)) + self.size_letter.setText(QtGui.QApplication.translate("Form", "2.0", None, QtGui.QApplication.UnicodeUTF8)) + self.button_revolve.setToolTip(QtGui.QApplication.translate("Form", "Revolve:\n" +"Make the revolution of Edge(s) or Wire(s) around an Axis:\n" +"- Select one or several wire(s)\n" +"- Then push this button\n" +"or\n" +"- Select FIRST one Point as center of rotation and one Axis as rotation axis !\n" +"- Select one or several wire(s)\n" +"- Then push this button\n" +"\n" +"NB:\n" +" You can also define the angle of revolution if needed\n" +" If no Axis is selected the Z axis is considered as Axis of rotation !\n" +" If no Point is selected the Origin is considered as Center of rotation !", None, QtGui.QApplication.UnicodeUTF8)) + self.button_revolve.setText(QtGui.QApplication.translate("Form", "Revolve", None, QtGui.QApplication.UnicodeUTF8)) + self.angle_revolve.setToolTip(QtGui.QApplication.translate("Form", "Angle of the revolution in degrees.", None, QtGui.QApplication.UnicodeUTF8)) + self.angle_revolve.setText(QtGui.QApplication.translate("Form", "360", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.Objects_Tab2), QtGui.QApplication.translate("Form", "Object", None, QtGui.QApplication.UnicodeUTF8)) self.button_alignface2view.setToolTip(QtGui.QApplication.translate("Form", "Align the face of selected object(s) to the actual view Plane.\n" " - Click first to select a Face of one or several objects.\n" @@ -2209,16 +2319,30 @@ class Ui_Form(object): "First Click on the line/edge in the view \n" "and push this button to accept...", None, QtGui.QApplication.UnicodeUTF8)) self.button_cut_select_line.setText(QtGui.QApplication.translate("Form", "Select Cut Line", None, QtGui.QApplication.UnicodeUTF8)) - self.button_cut_select_plane.setToolTip(QtGui.QApplication.translate("Form", "Select the reference Plane to cut the Object from:\n" + self.button_cut_select_plane.setToolTip(QtGui.QApplication.translate("Form", "Select the Reference Plane to cut the Object from:\n" "First Click on the plane in the view \n" "and push this button to accept...\n" -"(Note that the Angle is calculated from this Plane)", None, QtGui.QApplication.UnicodeUTF8)) +"\n" +"The Reference Plane is the Plane you pose the object on before to use a saw! \n" +"(Note that the Angle is calculated from the Normal at this Plane)", None, QtGui.QApplication.UnicodeUTF8)) self.button_cut_select_plane.setText(QtGui.QApplication.translate("Form", "Select Ref. Plane", None, QtGui.QApplication.UnicodeUTF8)) + self.label_angle.setToolTip(QtGui.QApplication.translate("Form", "Angle of cutting relative to the Normal of the Reference Plane (in degrees).\n" +"\n" +" 0.0 means that the Plane of cutting is along the Cut Line with \n" +"a 90 deg angle with Reference Plane.", None, QtGui.QApplication.UnicodeUTF8)) self.label_angle.setText(QtGui.QApplication.translate("Form", "Angle", None, QtGui.QApplication.UnicodeUTF8)) - self.angle_cut_object.setToolTip(QtGui.QApplication.translate("Form", "Angle of cutting relative to the Reference Plane (in degrees).", None, QtGui.QApplication.UnicodeUTF8)) + self.angle_cut_object.setToolTip(QtGui.QApplication.translate("Form", "Angle of cutting relative to the Normal of the Reference Plane (in degrees).\n" +"\n" +" 0.0 means that the Plane of cutting is along the Cut Line with \n" +"a 90 deg angle with Reference Plane.", None, QtGui.QApplication.UnicodeUTF8)) self.angle_cut_object.setText(QtGui.QApplication.translate("Form", "0.0", None, QtGui.QApplication.UnicodeUTF8)) + self.label_thickness.setToolTip(QtGui.QApplication.translate("Form", "Thickness of the Cut.\n" +"\n" +"i.e. the thickness of a saw.", None, QtGui.QApplication.UnicodeUTF8)) self.label_thickness.setText(QtGui.QApplication.translate("Form", "Thickness", None, QtGui.QApplication.UnicodeUTF8)) - self.thickness_cut_object.setToolTip(QtGui.QApplication.translate("Form", "Thickness of the Cut.", None, QtGui.QApplication.UnicodeUTF8)) + self.thickness_cut_object.setToolTip(QtGui.QApplication.translate("Form", "Thickness of the Cut.\n" +"\n" +"i.e. the thickness of a saw.", None, QtGui.QApplication.UnicodeUTF8)) self.thickness_cut_object.setText(QtGui.QApplication.translate("Form", "0.0", None, QtGui.QApplication.UnicodeUTF8)) self.button_cut_reset.setText(QtGui.QApplication.translate("Form", "Reset", None, QtGui.QApplication.UnicodeUTF8)) self.button_cut_apply.setToolTip(QtGui.QApplication.translate("Form", "Cut an object by selecting a Line cut, a Plane and an Angle regarding the Plane.", None, QtGui.QApplication.UnicodeUTF8)) @@ -2356,13 +2480,12 @@ class Ui_Form(object): "or aligned on 2 Points.\n" "ReClick with same selection, will reverse the direction.", None, QtGui.QApplication.UnicodeUTF8)) self.button_alignview.setText(QtGui.QApplication.translate("Form", "Align View to ...", None, QtGui.QApplication.UnicodeUTF8)) + self.button_trackcamera.setText(QtGui.QApplication.translate("Form", "Camera Track", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.View_Tab), QtGui.QApplication.translate("Form", "View", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isDistance.setToolTip(QtGui.QApplication.translate("Form", "Check for two Points distance:\n" -"Distances measurement and Delta values (on main Axes) between two Points\n" -"- Select the 2 Points and\n" -"Click this button\n" -" ", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isDistance.setText(QtGui.QApplication.translate("Form", "Distance ?", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isView.setToolTip(QtGui.QApplication.translate("Form", "Detect the position of the camera.\n" +"The returned value is the value provided \n" +"by the function getCameraOrientation().", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isView.setText(QtGui.QApplication.translate("Form", "View ?", 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\n" @@ -2375,17 +2498,6 @@ class Ui_Form(object): "\n" "NB: You can change the tolerance in \"Ori. Pref.\" TAB", None, QtGui.QApplication.UnicodeUTF8)) self.button_isCoplanar.setText(QtGui.QApplication.translate("Form", "are Coplanar ?", None, QtGui.QApplication.UnicodeUTF8)) - 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\n" -"\n" -"NB: You can change the tolerance in \"Ori. Pref.\" TAB", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isPerpendicular.setText(QtGui.QApplication.translate("Form", "are Perpendicular ?", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isClearance.setToolTip(QtGui.QApplication.translate("Form", "Check for two Objects Clearance distance:\n" -"Quick measurements between parallel faces and similarly placed objects\n" -"- Select the 2 Objects and\n" -"Click this button", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isClearance.setText(QtGui.QApplication.translate("Form", "Distance Clearance ?", None, QtGui.QApplication.UnicodeUTF8)) self.button_isAngle.setToolTip(QtGui.QApplication.translate("Form", "Check for two Edges/Planes angle:\n" "Angle measurement between two Edges or two Planes\n" "- Select the 2 Edges and\n" @@ -2400,10 +2512,34 @@ class Ui_Form(object): "NB:\n" " Normals of Planes will be used. ", None, QtGui.QApplication.UnicodeUTF8)) self.button_isAngle.setText(QtGui.QApplication.translate("Form", "Angle ?", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isView.setToolTip(QtGui.QApplication.translate("Form", "Detect the position of the camera.\n" -"The returned value is the value provided \n" -"by the function getCameraOrientation().", None, QtGui.QApplication.UnicodeUTF8)) - self.button_isView.setText(QtGui.QApplication.translate("Form", "View ?", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isLength.setToolTip(QtGui.QApplication.translate("Form", "Check for Line Length:\n" +"Length measurement and Delta values (on main Axes) for a Line\n" +"- Select the Line and\n" +"Click this button\n" +" ", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isLength.setText(QtGui.QApplication.translate("Form", "Length ?", None, QtGui.QApplication.UnicodeUTF8)) + 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\n" +"\n" +"NB: You can change the tolerance in \"Ori. Pref.\" TAB", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isPerpendicular.setText(QtGui.QApplication.translate("Form", "are Perpendicular ?", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isDistance.setToolTip(QtGui.QApplication.translate("Form", "Check for two Points distance:\n" +"Distances measurement and Delta values (on main Axes) between two Points\n" +"- Select the 2 Points and\n" +"Click this button\n" +" ", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isDistance.setText(QtGui.QApplication.translate("Form", "Distance ?", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isClearance.setToolTip(QtGui.QApplication.translate("Form", "Check for two Objects Clearance distance:\n" +"Quick measurements between parallel faces and similarly placed objects\n" +"- Select the 2 Objects and\n" +"Click this button", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isClearance.setText(QtGui.QApplication.translate("Form", "Distance Clearance ?", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isArea.setToolTip(QtGui.QApplication.translate("Form", "Check for surface Area:\n" +"Area measurement for a Plane or a set of Planes.\n" +"- Select One or several Planes and\n" +"Click this button", None, QtGui.QApplication.UnicodeUTF8)) + self.button_isArea.setText(QtGui.QApplication.translate("Form", "Area ?", 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)) self.button_WF_quit.setText(QtGui.QApplication.translate("Form", "Close", None, QtGui.QApplication.UnicodeUTF8)) diff --git a/WorkFeature/WFGui_2015.ui b/WorkFeature/WFGui_2015.ui index e5e1b3b..440a9c1 100644 --- a/WorkFeature/WFGui_2015.ui +++ b/WorkFeature/WFGui_2015.ui @@ -1847,7 +1847,96 @@ Then click on this button. Circle - + + + + + + Select an Axis and a Point to create a Circle +centered on the Point, perpendicular to the Axis +with the given radius. + + + Circle=(Axis, center) + + + + ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_lineCenterCircle.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_lineCenterCircle.svg + + + + 32 + 32 + + + + + + + + + 40 + 0 + + + + + 60 + 16777215 + + + + Radius of the Circle. + + + 10.0 + + + + + + + + + Select an Axis and a Point to create a Circle +centered on the Axis and tangenting the Point. + + + Circle=(Axis, point) + + + + ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_linePointCircle.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_linePointCircle.svg + + + + 32 + 32 + + + + + + + + Select 3 Points to create a Circle. + + + Circle=(3 points) + + + + ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_3pointsCircle.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_3pointsCircle.svg + + + + 32 + 32 + + + + + @@ -1907,66 +1996,17 @@ in "Ori. Pref." TAB - - - - - - Select an Axis and a Point to create a Circle -centered on the Point, perpendicular to the Axis -with the given radius. - - - Circle=(Axis, center) - - - - ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_lineCenterCircle.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_lineCenterCircle.svg - - - - 32 - 32 - - - - - - - - - 40 - 0 - - - - - 60 - 16777215 - - - - Radius of the Circle. - - - 10.0 - - - - - - - + + - Select an Axis and a Point to create a Circle -centered on the Axis and tangenting the Point. + Select a center and 2 Points to create an Ellipse. - Circle=(Axis, point) + Ellipse=(3 points) - ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_linePointCircle.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_linePointCircle.svg + ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_3pointsEllipse.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_3pointsEllipse.svg @@ -1989,17 +2029,20 @@ centered on the Axis and tangenting the Point. - - + + - Select a center and 2 Points to create an Ellipse. + Transform Circle(s) and Arc(s) in Sketch's object(s) by projection onto the Sketch's Plane: +- First select an existing Skecth; +- Select as much as Circles and arcs needed; +Then click on this button. - Ellipse=(3 points) + Circle(s) to Sketch - ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_3pointsEllipse.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_3pointsEllipse.svg + ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_2Sketch.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_2Sketch.svg @@ -2009,25 +2052,18 @@ centered on the Axis and tangenting the Point. - - - - Select 3 Points to create a Circle. + + + + Qt::Vertical - - Circle=(3 points) - - - - ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_3pointsCircle.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_3pointsCircle.svg - - + - 32 - 32 + 20 + 121 - + @@ -2729,12 +2765,13 @@ NB: - Create a Cylinder: -- First select an Axis and a Ref. Point. + Create a Cylinder aligned on Axes: +- First select one or several couple of ( Axis and a Ref. Point). - Define Diameter and Length if needed. Then Click the button... It will create a Cylinder aligned on the selected axis -with one of the extremities at the Ref. point. +with one of the extremities at the Ref. point, +for all couple selected. Cylinder @@ -2772,7 +2809,7 @@ with one of the extremities at the Ref. point. - Diameter of the Cylinder. + Radius of the Cylinder. 2.0 @@ -2815,12 +2852,13 @@ Negative value will reverse the direction from Ref. Point - Create a Cuboid: -- First select an Axis and a Ref. Point. + Create a Cuboid aligned on Axes: +- First select one or several couple of ( Axis and a Ref. Point). - Define Dimensions if needed. Then Click the button... It will create a Cube aligned on the selected axis -with one of the extremities at Ref. point. +with one of the extremities at Ref. point, +for all couple selected. Cube @@ -3048,6 +3086,147 @@ Original code from : Ulrich Brammer + + + + + AB: +Create 3D Text attached to a Point. +- First select a Plane +- Then push this button +in this case the center of the text is attached to center of the Plane; +or +- First select a Plane and a Point on the Plane +- Then push this button +NB: + Change the text and his size if needed + + + AB + + + + ../../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_pointText.svg../../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_pointText.svg + + + + 32 + 32 + + + + + + + + + 70 + 16777215 + + + + Put the desired text here + + + A + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 50 + 16777215 + + + + Size of the font. + + + 2.0 + + + + + + + + + + + Revolve: +Make the revolution of Edge(s) or Wire(s) around an Axis: +- Select one or several wire(s) +- Then push this button +or +- Select FIRST one Point as center of rotation and one Axis as rotation axis ! +- Select one or several wire(s) +- Then push this button + +NB: + You can also define the angle of revolution if needed + If no Axis is selected the Z axis is considered as Axis of rotation ! + If no Point is selected the Origin is considered as Center of rotation ! + + + Revolve + + + + ../Icons/WF_Revolve.svg../Icons/WF_Revolve.svg + + + + 32 + 32 + + + + + + + + + 0 + 0 + + + + + 40 + 0 + + + + + 40 + 16777215 + + + + Angle of the revolution in degrees. + + + 360 + + + + + + Qt::Vertical @@ -3070,7 +3249,7 @@ Original code from : Ulrich Brammer - 3 + 2 @@ -3432,10 +3611,12 @@ and push this button to accept... - Select the reference Plane to cut the Object from: + Select the Reference Plane to cut the Object from: First Click on the plane in the view and push this button to accept... -(Note that the Angle is calculated from this Plane) + +The Reference Plane is the Plane you pose the object on before to use a saw! +(Note that the Angle is calculated from the Normal at this Plane) Select Ref. Plane @@ -3472,6 +3653,12 @@ and push this button to accept... 16777215 + + Angle of cutting relative to the Normal of the Reference Plane (in degrees). + + 0.0 means that the Plane of cutting is along the Cut Line with +a 90 deg angle with Reference Plane. + Angle @@ -3498,7 +3685,10 @@ and push this button to accept... - Angle of cutting relative to the Reference Plane (in degrees). + Angle of cutting relative to the Normal of the Reference Plane (in degrees). + + 0.0 means that the Plane of cutting is along the Cut Line with +a 90 deg angle with Reference Plane. 0.0 @@ -3517,6 +3707,11 @@ and push this button to accept... 16777215 + + Thickness of the Cut. + +i.e. the thickness of a saw. + Thickness @@ -3537,7 +3732,9 @@ and push this button to accept... - Thickness of the Cut. + Thickness of the Cut. + +i.e. the thickness of a saw. 0.0 @@ -4765,7 +4962,7 @@ ReClick with same selection, will reverse the direction. - + Qt::Vertical @@ -4778,6 +4975,23 @@ ReClick with same selection, will reverse the direction. + + + + Camera Track + + + + ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_trackCamera.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_trackCamera.svg + + + + 32 + 32 + + + + @@ -4789,21 +5003,19 @@ ReClick with same selection, will reverse the direction. Check - - + + - Check for two Points distance: -Distances measurement and Delta values (on main Axes) between two Points -- Select the 2 Points and -Click this button - + Detect the position of the camera. +The returned value is the value provided +by the function getCameraOrientation(). - Distance ? + View ? - ../../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_distanceBetween.svg../../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_distanceBetween.svg + ../../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_FCCamera_02.svg../../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_FCCamera_02.svg @@ -4813,6 +5025,19 @@ Click this button + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -4861,66 +5086,6 @@ NB: You can change the tolerance in "Ori. Pref." TAB - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Check if two faces or two Edges are Perpendicular: -- Select the 2 faces/planes or 2 Edges/Lines and -Click this button - -NB: You can change the tolerance in "Ori. Pref." TAB - - - are Perpendicular ? - - - - ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_isPerpendicular.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_isPerpendicular.svg - - - - 32 - 32 - - - - - - - - Check for two Objects Clearance distance: -Quick measurements between parallel faces and similarly placed objects -- Select the 2 Objects and -Click this button - - - Distance Clearance ? - - - - ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_isClearance.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_isClearance.svg - - - - 32 - 32 - - - - @@ -4954,18 +5119,114 @@ NB: - + - Detect the position of the camera. -The returned value is the value provided -by the function getCameraOrientation(). + Check for Line Length: +Length measurement and Delta values (on main Axes) for a Line +- Select the Line and +Click this button + - View ? + Length ? - ../../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_FCCamera_02.svg../../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_FCCamera_02.svg + ../Icons/WF_isLength.svg../Icons/WF_isLength.svg + + + + 32 + 32 + + + + + + + + Check if two faces or two Edges are Perpendicular: +- Select the 2 faces/planes or 2 Edges/Lines and +Click this button + +NB: You can change the tolerance in "Ori. Pref." TAB + + + are Perpendicular ? + + + + ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_isPerpendicular.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_isPerpendicular.svg + + + + 32 + 32 + + + + + + + + Check for two Points distance: +Distances measurement and Delta values (on main Axes) between two Points +- Select the 2 Points and +Click this button + + + + Distance ? + + + + ../../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_distanceBetween.svg../../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_distanceBetween.svg + + + + 32 + 32 + + + + + + + + Check for two Objects Clearance distance: +Quick measurements between parallel faces and similarly placed objects +- Select the 2 Objects and +Click this button + + + Distance Clearance ? + + + + ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_isClearance.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_isClearance.svg + + + + 32 + 32 + + + + + + + + Check for surface Area: +Area measurement for a Plane or a set of Planes. +- Select One or several Planes and +Click this button + + + Area ? + + + + ../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_isArea.svg../../../../../../../../home/laurent/Documents/03_Plans/Python/Icons/WF_isArea.svg diff --git a/WorkFeature/WF_ObjRot_2015.py b/WorkFeature/WF_ObjRot_2015.py index 81fc509..c401413 100644 --- a/WorkFeature/WF_ObjRot_2015.py +++ b/WorkFeature/WF_ObjRot_2015.py @@ -1502,56 +1502,55 @@ class ObjectRotationTab(): } for m_key, m_val in self.connections_for_button_clicked.items(): - #print_msg( "Connecting : " + str(m_key) + " and " + str(m_val) ) + #func.print_msg( "Connecting : " + str(m_key) + " and " + str(m_val) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL("clicked()"),getattr(self,str(m_val))) # Connect to Rotation functions for m_key, m_val in self.connections_for_ObjRot_button_pressed.items(): - func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) + #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL("pressed()"),getattr(self.rot, str(m_val))) for m_key, m_val in self.connections_for_ObjRot_combobox_changed.items(): - print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) + #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL(_fromUtf8("currentIndexChanged(QString)")),getattr(self.rot, str(m_val))) for m_key, m_val in self.connections_for_ObjRot_slider_changed.items(): - func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) + #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL("valueChanged(int)"),getattr(self.rot, str(m_val))) for m_key, m_val in self.connections_for_ObjRot_return_pressed.items(): - func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) + #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL("returnPressed()"),getattr(self.rot, str(m_val))) # Connect to Translation functions for m_key, m_val in self.connections_for_ObjTrans_button_pressed.items(): - func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.trans, str(m_val))) ) + #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.trans, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL("pressed()"),getattr(self.trans, str(m_val))) for m_key, m_val in self.connections_for_ObjTrans_combobox_changed.items(): - func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.trans, str(m_val))) ) + #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.trans, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL(_fromUtf8("currentIndexChanged(QString)")),getattr(self.trans, str(m_val))) for m_key, m_val in self.connections_for_ObjTrans_checkbox_toggled.items(): - #print_msg( "Connecting : " + str(m_key) + " and " + str(m_val) ) - func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.trans, str(m_val))) ) + #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.trans, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL(_fromUtf8("toggled(bool)")),getattr(self.trans, str(m_val))) for m_key, m_val in self.connections_for_ObjTrans_spin_changed.items(): - func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.trans, str(m_val))) ) + #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.trans, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL("valueChanged(int)"),getattr(self.trans, str(m_val))) for m_key, m_val in self.connections_for_ObjTrans_return_pressed.items(): - func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.trans, str(m_val))) ) + #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.trans, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL("returnPressed()"),getattr(self.trans, str(m_val))) diff --git a/WorkFeature/__init__.py b/WorkFeature/__init__.py index 94461c9..7af9e75 100644 --- a/WorkFeature/__init__.py +++ b/WorkFeature/__init__.py @@ -4,7 +4,7 @@ *************************************************************************** * Thanks to original ideas, codes, and support from : * * - Javier Martinez Garcia 2014, 2015 for ideas and first WF codes * -* for tje code on parallelism of two faces * +* for tje code on parallelism of two faces, forTour camera code * * - Jonathan Wiedemann for Gui ideas and for view codes 2014 * * and support * * - NormandC for his support * @@ -58,15 +58,17 @@ if not sys.path.__contains__("/usr/lib/freecad/lib"): import WFGui_2015 as WFGui from WF_ObjRot_2015 import * global myRelease -myRelease = "2015_05_31" +myRelease = "2015_06_22" import os.path +import time import math import itertools import FreeCAD as App import FreeCADGui as Gui from pivy.coin import * +from pivy import coin import Part import Draft from FreeCAD import Base @@ -125,6 +127,7 @@ m_distLine = 10.0 m_angleLine = 45.0 m_angleAlignFaces = 0.0 m_angleAlignEdges = 0.0 +m_angleRevolve = 360.0 m_distPoint = 10.0 m_diameterCylinder = 2.0 m_lengthCylinder = 20.0 @@ -135,6 +138,7 @@ m_widthPlane = 10.0 m_extensionPlane = 50.0 m_extensionAxis = 50.0 m_attach_point = "Mid" +m_letter = "A" m_cut_selectObjects = [] m_angleCutObject = 0.0 @@ -142,6 +146,7 @@ m_thicknessCutObject = 0.0 m_diameterSphere = 10.0 m_diameterDome = 10.0 m_frequencyDome = 2 +m_sizeLetter = 2.0 m_callback = None m_clickForPoint = True @@ -525,6 +530,45 @@ def get_SelectedObjects(info=0, printError=True): printError_msg("No active document !") return + +def getType(objs): + if isinstance(objs,list): + for obj in objs: + print str(type(obj)) + + +def getEdgeType(edge): + "returns the type of geom this edge is based on" + try: + if isinstance(edge.Curve,Part.Line): + return "Line" + elif isinstance(edge.Curve,Part.Circle): + return "Circle" + elif isinstance(edge.Curve,Part.BSplineCurve): + return "BSplineCurve" + elif isinstance(edge.Curve,Part.BezierCurve): + return "BezierCurve" + elif isinstance(edge.Curve,Part.Ellipse): + return "Ellipse" + else: + return "Unknown" + except: + return "Unknown" + +def getShapeType(subObject): + try: + if isinstance(subObject,Part.Edge): + return "Edge" + elif isinstance(subObject,Part.Vertex): + return "Vertex" + elif isinstance(subObject,Part.Face): + return "Face" + elif isinstance(subObject,Part.Wire): + return "Wire" + else: + return "Unknown" + except: + return "Unknown" def definePropOfActiveObj(): Gui.activeDocument().activeObject().LineColor = (red, green, blue) @@ -1478,7 +1522,19 @@ def properties_plane(Plane_User_Name): print_msg("Not able to set Transparency !") return - + + +def plot_text(letter, size, part, name, grp="WorkObjects"): + if not(App.ActiveDocument.getObject( grp )): + App.ActiveDocument.addObject("App::DocumentObjectGroup", grp) + m_s = letter + m_ff = "/usr/share/fonts/truetype/freefont/FreeSans.ttf" + ss = Draft.makeShapeString(String=m_s,FontFile=m_ff,Size=size,Tracking=0) + App.ActiveDocument.getObject( grp ).addObject(ss) + text_User_Name = ss.Label + return text_User_Name, ss + + def plot_point(Vector_point, part, name, grp="WorkPoints"): if not(App.ActiveDocument.getObject( grp )): App.ActiveDocument.addObject("App::DocumentObjectGroup", grp) @@ -1679,6 +1735,19 @@ def plot_sphere(Radius, Point, part="Part::Feature", name="Sphere", grp="WorkObj return sphere_User_Name, sphere +def plot_Shape(shape, part="Part::Feature", name="Shape", grp="WorkObjects"): + if not(App.ActiveDocument.getObject( grp )): + App.ActiveDocument.addObject("App::DocumentObjectGroup", grp) + obj = App.ActiveDocument.addObject(part, name) + obj.Shape = shape + App.ActiveDocument.getObject( grp ).addObject( obj ) + obj_User_Name = obj.Label + Gui.ActiveDocument.getObject( obj_User_Name ).PointColor = (1.00,0.67,0.00) + Gui.ActiveDocument.getObject( obj_User_Name ).LineColor = (1.00,0.67,0.00) + Gui.ActiveDocument.getObject( obj_User_Name ).ShapeColor = (0.00,0.33,1.00) + return obj_User_Name, obj + + def plot_Dome(Point, Radius, Frequency, part="Part::Feature", name="Dome", grp="WorkObjects"): print_msg("plot_Dome :") if not(App.ActiveDocument.getObject( grp )): @@ -2636,7 +2705,7 @@ def plot_distPoint(): print_point(Point_C, msg="Point_C : ") Placement1 = Selected_Point.Placement #Placement1 = Parent_Point.Placement - base1 = Placement1.Base + #base1 = Placement1.Base #base1 = Point_C rot1 = Placement1.Rotation center_Vector = Point_C @@ -3275,10 +3344,10 @@ def plot_planeAxis(): if msg != 0: print_msg(" Number_of_Points = Number_of_Planes") for Selected_Plane, Selected_Point in zip(Plane_List, Point_List): - if msg != 0: - print_msg(" Selected_Plane=" + str(Selected_Plane)) - print_msg(" Selected_Point=" + str(Selected_Point)) - plot_normalAt(Selected_Plane, Selected_Point.Point) + if msg != 0: + print_msg(" Selected_Plane=" + str(Selected_Plane)) + print_msg(" Selected_Point=" + str(Selected_Point)) + plot_normalAt(Selected_Plane, Selected_Point.Point) else : if msg != 0: print_msg(" Number_of_Points > Number_of_Planes") @@ -3549,7 +3618,6 @@ 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: @@ -3723,7 +3791,7 @@ def plot_pointLineAxis(): Define the length and the attach point if needed. A Length of Zero means the length of already selected Axis will be used. """ - msg=0 + msg=verbose createFolders('WorkAxis') error_msg = "Unable to create Parallel Axis : \nSelect one Point and one Line only !" result_msg = " : Parallel Axis created !" @@ -4419,6 +4487,239 @@ def plot_baseObjectAxes(): printError_msg(error_msg) + +def edgeToSketch(m_obj): + msg=verbose + if msg != 0: + print_msg("Found an Edge !" + str(m_obj)) + +def vertexToSketch(m_obj): + msg=verbose + if msg != 0: + print_msg("Found a Vertex !" + str(m_obj)) + + m_rec = Part.makePlane(1,1) + +# P = BRep_Tool.Pnt(TopoDS.Vertex(refSubShape)) +# GeomAPI_ProjectPointOnSurf proj(P,gPlane) +# P = proj.NearestPoint() +# Base.Vector3d p(P.X(),P.Y(),P.Z()) +# invPlm.multVec(p,p) +# point = Part.GeomPoint(p) +# point.Construction = True +# ExternalGeo.push_back(point) + +def faceToSketch(m_obj): + msg=verbose + if msg != 0: + print_msg("Found a Face !" + str(m_obj)) + + print_gui_msg("Faces are not yet supported for external geometry of sketches !") + return + +def errorToSketch(m_obj): + print_gui_msg("Unknown type of geometry !") + return + +options = {'Edge' : edgeToSketch, 'Vertex' : vertexToSketch, 'Face' : faceToSketch, + 'Unknown' : errorToSketch } + +def toSketch(): + + msg=verbose + msg =1 + + m_actDoc=get_ActiveDocument(info=msg) + m_selEx = Gui.Selection.getSelectionEx(m_actDoc.Name) + for m_obj in m_selEx: + for m_sub in m_obj.SubObjects: + options[getShapeType(m_sub)](m_sub) +# #FACE: +# #EDGE: +# #VERTEX: +# pass + +def circle_toSketch(): + """ Transform Circle(s) and Arc(s) in Sketch's Cirlce(s) and Arc(s) by projection onto the Sketch's Plane: + - First select an existing Skecth; + - Select as much as Circles and Arcs needed; + Then click on this button. + """ + msg=verbose + msg=1 + m_tolerance=1e-12 + + m_actDoc = get_ActiveDocument(info=msg) + if m_actDoc == None: + return None + error_msg = "Transform Circle(s) and Arc(s) in Sketch's Circle(s) and Arc(s) : \nFirst select an existing Skecth\nthen select Circles and Arcs !" + result_msg = " : Circle(s) and Arc(s) transformed in Sketch's done!" + + m_sel = Gui.Selection.getSelection(m_actDoc.Name) + m_selEx = Gui.Selection.getSelectionEx(m_actDoc.Name) + if msg != 0: + print_msg("m_sel : " + str(m_sel)) + print_msg("m_selEx : " + str(m_selEx)) + m_num = len(m_sel) + m_num_arc = 0 + if m_num > 1: + # Get the Sketch from the selection + m_obj = m_sel[0] + if msg != 0: + print_msg("m_obj : " + str(m_obj)) + if hasattr(m_obj, 'TypeId'): + m_type = m_obj.TypeId + if msg != 0: + print_msg("m_obj.TypeId : " + str(m_type)) + else: + m_type = m_obj.Type + if msg != 0: + print_msg("m_obj.Type : " + str(m_type)) + + if m_type[:6] == "Sketch": + if msg != 0: + print_msg("Found a Sketch object!") + m_sketch = m_obj + # Get the Sketch Plane info + m_rec = Part.makePlane(1,1) + m_rec.Placement = m_sketch.Placement + m_recN = m_rec.normalAt(0,0) + # Build a geometry list + geoList = [] + # 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] + for SubObject in m_obj.SubObjects: + if SubObject.ShapeType == "Edge": + if msg != 0: + print_msg("Found a Edge object!") + + m_curve = SubObject.Curve + #if str(m_curve)[:6] == "Circle": + if getEdgeType(SubObject) == "Circle": + if msg != 0: + print_msg("SubObject.Curve=" + str(SubObject.Curve)) + print_msg("Object is Circle") + if hasattr(m_curve, 'Center'): + m_center = m_curve.Center + # Projection of the Point selected onto the Sketch Plane + m_center_Proj = m_center.projectToPlane(m_sketch.Placement.Base, m_recN) + # Append the Projection + geoList.append(Part.Point(m_center_Proj)) + # Add the geometry list to the Sketch + m_sketch.addGeometry(geoList) + # Get Normal of the Circle + m_cirN = m_curve.Axis + m_radius = m_curve.Radius + if msg != 0: + print_msg("m_radius=" + str(m_radius)) + # Check if the Plane of the Sketch is the same than the Plane of the Circle + if colinearVectors(m_recN, Base.Vector(0, 0, 0), m_cirN, info=msg, tolerance=m_tolerance): + # creates a circle + print_msg("Sketch and Circle are on Parallel Planes !") + m_begin = SubObject.FirstParameter + m_end = SubObject.LastParameter + if msg != 0: + print_msg("m_begin=" + str(m_begin)) + print_msg("m_end=" + str(m_end)) + + m_circle = Part.Circle(m_center_Proj, m_recN, m_radius) + if msg != 0: + print_msg("m_circle=" + str(m_circle)) + + if abs((m_begin - m_end)%(2*math.pi)) < m_tolerance: + geoList.append(m_circle) + else: + m_curve = Part.ArcOfCircle(m_circle, m_begin, m_end) + if msg != 0: + print_msg("m_curve=" + str(m_curve)) + geoList.append(m_curve) + m_sketch.addGeometry(geoList) + m_num_arc = m_num_arc + 1 + else: + # creates an ellipse + print_msg("Sketch and Circle are NOT on Parallel Planes !") + # Projection of a Circle(R)from a Plane towaerd another + # not paralell Plane gives an Ellipse(R,Rcos(teta)) + # with teta is angle betwwen the 2 Planes and center on + # projected center Point + + m_angle, m_angle_rad = angleBetween(m_recN,m_cirN) + if msg != 0: + print_msg("m_angle=" + str(m_angle)) + print_msg("m_angle_rad=" + str(m_angle_rad)) + + m_minRadius = m_radius*math.cos(m_angle_rad) + if msg != 0: + print_msg("m_minRadius=" + str(m_minRadius)) + + if abs(m_minRadius) < m_tolerance: + S1 = m_center_Proj.add(m_recN.cross(m_cirN).normalize().multiply(m_radius)) + S2 = m_center_Proj.sub(m_recN.cross(m_cirN).normalize().multiply(m_radius)) + geoList.append(Part.Line(S1,S2)) + else: + S1 = m_center_Proj.add(m_recN.cross(m_cirN).normalize().multiply(m_radius)) + S2 = m_center_Proj.add(m_recN.cross(m_recN.cross(m_cirN).normalize()).multiply(m_minRadius)) + m_curve = Part.Ellipse(S1,S2,m_center_Proj) + if msg != 0: + print_msg("m_curve=" + str(m_curve)) + geoList.append(m_curve) + m_sketch.addGeometry(geoList) + m_num_arc = m_num_arc + 1 + elif getEdgeType(SubObject) == "Ellipse": + if msg != 0: + print_msg("SubObject.Curve=" + str(SubObject.Curve)) + print_msg("Object is Ellipse") + if hasattr(m_curve, 'Center'): + m_center = m_curve.Center + # Projection of the Point selected onto the Sketch Plane + m_center_Proj = m_center.projectToPlane(m_sketch.Placement.Base, m_recN) + # Append the Projection + geoList.append(Part.Point(m_center_Proj)) + # Add the geometry list to the Sketch + m_sketch.addGeometry(geoList) + # Get Normal of the Ellipse + m_cirN = m_curve.Axis + # Check if the Plane of the Sketch is the same than the Plane of the Ellipse + if colinearVectors(m_recN, Base.Vector(0, 0, 0), m_cirN, info=msg, tolerance=m_tolerance): + # creates an Ellipse + print_msg("Sketch and Ellipse are on Parallel Planes !") + m_majorRadius = m_curve.MajorRadius + m_minorRadius = m_curve.MinorRadius + m_focus1 = m_curve.Focus1 + m_axis1 = m_center.sub(m_focus1) + if msg != 0: + print_msg("m_majorRadius=" + str(m_majorRadius)) + print_msg("m_minorRadius=" + str(m_minorRadius)) + print_msg("m_focus1=" + str(m_focus1)) + S1 = m_center_Proj.add(m_axis1.normalize().multiply(m_majorRadius)) + S2 = m_center_Proj.add(m_axis1.cross(m_cirN).normalize().multiply(m_minorRadius) ) + + m_curve = Part.Ellipse(S1,S2,m_center_Proj) + if msg != 0: + print_msg("m_curve=" + str(m_curve)) + geoList.append(m_curve) + else: + # creates an ellipse + print_msg("Sketch and Ellipse are NOT on Parallel Planes !") + printError_msg("Sketch and Ellipse are NOT on Parallel Planes ! \nNot yet supported developped !") + m_sketch.addGeometry(geoList) + m_num_arc = m_num_arc + 1 + else: + printError_msg("Not a Circle neither an ellipse \nNot yet supported geometry !") + + else: + continue + # Refresh + App.getDocument(str(m_actDoc.Name)).recompute() + print_msg(str(m_num_arc) + result_msg ) + else: + printError_msg(error_msg) + else: + printError_msg(error_msg) + return + def line_toSketch(): """ Transform Line(s) in Sketch's Line(s) by projection onto the Sketch's Plane: - First select an existing Skecth; @@ -4427,6 +4728,7 @@ def line_toSketch(): """ global verbose msg=verbose + m_tolerance=1e-12 m_actDoc = get_ActiveDocument(info=msg) if m_actDoc == None: @@ -4484,8 +4786,12 @@ def line_toSketch(): # 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)) + if distanceBetween(Projection1, Projection2) < m_tolerance: + # Append the Projection + geoList.append(Part.Point(Projection1)) + else: + # 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 @@ -5812,10 +6118,12 @@ def plot_axisPointCylinder(): """ Plot a cylinder with axis aligned on the selected axis and with center at the selected point. """ - msg=0 + msg=verbose + msg=1 createFolders('WorkObjects') - error_msg = "Unable to create a Cylinder : \nSelect one Axis and one point only!" - result_msg = " : Cylinder created !" + error_msg = "Unable to create a Cylinder : \n"\ + "Select one or several couple of one Axis and one point!" + result_msg = " : Cylinder(s) created !" name = "Cylinder" part = "Part::Feature" global m_diameterCylinder @@ -5826,31 +6134,38 @@ def plot_axisPointCylinder(): return None Selection = get_SelectedObjects(info=msg, printError=False) - if Selection == None: - return None try: SelectedObjects = Selection Number_of_Points = SelectedObjects[0] Number_of_Edges = SelectedObjects[1] if msg != 0: - print_msg("Number_of_Edges=" + str(Number_of_Edges) + - " Number_of_Points=" + str(Number_of_Points)) - if (Number_of_Edges == 1) and (Number_of_Points == 1) : + print_msg(" Number_of_Edges =" + str(Number_of_Edges)) + print_msg(" Number_of_Points=" + str(Number_of_Points)) + + if (Number_of_Edges == 0 ): + printError_msg(error_msg) + return + + if (Number_of_Edges == Number_of_Points) : Point_List = SelectedObjects[3] Edge_List = SelectedObjects[4] if msg != 0: print_msg(str(Point_List)) print_msg(str(Edge_List)) - Vector_C = Point_List[0].Point - Vector_A = Edge_List[0].valueAt( 0.0 ) - Vector_B = Edge_List[0].valueAt( Edge_List[0].Length ) - if msg != 0: - print_point(Vector_C, msg="Reference Point : ") - print_point(Vector_A, msg="Point A : ") - print_point(Vector_B, msg="Point B : ") - - Cyl_User_Name, cylinder = plot_cylinder(m_diameterCylinder, m_lengthCylinder, Vector_C, Vector_A - Vector_B, part, name) - print_msg(str(Cyl_User_Name) + result_msg ) + for Selected_Line, Selected_Point in zip(Edge_List, Point_List): + if msg != 0: + print_msg(" Selected_Line=" + str(Selected_Line)) + print_msg(" Selected_Point=" + str(Selected_Point)) + Vector_C = Selected_Point.Point + Vector_A = Selected_Line.valueAt( 0.0 ) + Vector_B = Selected_Line.valueAt( Selected_Line.Length ) + if msg != 0: + print_point(Vector_C, msg="Reference Point : ") + print_point(Vector_A, msg="Point A : ") + print_point(Vector_B, msg="Point B : ") + + Cyl_User_Name, cylinder = plot_cylinder(m_diameterCylinder, m_lengthCylinder, Vector_C, Vector_A - Vector_B, part, name) + print_msg(str(Cyl_User_Name) + result_msg ) else: printError_msg(error_msg) except: @@ -5891,10 +6206,12 @@ def plot_axisPointCube(): """ Plot a cube with axis aligned on the selected axis and with center at the selected point. """ - msg=0 + msg=verbose + msg=1 createFolders('WorkObjects') - error_msg = "Unable to create a Cube : \nSelect one Axis and one point only!" - result_msg = " : Cube created !" + error_msg = "Unable to create a Cube : \n"\ + "Select or several couple of one Axis and one point!" + result_msg = " : Cube(s) created !" name = "Cuboid" part = "Part::Feature" global m_lengthCube @@ -5906,31 +6223,38 @@ def plot_axisPointCube(): return None Selection = get_SelectedObjects(info=msg, printError=False) - if Selection == None: - return None try: SelectedObjects = Selection Number_of_Points = SelectedObjects[0] Number_of_Edges = SelectedObjects[1] if msg != 0: - print_msg("Number_of_Edges=" + str(Number_of_Edges) + - " Number_of_Points=" + str(Number_of_Points)) - if (Number_of_Edges == 1) and (Number_of_Points == 1) : + print_msg("Number_of_Edges=" + str(Number_of_Edges)) + print_msg(" Number_of_Points=" + str(Number_of_Points)) + + if (Number_of_Edges == 0 ): + printError_msg(error_msg) + return + + if (Number_of_Edges == Number_of_Points) : Point_List = SelectedObjects[3] Edge_List = SelectedObjects[4] if msg != 0: print_msg(str(Point_List)) print_msg(str(Edge_List)) - Vector_C = Point_List[0].Point - Vector_A = Edge_List[0].valueAt( 0.0 ) - Vector_B = Edge_List[0].valueAt( Edge_List[0].Length ) - if msg != 0: - print_point(Vector_C, msg="Reference Point : ") - print_point(Vector_A, msg="Point A : ") - print_point(Vector_B, msg="Point B : ") - - Cube_User_Name, cube = plot_cube(m_lengthCube, m_widthCube, m_heightCube, Vector_C, Vector_A - Vector_B, part, name) - print_msg(str(Cube_User_Name) + result_msg ) + for Selected_Line, Selected_Point in zip(Edge_List, Point_List): + if msg != 0: + print_msg(" Selected_Line=" + str(Selected_Line)) + print_msg(" Selected_Point=" + str(Selected_Point)) + Vector_C = Selected_Point.Point + Vector_A = Selected_Line.valueAt( 0.0 ) + Vector_B = Selected_Line.valueAt( Selected_Line.Length ) + if msg != 0: + print_point(Vector_C, msg="Reference Point : ") + print_point(Vector_A, msg="Point A : ") + print_point(Vector_B, msg="Point B : ") + + Cube_User_Name, cube = plot_cube(m_lengthCube, m_widthCube, m_heightCube, Vector_C, Vector_A - Vector_B, part, name) + print_msg(str(Cube_User_Name) + result_msg ) else: printError_msg(error_msg) except: @@ -6397,6 +6721,264 @@ def plot_centerDome(): printError_msg(error_msg) +def sizeLetter(value): + """ Respond to the change in sizer value from the text box. + """ + try: + # First we check if a valid number have been entered + global m_sizeLetter + if str(value) == '-': + return + m_sizeLetter = float(value) + print_msg("New diameter is :" + str(m_sizeLetter)) + except ValueError: + printError_msg("Size must be valid number !") + + +def letter(value): + """ Respond to the change in letter from the text box. + """ + global verbose + msg=verbose + try: + # First we check if a valid number have been entered + global m_letter + m_letter = value + if msg != 0: + print_msg("New letter is :" + str(m_letter)) + except ValueError: + printError_msg("Letter must be valid text !") + + +def plot_letter(): + """ Create 3D Text attached to a Point. + - First select a Plane + in this case the center of the text is attached to center of the Plane; + or + - First select a Plane and a Point on the Plane + + NB: + Change the text and his size if needed + """ + import Draft + + def text_at(Plane_Point,Plane_Normal): + text_User_Name, text = plot_text(m_letter, m_sizeLetter, part, name, grp="WorkObjects") + text_Point = text.Shape.BoundBox.Center + text_Normal = text.Shape.Faces[0].normalAt(0,0) + if msg != 0: + print_point(text_Point, msg="text_Point = ") + print_point(text_Normal, msg="text_Normal = ") + # Rotation + if colinearVectors(text_Normal, Origin, Plane_Normal, info=0, tolerance=1e-12): + rot_axis = Base.Vector(0, 0, 1).cross(text_Normal) + rot_center = text_Point + rot_angle = 180. + else: + m_angle, m_angle_rad = angleBetween(text_Normal,Plane_Normal) + rot_axis = text_Normal.cross(Plane_Normal) + rot_center = text_Point + rot_angle = m_angle + Draft.rotate(text,rot_angle,rot_center,rot_axis) + # translation + New_Point = Plane_Point + Plane_Normal.normalize().multiply(2) + m_move = New_Point.sub(rot_center) + if msg != 0: + print_msg("m_move = " + str(m_move)) + m_rot = text.Placement.Rotation + m_base = text.Placement.Base + m_newplace = App.Placement(m_base.add(m_move), m_rot ) + text.Placement = m_newplace + + msg=verbose + msg=1 + + createFolders('WorkObjects') + error_msg = "Unable to create Text : \nSelect one Plane and one Point !" + result_msg = " : Text created !" + name = "Text" + part = "Part::Feature" + Selection = get_SelectedObjects(info=msg, printError=False) + try: + SelectedObjects = Selection + Number_of_Planes = SelectedObjects[2] + Number_of_Points = SelectedObjects[0] + if msg != 0: + print_msg(" Number_of_Planes=" + str(Number_of_Planes)) + print_msg(" Number_of_Points=" + str(Number_of_Points)) + Point_List = SelectedObjects[3] + Plane_List = SelectedObjects[5] + if msg != 0: + print_msg(" Point_List=" + str(Point_List)) + print_msg(" Plane_List=" + str(Plane_List)) + + if (Number_of_Planes == 0 ): + printError_msg(error_msg) + return + + Origin = Base.Vector(0, 0, 0) + if (Number_of_Points == 0 ): + for Selected_Plane in Plane_List: + try: + #print_msg(str(Selected_Plane)) + Plane_Point = Selected_Plane.CenterOfMass + Plane_Normal = Selected_Plane.normalAt(0,0) + if msg != 0: + print_point(Plane_Point, msg="Plane_Point = ") + print_point(Plane_Normal, msg="Plane_Normal = ") + text_at(Plane_Point,Plane_Normal) + + except: + printError_msg("Non Planar Surface !") + else: + if Number_of_Points == Number_of_Planes: + if msg != 0: + print_msg(" Number_of_Points = Number_of_Planes") + for Selected_Plane, Selected_Point in zip(Plane_List, Point_List): + if msg != 0: + print_msg(" Selected_Plane=" + str(Selected_Plane)) + print_msg(" Selected_Point=" + str(Selected_Point)) + Plane_Point = Selected_Point.Point + Plane_Normal = Selected_Plane.normalAt(0,0) + if msg != 0: + print_point(Plane_Point, msg="Plane_Point = ") + print_point(Plane_Normal, msg="Plane_Normal = ") + text_at(Plane_Point,Plane_Normal) + + else: + printError_msg(error_msg) + except: + printError_msg(error_msg) + + +def angleRevolve(value): + """ Respond to the change in revolution angle value from the text box. + """ + try: + # First we check if a valid number have been entered + global m_angleRevolve + m_angleRevolve = float(value) + print_msg("New revolution angle is :" + str(m_angleRevolve)) + except ValueError: + printError_msg("Revolution angle must be valid number angle in degrees)!") + + +def plot_revolution(): + """ + Revolve: + Make the revolution of an Object around an Axis: + - Select on or several axis(es) and one or several wire(s) + + """ + + # revolve around Y axis by number of degrees + # rev=shape.revolve(App.Vector(0,0,0),App.Vector(0,1,0),Dg)Revolve the shape around an Axis to a given degree. +#============================================================================== +# Part.revolve(Vector(0,0,0),Vector(0,0,1),360) - revolves the shape around the Z Axis 360 degree. +# +# Hints: Sometimes you want to create a rotation body out of a closed edge or wire. +# Example: +# from FreeCAD import Base +# import Part +# V=Base.Vector +# +# e=Part.Ellipse() +# s=e.toShape() +# r=s.revolve(V(0,0,0),V(0,1,0), 360) +# Part.show(r) +# +# However, you may possibly realize some rendering artifacts or that the mesh +# creation seems to hang. This is because this way the surface is created twice. +# Since the curve is a full ellipse it is sufficient to do a rotation of 180 degree +# only, i.e. r=s.revolve(V(0,0,0),V(0,1,0), 180) +# +# Now when rendering this object you may still see some artifacts at the poles. Now the +# problem seems to be that the meshing algorithm doesn't like to rotate around a point +# where there is no vertex. +# +# The idea to fix this issue is that you create only half of the ellipse so that its shape +# representation has vertexes at its start and end point. +# +# from FreeCAD import Base +# import Part +# V=Base.Vector +# +# e=Part.Ellipse() +# s=e.toShape(e.LastParameter/4,3*e.LastParameter/4) +# r=s.revolve(V(0,0,0),V(0,1,0), 360) +# Part.show(r) +#============================================================================== + msg=verbose + + createFolders('WorkObjects') + error_msg =\ + "INCORRECT Object(s) Selection :\n" +\ + "You Must Select one Point as center of rotation\n" +\ + "and one Axis as rotation axis FIRST !\n" +\ + "Then Select Edge(s) or Wire(s) to create revolution(s)\n" +\ + "If no Axis is selected the Z axis is considered as Axis of rotation !\n" +\ + "If no Point is selected the Origin is considered as Center of rotation !" + + m_actDoc=App.activeDocument() + if m_actDoc.Name: + m_sel = Gui.Selection.getSelection(m_actDoc.Name) + if msg != 0: + print_msg("m_sel=" + str(m_sel)) + m_num_objs = len(m_sel) + if msg != 0: + print_msg("m_num_objs=" + str(m_num_objs)) + + Selection = get_SelectedObjects(info=msg, printError=False) + try: + SelectedObjects = m_sel + SelectedObjects_rot = Selection + Number_of_Edges = SelectedObjects_rot[1] + Number_of_Points = SelectedObjects_rot[0] + # No axis of rotation selected + if Number_of_Edges == 0: + Axis = Base.Vector(0, 0, 1) + # No axis of rotation selected just one edge to revolve + elif Number_of_Edges > 0 and m_num_objs == 1: + Axis = Base.Vector(0, 0, 1) + # Axis of rotation selected + else : + Edge_List = SelectedObjects_rot[4] + edge = Edge_List[0] + Axis = edge.Vertexes[-1].Point.sub(edge.Vertexes[0].Point) + del SelectedObjects[0] + if msg != 0: + print_msg("Axis=" + str(Axis)) + + if Number_of_Points == 0: + Center = Base.Vector(0, 0, 0) + else: + Point_List = SelectedObjects_rot[3] + Center = Point_List[0].Point + if msg != 0: + print_msg("Center=" + str(Center)) + + if msg != 0: + print_msg("SelectedObjects=" + str(SelectedObjects)) + + m_num = 0 + for m_obj in SelectedObjects : + if msg != 0: + print_msg("m_obj.Shape=" + str(m_obj.Shape)) + if not (getShapeType(m_obj.Shape) == "Wire" or getShapeType(m_obj.Shape) == "Edge"): + continue + m_num = m_num + 1 + if msg != 0: + print_msg("m_num=" + str(m_num)) + r = m_obj.Shape.revolve(Center, Axis, m_angleRevolve) + plot_Shape(r, part="Part::Feature", name="Revolve", grp="WorkObjects") + #Part.show(r) + + if m_num == 0: + printError_msg("No Edge was selected !") + + except: + printError_msg(error_msg) + def view_align(): """ Set the current view perpendicular to the selected Face, Edge or 2 points selected @@ -6468,8 +7050,102 @@ def view_align(): printError_msg(error_msg) else: printError_msg(error_msg) + + +def view_trackCamera(): + """ + Originalcode : Tour camera by Javier Martinez Garcia November 2014 + """ + msg=verbose + + m_sleep = 0.0004 + m_camHeight = 10 # Height of the camera above the track + m_lookVectorLength = 80 # Distance from next line start where the camera + # starts to align with new direction + error_msg =\ + "INCORRECT Object(s) Selection :\n" +\ + "You Must Select Edge(s) or Wire(s) !" + + m_actDoc=App.activeDocument() + if m_actDoc.Name: + m_sel = Gui.Selection.getSelection(m_actDoc.Name) + + try: + SelectedObjects = m_sel + if msg != 0: + print_msg("SelectedObjects=" + str(SelectedObjects)) + + m_edges_num = 0 + for m_obj in SelectedObjects : + if msg != 0: + print_msg("m_obj.Shape=" + str(m_obj.Shape)) + if not (getShapeType(m_obj.Shape) == "Wire" or getShapeType(m_obj.Shape) == "Edge"): + continue + if msg != 0: + print_msg("m_obj.Shape.Edges=" + str(m_obj.Shape.Edges)) + if len(m_obj.Shape.Edges) == 0 : + continue + Edge_List = m_obj.Shape.Edges - + ## Edge rearrangement inside trajectory list + trajectory = [] + trajectory.append( Edge_List[0] ) + currentEdge = Edge_List[0] + for n in range( len( Edge_List ) ): + for edge in Edge_List: + if edge.valueAt(0.0) == currentEdge.valueAt( currentEdge.Length ): + trajectory.append( edge ) + currentEdge = edge + break + Edge_List = trajectory + m_edges_num = m_edges_num + len(Edge_List) + m_camera = Gui.ActiveDocument.ActiveView.getCameraNode() + currEdge = Edge_List[0] + currEdgeDir = currEdge.Vertexes[-1].Point.sub(currEdge.Vertexes[0].Point).normalize() + currPos = currEdge.valueAt( 0.0 ) + for i in range( len( m_obj.Shape.Edges ) - 1): + currEdge = Edge_List[i] + #if msg != 0: + # print_msg("currEdge=" + str(currEdge)) + currEdgeDir = currEdge.Vertexes[-1].Point.sub(currEdge.Vertexes[0].Point).normalize() + #if msg != 0: + #print_msg("currEdgeDir=" + str(currEdgeDir)) + nextEdge = Edge_List[i+1] + #if msg != 0: + #print_msg("nextEdge=" + str(nextEdge)) + nextEdgeDir = nextEdge.Vertexes[-1].Point.sub(nextEdge.Vertexes[0].Point).normalize() + #if msg != 0: + #print_msg("nextEdgeDir=" + str(nextEdgeDir)) + currPos = currEdge.valueAt( 0.0 ) + #if msg != 0: + #print_point(currPos, "currPos ") + + while currPos.sub(currEdge.valueAt( 0.0 )).Length < currEdge.Length: + currPos = currPos + currEdgeDir + m_camera.position.setValue( currPos + Base.Vector( 0, 0, m_camHeight ) ) + m_cameraLookVector = currEdgeDir*m_lookVectorLength + if (m_cameraLookVector + currPos - currEdge.valueAt(0.0) ).Length > currEdge.Length: + L = ( m_cameraLookVector + ( currPos - currEdge.valueAt( 0.0 ) ) ).Length - currEdge.Length + m_lookVector = nextEdgeDir*L + nextEdge.valueAt( 0.0 ) + else: + m_lookVector = currEdge.valueAt( currEdge.Length ) + m_camera.pointAt( coin.SbVec3f( m_lookVector[0], m_lookVector[1], m_lookVector[2] + m_camHeight ), coin.SbVec3f( 0, 0, 1 ) ) + Gui.updateGui() + time.sleep( m_sleep ) + + while currPos.sub(currEdge.valueAt( 0.0 )).Length < currEdge.Length: + currPos = currPos + currEdgeDir + m_camera.position.setValue( currPos + Base.Vector( 0, 0, m_camHeight ) ) + m_lookVector = currEdge.valueAt( currEdge.Length ) + m_camera.pointAt( coin.SbVec3f( m_lookVector[0], m_lookVector[1], m_lookVector[2] + m_camHeight ), coin.SbVec3f( 0, 0, 1 ) ) + Gui.updateGui() + time.sleep( m_sleep ) + if m_edges_num == 0: + printError_msg("No Edge was selected !") + except: + printError_msg(error_msg) + + def angleCutObject(value): """ Respond to the change in angle value from the text box. """ @@ -7504,6 +8180,101 @@ def points_distance(): printError_msg(error_msg) +def line_length(): + """ + Check for Line Length: + Length measurement and Delta values (on main Axes) for a Line + - Select the Line + + """ + msg=verbose + + error_msg = "INCORRECT Object(s) Selection :\n\nYou Must Select One Line !" + + Selection = get_SelectedObjects(info=msg, printError=False) + try: + SelectedObjects = Selection + Number_of_Edges = SelectedObjects[1] + if msg!=0: + print_msg("Number_of_Edges=" + str(Number_of_Edges)) + + if Number_of_Edges != 1: + printError_msg(error_msg) + return + + Edge_List = SelectedObjects[4] + edge = Edge_List[0] + + pos_X1 = edge.Vertexes[0].Point.x + pos_Y1 = edge.Vertexes[0].Point.y + pos_Z1 = edge.Vertexes[0].Point.z + if msg!=0: + print_point(edge.Vertexes[0].Point, msg="First Point : ") + + pos_X2 = edge.Vertexes[-1].Point.x + pos_Y2 = edge.Vertexes[-1].Point.y + pos_Z2 = edge.Vertexes[-1].Point.z + if msg!=0: + print_point(edge.Vertexes[-1].Point, msg="Last Point : ") + + m_dist = distanceBetween(edge.Vertexes[0].Point,edge.Vertexes[-1].Point) + if msg!=0: + print_msg("Distance is : " + str(m_dist)) + + msg=\ + "Begin : X1 "+str(pos_X1)+" Y1: "+str(pos_Y1)+" Z1: "+str(pos_Z1)+"\n\n" +\ + "End : X2 "+str(pos_X2)+" Y2: "+str(pos_Y2)+" Z2: "+str(pos_Z2)+"\n\n" +\ + "Delta X : "+str(abs(pos_X1-pos_X2))+"\n" +\ + "Delta Y : "+str(abs(pos_Y1-pos_Y2))+"\n" +\ + "Delta Z : "+str(abs(pos_Z1-pos_Z2))+"\n\n" +\ + "Distance : " + str(m_dist) + + print_gui_msg(msg) + except: + printError_msg(error_msg) + + +def plane_area(): + """ + Check for surface Area: + Area measurement for a Plane or a set of Planes. + - Select One or several Planes and + + """ + msg=verbose + + error_msg =\ + "INCORRECT Object(s) Selection :\n" +\ + "You Must Select Face(s) !" + Selection = get_SelectedObjects(info=msg, printError=False) + try: + SelectedObjects = Selection + Number_of_Planes = SelectedObjects[2] + if msg!=0: + print_msg("Number_of_Planes=" + str(Number_of_Planes)) + + if Number_of_Planes >= 1 : + Plane_List = SelectedObjects[5] + if msg != 0: + print_msg(" Plane_List=" + str(Plane_List)) + m_areas = [] + for m_plane in Plane_List: + m_areas.append(m_plane.Area) + result = "Area(s) :\n" + a=0 + for m_a in m_areas: + a+=m_a + + result += str(math.ceil(m_a*1000)/1000) + " mm2\n" + + result += "Total of areas is " + str(math.ceil(a*1000)/1000) + " mm2" + print_gui_msg(result) + else: + printError_msg(error_msg) + except: + printError_msg(error_msg) + + def camera_orientation(): """ Detect the position of the camera. The returned value is the value provided @@ -7828,7 +8599,8 @@ def object_jointPoints(): print_msg("Selected_Point = " + str(Selected_Point)) print_msg("Parent_Point = " + str(Parent_Point)) m_move = Point_ref.Point.sub(Selected_Point.Point) - print_msg("m_move = " + str(m_move)) + if msg != 0: + print_msg("m_move = " + str(m_move)) m_rot = Parent_Point.Placement.Rotation m_base = Parent_Point.Placement.Base m_newplace = App.Placement(m_base.add(m_move), m_rot ) @@ -7848,36 +8620,55 @@ except AttributeError: #################################################################################### class WorkFeatureTab(): - def __init__(self): + def __init__(self, movable=True): + self.movable = movable + if self.movable: + # Look if WF movable tab already exists + m_mvtab=Gui.getMainWindow().findChild(QtGui.QDockWidget, "WorkFeatures") + if m_mvtab: + m_mvtab.show() + m_mvtab.raise_() + return + # Get main window self.m_main = self.getMainWindow() # Get Tab panel - self.m_tab = self.getComboView(self.m_main) - - if self.m_tab.count() == 2: - # Create a new fake dialog - self.m_fake_dialog = QtGui.QDialog() - self.m_tab.addTab(self.m_fake_dialog,"") + if self.movable: + self.m_tab = self.getComboViewMv(self.m_main) - # Create a new dialog for WorkFeatureTab - self.m_dialog = QtGui.QDialog() - # Add the dialog in a new tab or focus on it if already exists - if self.m_tab.count() >= 2: - for i in range(2,self.m_tab.count()): - #print_msg (str(isinstance(self.m_tab.tabText(i), unicode))) - #print_msg (str(unicode(self.m_tab.tabText(i), 'utf-8'))) - #if "Work Features" == str(unicode(self.m_tab.tabText(i), 'utf-8')): - if "Work Features" == str(_fromUtf8(self.m_tab.tabText(i))): - self.m_tab.removeTab(int(i)) - break + self.m_dialog = QtGui.QWidget() + self.m_tab.addWidget(self.m_dialog) + self.ui = WFGui.Ui_Form() + self.ui.setupUi(self.m_dialog) + self.m_dialog.setMaximumWidth(400) + else : + self.m_tab = self.getComboView(self.m_main) - self.m_tab.addTab(self.m_dialog,"Work Features") - - self.ui = WFGui.Ui_Form() - self.ui.setupUi(self.m_dialog) - self.m_tab.setCurrentIndex(3) + if self.m_tab.count() == 2: + # Create a new fake dialog + self.m_fake_dialog = QtGui.QDialog() + self.m_tab.addTab(self.m_fake_dialog,"") + + # Create a new dialog for WorkFeatureTab + self.m_dialog = QtGui.QDialog() + # Add the dialog in a new tab or focus on it if already exists + if self.m_tab.count() >= 2: + for i in range(2,self.m_tab.count()): + #print_msg (str(isinstance(self.m_tab.tabText(i), unicode))) + #print_msg (str(unicode(self.m_tab.tabText(i), 'utf-8'))) + #if "Work Features" == str(unicode(self.m_tab.tabText(i), 'utf-8')): + if "Work Features" == str(_fromUtf8(self.m_tab.tabText(i))): + self.m_tab.removeTab(int(i)) + break + + self.m_tab.addTab(self.m_dialog,"Work Features") + + self.ui = WFGui.Ui_Form() + self.ui.setupUi(self.m_dialog) + self.m_tab.setCurrentIndex(3) +#---------------------------------------------------------------- # Create a Rotation object self.rot = Rotation(self.ui) # Create a Translation object @@ -7938,7 +8729,8 @@ class WorkFeatureTab(): "button_linepoint_circle" : "plot_linepointCircle", "button_3points_circle" : "plot_3pointsCircle", "button_cut_circle" : "plot_cutCircle", - "button_3points_ellipse" : "plot_3pointsEllipse", + "button_3points_ellipse" : "plot_3pointsEllipse", + "button_circle_to_sketch" : "circle_toSketch", "button_threepoints_plane" : "plot_3PointsPlane", "button_axisandpoint_plane" : "plot_axisPointPlane", @@ -7958,14 +8750,17 @@ class WorkFeatureTab(): "button_cube_create" : "plot_axisPointCube", "button_sphere_create" : "plot_centerSphere", "button_dome_create" : "plot_centerDome", + "button_letter" : "plot_letter", + "button_revolve" : "plot_revolution", - "button_alignview" : "view_align", + "button_alignview" : "view_align", + "button_trackcamera" : "view_trackCamera", "button_cut_select_object" : "cut_selectObject", "button_cut_select_line" : "cut_selectLine", "button_cut_select_plane" : "cut_selectPlane", "button_cut_reset" : "cut_reset", - "button_cut_apply" : "plot_cutObject", + "button_cut_apply" : "plot_cutObject", "button_isParallel" : "object_parallel", "button_isPerpendicular" : "object_perpendicular", @@ -7973,6 +8768,8 @@ class WorkFeatureTab(): "button_isClearance" : "object_clearance", "button_isAngle" : "object_angle", "button_isDistance" : "points_distance", + "button_isLength" : "line_length", + "button_isArea" : "plane_area", "button_isView" : "camera_orientation", "button_alignface2view" : "object_align2view", @@ -8016,6 +8813,9 @@ class WorkFeatureTab(): "dist_point" : "distPoint", "angle_align_faces" : "angleAlignFaces", "angle_align_edges" : "angleAlignEdges", + "angle_revolve" : "angleRevolve", + "size_letter" : "sizeLetter", + "letter" : "letter", } self.connections_for_spin_changed = { @@ -8120,7 +8920,7 @@ class WorkFeatureTab(): # Connect to Translation functions #============================================================================== for m_key, m_val in self.connections_for_ObjTrans_button_pressed.items(): - #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.trans, str(m_val))) ) + #print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.trans, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL("pressed()"),getattr(self.trans, str(m_val))) @@ -8174,7 +8974,7 @@ class WorkFeatureTab(): # Connect to Rotation functions #============================================================================== for m_key, m_val in self.connections_for_ObjRot_button_pressed.items(): - #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) + #print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL("pressed()"),getattr(self.rot, str(m_val))) @@ -8184,31 +8984,47 @@ class WorkFeatureTab(): QtCore.SIGNAL(_fromUtf8("currentIndexChanged(QString)")),getattr(self.rot, str(m_val))) for m_key, m_val in self.connections_for_ObjRot_slider_changed.items(): - #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) + #print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL("valueChanged(int)"),getattr(self.rot, str(m_val))) for m_key, m_val in self.connections_for_ObjRot_return_pressed.items(): - #func.print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) + #print_msg( "Connecting : " + str(getattr(self.ui, str(m_key))) + " and " + str(getattr(self.rot, str(m_val))) ) QtCore.QObject.connect(getattr(self.ui, str(m_key)), QtCore.SIGNAL("returnPressed()"),getattr(self.rot, str(m_val))) - - - - - +#============================================================================== + self.m_dialog.show() m_text=str(myRelease) self.ui.label_release.setText(QtGui.QApplication.translate("Form", m_text, None, QtGui.QApplication.UnicodeUTF8)) - - def quit_clicked(self): # quit - #self.m_dialog.hide() - self.m_dialog.close() - if self.m_tab.count() >= 2: - for i in range(2,self.m_tab.count()): - if "Work Features" == str(_fromUtf8(self.m_tab.tabText(i))): - self.m_tab.removeTab(int(i)) - break + +#---------------------------------------------------------------- + if self.movable: + t=Gui.getMainWindow() + wf = t.findChild(QtGui.QDockWidget, "WorkFeatures") + cv = t.findChild(QtGui.QDockWidget, "Combo View") + print_msg( "Combo View" + str(cv)) + print_msg( "WorkFeatures" + str(wf)) + cv.setFeatures( QtGui.QDockWidget.DockWidgetMovable | QtGui.QDockWidget.DockWidgetFloatable|QtGui.QDockWidget.DockWidgetClosable ) + wf.setFeatures( QtGui.QDockWidget.DockWidgetMovable | QtGui.QDockWidget.DockWidgetFloatable|QtGui.QDockWidget.DockWidgetClosable ) + if wf and cv: + t.tabifyDockWidget(cv,wf) + print_msg( "Tabified done !") + wf.activateWindow() + wf.raise_() + + def quit_clicked(self): # quit + if self.movable: + self.dw.close() + print_msg( "Close done !") + return + else: + self.m_dialog.close() + if self.m_tab.count() >= 2: + for i in range(2,self.m_tab.count()): + if "Work Features" == str(_fromUtf8(self.m_tab.tabText(i))): + self.m_tab.removeTab(int(i)) + break def getMainWindow(self): """ Returns the main window @@ -8232,7 +9048,27 @@ class WorkFeatureTab(): return i.findChild(QtGui.QTabWidget) raise Exception("No tab widget found") - + def getComboViewMv(self,window): + """ Returns the main Tab. + """ + import FreeCAD + mw=FreeCAD.Gui.getMainWindow() + layout = QtGui.QVBoxLayout() + myw=QtGui.QWidget() + myw.setLayout(layout) + + dw1=QtGui.QDockWidget(mw) + dw1.setWindowTitle("Work Features") + dw1.setObjectName('WorkFeatures') + dw1.setWidget(myw) + + mw.addDockWidget(QtCore.Qt.RightDockWidgetArea , dw1) + self.myw=myw + self.dw=dw1 + layout.mw=mw + return layout + + if __name__ == '__main__': myDialog = WorkFeatureTab() \ No newline at end of file