From 251a9bd276c957edb4e765480a4f9304ba7c6a51 Mon Sep 17 00:00:00 2001 From: marioalexis Date: Mon, 21 Feb 2022 13:16:40 -0300 Subject: [PATCH] Arch: Replace Drawing functions with TechDraw functions --- src/Mod/Arch/ArchComponent.py | 4 ++-- src/Mod/Arch/ArchPanel.py | 4 ++-- src/Mod/Arch/ArchSectionPlane.py | 16 ++++++++-------- src/Mod/Arch/ArchSite.py | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index b454feec3e..c6a4013a8a 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -972,7 +972,7 @@ class Component(ArchIFC.IfcProduct): obj.PerimeterLength = 0 return - import Drawing,Part + import TechDraw, Part fmax = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetInt("MaxComputeAreas",20) if len(obj.Shape.Faces) > fmax: obj.VerticalArea = 0 @@ -1008,7 +1008,7 @@ class Component(ArchIFC.IfcProduct): pset.append(f) else: try: - pf = Part.Face(Part.Wire(Drawing.project(f,FreeCAD.Vector(0,0,1))[0].Edges)) + pf = Part.Face(Part.Wire(TechDraw.project(f,FreeCAD.Vector(0,0,1))[0].Edges)) except Part.OCCError: # error in computing the areas. Better set them to zero than show a wrong value if obj.HorizontalArea.Value != 0: diff --git a/src/Mod/Arch/ArchPanel.py b/src/Mod/Arch/ArchPanel.py index 13fe398bd8..4124281c52 100644 --- a/src/Mod/Arch/ArchPanel.py +++ b/src/Mod/Arch/ArchPanel.py @@ -869,11 +869,11 @@ class PanelView: if hasattr(obj.Source.Proxy,"BaseProfile"): p = obj.Source.Proxy.BaseProfile n = obj.Source.Proxy.ExtrusionVector - import Drawing + import TechDraw svg1 = "" svg2 = "" result = "" - svg1 = Drawing.projectToSVG(p,DraftVecUtils.neg(n)) + svg1 = TechDraw.projectToSVG(p,DraftVecUtils.neg(n)) if svg1: w = str(obj.LineWidth/obj.Scale) #don't let linewidth be influenced by the scale... svg1 = svg1.replace('stroke-width="0.35"','stroke-width="'+w+'"') diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py index af649de304..89e48edf79 100644 --- a/src/Mod/Arch/ArchSectionPlane.py +++ b/src/Mod/Arch/ArchSectionPlane.py @@ -483,12 +483,12 @@ def getSVG(source, if should_update_svg_cache: svgcache = "" # render using the Drawing module - import Drawing, Part + import TechDraw, Part if vshapes: baseshape = Part.makeCompound(vshapes) style = {'stroke': "SVGLINECOLOR", 'stroke-width': "SVGLINEWIDTH"} - svgcache += Drawing.projectToSVG( + svgcache += TechDraw.projectToSVG( baseshape, direction, hStyle=style, h0Style=style, h1Style=style, vStyle=style, v0Style=style, v1Style=style) @@ -497,7 +497,7 @@ def getSVG(source, style = {'stroke': "SVGLINECOLOR", 'stroke-width': "SVGLINEWIDTH", 'stroke-dasharray': "SVGHIDDENPATTERN"} - svgcache += Drawing.projectToSVG( + svgcache += TechDraw.projectToSVG( hshapes, direction, hStyle=style, h0Style=style, h1Style=style, vStyle=style, v0Style=style, v1Style=style) @@ -524,7 +524,7 @@ def getSVG(source, sshapes = Part.makeCompound(sshapes) style = {'stroke': "SVGLINECOLOR", 'stroke-width': "SVGCUTLINEWIDTH"} - svgcache += Drawing.projectToSVG( + svgcache += TechDraw.projectToSVG( sshapes, direction, hStyle=style, h0Style=style, h1Style=style, vStyle=style, v0Style=style, v1Style=style) @@ -629,7 +629,7 @@ def getDXF(obj): elif hasattr(obj,"showHidden"): showHidden = obj.showHidden result = [] - import Drawing,Part + import TechDraw, Part if not obj.Source: return result source = obj.Source @@ -641,11 +641,11 @@ def getDXF(obj): objs = [o for o in objs if ((not(Draft.getType(o) in ["Space","Dimension","Annotation"])) and (not (o.isDerivedFrom("Part::Part2DObject"))))] vshapes,hshapes,sshapes,cutface,cutvolume,invcutvolume = getCutShapes(objs,cutplane,onlySolids,clip,False,showHidden) if vshapes: - result.append(Drawing.projectToDXF(Part.makeCompound(vshapes),direction)) + result.append(TechDraw.projectToDXF(Part.makeCompound(vshapes),direction)) if sshapes: - result.append(Drawing.projectToDXF(Part.makeCompound(sshapes),direction)) + result.append(TechDraw.projectToDXF(Part.makeCompound(sshapes),direction)) if hshapes: - result.append(Drawing.projectToDXF(Part.makeCompound(hshapes),direction)) + result.append(TechDraw.projectToDXF(Part.makeCompound(hshapes),direction)) return result diff --git a/src/Mod/Arch/ArchSite.py b/src/Mod/Arch/ArchSite.py index da55e26a61..b89d90a0bd 100644 --- a/src/Mod/Arch/ArchSite.py +++ b/src/Mod/Arch/ArchSite.py @@ -749,11 +749,11 @@ class _Site(ArchIFC.IfcProduct): if f.normalAt(0,0).getAngle(FreeCAD.Vector(0,0,1)) < 1.5707: fset.append(f) if fset: - import Drawing,Part + import TechDraw, Part pset = [] for f in fset: try: - pf = Part.Face(Part.Wire(Drawing.project(f,FreeCAD.Vector(0,0,1))[0].Edges)) + pf = Part.Face(Part.Wire(TechDraw.project(f,FreeCAD.Vector(0,0,1))[0].Edges)) except Part.OCCError: # error in computing the area. Better set it to zero than show a wrong value if obj.ProjectedArea.Value != 0: