View Issue Details

IDProjectCategoryView StatusLast Update
0003284Path[FreeCAD] Bugpublic2019-01-13 11:13
Reporteruser3807Assigned Tosliptonic 
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformAMD 64OSUbuntuOS Version64bit
Product Version[FreeCAD] 0.17 
Target VersionFixed in Version[FreeCAD] 0.17 
Summary0003284: Path Face Edge or Profile Edge Does run wrong direction on Not UseCompensation
DescriptionHi im new but not that "New" 70+
i discovered on making a NEW dressup Featurer LEAD in OUT
to get CRC working G41/42
that on UN Checking USE COMPENSATION the Path runs the Wrong direction

OS: Ubuntu 14.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12802 (Git)
Build type: None
Branch: master
Hash: 91bb7ed0c51ba47f011199af7bc0a3a2964cf5be
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)

 
Steps To ReproduceMake a Part
goto Path
""get a JOB ""
select topface or the EDges
make a Prifile path
UN CHECK the USECompensation -> Exact Part Shape
outside CW

Simulate it will run counterclockwise
 
NOW it eighter came the Wrong direction from the BASE Contour or it is twisted somwhere inside the generator

Additional InformationVideo of the Dressup to get
https://www.youtube.com/watch?v=EmflIoiweEk&feature=youtu.be

I will do this BUG Fix if i get to the point where the main Path is created

TagsPath

Activities

user3807

2017-12-18 10:09

  ~0010614

SOLVED needs CHANGE in PathProfileBASE

    def areaOpPathParams(self, obj, isHole):
        '''areaOpPathParams(obj, isHole) ... returns dictionary with path parameters.
        Do not overwrite.'''
        params = {}

        # Reverse the direction for holes
        if isHole:
            direction = "CW" if obj.Direction == "CCW" else "CCW"
        else:
            direction = obj.Direction

        if direction == 'CCW':
            params['orientation'] = 0
        else:
            params['orientation'] = 1
        if not obj.UseComp:
            if direction == 'CCW':
                params['orientation'] = 1
            else:
                params['orientation'] = 0
            
        return params



do i need to make a commit

PathProfileBase.py (6,431 bytes)
# -*- coding: utf-8 -*-

# ***************************************************************************
# *                                                                         *
# *   Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com>               *
# *                                                                         *
# *   This program is free software; you can redistribute it and/or modify  *
# *   it under the terms of the GNU Lesser General Public License (LGPL)    *
# *   as published by the Free Software Foundation; either version 2 of     *
# *   the License, or (at your option) any later version.                   *
# *   for detail see the LICENCE text file.                                 *
# *                                                                         *
# *   This program is distributed in the hope that it will be useful,       *
# *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
# *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
# *   GNU Library General Public License for more details.                  *
# *                                                                         *
# *   You should have received a copy of the GNU Library General Public     *
# *   License along with this program; if not, write to the Free Software   *
# *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
# *   USA                                                                   *
# *                                                                         *
# ***************************************************************************

import FreeCAD
import PathScripts.PathAreaOp as PathAreaOp
import PathScripts.PathLog as PathLog
import PathScripts.PathOp as PathOp

from PySide import QtCore

__title__ = "Base Path Profile Operation"
__author__ = "sliptonic (Brad Collette)"
__url__ = "http://www.freecadweb.org"
__doc__ = "Base class and implementation for Path profile operations."

if False:
    PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
    PathLog.trackModule(PathLog.thisModule())
else:
    PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())

# Qt tanslation handling
def translate(context, text, disambig=None):
    return QtCore.QCoreApplication.translate(context, text, disambig)


