Skip to content

Commit

Permalink
adapt importCSG to makeFace property and change in importDXF
Browse files Browse the repository at this point in the history
in commit 06a689e
  • Loading branch information
5263 authored and wwmayer committed Feb 24, 2015
1 parent 627e32a commit a77106a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Mod/OpenSCAD/OpenSCAD2Dgeom.py
Expand Up @@ -462,6 +462,7 @@ def median(v1,v2):

def importDXFface(filename,layer=None,doc=None):
import FreeCAD,importDXF
importDXF.readPreferences()
doc = doc or FreeCAD.activeDocument()
layers = importDXF.processdxf(doc,filename) or importDXF.layers
for l in layers:
Expand Down
6 changes: 4 additions & 2 deletions src/Mod/OpenSCAD/importCSG.py
Expand Up @@ -877,7 +877,7 @@ def p_cylinder_action(p):
mycyl.Dir = (0,0,h)
try :
import Draft
mycyl.Base = Draft.makePolygon(n,r1)
mycyl.Base = Draft.makePolygon(n,r1,face=True)
except :
# If Draft can't import (probably due to lack of Pivy on Mac and
# Linux builds of FreeCAD), this is a fallback.
Expand Down Expand Up @@ -976,7 +976,8 @@ def p_circle_action(p) :
mycircle = FreeCAD.ActiveDocument.addObject("Part::Part2DObjectPython",'circle')
Draft._Circle(mycircle)
mycircle.Radius = r
#mycircle = Draft.makeCircle(r) # would call doc.recompute
mycircle.MakeFace = True
#mycircle = Draft.makeCircle(r,face=True) # would call doc.recompute
#mycircle = doc.addObject('Part::Circle',p[1]) #would not create a face
#mycircle.Radius = r
else :
Expand All @@ -986,6 +987,7 @@ def p_circle_action(p) :
mycircle.FacesNumber = n
mycircle.Radius = r
mycircle.DrawMode = "inscribed"
mycircle.MakeFace = True
if gui:
Draft._ViewProviderDraft(mycircle.ViewObject)
if printverbose: print "Push Circle"
Expand Down

0 comments on commit a77106a

Please sign in to comment.