Fixed circular hole diameter for cases where the selected edge is not the full circle.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
import ArchPanel
|
||||
import FreeCAD
|
||||
import DraftGeomUtils
|
||||
import Part
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOp as PathOp
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
@@ -45,6 +46,8 @@ def translate(context, text, disambig=None):
|
||||
if False:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
||||
|
||||
class ObjectOp(PathOp.ObjectOp):
|
||||
'''Base class for proxy objects of all operations on circular holes.'''
|
||||
@@ -96,6 +99,9 @@ class ObjectOp(PathOp.ObjectOp):
|
||||
if shape.ShapeType == 'Vertex':
|
||||
return 0
|
||||
|
||||
if shape.ShapeType == 'Edge' and type(shape.Curve) == Part.Circle:
|
||||
return shape.Curve.Radius * 2
|
||||
|
||||
# for all other shapes the diameter is just the dimension in X
|
||||
return shape.BoundBox.XLength
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ __author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "Implementation of circular hole specific base geometry page controller."
|
||||
|
||||
if True:
|
||||
if False:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user