class ObjectProfile(PathAreaOp.ObjectOp):
    '''Base class for proxy objects of all profile operations.'''

    def initAreaOp(self, obj):
        '''initAreaOp(obj) ... creates all profile specific properties.
        Do not overwrite.'''
        # Profile Properties
        obj.addProperty("App::PropertyEnumeration", "Side", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "Side of edge that tool should cut"))
        obj.Side = ['Outside', 'Inside']  # side of profile that cutter is on in relation to direction of profile
        obj.addProperty("App::PropertyEnumeration", "Direction", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "The direction that the toolpath should go around the part ClockWise CW or CounterClockWise CCW"))
        obj.Direction = ['CW', 'CCW']  # this is the direction that the profile runs
        obj.addProperty("App::PropertyBool", "UseComp", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "make True, if using Cutter Radius Compensation"))

        obj.addProperty("App::PropertyDistance", "OffsetExtra", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "Extra value to stay away from final profile- good for roughing toolpath"))
        obj.addProperty("App::PropertyEnumeration", "JoinType", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "Controls how tool moves around corners. Default=Round"))
        obj.JoinType = ['Round', 'Square', 'Miter']  # this is the direction that the Profile runs
        obj.addProperty("App::PropertyFloat", "MiterLimit", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "Maximum distance before a miter join is truncated"))
        obj.setEditorMode('MiterLimit', 2)

    def areaOpOnChanged(self, obj, prop):
        '''areaOpOnChanged(obj, prop) ... updates Side and MiterLimit visibility depending on changed properties.
        Do not overwrite.'''
        if prop == "UseComp":
            if not obj.UseComp:
                obj.setEditorMode('Side', 2)
            else:
                obj.setEditorMode('Side', 0)

        if prop == 'JoinType':
            if obj.JoinType == 'Miter':
                obj.setEditorMode('MiterLimit', 0)
            else:
                obj.setEditorMode('MiterLimit', 2)

    def areaOpAreaParams(self, obj, isHole):
        '''areaOpAreaParams(obj, isHole) ... returns dictionary with area parameters.
        Do not overwrite.'''
        params = {}
        params['Fill'] = 0
        params['Coplanar'] = 0
        params['SectionCount'] = -1

        offset = 0.0
        if obj.UseComp:
            offset = self.radius + obj.OffsetExtra.Value
        if obj.Side == 'Inside':
            offset = 0 - offset
        if isHole:
            offset = 0 - offset
        params['Offset'] = offset

        jointype = ['Round', 'Square', 'Miter']
        params['JoinType'] = jointype.index(obj.JoinType)

        if obj.JoinType == 'Miter':
            params['MiterLimit'] = obj.MiterLimit

        return params

    def areaOpPathParams(self, obj, isHole):
        '''areaOpPathParams(obj, isHole) ... returns dictionary with path parameters.
        Do not overwrite.'''
        params = {}

        # Reverse the direction for holes
        if isHole:
            direction = "CW" if obj.Direction == "CCW" else "CCW"
        else:
            direction = obj.Direction

        if direction == 'CCW':
            params['orientation'] = 0
        else:
            params['orientation'] = 1
        if not obj.UseComp:
            if direction == 'CCW':
                params['orientation'] = 1
            else:
                params['orientation'] = 0
            
        return params

    def areaOpUseProjection(self, obj):
        '''areaOpUseProjection(obj) ... returns True'''
        return True

    def areaOpSetDefaultValues(self, obj):
        '''areaOpSetDefaultValues(obj) ... sets default values.
        Do not overwrite.'''
        obj.Side = "Outside"
        obj.OffsetExtra = 0.0
        obj.Direction = "CW"
        obj.UseComp = True
        obj.JoinType = "Round"
        obj.MiterLimit = 0.1

PathProfileBase.py (6,431 bytes)

Kunda1

2017-12-18 12:12

administrator   ~0010615

@mlampert care to weigh in ?

wmayer

2017-12-23 13:39

administrator   ~0010624

https://github.com/FreeCAD/FreeCAD/commit/c093c59416228828563fd830f54ceff1fe2059c6

Issue History

Date Modified Username Field Change
2017-12-16 08:18 user3807 New Issue
2017-12-16 08:18 user3807 Tag Attached: Path
2017-12-16 08:18 user3807 Tag Attached: CRC
2017-12-16 08:18 user3807 Tag Attached: Edge Profile
2017-12-18 10:09 user3807 File Added: PathProfileBase.py
2017-12-18 10:09 user3807 Note Added: 0010614
2017-12-18 12:12 Kunda1 Note Added: 0010615
2017-12-23 13:39 wmayer Assigned To => sliptonic
2017-12-23 13:39 wmayer Status new => closed
2017-12-23 13:39 wmayer Resolution open => fixed
2017-12-23 13:39 wmayer Fixed in Version => 0.17
2017-12-23 13:39 wmayer Note Added: 0010624
2018-03-03 10:31 Kunda1 Tag Detached: CRC
2019-01-13 11:13 Kunda1 Tag Detached: Edge Profile