diff --git a/WorkFeature/Beam/__init__.py b/WorkFeature/Beam/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/WorkFeature/Beam/beam.py b/WorkFeature/Beam/beam.py new file mode 100644 index 0000000..c41cd0d --- /dev/null +++ b/WorkFeature/Beam/beam.py @@ -0,0 +1,254 @@ +# -*- coding: utf-8 -*- + +import os +import FreeCAD as App +import FreeCADGui as Gui +import Part + +def sketch_normal(sketch): + a = App.Vector(0, 0, 1) + return sketch.Placement.Rotation.multVec(a) + +def project_to_plane(plane_p, plane_n, p, n): + '''p + l * n = plane_p + x * plane_n''' + return p + n * (plane_n.dot(plane_p - p) / (n.dot(plane_n))) + +class Beam(): + def __init__(self, obj, profile, path, path_name): + "'''Beam: representing a straight extrusion of a profile'''" + obj.addProperty("App::PropertyString", "type", "Beam", "type of the object").type = "beam" + obj.addProperty("App::PropertyLink","profile","Beam","sketch profile of the beam").profile = profile + obj.addProperty("App::PropertyLink","path","Beam","path of the beam").path = path + obj.addProperty("App::PropertyString","path_name","Beam", "name of beam line").path_name = path_name + obj.addProperty("App::PropertyDistance", "exdent_1", "Beam", "exdent side 1").exdent_1 = "0 mm" + obj.addProperty("App::PropertyDistance", "exdent_2", "Beam", "exdent side 2").exdent_2 = "0 mm" + obj.setEditorMode("path_name", 1) + obj.Proxy = self + self.Object = obj + + + def initialize(self): + print("initialize ...") + + @property + def profile(self): + profile = Part.Face(self.Object.profile.Shape.Wires) + if profile.Area < 0: + profile = Part.Face(self.Object.profile.Shape.Wires[::-1]) + return profile + + @property + def outer_shape(self): + path, a, b, n = self.path_a_b_n + profile = Part.Face(self.profile.Wires[0]) + new_profile = self.transform_to_n(profile, self.midpoint, a - n * self.Object.exdent_1.Value, n) + return new_profile.extrude(App.Vector(b - a) + n * (self.Object.exdent_1.Value + self.Object.exdent_2.Value)) + + def attach(self, fp): + fp.Proxy.Object = fp + + def execute(self, fp): + '''Do something when doing a recomputation, this method is mandatory''' + fp.Proxy.Object = fp + path, a, b, n = self.path_a_b_n + new_profile = self.transform_to_n(self.profile, self.midpoint, a - n * fp.exdent_1.Value, n) + fp.Shape = new_profile.extrude(App.Vector(b - a) + n * (fp.exdent_1.Value + fp.exdent_2.Value)) + + def transform_to_n(self, profile, midpoint, p, n): + '''transform a profile (Shape) lying in z = 0 to p and n''' + + t = sketch_normal(self.Object.path) + n.normalize() + v = n.cross(t) + + mat2 = App.Matrix() + mat2.move(App.Vector() - midpoint) + new_profile = profile.transformGeometry(mat2) + + rot_mat = App.Matrix() + rot_mat.A11 = v.x + rot_mat.A21 = v.y + rot_mat.A31 = v.z + rot_mat.A12 = t.x + rot_mat.A22 = t.y + rot_mat.A32 = t.z + rot_mat.A13 = n.x + rot_mat.A23 = n.y + rot_mat.A33 = n.z + new_profile = new_profile.transformGeometry(rot_mat) + + mat3 = App.Matrix() + mat3.move(p) + new_profile.transformShape(mat3) + return new_profile + + @property + def midpoint(self): + profile_midpoint = filter(lambda x: isinstance(x, App.Base.Vector), self.Object.profile.Geometry) + if len(profile_midpoint) == 0 or profile_midpoint is None: + profile_midpoint = App.Vector(0, 0, 0) + else: + profile_midpoint = profile_midpoint[0] + return profile_midpoint + + @property + def path_a_b_n(self): + path = self.Object.path.Shape.getElement(self.Object.path_name) + a, b = path.Vertexes + n = b.Point - a.Point + n.normalize() + return (path, a.Point, b.Point, n) + + @property + def profile_bound_box(self): + fac = 0.3 + bb = self.Object.profile.Shape.BoundBox + xmax = bb.XMax + bb.XLength * fac + xmin = bb.XMin - bb.XLength * fac + ymax = bb.YMax + bb.YLength * fac + ymin = bb.YMin - bb.YLength * fac + pol = Part.makePolygon( + [App.Vector(xmax, ymax, 0), + App.Vector(xmax, ymin, 0), + App.Vector(xmin, ymin, 0), + App.Vector(xmin, ymax, 0), + App.Vector(xmax, ymax, 0)]) + path, a, b, n = self.path_a_b_n + return self.transform_to_n(pol, self.midpoint, a, n) + + def project_profile_bound_box(self, plane_n, plane_p): + bb = self.profile_bound_box.Vertexes + vectors = [v.Point for v in bb] + path, a, b, n = self.path_a_b_n + projected = [project_to_plane(plane_p, plane_n, v, n) for v in vectors] + projected.append(projected[0]) + pol = Part.makePolygon(projected) + return pol + + def __getstate__(self): + return None + + def __setstate__(self, state): + return None + + +class ViewProviderBeam: + def __init__(self, obj): + ''' Set this object to the proxy object of the actual view provider ''' + obj.Proxy = self + + def attach(self, vobj): + self.vobj = vobj + + def getIcon(self): + _dir = os.path.dirname(os.path.realpath(__file__)) + return(_dir + "/" + "Icons/beam.png") + + def __getstate__(self): + return None + + def __setstate__(self, state): + return None + + +def makeBeam2(): + def plot_edge(Vector_A, Vector_B, part="Part::Feature", name="Edge", grp="Work"): + if not(App.ActiveDocument.getObject( grp )): + App.ActiveDocument.addObject("App::DocumentObjectGroup", grp) + edge = App.ActiveDocument.addObject(part, name) + edge.Shape = Part.makeLine(Vector_A, Vector_B) + App.ActiveDocument.getObject( grp ).addObject(edge) + edge_User_Name = edge.Label + + return edge_User_Name, edge + + def plot_shape(Shape, part="Part::Feature", name="Shape", grp="Work"): + if not(App.ActiveDocument.getObject( grp )): + App.ActiveDocument.addObject("App::DocumentObjectGroup", grp) + shape = App.ActiveDocument.addObject(part, name) + shape.Shape = Part.Shape(Shape) + App.ActiveDocument.getObject( grp ).addObject(shape) + shape_User_Name = shape.Label + + return shape_User_Name, shape + + from FreeCAD import Base + V1 = Base.Vector(0,10,0) + V2 = Base.Vector(30,10,0) + V3 = Base.Vector(30,-10,0) + V4 = Base.Vector(0,-10,0) + + VC1 = Base.Vector(-10,0,0) + C1 = Part.Arc(V1,VC1,V4) + L0 = Part.Line(V1,V4) + S0 = Part.Shape([C1,L0]) + + v1 = App.Vector(0,0,0) + v2 = App.Vector(10,0,0) + v3 = App.Vector(0,10,0) + #profile = Part.makePolygon([v1,v2,v3,v1]) + v4 = App.Vector(0,0,100) + L1 = Part.Line(v1,v4) + S1 = Part.Shape([L1]) + + + #path = Part.makeLine(v1, v4) + App.newDocument() + + + shape_User_Name, shape = plot_shape([C1,L0], part="Part::Feature", name="profile", grp="Work") + edge_User_Name, edge = plot_edge(v1, v4, part="Part::Feature", name="path", grp="Work") + + + a=App.ActiveDocument.addObject("Part::FeaturePython","Beam") + Beam(a, shape_User_Name, edge_User_Name, "Beam") + ViewProviderBeam(a.ViewObject) + +class make_beam(object): + def __init__(self, view): + self.profile = None + self.midpoint = None + self.path = None + self.n = None + self.view = view + App.Console.PrintMessage("choose the profile\n") + Gui.Selection.clearSelection() + self.klick_event = self.view.addEventCallback("SoMouseButtonEvent", self.choose_profile) + + + def choose_profile(self, cb): + if cb["State"] == "DOWN": + sel = Gui.Selection.getSelection() + if len(sel) > 0: + self.profile = sel[0] + App.Console.PrintMessage("Profile selected !\n") + Gui.Selection.clearSelection() + self.view.removeEventCallback("SoMouseButtonEvent", self.klick_event) + self.klick_event = self.view.addEventCallback("SoMouseButtonEvent", self.choose_path) + App.Console.PrintMessage("choose path\n") + + def choose_path(self, cb): + if cb["State"] == "DOWN": + sel = Gui.Selection.getSelectionEx() + if sel: + path_sketch = sel[0].Object + path_name = sel[0].SubElementNames[0] + App.Console.PrintMessage("Path selected !\n") + self.view.removeEventCallback("SoMouseButtonEvent", self.klick_event) + + a = App.ActiveDocument.addObject("Part::FeaturePython","beam") + Beam(a, self.profile, path_sketch, path_name) + ViewProviderBeam(a.ViewObject) + App.ActiveDocument.recompute() + + + App.Console.PrintMessage("end of tube tool\n") + + +if __name__ == "__main__": + view = Gui.ActiveDocument.activeView() + selection = make_beam(view) + +# if __name__ == '__main__': +# makeBeam() + \ No newline at end of file diff --git a/WorkFeature/Doc/WF_releasesDocumentation.pdf b/WorkFeature/Doc/WF_releasesDocumentation.pdf index 9e3328c..a857023 100644 Binary files a/WorkFeature/Doc/WF_releasesDocumentation.pdf and b/WorkFeature/Doc/WF_releasesDocumentation.pdf differ diff --git a/WorkFeature/Icons/WF_Beam.svg b/WorkFeature/Icons/WF_Beam.svg index 2cda4c0..d5f97eb 100644 --- a/WorkFeature/Icons/WF_Beam.svg +++ b/WorkFeature/Icons/WF_Beam.svg @@ -14,7 +14,7 @@ width="64" height="64" id="svg3017" - inkscape:version="0.48.5 r10040" + inkscape:version="0.91 r13725" sodipodi:docname="WF_Beam.svg" inkscape:export-filename="/home/mark/HyperbolaIcon.png" inkscape:export-xdpi="90" @@ -388,6 +388,37 @@ operator="over" result="composite2" /> + + + + + + + + @@ -417,31 +455,31 @@ id="layer1" inkscape:label="Layer1" /> + transform="matrix(0.91475345,-0.43761454,0.43761454,0.91475345,-36.379419,43.920861)" /> + transform="matrix(-0.27517775,-0.79253981,0.77893612,-0.28735762,27.462717,63.890512)" /> + sodipodi:nodetypes="scsssccccscss" + transform="matrix(-0.49449359,0.39060441,-0.62773631,-0.79469555,97.151171,40.082247)" /> + transform="matrix(0.78623928,0.64039688,-0.64039688,0.78623928,35.707732,-10.466987)" /> diff --git a/WorkFeature/Icons/WF_isRadius.svg b/WorkFeature/Icons/WF_isRadius.svg new file mode 100644 index 0000000..095a505 --- /dev/null +++ b/WorkFeature/Icons/WF_isRadius.svg @@ -0,0 +1,473 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + ? + + + R + + + + + + + + diff --git a/WorkFeature/Icons/WF_objectCopy.svg b/WorkFeature/Icons/WF_objectCopy.svg new file mode 100644 index 0000000..60db8e1 --- /dev/null +++ b/WorkFeature/Icons/WF_objectCopy.svg @@ -0,0 +1,381 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/WorkFeature/Ui/WFGui_2015.py b/WorkFeature/Ui/WFGui_2015.py index 13fb09c..075986e 100644 --- a/WorkFeature/Ui/WFGui_2015.py +++ b/WorkFeature/Ui/WFGui_2015.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'WFGui_2015.ui' # -# Created: Sat Nov 7 20:09:36 2015 -# by: PySide UI code generator 4.11.2 +# Created: Sun Dec 13 18:49:39 2015 +# by: PySide UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! @@ -636,7 +636,7 @@ class Ui_Form(object): self.scrollArea_2.setWidgetResizable(True) self.scrollArea_2.setObjectName(_fromUtf8("scrollArea_2")) self.scrollAreaWidgetContents_5 = QtGui.QWidget() - self.scrollAreaWidgetContents_5.setGeometry(QtCore.QRect(0, 0, 259, 650)) + self.scrollAreaWidgetContents_5.setGeometry(QtCore.QRect(0, 0, 245, 648)) self.scrollAreaWidgetContents_5.setObjectName(_fromUtf8("scrollAreaWidgetContents_5")) self.gridLayout_76 = QtGui.QGridLayout(self.scrollAreaWidgetContents_5) self.gridLayout_76.setObjectName(_fromUtf8("gridLayout_76")) @@ -1169,8 +1169,8 @@ class Ui_Form(object): self.tabWidget_7.addTab(self.tab_16, icon45, _fromUtf8("")) self.tab_17 = QtGui.QWidget() self.tab_17.setObjectName(_fromUtf8("tab_17")) - self.gridLayout_85 = QtGui.QGridLayout(self.tab_17) - self.gridLayout_85.setObjectName(_fromUtf8("gridLayout_85")) + self.gridLayout_6 = QtGui.QGridLayout(self.tab_17) + self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) self.frame_9 = QtGui.QFrame(self.tab_17) self.frame_9.setFrameShape(QtGui.QFrame.StyledPanel) self.frame_9.setFrameShadow(QtGui.QFrame.Raised) @@ -1209,11 +1209,16 @@ class Ui_Form(object): self.button_sweep.setIconSize(QtCore.QSize(32, 32)) self.button_sweep.setObjectName(_fromUtf8("button_sweep")) self.gridLayout_86.addWidget(self.button_sweep, 1, 0, 1, 1) - self.gridLayout_85.addWidget(self.frame_9, 0, 0, 1, 1) + self.gridLayout_6.addWidget(self.frame_9, 0, 0, 1, 1) spacerItem11 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_85.addItem(spacerItem11, 1, 0, 1, 1) + self.gridLayout_6.addItem(spacerItem11, 2, 0, 1, 1) + self.button_beam = QtGui.QPushButton(self.tab_17) icon47 = QtGui.QIcon() icon47.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_Beam.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_beam.setIcon(icon47) + self.button_beam.setIconSize(QtCore.QSize(32, 32)) + self.button_beam.setObjectName(_fromUtf8("button_beam")) + self.gridLayout_6.addWidget(self.button_beam, 1, 0, 1, 1) self.tabWidget_7.addTab(self.tab_17, icon47, _fromUtf8("")) self.Plane_Tab1_3 = QtGui.QWidget() self.Plane_Tab1_3.setObjectName(_fromUtf8("Plane_Tab1_3")) @@ -1618,25 +1623,32 @@ class Ui_Form(object): self.angle_revolve.setObjectName(_fromUtf8("angle_revolve")) self.horizontalLayout_76.addWidget(self.angle_revolve) self.gridLayout_5.addLayout(self.horizontalLayout_76, 7, 0, 1, 1) - self.button_common = QtGui.QPushButton(self.Objects_Tab2_2) + self.button_copy_objects = QtGui.QPushButton(self.Objects_Tab2_2) icon67 = QtGui.QIcon() - icon67.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_Common.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_common.setIcon(icon67) + icon67.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectCopy.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_copy_objects.setIcon(icon67) + self.button_copy_objects.setIconSize(QtCore.QSize(32, 32)) + self.button_copy_objects.setObjectName(_fromUtf8("button_copy_objects")) + self.gridLayout_5.addWidget(self.button_copy_objects, 8, 0, 1, 1) + self.button_common = QtGui.QPushButton(self.Objects_Tab2_2) + icon68 = QtGui.QIcon() + icon68.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_Common.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_common.setIcon(icon68) self.button_common.setIconSize(QtCore.QSize(32, 32)) self.button_common.setObjectName(_fromUtf8("button_common")) - self.gridLayout_5.addWidget(self.button_common, 8, 0, 1, 1) + self.gridLayout_5.addWidget(self.button_common, 9, 0, 1, 1) self.button_difference = QtGui.QPushButton(self.Objects_Tab2_2) - icon68 = QtGui.QIcon() - icon68.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_Difference.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_difference.setIcon(icon68) + icon69 = QtGui.QIcon() + icon69.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_Difference.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_difference.setIcon(icon69) self.button_difference.setIconSize(QtCore.QSize(32, 32)) self.button_difference.setObjectName(_fromUtf8("button_difference")) - self.gridLayout_5.addWidget(self.button_difference, 9, 0, 1, 1) + self.gridLayout_5.addWidget(self.button_difference, 10, 0, 1, 1) spacerItem14 = QtGui.QSpacerItem(17, 8, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_5.addItem(spacerItem14, 10, 0, 1, 1) - icon69 = QtGui.QIcon() - icon69.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_box.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_7.addTab(self.Objects_Tab2_2, icon69, _fromUtf8("")) + self.gridLayout_5.addItem(spacerItem14, 11, 0, 1, 1) + icon70 = QtGui.QIcon() + icon70.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_box.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_7.addTab(self.Objects_Tab2_2, icon70, _fromUtf8("")) self.Modif_Tab_2 = QtGui.QWidget() self.Modif_Tab_2.setObjectName(_fromUtf8("Modif_Tab_2")) self.gridLayout_94 = QtGui.QGridLayout(self.Modif_Tab_2) @@ -1654,9 +1666,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)) - icon70 = QtGui.QIcon() - icon70.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlignFace.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_alignface2view.setIcon(icon70) + icon71 = QtGui.QIcon() + icon71.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlignFace.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_alignface2view.setIcon(icon71) self.button_alignface2view.setIconSize(QtCore.QSize(32, 32)) self.button_alignface2view.setObjectName(_fromUtf8("button_alignface2view")) self.gridLayout_95.addWidget(self.button_alignface2view, 0, 0, 1, 1) @@ -1664,9 +1676,9 @@ class Ui_Form(object): self.horizontalLayout_78.setObjectName(_fromUtf8("horizontalLayout_78")) self.button_align_faces = QtGui.QPushButton(self.align_tab_2) self.button_align_faces.setMaximumSize(QtCore.QSize(220, 16777215)) - icon71 = QtGui.QIcon() - icon71.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectAlignFaces.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_align_faces.setIcon(icon71) + icon72 = QtGui.QIcon() + icon72.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectAlignFaces.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_align_faces.setIcon(icon72) self.button_align_faces.setIconSize(QtCore.QSize(32, 32)) self.button_align_faces.setObjectName(_fromUtf8("button_align_faces")) self.horizontalLayout_78.addWidget(self.button_align_faces) @@ -1685,9 +1697,9 @@ class Ui_Form(object): self.horizontalLayout_79.setObjectName(_fromUtf8("horizontalLayout_79")) self.button_align_edges = QtGui.QPushButton(self.align_tab_2) self.button_align_edges.setMaximumSize(QtCore.QSize(220, 16777215)) - icon72 = QtGui.QIcon() - icon72.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectAlignAxes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_align_edges.setIcon(icon72) + icon73 = QtGui.QIcon() + icon73.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectAlignAxes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_align_edges.setIcon(icon73) self.button_align_edges.setIconSize(QtCore.QSize(32, 32)) self.button_align_edges.setObjectName(_fromUtf8("button_align_edges")) self.horizontalLayout_79.addWidget(self.button_align_edges) @@ -1705,16 +1717,16 @@ class Ui_Form(object): spacerItem15 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_95.addItem(spacerItem15, 5, 0, 1, 1) self.button_joint_points = QtGui.QPushButton(self.align_tab_2) - icon73 = QtGui.QIcon() - icon73.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectJointPoints.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_joint_points.setIcon(icon73) + icon74 = QtGui.QIcon() + icon74.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectJointPoints.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_joint_points.setIcon(icon74) self.button_joint_points.setIconSize(QtCore.QSize(32, 32)) self.button_joint_points.setObjectName(_fromUtf8("button_joint_points")) self.gridLayout_95.addWidget(self.button_joint_points, 3, 0, 1, 1) self.button_joint_faces = QtGui.QPushButton(self.align_tab_2) - icon74 = QtGui.QIcon() - icon74.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectJointFaces.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_joint_faces.setIcon(icon74) + icon75 = QtGui.QIcon() + icon75.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectJointFaces.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_joint_faces.setIcon(icon75) self.button_joint_faces.setIconSize(QtCore.QSize(32, 32)) self.button_joint_faces.setObjectName(_fromUtf8("button_joint_faces")) self.gridLayout_95.addWidget(self.button_joint_faces, 4, 0, 1, 1) @@ -1884,9 +1896,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_105.addWidget(self.ObjRot_button_select_axis, 1, 0, 1, 1) - icon75 = QtGui.QIcon() - icon75.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_rotationAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_10.addTab(self.tab_18, icon75, _fromUtf8("")) + icon76 = QtGui.QIcon() + icon76.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_rotationAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_10.addTab(self.tab_18, icon76, _fromUtf8("")) self.tab_19 = QtGui.QWidget() self.tab_19.setObjectName(_fromUtf8("tab_19")) self.gridLayout_106 = QtGui.QGridLayout(self.tab_19) @@ -1913,9 +1925,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_106.addWidget(self.ObjRot_button_select_center, 1, 0, 1, 1) - icon76 = QtGui.QIcon() - icon76.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_rotationPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_10.addTab(self.tab_19, icon76, _fromUtf8("")) + icon77 = QtGui.QIcon() + icon77.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_rotationPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_10.addTab(self.tab_19, icon77, _fromUtf8("")) self.gridLayout_104.addWidget(self.tabWidget_10, 1, 0, 1, 1) self.groupBox_21 = QtGui.QGroupBox(self.frame_11) self.groupBox_21.setMinimumSize(QtCore.QSize(150, 67)) @@ -1951,9 +1963,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_109.addWidget(self.ObjRot_button_select_angle, 0, 0, 1, 1) - icon77 = QtGui.QIcon() - icon77.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_click.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_11.addTab(self.tab_21, icon77, _fromUtf8("")) + icon78 = QtGui.QIcon() + icon78.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_click.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_11.addTab(self.tab_21, icon78, _fromUtf8("")) self.gridLayout_107.addWidget(self.tabWidget_11, 0, 0, 1, 1) self.horizontalLayout_81 = QtGui.QHBoxLayout() self.horizontalLayout_81.setObjectName(_fromUtf8("horizontalLayout_81")) @@ -2102,9 +2114,9 @@ class Ui_Form(object): self.gridLayout_114.addLayout(self.gridLayout_117, 2, 0, 1, 1) self.gridLayout_113.addLayout(self.gridLayout_114, 2, 0, 1, 1) self.gridLayout_112.addWidget(self.groupBox_22, 0, 0, 1, 1) - icon78 = QtGui.QIcon() - icon78.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_startPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_12.addTab(self.tab_22, icon78, _fromUtf8("")) + icon79 = QtGui.QIcon() + icon79.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_startPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_12.addTab(self.tab_22, icon79, _fromUtf8("")) self.tab_23 = QtGui.QWidget() self.tab_23.setObjectName(_fromUtf8("tab_23")) self.gridLayout_118 = QtGui.QGridLayout(self.tab_23) @@ -2179,9 +2191,9 @@ class Ui_Form(object): self.gridLayout_120.addLayout(self.gridLayout_123, 0, 0, 1, 1) self.gridLayout_119.addLayout(self.gridLayout_120, 2, 0, 1, 1) self.gridLayout_118.addWidget(self.groupBox_23, 0, 0, 1, 1) - icon79 = QtGui.QIcon() - icon79.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_endPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_12.addTab(self.tab_23, icon79, _fromUtf8("")) + icon80 = QtGui.QIcon() + icon80.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_endPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_12.addTab(self.tab_23, icon80, _fromUtf8("")) self.gridLayout_111.addWidget(self.tabWidget_12, 2, 0, 1, 1) self.horizontalLayout_84 = QtGui.QHBoxLayout() self.horizontalLayout_84.setObjectName(_fromUtf8("horizontalLayout_84")) @@ -2215,65 +2227,58 @@ class Ui_Form(object): sizePolicy.setHeightForWidth(self.button_alignview.sizePolicy().hasHeightForWidth()) self.button_alignview.setSizePolicy(sizePolicy) self.button_alignview.setMaximumSize(QtCore.QSize(16777215, 16777215)) - icon80 = QtGui.QIcon() - icon80.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlign.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_alignview.setIcon(icon80) + icon81 = QtGui.QIcon() + icon81.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlign.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_alignview.setIcon(icon81) self.button_alignview.setIconSize(QtCore.QSize(32, 32)) self.button_alignview.setObjectName(_fromUtf8("button_alignview")) self.gridLayout_124.addWidget(self.button_alignview, 0, 0, 1, 1) spacerItem22 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_124.addItem(spacerItem22, 2, 0, 1, 1) self.button_trackcamera = QtGui.QPushButton(self.View_Tab_2) - icon81 = QtGui.QIcon() - icon81.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_trackCamera.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_trackcamera.setIcon(icon81) + icon82 = QtGui.QIcon() + icon82.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_trackCamera.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_trackcamera.setIcon(icon82) self.button_trackcamera.setIconSize(QtCore.QSize(32, 32)) self.button_trackcamera.setObjectName(_fromUtf8("button_trackcamera")) self.gridLayout_124.addWidget(self.button_trackcamera, 1, 0, 1, 1) - icon82 = QtGui.QIcon() - icon82.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_view.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_7.addTab(self.View_Tab_2, icon82, _fromUtf8("")) + icon83 = QtGui.QIcon() + icon83.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_view.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_7.addTab(self.View_Tab_2, icon83, _fromUtf8("")) self.tab_24 = QtGui.QWidget() self.tab_24.setObjectName(_fromUtf8("tab_24")) self.gridLayout_125 = QtGui.QGridLayout(self.tab_24) self.gridLayout_125.setObjectName(_fromUtf8("gridLayout_125")) - spacerItem23 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_125.addItem(spacerItem23, 9, 0, 1, 1) self.button_isView = QtGui.QPushButton(self.tab_24) - icon83 = QtGui.QIcon() - icon83.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_FCCamera_02.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isView.setIcon(icon83) + icon84 = QtGui.QIcon() + icon84.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_FCCamera_02.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isView.setIcon(icon84) self.button_isView.setIconSize(QtCore.QSize(32, 32)) self.button_isView.setObjectName(_fromUtf8("button_isView")) - self.gridLayout_125.addWidget(self.button_isView, 8, 0, 1, 1) + self.gridLayout_125.addWidget(self.button_isView, 9, 0, 1, 1) + spacerItem23 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_125.addItem(spacerItem23, 10, 0, 1, 1) self.button_isParallel = QtGui.QPushButton(self.tab_24) - icon84 = QtGui.QIcon() - icon84.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isParallel.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isParallel.setIcon(icon84) + icon85 = QtGui.QIcon() + icon85.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isParallel.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isParallel.setIcon(icon85) self.button_isParallel.setIconSize(QtCore.QSize(32, 32)) self.button_isParallel.setObjectName(_fromUtf8("button_isParallel")) self.gridLayout_125.addWidget(self.button_isParallel, 0, 0, 1, 1) self.button_isAngle = QtGui.QPushButton(self.tab_24) - icon85 = QtGui.QIcon() - icon85.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_angleBetween.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isAngle.setIcon(icon85) + icon86 = QtGui.QIcon() + icon86.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_angleBetween.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isAngle.setIcon(icon86) self.button_isAngle.setIconSize(QtCore.QSize(32, 32)) self.button_isAngle.setObjectName(_fromUtf8("button_isAngle")) self.gridLayout_125.addWidget(self.button_isAngle, 4, 0, 1, 1) self.button_isLength = QtGui.QPushButton(self.tab_24) - icon86 = QtGui.QIcon() - icon86.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isLength.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isLength.setIcon(icon86) + icon87 = QtGui.QIcon() + icon87.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isLength.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isLength.setIcon(icon87) self.button_isLength.setIconSize(QtCore.QSize(32, 32)) self.button_isLength.setObjectName(_fromUtf8("button_isLength")) self.gridLayout_125.addWidget(self.button_isLength, 6, 0, 1, 1) - self.button_isPerpendicular = QtGui.QPushButton(self.tab_24) - icon87 = QtGui.QIcon() - icon87.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isPerpendicular.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isPerpendicular.setIcon(icon87) - self.button_isPerpendicular.setIconSize(QtCore.QSize(32, 32)) - self.button_isPerpendicular.setObjectName(_fromUtf8("button_isPerpendicular")) - self.gridLayout_125.addWidget(self.button_isPerpendicular, 1, 0, 1, 1) self.button_isDistance = QtGui.QPushButton(self.tab_24) icon88 = QtGui.QIcon() icon88.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_distanceBetween.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) @@ -2281,30 +2286,44 @@ class Ui_Form(object): self.button_isDistance.setIconSize(QtCore.QSize(32, 32)) self.button_isDistance.setObjectName(_fromUtf8("button_isDistance")) self.gridLayout_125.addWidget(self.button_isDistance, 5, 0, 1, 1) - self.button_isArea = QtGui.QPushButton(self.tab_24) - icon89 = QtGui.QIcon() - icon89.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isArea.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isArea.setIcon(icon89) - self.button_isArea.setIconSize(QtCore.QSize(32, 32)) - self.button_isArea.setObjectName(_fromUtf8("button_isArea")) - self.gridLayout_125.addWidget(self.button_isArea, 7, 0, 1, 1) self.button_isCoplanar = QtGui.QPushButton(self.tab_24) - icon90 = QtGui.QIcon() - icon90.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isCoplanar.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isCoplanar.setIcon(icon90) + icon89 = QtGui.QIcon() + icon89.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isCoplanar.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isCoplanar.setIcon(icon89) self.button_isCoplanar.setIconSize(QtCore.QSize(32, 32)) self.button_isCoplanar.setObjectName(_fromUtf8("button_isCoplanar")) self.gridLayout_125.addWidget(self.button_isCoplanar, 2, 0, 1, 1) - self.button_isClearance = QtGui.QPushButton(self.tab_24) + self.button_isArea = QtGui.QPushButton(self.tab_24) + icon90 = QtGui.QIcon() + icon90.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isArea.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isArea.setIcon(icon90) + self.button_isArea.setIconSize(QtCore.QSize(32, 32)) + self.button_isArea.setObjectName(_fromUtf8("button_isArea")) + self.gridLayout_125.addWidget(self.button_isArea, 7, 0, 1, 1) + self.button_isPerpendicular = QtGui.QPushButton(self.tab_24) icon91 = QtGui.QIcon() - icon91.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isClearance.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isClearance.setIcon(icon91) + icon91.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isPerpendicular.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isPerpendicular.setIcon(icon91) + self.button_isPerpendicular.setIconSize(QtCore.QSize(32, 32)) + self.button_isPerpendicular.setObjectName(_fromUtf8("button_isPerpendicular")) + self.gridLayout_125.addWidget(self.button_isPerpendicular, 1, 0, 1, 1) + self.button_isClearance = QtGui.QPushButton(self.tab_24) + icon92 = QtGui.QIcon() + icon92.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isClearance.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isClearance.setIcon(icon92) self.button_isClearance.setIconSize(QtCore.QSize(32, 32)) self.button_isClearance.setObjectName(_fromUtf8("button_isClearance")) self.gridLayout_125.addWidget(self.button_isClearance, 3, 0, 1, 1) - icon92 = QtGui.QIcon() - icon92.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_check.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_7.addTab(self.tab_24, icon92, _fromUtf8("")) + self.button_isRadius = QtGui.QPushButton(self.tab_24) + icon93 = QtGui.QIcon() + icon93.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isRadius.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isRadius.setIcon(icon93) + self.button_isRadius.setIconSize(QtCore.QSize(32, 32)) + self.button_isRadius.setObjectName(_fromUtf8("button_isRadius")) + self.gridLayout_125.addWidget(self.button_isRadius, 8, 0, 1, 1) + icon94 = QtGui.QIcon() + icon94.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_check.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_7.addTab(self.tab_24, icon94, _fromUtf8("")) self.gridLayout_128.addWidget(self.tabWidget_7, 0, 0, 1, 1) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.gridLayout_34.addWidget(self.scrollArea, 0, 0, 1, 1) @@ -2321,7 +2340,7 @@ class Ui_Form(object): self.gridLayout_34.addLayout(self.horizontalLayout_43, 1, 0, 1, 1) self.retranslateUi(Form) - self.tabWidget_7.setCurrentIndex(4) + self.tabWidget_7.setCurrentIndex(7) self.point_loc_comboBox.setCurrentIndex(1) self.tabWidget_8.setCurrentIndex(0) self.transition_comboBox.setCurrentIndex(2) @@ -2637,7 +2656,8 @@ class Ui_Form(object): "- Second push this button\n" "\n" "NB: \n" -" - The percentage of the extension can be defined first.", None)) +" - The percentage of the extension can be defined first.\n" +" - Negative percentage will shrink the Axis", None)) self.button_extension_axis.setText(_translate("Form", "Enlarge(Axis)", None)) self.extension_axis.setToolTip(_translate("Form", "Extension of the Line in percentage of original length of the Line.\n" "If the extension is 50% it means that each side is extended with 25% length.\n" @@ -2696,7 +2716,7 @@ class Ui_Form(object): self.ParCurve_button_store_2.setText(_translate("Form", "Store", None)) self.ParCurve_button_apply_2.setToolTip(_translate("Form", "Click to visualize the curve.", None)) self.ParCurve_button_apply_2.setText(_translate("Form", "Apply", None)) - self.tabWidget_8.setTabText(self.tabWidget_8.indexOf(self.tab_14), _translate("Form", "2D", None)) + self.tabWidget_8.setTabText(self.tabWidget_8.indexOf(self.tab_14), _translate("Form", "Parametric 2D", None)) self.ParCurve_comboBox_3.setToolTip(_translate("Form", "Choose another curve from the list.", None)) self.ParCurve_button_edit_3.setToolTip(_translate("Form", "Click to access to a table where you can edit all parameters of all curves and \n" "save your custom curves.", None)) @@ -2734,7 +2754,7 @@ class Ui_Form(object): self.ParCurve_button_store_3.setText(_translate("Form", "Store", None)) self.ParCurve_button_apply_3.setToolTip(_translate("Form", "Click to visualize the curve.", None)) self.ParCurve_button_apply_3.setText(_translate("Form", "Apply", None)) - self.tabWidget_8.setTabText(self.tabWidget_8.indexOf(self.tab_15), _translate("Form", "3D", None)) + self.tabWidget_8.setTabText(self.tabWidget_8.indexOf(self.tab_15), _translate("Form", "Parametric 3D", None)) self.tabWidget_7.setTabText(self.tabWidget_7.indexOf(self.Wire_Tab_2), _translate("Form", "Wire", None)) self.button_linecenter_circle.setToolTip(_translate("Form", "Select an Axis and a Point to create a Circle\n" "centered on the Point, perpendicular to the Axis \n" @@ -2807,6 +2827,14 @@ class Ui_Form(object): "# 0 (default), 1 (right corners) or 2 (rounded corners).)\n" "", None)) self.button_sweep.setText(_translate("Form", "Section Sweep", None)) + self.button_beam.setToolTip(_translate("Form", "Beam:\n" +"Will extrude a Section along a Linear Trajectory.\n" +"- Select first one Section wire (Closed wire will generate volumes by default)\n" +"(This Section can be a compound from sketch to realize \"tube\")\n" +"- Select one or several wire(s) as Trajectory(ies)\n" +"- Then push this button\n" +"", None)) + self.button_beam.setText(_translate("Form", "Beam", None)) self.tabWidget_7.setTabText(self.tabWidget_7.indexOf(self.tab_17), _translate("Form", "Sweeping", None)) self.button_click_for_plane.setToolTip(_translate("Form", "Click:\n" "Create a rectangular Plane perpendicular to the view at location of one mouse click.\n" @@ -2994,6 +3022,11 @@ class Ui_Form(object): self.button_revolve.setText(_translate("Form", "Revolve", None)) self.angle_revolve.setToolTip(_translate("Form", "Angle of the revolution in degrees.", None)) self.angle_revolve.setText(_translate("Form", "360", None)) + self.button_copy_objects.setToolTip(_translate("Form", "Duplicate:\n" +"Make a copy of an object or a selected subObject part:\n" +"- Select one or several object(s) or subobject(s)\n" +"- Then push this button", None)) + self.button_copy_objects.setText(_translate("Form", "Duplicate", None)) self.button_common.setToolTip(_translate("Form", "Compute the common parts between selected shapes.\n" "- Select at least two objects and click.\n" "\n" @@ -3287,34 +3320,39 @@ class Ui_Form(object): "Click this button\n" " ", None)) self.button_isLength.setText(_translate("Form", "Length ?", None)) - self.button_isPerpendicular.setToolTip(_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)) - self.button_isPerpendicular.setText(_translate("Form", "are Perpendicular ?", None)) self.button_isDistance.setToolTip(_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)) self.button_isDistance.setText(_translate("Form", "Distance ?", None)) - self.button_isArea.setToolTip(_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)) - self.button_isArea.setText(_translate("Form", "Area ?", None)) self.button_isCoplanar.setToolTip(_translate("Form", "Check if two faces or two Edges are Coplanar:\n" "- Select the 2 faces/planes or 2 Edges/Lines and\n" "Click this button\n" "\n" "NB: You can change the tolerance in \"Ori. Pref.\" TAB", None)) self.button_isCoplanar.setText(_translate("Form", "are Coplanar ?", None)) + self.button_isArea.setToolTip(_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" +"- Then click this button", None)) + self.button_isArea.setText(_translate("Form", "Area ?", None)) + self.button_isPerpendicular.setToolTip(_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)) + self.button_isPerpendicular.setText(_translate("Form", "are Perpendicular ?", None)) self.button_isClearance.setToolTip(_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)) self.button_isClearance.setText(_translate("Form", "Distance Clearance ?", None)) + self.button_isRadius.setToolTip(_translate("Form", "Check for Radius:\n" +"Radius measurement for a Circle or an Arc.\n" +"- Select One Circle or Arc\n" +"- Then click this button", None)) + self.button_isRadius.setText(_translate("Form", "Radius ?", None)) self.tabWidget_7.setTabText(self.tabWidget_7.indexOf(self.tab_24), _translate("Form", "Check", None)) self.button_WF_quit.setText(_translate("Form", "Close", None)) self.label_release.setText(_translate("Form", "2015", None)) diff --git a/WorkFeature/Ui/WFGui_2015.ui b/WorkFeature/Ui/WFGui_2015.ui index f3f6d99..80abcad 100644 --- a/WorkFeature/Ui/WFGui_2015.ui +++ b/WorkFeature/Ui/WFGui_2015.ui @@ -57,7 +57,7 @@ QTabWidget::West - 4 + 0 @@ -1745,7 +1745,8 @@ Extend an Axis at two extrema. - Second push this button NB: - - The percentage of the extension can be defined first. + - The percentage of the extension can be defined first. + - Negative percentage will shrink the Axis Enlarge(Axis) @@ -1908,7 +1909,7 @@ Then click on this button. - 2D + Parametric 2D @@ -2514,7 +2515,7 @@ To save your curve you need to go to "Edit". - 3D + Parametric 3D @@ -3412,7 +3413,7 @@ Then click on this button. Sweeping - + @@ -3560,7 +3561,7 @@ NB: You can change first: - + Qt::Vertical @@ -3573,6 +3574,32 @@ NB: You can change first: + + + + Beam: +Will extrude a Section along a Linear Trajectory. +- Select first one Section wire (Closed wire will generate volumes by default) +(This Section can be a compound from sketch to realize "tube") +- Select one or several wire(s) as Trajectory(ies) +- Then push this button + + + + Beam + + + + ../Icons/WF_Beam.svg../Icons/WF_Beam.svg + + + + 32 + 32 + + + + @@ -4762,6 +4789,29 @@ NB: + + + Duplicate: +Make a copy of an object or a selected subObject part: +- Select one or several object(s) or subobject(s) +- Then push this button + + + Duplicate + + + + ../Icons/WF_objectCopy.svg../Icons/WF_objectCopy.svg + + + + 32 + 32 + + + + + Compute the common parts between selected shapes. @@ -4788,7 +4838,7 @@ Original code from HighlightCommon.FCMacro - + Compute the difference parts between selected shapes. @@ -4814,7 +4864,7 @@ Original code from HighlightDifference.FCMacro - + Qt::Vertical @@ -6633,19 +6683,6 @@ ReClick with same selection, will reverse the direction. - - - Qt::Vertical - - - - 20 - 40 - - - - - Detect the position of the camera. @@ -6667,6 +6704,19 @@ by the function getCameraOrientation(). + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -6747,30 +6797,6 @@ Click this button - - - - 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 ? - - - - ../Icons/WF_isPerpendicular.svg../Icons/WF_isPerpendicular.svg - - - - 32 - 32 - - - - @@ -6795,29 +6821,6 @@ Click this button - - - - Check for surface Area: -Area measurement for a Plane or a set of Planes. -- Select One or several Planes and -Click this button - - - Area ? - - - - ../Icons/WF_isArea.svg../Icons/WF_isArea.svg - - - - 32 - 32 - - - - @@ -6842,6 +6845,53 @@ NB: You can change the tolerance in "Ori. Pref." TAB + + + + Check for surface Area: +Area measurement for a Plane or a set of Planes. +- Select One or several Planes and +- Then click this button + + + Area ? + + + + ../Icons/WF_isArea.svg../Icons/WF_isArea.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 ? + + + + ../Icons/WF_isPerpendicular.svg../Icons/WF_isPerpendicular.svg + + + + 32 + 32 + + + + @@ -6865,6 +6915,29 @@ Click this button + + + + Check for Radius: +Radius measurement for a Circle or an Arc. +- Select One Circle or Arc +- Then click this button + + + Radius ? + + + + ../Icons/WF_isRadius.svg../Icons/WF_isRadius.svg + + + + 32 + 32 + + + + diff --git a/WorkFeature/WFGui_2015.py b/WorkFeature/WFGui_2015.py index 13fb09c..075986e 100644 --- a/WorkFeature/WFGui_2015.py +++ b/WorkFeature/WFGui_2015.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'WFGui_2015.ui' # -# Created: Sat Nov 7 20:09:36 2015 -# by: PySide UI code generator 4.11.2 +# Created: Sun Dec 13 18:49:39 2015 +# by: PySide UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! @@ -636,7 +636,7 @@ class Ui_Form(object): self.scrollArea_2.setWidgetResizable(True) self.scrollArea_2.setObjectName(_fromUtf8("scrollArea_2")) self.scrollAreaWidgetContents_5 = QtGui.QWidget() - self.scrollAreaWidgetContents_5.setGeometry(QtCore.QRect(0, 0, 259, 650)) + self.scrollAreaWidgetContents_5.setGeometry(QtCore.QRect(0, 0, 245, 648)) self.scrollAreaWidgetContents_5.setObjectName(_fromUtf8("scrollAreaWidgetContents_5")) self.gridLayout_76 = QtGui.QGridLayout(self.scrollAreaWidgetContents_5) self.gridLayout_76.setObjectName(_fromUtf8("gridLayout_76")) @@ -1169,8 +1169,8 @@ class Ui_Form(object): self.tabWidget_7.addTab(self.tab_16, icon45, _fromUtf8("")) self.tab_17 = QtGui.QWidget() self.tab_17.setObjectName(_fromUtf8("tab_17")) - self.gridLayout_85 = QtGui.QGridLayout(self.tab_17) - self.gridLayout_85.setObjectName(_fromUtf8("gridLayout_85")) + self.gridLayout_6 = QtGui.QGridLayout(self.tab_17) + self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) self.frame_9 = QtGui.QFrame(self.tab_17) self.frame_9.setFrameShape(QtGui.QFrame.StyledPanel) self.frame_9.setFrameShadow(QtGui.QFrame.Raised) @@ -1209,11 +1209,16 @@ class Ui_Form(object): self.button_sweep.setIconSize(QtCore.QSize(32, 32)) self.button_sweep.setObjectName(_fromUtf8("button_sweep")) self.gridLayout_86.addWidget(self.button_sweep, 1, 0, 1, 1) - self.gridLayout_85.addWidget(self.frame_9, 0, 0, 1, 1) + self.gridLayout_6.addWidget(self.frame_9, 0, 0, 1, 1) spacerItem11 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_85.addItem(spacerItem11, 1, 0, 1, 1) + self.gridLayout_6.addItem(spacerItem11, 2, 0, 1, 1) + self.button_beam = QtGui.QPushButton(self.tab_17) icon47 = QtGui.QIcon() icon47.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_Beam.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_beam.setIcon(icon47) + self.button_beam.setIconSize(QtCore.QSize(32, 32)) + self.button_beam.setObjectName(_fromUtf8("button_beam")) + self.gridLayout_6.addWidget(self.button_beam, 1, 0, 1, 1) self.tabWidget_7.addTab(self.tab_17, icon47, _fromUtf8("")) self.Plane_Tab1_3 = QtGui.QWidget() self.Plane_Tab1_3.setObjectName(_fromUtf8("Plane_Tab1_3")) @@ -1618,25 +1623,32 @@ class Ui_Form(object): self.angle_revolve.setObjectName(_fromUtf8("angle_revolve")) self.horizontalLayout_76.addWidget(self.angle_revolve) self.gridLayout_5.addLayout(self.horizontalLayout_76, 7, 0, 1, 1) - self.button_common = QtGui.QPushButton(self.Objects_Tab2_2) + self.button_copy_objects = QtGui.QPushButton(self.Objects_Tab2_2) icon67 = QtGui.QIcon() - icon67.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_Common.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_common.setIcon(icon67) + icon67.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectCopy.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_copy_objects.setIcon(icon67) + self.button_copy_objects.setIconSize(QtCore.QSize(32, 32)) + self.button_copy_objects.setObjectName(_fromUtf8("button_copy_objects")) + self.gridLayout_5.addWidget(self.button_copy_objects, 8, 0, 1, 1) + self.button_common = QtGui.QPushButton(self.Objects_Tab2_2) + icon68 = QtGui.QIcon() + icon68.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_Common.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_common.setIcon(icon68) self.button_common.setIconSize(QtCore.QSize(32, 32)) self.button_common.setObjectName(_fromUtf8("button_common")) - self.gridLayout_5.addWidget(self.button_common, 8, 0, 1, 1) + self.gridLayout_5.addWidget(self.button_common, 9, 0, 1, 1) self.button_difference = QtGui.QPushButton(self.Objects_Tab2_2) - icon68 = QtGui.QIcon() - icon68.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_Difference.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_difference.setIcon(icon68) + icon69 = QtGui.QIcon() + icon69.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_Difference.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_difference.setIcon(icon69) self.button_difference.setIconSize(QtCore.QSize(32, 32)) self.button_difference.setObjectName(_fromUtf8("button_difference")) - self.gridLayout_5.addWidget(self.button_difference, 9, 0, 1, 1) + self.gridLayout_5.addWidget(self.button_difference, 10, 0, 1, 1) spacerItem14 = QtGui.QSpacerItem(17, 8, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_5.addItem(spacerItem14, 10, 0, 1, 1) - icon69 = QtGui.QIcon() - icon69.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_box.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_7.addTab(self.Objects_Tab2_2, icon69, _fromUtf8("")) + self.gridLayout_5.addItem(spacerItem14, 11, 0, 1, 1) + icon70 = QtGui.QIcon() + icon70.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_box.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_7.addTab(self.Objects_Tab2_2, icon70, _fromUtf8("")) self.Modif_Tab_2 = QtGui.QWidget() self.Modif_Tab_2.setObjectName(_fromUtf8("Modif_Tab_2")) self.gridLayout_94 = QtGui.QGridLayout(self.Modif_Tab_2) @@ -1654,9 +1666,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)) - icon70 = QtGui.QIcon() - icon70.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlignFace.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_alignface2view.setIcon(icon70) + icon71 = QtGui.QIcon() + icon71.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlignFace.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_alignface2view.setIcon(icon71) self.button_alignface2view.setIconSize(QtCore.QSize(32, 32)) self.button_alignface2view.setObjectName(_fromUtf8("button_alignface2view")) self.gridLayout_95.addWidget(self.button_alignface2view, 0, 0, 1, 1) @@ -1664,9 +1676,9 @@ class Ui_Form(object): self.horizontalLayout_78.setObjectName(_fromUtf8("horizontalLayout_78")) self.button_align_faces = QtGui.QPushButton(self.align_tab_2) self.button_align_faces.setMaximumSize(QtCore.QSize(220, 16777215)) - icon71 = QtGui.QIcon() - icon71.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectAlignFaces.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_align_faces.setIcon(icon71) + icon72 = QtGui.QIcon() + icon72.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectAlignFaces.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_align_faces.setIcon(icon72) self.button_align_faces.setIconSize(QtCore.QSize(32, 32)) self.button_align_faces.setObjectName(_fromUtf8("button_align_faces")) self.horizontalLayout_78.addWidget(self.button_align_faces) @@ -1685,9 +1697,9 @@ class Ui_Form(object): self.horizontalLayout_79.setObjectName(_fromUtf8("horizontalLayout_79")) self.button_align_edges = QtGui.QPushButton(self.align_tab_2) self.button_align_edges.setMaximumSize(QtCore.QSize(220, 16777215)) - icon72 = QtGui.QIcon() - icon72.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectAlignAxes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_align_edges.setIcon(icon72) + icon73 = QtGui.QIcon() + icon73.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectAlignAxes.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_align_edges.setIcon(icon73) self.button_align_edges.setIconSize(QtCore.QSize(32, 32)) self.button_align_edges.setObjectName(_fromUtf8("button_align_edges")) self.horizontalLayout_79.addWidget(self.button_align_edges) @@ -1705,16 +1717,16 @@ class Ui_Form(object): spacerItem15 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_95.addItem(spacerItem15, 5, 0, 1, 1) self.button_joint_points = QtGui.QPushButton(self.align_tab_2) - icon73 = QtGui.QIcon() - icon73.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectJointPoints.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_joint_points.setIcon(icon73) + icon74 = QtGui.QIcon() + icon74.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectJointPoints.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_joint_points.setIcon(icon74) self.button_joint_points.setIconSize(QtCore.QSize(32, 32)) self.button_joint_points.setObjectName(_fromUtf8("button_joint_points")) self.gridLayout_95.addWidget(self.button_joint_points, 3, 0, 1, 1) self.button_joint_faces = QtGui.QPushButton(self.align_tab_2) - icon74 = QtGui.QIcon() - icon74.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectJointFaces.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_joint_faces.setIcon(icon74) + icon75 = QtGui.QIcon() + icon75.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_objectJointFaces.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_joint_faces.setIcon(icon75) self.button_joint_faces.setIconSize(QtCore.QSize(32, 32)) self.button_joint_faces.setObjectName(_fromUtf8("button_joint_faces")) self.gridLayout_95.addWidget(self.button_joint_faces, 4, 0, 1, 1) @@ -1884,9 +1896,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_105.addWidget(self.ObjRot_button_select_axis, 1, 0, 1, 1) - icon75 = QtGui.QIcon() - icon75.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_rotationAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_10.addTab(self.tab_18, icon75, _fromUtf8("")) + icon76 = QtGui.QIcon() + icon76.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_rotationAxis.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_10.addTab(self.tab_18, icon76, _fromUtf8("")) self.tab_19 = QtGui.QWidget() self.tab_19.setObjectName(_fromUtf8("tab_19")) self.gridLayout_106 = QtGui.QGridLayout(self.tab_19) @@ -1913,9 +1925,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_106.addWidget(self.ObjRot_button_select_center, 1, 0, 1, 1) - icon76 = QtGui.QIcon() - icon76.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_rotationPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_10.addTab(self.tab_19, icon76, _fromUtf8("")) + icon77 = QtGui.QIcon() + icon77.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_rotationPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_10.addTab(self.tab_19, icon77, _fromUtf8("")) self.gridLayout_104.addWidget(self.tabWidget_10, 1, 0, 1, 1) self.groupBox_21 = QtGui.QGroupBox(self.frame_11) self.groupBox_21.setMinimumSize(QtCore.QSize(150, 67)) @@ -1951,9 +1963,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_109.addWidget(self.ObjRot_button_select_angle, 0, 0, 1, 1) - icon77 = QtGui.QIcon() - icon77.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_click.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_11.addTab(self.tab_21, icon77, _fromUtf8("")) + icon78 = QtGui.QIcon() + icon78.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_click.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_11.addTab(self.tab_21, icon78, _fromUtf8("")) self.gridLayout_107.addWidget(self.tabWidget_11, 0, 0, 1, 1) self.horizontalLayout_81 = QtGui.QHBoxLayout() self.horizontalLayout_81.setObjectName(_fromUtf8("horizontalLayout_81")) @@ -2102,9 +2114,9 @@ class Ui_Form(object): self.gridLayout_114.addLayout(self.gridLayout_117, 2, 0, 1, 1) self.gridLayout_113.addLayout(self.gridLayout_114, 2, 0, 1, 1) self.gridLayout_112.addWidget(self.groupBox_22, 0, 0, 1, 1) - icon78 = QtGui.QIcon() - icon78.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_startPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_12.addTab(self.tab_22, icon78, _fromUtf8("")) + icon79 = QtGui.QIcon() + icon79.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_startPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_12.addTab(self.tab_22, icon79, _fromUtf8("")) self.tab_23 = QtGui.QWidget() self.tab_23.setObjectName(_fromUtf8("tab_23")) self.gridLayout_118 = QtGui.QGridLayout(self.tab_23) @@ -2179,9 +2191,9 @@ class Ui_Form(object): self.gridLayout_120.addLayout(self.gridLayout_123, 0, 0, 1, 1) self.gridLayout_119.addLayout(self.gridLayout_120, 2, 0, 1, 1) self.gridLayout_118.addWidget(self.groupBox_23, 0, 0, 1, 1) - icon79 = QtGui.QIcon() - icon79.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_endPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_12.addTab(self.tab_23, icon79, _fromUtf8("")) + icon80 = QtGui.QIcon() + icon80.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_endPoint.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_12.addTab(self.tab_23, icon80, _fromUtf8("")) self.gridLayout_111.addWidget(self.tabWidget_12, 2, 0, 1, 1) self.horizontalLayout_84 = QtGui.QHBoxLayout() self.horizontalLayout_84.setObjectName(_fromUtf8("horizontalLayout_84")) @@ -2215,65 +2227,58 @@ class Ui_Form(object): sizePolicy.setHeightForWidth(self.button_alignview.sizePolicy().hasHeightForWidth()) self.button_alignview.setSizePolicy(sizePolicy) self.button_alignview.setMaximumSize(QtCore.QSize(16777215, 16777215)) - icon80 = QtGui.QIcon() - icon80.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlign.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_alignview.setIcon(icon80) + icon81 = QtGui.QIcon() + icon81.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_viewAlign.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_alignview.setIcon(icon81) self.button_alignview.setIconSize(QtCore.QSize(32, 32)) self.button_alignview.setObjectName(_fromUtf8("button_alignview")) self.gridLayout_124.addWidget(self.button_alignview, 0, 0, 1, 1) spacerItem22 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_124.addItem(spacerItem22, 2, 0, 1, 1) self.button_trackcamera = QtGui.QPushButton(self.View_Tab_2) - icon81 = QtGui.QIcon() - icon81.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_trackCamera.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_trackcamera.setIcon(icon81) + icon82 = QtGui.QIcon() + icon82.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_trackCamera.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_trackcamera.setIcon(icon82) self.button_trackcamera.setIconSize(QtCore.QSize(32, 32)) self.button_trackcamera.setObjectName(_fromUtf8("button_trackcamera")) self.gridLayout_124.addWidget(self.button_trackcamera, 1, 0, 1, 1) - icon82 = QtGui.QIcon() - icon82.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_view.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_7.addTab(self.View_Tab_2, icon82, _fromUtf8("")) + icon83 = QtGui.QIcon() + icon83.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_view.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_7.addTab(self.View_Tab_2, icon83, _fromUtf8("")) self.tab_24 = QtGui.QWidget() self.tab_24.setObjectName(_fromUtf8("tab_24")) self.gridLayout_125 = QtGui.QGridLayout(self.tab_24) self.gridLayout_125.setObjectName(_fromUtf8("gridLayout_125")) - spacerItem23 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_125.addItem(spacerItem23, 9, 0, 1, 1) self.button_isView = QtGui.QPushButton(self.tab_24) - icon83 = QtGui.QIcon() - icon83.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_FCCamera_02.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isView.setIcon(icon83) + icon84 = QtGui.QIcon() + icon84.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_FCCamera_02.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isView.setIcon(icon84) self.button_isView.setIconSize(QtCore.QSize(32, 32)) self.button_isView.setObjectName(_fromUtf8("button_isView")) - self.gridLayout_125.addWidget(self.button_isView, 8, 0, 1, 1) + self.gridLayout_125.addWidget(self.button_isView, 9, 0, 1, 1) + spacerItem23 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_125.addItem(spacerItem23, 10, 0, 1, 1) self.button_isParallel = QtGui.QPushButton(self.tab_24) - icon84 = QtGui.QIcon() - icon84.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isParallel.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isParallel.setIcon(icon84) + icon85 = QtGui.QIcon() + icon85.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isParallel.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isParallel.setIcon(icon85) self.button_isParallel.setIconSize(QtCore.QSize(32, 32)) self.button_isParallel.setObjectName(_fromUtf8("button_isParallel")) self.gridLayout_125.addWidget(self.button_isParallel, 0, 0, 1, 1) self.button_isAngle = QtGui.QPushButton(self.tab_24) - icon85 = QtGui.QIcon() - icon85.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_angleBetween.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isAngle.setIcon(icon85) + icon86 = QtGui.QIcon() + icon86.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_angleBetween.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isAngle.setIcon(icon86) self.button_isAngle.setIconSize(QtCore.QSize(32, 32)) self.button_isAngle.setObjectName(_fromUtf8("button_isAngle")) self.gridLayout_125.addWidget(self.button_isAngle, 4, 0, 1, 1) self.button_isLength = QtGui.QPushButton(self.tab_24) - icon86 = QtGui.QIcon() - icon86.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isLength.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isLength.setIcon(icon86) + icon87 = QtGui.QIcon() + icon87.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isLength.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isLength.setIcon(icon87) self.button_isLength.setIconSize(QtCore.QSize(32, 32)) self.button_isLength.setObjectName(_fromUtf8("button_isLength")) self.gridLayout_125.addWidget(self.button_isLength, 6, 0, 1, 1) - self.button_isPerpendicular = QtGui.QPushButton(self.tab_24) - icon87 = QtGui.QIcon() - icon87.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isPerpendicular.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isPerpendicular.setIcon(icon87) - self.button_isPerpendicular.setIconSize(QtCore.QSize(32, 32)) - self.button_isPerpendicular.setObjectName(_fromUtf8("button_isPerpendicular")) - self.gridLayout_125.addWidget(self.button_isPerpendicular, 1, 0, 1, 1) self.button_isDistance = QtGui.QPushButton(self.tab_24) icon88 = QtGui.QIcon() icon88.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_distanceBetween.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) @@ -2281,30 +2286,44 @@ class Ui_Form(object): self.button_isDistance.setIconSize(QtCore.QSize(32, 32)) self.button_isDistance.setObjectName(_fromUtf8("button_isDistance")) self.gridLayout_125.addWidget(self.button_isDistance, 5, 0, 1, 1) - self.button_isArea = QtGui.QPushButton(self.tab_24) - icon89 = QtGui.QIcon() - icon89.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isArea.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isArea.setIcon(icon89) - self.button_isArea.setIconSize(QtCore.QSize(32, 32)) - self.button_isArea.setObjectName(_fromUtf8("button_isArea")) - self.gridLayout_125.addWidget(self.button_isArea, 7, 0, 1, 1) self.button_isCoplanar = QtGui.QPushButton(self.tab_24) - icon90 = QtGui.QIcon() - icon90.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isCoplanar.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isCoplanar.setIcon(icon90) + icon89 = QtGui.QIcon() + icon89.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isCoplanar.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isCoplanar.setIcon(icon89) self.button_isCoplanar.setIconSize(QtCore.QSize(32, 32)) self.button_isCoplanar.setObjectName(_fromUtf8("button_isCoplanar")) self.gridLayout_125.addWidget(self.button_isCoplanar, 2, 0, 1, 1) - self.button_isClearance = QtGui.QPushButton(self.tab_24) + self.button_isArea = QtGui.QPushButton(self.tab_24) + icon90 = QtGui.QIcon() + icon90.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isArea.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isArea.setIcon(icon90) + self.button_isArea.setIconSize(QtCore.QSize(32, 32)) + self.button_isArea.setObjectName(_fromUtf8("button_isArea")) + self.gridLayout_125.addWidget(self.button_isArea, 7, 0, 1, 1) + self.button_isPerpendicular = QtGui.QPushButton(self.tab_24) icon91 = QtGui.QIcon() - icon91.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isClearance.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.button_isClearance.setIcon(icon91) + icon91.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isPerpendicular.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isPerpendicular.setIcon(icon91) + self.button_isPerpendicular.setIconSize(QtCore.QSize(32, 32)) + self.button_isPerpendicular.setObjectName(_fromUtf8("button_isPerpendicular")) + self.gridLayout_125.addWidget(self.button_isPerpendicular, 1, 0, 1, 1) + self.button_isClearance = QtGui.QPushButton(self.tab_24) + icon92 = QtGui.QIcon() + icon92.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isClearance.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isClearance.setIcon(icon92) self.button_isClearance.setIconSize(QtCore.QSize(32, 32)) self.button_isClearance.setObjectName(_fromUtf8("button_isClearance")) self.gridLayout_125.addWidget(self.button_isClearance, 3, 0, 1, 1) - icon92 = QtGui.QIcon() - icon92.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_check.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget_7.addTab(self.tab_24, icon92, _fromUtf8("")) + self.button_isRadius = QtGui.QPushButton(self.tab_24) + icon93 = QtGui.QIcon() + icon93.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_isRadius.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.button_isRadius.setIcon(icon93) + self.button_isRadius.setIconSize(QtCore.QSize(32, 32)) + self.button_isRadius.setObjectName(_fromUtf8("button_isRadius")) + self.gridLayout_125.addWidget(self.button_isRadius, 8, 0, 1, 1) + icon94 = QtGui.QIcon() + icon94.addPixmap(QtGui.QPixmap(_fromUtf8("icons:WF_check.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget_7.addTab(self.tab_24, icon94, _fromUtf8("")) self.gridLayout_128.addWidget(self.tabWidget_7, 0, 0, 1, 1) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.gridLayout_34.addWidget(self.scrollArea, 0, 0, 1, 1) @@ -2321,7 +2340,7 @@ class Ui_Form(object): self.gridLayout_34.addLayout(self.horizontalLayout_43, 1, 0, 1, 1) self.retranslateUi(Form) - self.tabWidget_7.setCurrentIndex(4) + self.tabWidget_7.setCurrentIndex(7) self.point_loc_comboBox.setCurrentIndex(1) self.tabWidget_8.setCurrentIndex(0) self.transition_comboBox.setCurrentIndex(2) @@ -2637,7 +2656,8 @@ class Ui_Form(object): "- Second push this button\n" "\n" "NB: \n" -" - The percentage of the extension can be defined first.", None)) +" - The percentage of the extension can be defined first.\n" +" - Negative percentage will shrink the Axis", None)) self.button_extension_axis.setText(_translate("Form", "Enlarge(Axis)", None)) self.extension_axis.setToolTip(_translate("Form", "Extension of the Line in percentage of original length of the Line.\n" "If the extension is 50% it means that each side is extended with 25% length.\n" @@ -2696,7 +2716,7 @@ class Ui_Form(object): self.ParCurve_button_store_2.setText(_translate("Form", "Store", None)) self.ParCurve_button_apply_2.setToolTip(_translate("Form", "Click to visualize the curve.", None)) self.ParCurve_button_apply_2.setText(_translate("Form", "Apply", None)) - self.tabWidget_8.setTabText(self.tabWidget_8.indexOf(self.tab_14), _translate("Form", "2D", None)) + self.tabWidget_8.setTabText(self.tabWidget_8.indexOf(self.tab_14), _translate("Form", "Parametric 2D", None)) self.ParCurve_comboBox_3.setToolTip(_translate("Form", "Choose another curve from the list.", None)) self.ParCurve_button_edit_3.setToolTip(_translate("Form", "Click to access to a table where you can edit all parameters of all curves and \n" "save your custom curves.", None)) @@ -2734,7 +2754,7 @@ class Ui_Form(object): self.ParCurve_button_store_3.setText(_translate("Form", "Store", None)) self.ParCurve_button_apply_3.setToolTip(_translate("Form", "Click to visualize the curve.", None)) self.ParCurve_button_apply_3.setText(_translate("Form", "Apply", None)) - self.tabWidget_8.setTabText(self.tabWidget_8.indexOf(self.tab_15), _translate("Form", "3D", None)) + self.tabWidget_8.setTabText(self.tabWidget_8.indexOf(self.tab_15), _translate("Form", "Parametric 3D", None)) self.tabWidget_7.setTabText(self.tabWidget_7.indexOf(self.Wire_Tab_2), _translate("Form", "Wire", None)) self.button_linecenter_circle.setToolTip(_translate("Form", "Select an Axis and a Point to create a Circle\n" "centered on the Point, perpendicular to the Axis \n" @@ -2807,6 +2827,14 @@ class Ui_Form(object): "# 0 (default), 1 (right corners) or 2 (rounded corners).)\n" "", None)) self.button_sweep.setText(_translate("Form", "Section Sweep", None)) + self.button_beam.setToolTip(_translate("Form", "Beam:\n" +"Will extrude a Section along a Linear Trajectory.\n" +"- Select first one Section wire (Closed wire will generate volumes by default)\n" +"(This Section can be a compound from sketch to realize \"tube\")\n" +"- Select one or several wire(s) as Trajectory(ies)\n" +"- Then push this button\n" +"", None)) + self.button_beam.setText(_translate("Form", "Beam", None)) self.tabWidget_7.setTabText(self.tabWidget_7.indexOf(self.tab_17), _translate("Form", "Sweeping", None)) self.button_click_for_plane.setToolTip(_translate("Form", "Click:\n" "Create a rectangular Plane perpendicular to the view at location of one mouse click.\n" @@ -2994,6 +3022,11 @@ class Ui_Form(object): self.button_revolve.setText(_translate("Form", "Revolve", None)) self.angle_revolve.setToolTip(_translate("Form", "Angle of the revolution in degrees.", None)) self.angle_revolve.setText(_translate("Form", "360", None)) + self.button_copy_objects.setToolTip(_translate("Form", "Duplicate:\n" +"Make a copy of an object or a selected subObject part:\n" +"- Select one or several object(s) or subobject(s)\n" +"- Then push this button", None)) + self.button_copy_objects.setText(_translate("Form", "Duplicate", None)) self.button_common.setToolTip(_translate("Form", "Compute the common parts between selected shapes.\n" "- Select at least two objects and click.\n" "\n" @@ -3287,34 +3320,39 @@ class Ui_Form(object): "Click this button\n" " ", None)) self.button_isLength.setText(_translate("Form", "Length ?", None)) - self.button_isPerpendicular.setToolTip(_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)) - self.button_isPerpendicular.setText(_translate("Form", "are Perpendicular ?", None)) self.button_isDistance.setToolTip(_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)) self.button_isDistance.setText(_translate("Form", "Distance ?", None)) - self.button_isArea.setToolTip(_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)) - self.button_isArea.setText(_translate("Form", "Area ?", None)) self.button_isCoplanar.setToolTip(_translate("Form", "Check if two faces or two Edges are Coplanar:\n" "- Select the 2 faces/planes or 2 Edges/Lines and\n" "Click this button\n" "\n" "NB: You can change the tolerance in \"Ori. Pref.\" TAB", None)) self.button_isCoplanar.setText(_translate("Form", "are Coplanar ?", None)) + self.button_isArea.setToolTip(_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" +"- Then click this button", None)) + self.button_isArea.setText(_translate("Form", "Area ?", None)) + self.button_isPerpendicular.setToolTip(_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)) + self.button_isPerpendicular.setText(_translate("Form", "are Perpendicular ?", None)) self.button_isClearance.setToolTip(_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)) self.button_isClearance.setText(_translate("Form", "Distance Clearance ?", None)) + self.button_isRadius.setToolTip(_translate("Form", "Check for Radius:\n" +"Radius measurement for a Circle or an Arc.\n" +"- Select One Circle or Arc\n" +"- Then click this button", None)) + self.button_isRadius.setText(_translate("Form", "Radius ?", None)) self.tabWidget_7.setTabText(self.tabWidget_7.indexOf(self.tab_24), _translate("Form", "Check", None)) self.button_WF_quit.setText(_translate("Form", "Close", None)) self.label_release.setText(_translate("Form", "2015", None)) diff --git a/WorkFeature/WF_2015.py b/WorkFeature/WF_2015.py index 1f9d8a1..3689398 100644 --- a/WorkFeature/WF_2015.py +++ b/WorkFeature/WF_2015.py @@ -14,6 +14,7 @@ * - Ulrich Brammer for Geodesic dome code * * - Wmayer Many Thanks for active help on testing and debbuging * * - Gaƫl Ecorchard for HighlightDifference Macro * +* - lorenz_l for Beam tool Macro * * Special thanks to Mario52 for diverse MACRO codes as FCCamera, * * cutCircle, cutWire, Delta xyz, bounding box ... * * and other diverse pieces of codes * @@ -54,7 +55,7 @@ # First two lines to be able to launch with python import sys from WorkFeature import WF_ObjParCurve_2015 -# change this by your own FreeCAD lib path import FreeCAD +# Change this by your own FreeCAD lib path to import FreeCAD if not sys.path.__contains__("/usr/lib/freecad/lib"): sys.path.append("/usr/lib/freecad/lib") @@ -64,7 +65,7 @@ from WF_Utils_2015 import * from WF_ObjParCurve_2015 import * global myRelease -myRelease = "2015_11_08" +myRelease = "2015_12_16" import os.path import time @@ -380,7 +381,7 @@ def get_typefromSelection(objectType="Edge", info=0): if info != 0: print("SubObject = " + str(SubObject)) print("SubObject.ShapeType = " + str(SubObject.ShapeType)) - if SubObject.ShapeType == "Edge": + if SubObject.ShapeType == objectType: m_found = True break if m_found: @@ -444,7 +445,6 @@ def get_InfoObjects(info=0, printError=True): ", m_objNames=" + str(m_objNames)) return m_num, m_selEx, m_objs, m_objNames - def reset_SelectedObjects(Selection, info=0): """ Reset the selection changed by Draft.rotate for example Selection is the original selection you want to reset. Must be saved before any @@ -515,7 +515,6 @@ def get_SelectedObjectsWithParent(info=0, printError=True): printError_msg("No active document !") return - def get_SelectedObjects(info=0, printError=True): """ Return selected objects as Selection = (Number_of_Points, Number_of_Edges, Number_of_Planes, @@ -717,7 +716,6 @@ def getEdgeType(edge): except: return "Unknown" - def getShapeType(subObject): try: if isinstance(subObject,Part.Edge): @@ -733,9 +731,8 @@ def getShapeType(subObject): except: return "Unknown" - def definePropOfActiveObj(): - Gui.activeDocument().activeObject().LineColor = (red, green, blue) + Gui.activeDocument().activeObject().LineColor = (1.00,0.67,0.00) Gui.activeDocument().activeObject().ShapeColor = (0.33,1.00,1.00) Gui.activeDocument().activeObject().Transparency = (50) @@ -747,7 +744,6 @@ def addObjectToGrp(obj,grp,info=0): if info != 0: print_msg("Object " + str(m_obj) + " added to Group : " + str(m_grp)) - def addObjectToGrp2(obj,grp,info=0): m_obj = obj m_grp = grp @@ -911,6 +907,7 @@ def minMaxObjectsLimits(objs,info=0): return xmax, xmin, ymax, ymin, zmax, zmin + def baseObjectPoint(obj,info=0): """ Return the base point of selected Object. """ @@ -921,7 +918,6 @@ def baseObjectPoint(obj,info=0): print_point(base,"Base of object selected is :") return base - def meanVectorsPoint(vertx,info=0): """ Return the mean point of all selected Vectors. """ @@ -955,7 +951,6 @@ def meanVectorsPoint(vertx,info=0): print_point(mean,"Mean of all vectors selected is : ") return mean - def centerBBVectorsPoint(vertx,info=0): """ Return the center point of the bounding box of all selected Vectors. """ @@ -1037,7 +1032,6 @@ def distanceBetween(A, B): except Part.OCCError: return 0.0 - def angleBetween(e1, e2): """ Return the angle (in degrees) between 2 edges. """ @@ -1636,7 +1630,6 @@ def attachPoint(*argc): if msg != 0: print_msg("argc is " + str(*argc) + " and Attach point " + str(m_attach_point) + " selected !") - def intersecPlanePlane(Plane_Normal1, Plane_Point1, Plane_Normal2, Plane_Point2, info=0): """ Return the intersection Line between two Planes. """ @@ -2047,6 +2040,9 @@ def plot_sweep(traj, section, makeSolid=True, isFrenet=True, transition=2 , part def bounding_box(grp,ori_X,ori_Y,ori_Z,length_X,length_Y,length_Z,createVol=False,info=0): """ Create a bounding box. """ + global verbose + msg=verbose + m_grp = grp m_l_X = length_X m_l_Y = length_Y @@ -6672,10 +6668,10 @@ def plot_boundingBoxes(): m_grp=m_actDoc.getObject( str(m_dir) ) # Create a solid out of the shells of a shape try: - m_s = m_obj.Shape + m_s = m_obj.Shape except: - printError_msg( "This object has no attribute 'Shape' !\nSelect another one !\n") - break + printError_msg( "This object has no attribute 'Shape' !\nSelect another one !\n") + break # Get a boundBox A bounding box is an orthographic cube which is a way to describe outer boundaries m_boundBox = m_s.BoundBox if msg != 0: @@ -7727,7 +7723,7 @@ def plot_sectionSweep(): "INCORRECT Object(s) Selection :\n" +\ "First select the wire you want as section for Section Sweep (must be closed for solid creation!)\n" +\ "Then select the second wire for the trajectory of the Sweep !" - result_msg = " : Section Sweep created !" + result_msg = " : Section Sweep created into WorkFeatures/WorkObjects!" name = "SectionSweep" part = "Part::Feature" @@ -7909,7 +7905,54 @@ def plot_sectionSweep(): except: printError_msg(error_msg) + + +def plot_sectionBeam(): + """Section Beam: + """ + import WorkFeature.Beam.beam as BM + msg=verbose + msg=1 + createFolders('WorkObjects') + error_msg =\ + "INCORRECT Object(s) Selection :\n" +\ + "First select the wire you want as section for Section Beam \n" +\ + "Then select the second wire for the strait path trajectory of the Beam !" + result_msg = " : Section Beam created into WorkFeatures/WorkObjects!" + name = "Beam" + part = "Part::FeaturePython" + + m_actDoc=App.activeDocument() + if m_actDoc.Name: + m_sel = Gui.Selection.getSelection(m_actDoc.Name) + m_selEx = Gui.Selection.getSelectionEx(m_actDoc.Name) + else: + return + + try: + m_profile = m_sel[0] + if msg != 0: + print_msg("m_profile !" + str(m_profile)) + print_msg("m_selEx !" + str(m_selEx)) + for m_path_selected in m_selEx[1:]: + m_path = m_path_selected.Object + #m_path_name = m_path_selected.SubElementNames[0] + for m_path_name in m_path_selected.SubElementNames: + if msg != 0: + print_msg("m_path !" + str(m_path)) + print_msg("m_path_name !" + str(m_path_name)) + m_beam = App.ActiveDocument.addObject(part,name) + BM.Beam(m_beam, m_profile, m_path, m_path_name) + BM.ViewProviderBeam(m_beam.ViewObject) + App.ActiveDocument.getObject( 'WorkObjects' ).addObject(m_beam) + + App.ActiveDocument.recompute() + print_msg(m_beam.Label + str(result_msg)) + except: + printError_msg(error_msg) + + def plot_sectionSweep2(): """ Beam Sweep: @@ -9306,6 +9349,7 @@ def line_length(): msg=verbose error_msg = "INCORRECT Object(s) Selection :\n\nYou Must Select One Line !" + m_length = None Selection = get_SelectedObjects(info=msg, printError=False) try: @@ -9337,24 +9381,73 @@ def line_length(): if msg!=0: print_msg("Distance is : " + str(m_dist)) + if hasattr(edge, 'Length'): + m_length = edge.Length + 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) + "Distance : " + str(m_dist)+"\n\n" + + if m_length: + msg+="Length along edge/arc : " + str(m_length) + print_gui_msg(msg) except: printError_msg(error_msg) + +def object_radius(): + """ + Check for Radius: + + """ + msg=verbose + error_msg = "INCORRECT Object(s) Selection :\n\nYou Must Select One Arc!" + + Selection = Gui.Selection.getSelectionEx() + + try: + result = "Radius :" + m_found = False + for m_sel in Selection: + m_name = m_sel.ObjectName + if hasattr(m_sel, 'SubObjects'): + for m_sub,m_sub_name in zip(m_sel.SubObjects,m_sel.SubElementNames): + if hasattr(m_sub, 'Curve'): + r = m_sub.Curve + if hasattr(r, 'Radius'): + m_radius = r.Radius + result += "\nObject : " + str(m_name) + "." + str(m_sub_name) + result += "\nRadius is " + str(m_radius) + m_found = True + else: + if hasattr(m_sel, 'Curve'): + r = m_sel.Curve + if hasattr(r, 'Radius'): + m_radius = r.Radius + result += "\nObject : " + str(m_name) + result += "\nRadius is " + str(m_radius) + m_found = True + + if m_found: + print_gui_msg(result) + else : + printError_msg(error_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 + - Select One or several Face(s) """ msg=verbose @@ -9745,6 +9838,82 @@ def angleAlignFaces(value): except ValueError: printError_msg("Angle must be valid number !") + +def object_copy(): + """ + Duplicate: + Make a copy of an object or a selected subObject part: + - Select one or several object(s) or subobject(s) + + Original code from Macro_ReproWire + Authors = 2015 Mario52 + """ + msg=verbose + msg=1 + + error_msg = "INCORRECT Object(s) Selection :\n\nYou Must Select at least one Object !" + + sel = Gui.Selection.getSelection() + s = Gui.Selection.getSelectionEx() + + try: + if len(sel) != 0: +# print "Object(s) : ", len(sel), " , SubObject(s) : ", len(s) + i2 = ii2 = -1 + for i in s: + i2 += 1 + ii2 = -1 + try: + FreeCADGui.Selection.getSelectionEx()[i2].SubObjects[ii2] + for ii in i.SubElementNames: +# print "SubObject" + ii2 += 1 + # create repro shape subObject + Part.show(FreeCADGui.Selection.getSelectionEx()[i2].SubObjects[ii2].copy()) + # display the info SubObject + print i2+1 ,"/", ii2+1 ,"/", len(s) ," ", i.ObjectName ," ", ii + + a = App.ActiveDocument.ActiveObject + # Label for the repro shape + # object Name / original object Name / SubObject Name + a.Label = a.Name + " " + i.ObjectName + " " + ii + try: + # give LineColor + FreeCADGui.activeDocument().activeObject().LineColor = (1.0,0.0,0.0) + # give PointColor + FreeCADGui.activeDocument().activeObject().PointColor = (1.0,0.0,0.0) + # give ShapeColor + FreeCADGui.activeDocument().activeObject().ShapeColor = (1.0,0.0,0.0) + + except Exception: + None + except Exception: +# print "Not SubObject" + # create repro shape object + Part.show(sel[i2].Shape) + # display the info SubObject + print i2+1 ,"/", ii2+1 ,"/", len(s) ," ", sel[i2].Name + + a = App.ActiveDocument.ActiveObject + # Label for the repro shape + # object Name / original object Name + a.Label =a.Name + " " + sel[i2].Name + + try: + # give LineColor + FreeCADGui.activeDocument().activeObject().LineColor = (1.0,0.0,0.0) + # give PointColor + FreeCADGui.activeDocument().activeObject().PointColor = (1.0,0.0,0.0) + # give ShapeColor + FreeCADGui.activeDocument().activeObject().ShapeColor = (1.0,0.0,0.0) + + except Exception: + None + else : + printError_msg(error_msg) + pass + except: + printError_msg(error_msg) def object_alignFaces(): """ @@ -10247,7 +10416,9 @@ class WorkFeatureTab(): "button_revolve" : "plot_revolution", "button_common" : "object_common", "button_difference" : "object_difference", + "button_copy_objects" : "object_copy", "button_sweep" : "plot_sectionSweep", + "button_beam" : "plot_sectionBeam", "button_alignview" : "view_align", "button_trackcamera" : "view_trackCamera", @@ -10265,6 +10436,7 @@ class WorkFeatureTab(): "button_isAngle" : "object_angle", "button_isDistance" : "points_distance", "button_isLength" : "line_length", + "button_isRadius" : "object_radius", "button_isArea" : "plane_area", "button_isView" : "camera_orientation", diff --git a/WorkFeature/WF_ObjParCurve_2015.py b/WorkFeature/WF_ObjParCurve_2015.py index f8a8e84..51592f5 100644 --- a/WorkFeature/WF_ObjParCurve_2015.py +++ b/WorkFeature/WF_ObjParCurve_2015.py @@ -94,7 +94,7 @@ class Parametric(): self.updateOptions() - def plot_matriz(self, matriz): + def plot_matriz_old(self, matriz): """ Plot the dataset with different options. """ if self.debug != 0: @@ -116,7 +116,44 @@ class Parametric(): Draft.upgrade(FreeCADGui.Selection.getSelection(),delete=True) FreeCAD.ActiveDocument.recompute() - + def plot_matriz(self, matriz): + """ Plot the dataset with different options. + """ + if self.debug != 0: + print self.plot_matriz.__name__ + + doc = FreeCAD.ActiveDocument + if doc == None: + doc = FreeCAD.newDocument() + + if self.points == True: + for point in matriz: + a = Draft.makePoint(point) + FreeCAD.ActiveDocument.ActiveObject.Label = str(a.Name)+"_Point_"+str(self.name.text()) + else: + curva = Part.makePolygon(matriz) + if self.bspline == True: + a = Draft.makeBSpline(curva,closed=self.close,face=False) + FreeCAD.ActiveDocument.ActiveObject.Label = str(a.Name)+"_BSpline_"+str(self.name.text()) + if self.bezier == True: + a = Draft.makeBezCurve(curva,closed=self.close,face=False) + FreeCAD.ActiveDocument.ActiveObject.Label = str(a.Name)+"_BezCurve_"+str(self.name.text()) + if self.poly == True: + a = Draft.makeWire(curva,closed=self.close,face=False) + FreeCAD.ActiveDocument.ActiveObject.Label = str(a.Name)+"_Wire_"+str(self.name.text()) +# if self.arcs == True: +# s=Part.BSplineCurve() +# s.interpolate(matriz, True) +# s.buildFromPoles(matriz) +# #Part.show(s.toShape()) +# arcs=s.toBiArcs(0.1) +# wire=Part.Wire([Part.Edge(i) for i in arcs]) +# Part.show(wire) + if self.close == True and self.face == True: + Draft.upgrade(FreeCADGui.Selection.getSelection(),delete=True) + FreeCAD.ActiveDocument.recompute() + FreeCADGui.ActiveDocument.ActiveView.fitAll() + def edit(self): """ Launch the edit panel curve. """ diff --git a/start_WF.FCMacro b/start_WF.FCMacro index 59ab6c7..bc30041 100644 --- a/start_WF.FCMacro +++ b/start_WF.FCMacro @@ -2,6 +2,10 @@ import sys import os.path +# Change this by your own FreeCAD lib path to import FreeCAD +if not sys.path.__contains__("/usr/lib/freecad/lib"): + sys.path.append("/usr/lib/freecad/lib") + try: # try import import WorkFeature.WF_2015 as WF