Ejemplo n.º 1
0
 def assignDefaultValues(self):
     self.obj.Width = HoldingTagPreferences.defaultWidth(self.toolRadius() *
                                                         2)
     self.obj.Height = HoldingTagPreferences.defaultHeight(
         self.toolRadius())
     self.obj.Angle = HoldingTagPreferences.defaultAngle()
     self.obj.Radius = HoldingTagPreferences.defaultRadius()
Ejemplo n.º 2
0
    def setup(self, obj, generate=False):
        PathLog.debug("setup")
        self.obj = obj
        try:
            pathData = PathData(obj)
        except ValueError:
            PathLog.error(
                translate(
                    "Path_DressupTag",
                    "Cannot insert holding tags for this path - please select a Profile path"
                ) + "\n")
            #if sys.version_info.major < 3:
            #    traceback.print_exc(e)
            #else:
            #    traceback.print_exc()
            return None

        self.toolRadius = PathDressup.toolController(
            obj.Base).Tool.Diameter / 2
        self.pathData = pathData
        if generate:
            obj.Height = self.pathData.defaultTagHeight()
            obj.Width = self.pathData.defaultTagWidth()
            obj.Angle = self.pathData.defaultTagAngle()
            obj.Radius = self.pathData.defaultTagRadius()
            count = HoldingTagPreferences.defaultCount()
            self.generateTags(obj, count)
        return self.pathData
Ejemplo n.º 3
0
 def defaultTagHeight(self):
     if hasattr(self.obj, 'Base') and hasattr(self.obj.Base, 'StartDepth') and hasattr(self.obj.Base, 'FinalDepth'):
         pathHeight = (self.obj.Base.StartDepth - self.obj.Base.FinalDepth).Value
     else:
         pathHeight = self.maxZ - self.minZ
     height = HoldingTagPreferences.defaultHeight(pathHeight / 2)
     if height > pathHeight:
         return pathHeight
     return height
 def defaultTagHeight(self):
     if hasattr(self.obj, 'Base') and hasattr(self.obj.Base, 'StartDepth') and hasattr(self.obj.Base, 'FinalDepth'):
         pathHeight = (self.obj.Base.StartDepth - self.obj.Base.FinalDepth).Value
     else:
         pathHeight = self.maxZ - self.minZ
     height = HoldingTagPreferences.defaultHeight(pathHeight / 2)
     if height > pathHeight:
         return pathHeight
     return height
Ejemplo n.º 5
0
    def setup(self, obj, generate=False):
        PathLog.debug("setup")
        self.obj = obj
        try:
            pathData = PathData(obj)
        except ValueError:
            PathLog.error(translate("PathDressup_HoldingTags", "Cannot insert holding tags for this path - please select a Profile path\n"))
            return None

        self.toolRadius = obj.Base.ToolController.Tool.Diameter / 2
        self.pathData = pathData
        if generate:
            obj.Height = self.pathData.defaultTagHeight()
            obj.Width  = self.pathData.defaultTagWidth()
            obj.Angle  = self.pathData.defaultTagAngle()
            obj.Radius = self.pathData.defaultTagRadius()
            count = HoldingTagPreferences.defaultCount()
            self.generateTags(obj, count)
        return self.pathData
    def setup(self, obj, generate=False):
        PathLog.debug("setup")
        self.obj = obj
        try:
            pathData = PathData(obj)
        except ValueError:
            PathLog.error(translate("Path_DressupTag", "Cannot insert holding tags for this path - please select a Profile path")+"\n")
            return None

        self.toolRadius = PathDressup.toolController(obj.Base).Tool.Diameter / 2
        self.pathData = pathData
        if generate:
            obj.Height = self.pathData.defaultTagHeight()
            obj.Width = self.pathData.defaultTagWidth()
            obj.Angle = self.pathData.defaultTagAngle()
            obj.Radius = self.pathData.defaultTagRadius()
            count = HoldingTagPreferences.defaultCount()
            self.generateTags(obj, count)
        return self.pathData
Ejemplo n.º 7
0
 def defaultTagRadius(self):
     return HoldingTagPreferences.defaultRadius()
Ejemplo n.º 8
0
 def defaultTagAngle(self):
     return HoldingTagPreferences.defaultAngle()
Ejemplo n.º 9
0
 def defaultTagWidth(self):
     width = self.shortestAndLongestPathEdge()[1].Length / 10
     return HoldingTagPreferences.defaultWidth(width)
Ejemplo n.º 10
0
 def defaultTagRadius(self):
     return HoldingTagPreferences.defaultRadius()
Ejemplo n.º 11
0
 def defaultTagAngle(self):
     return HoldingTagPreferences.defaultAngle()
Ejemplo n.º 12
0
 def defaultTagWidth(self):
     width = self.shortestAndLongestPathEdge()[1].Length / 10
     return HoldingTagPreferences.defaultWidth(width)
Ejemplo n.º 13
0
 def assignDefaultValues(self):
     self.obj.Width = HoldingTagPreferences.defaultWidth(self.toolRadius() * 2)
     self.obj.Height = HoldingTagPreferences.defaultHeight(self.toolRadius())
     self.obj.Angle = HoldingTagPreferences.defaultAngle()
     self.obj.Radius = HoldingTagPreferences.defaultRadius()