Merge pull request #6420 from marioalexis84/draft-drawing_techdraw
Arch: Replace Drawing functions with TechDraw functions
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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+'"')
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user