diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py index 1c28b391cb..b593aacf3a 100644 --- a/src/Mod/Arch/ArchSectionPlane.py +++ b/src/Mod/Arch/ArchSectionPlane.py @@ -384,7 +384,7 @@ class _ArchDrawingView: import ArchVRM, WorkingPlane wp = WorkingPlane.plane() wp.setFromPlacement(obj.Source.Placement) - wp.inverse() + #wp.inverse() render = ArchVRM.Renderer() render.setWorkingPlane(wp) render.addObjects(objs) @@ -392,12 +392,14 @@ class _ArchDrawingView: render.cut(obj.Source.Shape,obj.ShowCut) else: render.cut(obj.Source.Shape) + self.svg += '\n' self.svg += render.getViewSVG(linewidth="LWPlaceholder") self.svg += fillpattern self.svg += render.getSectionSVG(linewidth="SWPlaceholder",fillpattern="sectionfill") if hasattr(obj,"ShowCut"): if obj.ShowCut: self.svg += render.getHiddenSVG(linewidth="LWPlaceholder") + self.svg += '\n' # print render.info() else: diff --git a/src/Mod/Arch/ArchStructure.py b/src/Mod/Arch/ArchStructure.py index 903b83e652..270301ea0c 100644 --- a/src/Mod/Arch/ArchStructure.py +++ b/src/Mod/Arch/ArchStructure.py @@ -774,6 +774,7 @@ class _StructuralSystem(ArchComponent.Component): ArchComponent.Component.__init__(self,obj) obj.addProperty("App::PropertyLinkList","Axes","Arch",translate("Arch","Axes systems this structure is built on")) obj.addProperty("App::PropertyIntegerList","Exclude","Arch",translate("Arch","The element numbers to exclude when this structure is based on axes")) + obj.addProperty("App::PropertyBool","Align","Arch","If true the element are aligned with axes").Align = False self.Type = "StructuralSystem" def execute(self,obj): @@ -794,7 +795,13 @@ class _StructuralSystem(ArchComponent.Component): # applying axes pts = self.getAxisPoints(obj) - apl = self.getAxisPlacement(obj) + if hasattr(obj,"Align"): + if obj.Align == False : + apl = self.getAxisPlacement(obj) + if obj.Align == True : + apl = None + else : + apl = self.getAxisPlacement(obj) if pts: fsh = [] @@ -830,8 +837,19 @@ class _StructuralSystem(ArchComponent.Component): import DraftGeomUtils pts = [] if len(obj.Axes) == 1: - for e in obj.Axes[0].Shape.Edges: - pts.append(e.Vertexes[0].Point) + if hasattr(obj,"Align"): + if obj.Align == True : + p0 = obj.Axes[0].Shape.Edges[0].Vertexes[1].Point + for e in obj.Axes[0].Shape.Edges: + p = e.Vertexes[1].Point + p = p.sub(p0) + pts.append(p) + else: + for e in obj.Axes[0].Shape.Edges: + pts.append(e.Vertexes[0].Point) + else: + for e in obj.Axes[0].Shape.Edges: + pts.append(e.Vertexes[0].Point) elif len(obj.Axes) >= 2: set1 = obj.Axes[0].Shape.Edges set2 = obj.Axes[1].Shape.Edges diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index 287030e88a..39bfcc94d9 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -2094,31 +2094,44 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct elif getType(obj) == "Axis": "returns the SVG representation of an Arch Axis system" + vobj = obj.ViewObject lorig = getLineStyle() fill = 'none' - invpl = obj.Placement.inverse() + rad = vobj.BubbleSize.Value/2 n = 0 for e in obj.Shape.Edges: lstyle = lorig svg += getPath([e]) - p1 = invpl.multVec(e.Vertexes[0].Point) - p2 = invpl.multVec(e.Vertexes[1].Point) - dv = p2.sub(p1) - dv.normalize() - rad = obj.ViewObject.BubbleSize - center = p2.add(dv.scale(rad,rad,rad)) lstyle = "none" - svg += getCircle(Part.makeCircle(rad,center)) - svg += '\n' - svg += '\n' - n += 1 + pos = ["Start"] + if hasattr(vobj,"BubblePosition"): + if vobj.BubblePosition == "Both": + pos = ["Start","End"] + else: + pos = [vobj.BubblePosition] + for p in pos: + if p == "Start": + p1 = e.Vertexes[0].Point + p2 = e.Vertexes[1].Point + else: + p1 = e.Vertexes[1].Point + p2 = e.Vertexes[0].Point + dv = p2.sub(p1) + dv.normalize() + center = p2.add(dv.scale(rad,rad,rad)) + svg += getCircle(Part.makeCircle(rad,center)) + if hasattr(vobj.Proxy,"bubbletexts"): + if len (vobj.Proxy.bubbletexts) >= n: + svg += '\n' + svg += '\n' + n += 1 elif getType(obj) == "Space": "returns an SVG fragment for the text of a space"