Split pocket gui into its own file and based on PathAreaOpGui.

This commit is contained in:
Markus Lampert
2017-08-03 22:22:51 -07:00
committed by Yorik van Havre
parent bf025123a0
commit bd83f3d776
10 changed files with 552 additions and 360 deletions

View File

@@ -48,8 +48,11 @@ FeatureTool = 0x01
FeatureDepths = 0x02
FeatureHeights = 0x04
FeatureStartPoint = 0x08
FeatureBaseGeometry = 0x10
FeatureFinishDepth = 0x20
FeatureBaseFaces = 0x10
FeatureBaseEdges = 0x20
FeatureFinishDepth = 0x40
FeatureBaseGeometry = FeatureBaseFaces | FeatureBaseEdges
class ObjectOp(object):
@@ -268,3 +271,39 @@ class ObjectOp(object):
obj.Path = path
return sim
def addBase(self, obj, base, sub=""):
PathLog.track()
baselist = obj.Base
if baselist is None:
baselist = []
if len(baselist) == 0: # When adding the first base object, guess at heights
try:
bb = base.Shape.BoundBox # parent boundbox
subobj = base.Shape.getElement(sub)
fbb = subobj.BoundBox # feature boundbox
obj.StartDepth = bb.ZMax
obj.ClearanceHeight = bb.ZMax + 5.0
obj.SafeHeight = bb.ZMax + 3.0
if fbb.ZMax == fbb.ZMin and fbb.ZMax == bb.ZMax: # top face
obj.FinalDepth = bb.ZMin
elif fbb.ZMax > fbb.ZMin and fbb.ZMax == bb.ZMax: # vertical face, full cut
obj.FinalDepth = fbb.ZMin
elif fbb.ZMax > fbb.ZMin and fbb.ZMin > bb.ZMin: # internal vertical wall
obj.FinalDepth = fbb.ZMin
elif fbb.ZMax == fbb.ZMin and fbb.ZMax > bb.ZMin: # face/shelf
obj.FinalDepth = fbb.ZMin
else: # catch all
obj.FinalDepth = bb.ZMin
except:
obj.StartDepth = 5.0
obj.ClearanceHeight = 10.0
obj.SafeHeight = 8.0
item = (base, sub)
if item in baselist:
PathLog.warning(translate("Path", "this object already in the list" + "\n"))
else:
baselist.append(item)
obj.Base = baselist