Skip to content

Commit

Permalink
Merge pull request #357 from mlampert/PathGeom
Browse files Browse the repository at this point in the history
Path: Path->Wire transformation and other goemetry helpers.
  • Loading branch information
wwmayer committed Dec 1, 2016
2 parents c6529d2 + ad3e316 commit 01fd5ce
Show file tree
Hide file tree
Showing 17 changed files with 829 additions and 144 deletions.
7 changes: 5 additions & 2 deletions src/Mod/Part/App/TopoShape.cpp
Expand Up @@ -1662,12 +1662,15 @@ TopoDS_Shape TopoShape::makeHelix(Standard_Real pitch, Standard_Real height,
Standard_Boolean leftHanded,
Standard_Boolean newStyle) const
{
if (pitch < Precision::Confusion())
if (fabs(pitch) < Precision::Confusion())
Standard_Failure::Raise("Pitch of helix too small");

if (height < Precision::Confusion())
if (fabs(height) < Precision::Confusion())
Standard_Failure::Raise("Height of helix too small");

if ((height > 0 && pitch < 0) || (height < 0 && pitch > 0))
Standard_Failure::Raise("Pitch and height of helix not compatible");

gp_Ax2 cylAx2(gp_Pnt(0.0,0.0,0.0) , gp::DZ());
Handle_Geom_Surface surf;
if (angle < Precision::Confusion()) {
Expand Down
97 changes: 52 additions & 45 deletions src/Mod/Path/CMakeLists.txt
Expand Up @@ -16,61 +16,68 @@ INSTALL(

SET(PathScripts_SRCS
PathCommands.py
PathScripts/__init__.py
PathScripts/PostUtils.py
PathScripts/example_pre.py
PathScripts/opensbp_pre.py
PathScripts/opensbp_post.py
PathScripts/example_post.py
PathScripts/linuxcnc_post.py
PathScripts/centroid_post.py
PathScripts/comparams_post.py
PathScripts/dynapath_post.py
PathScripts/generic_post.py
PathScripts/dumper_post.py
PathScripts/rml_post.py
PathScripts/TooltableEditor.py
PathScripts/PathProfile.py
PathScripts/PathProfileEdges.py
PathScripts/DogboneDressup.py
PathScripts/DragknifeDressup.py
PathScripts/PathAreaUtils.py
PathScripts/PathArray.py
PathScripts/PathComment.py
PathScripts/PathCompoundExtended.py
PathScripts/PathContour.py
PathScripts/PathMillFace.py
PathScripts/PathPocket.py
PathScripts/PathDrilling.py
PathScripts/PathCopy.py
PathScripts/PathCustom.py
PathScripts/PathDressup.py
PathScripts/DragknifeDressup.py
PathScripts/PathHop.py
PathScripts/PathUtils.py
PathScripts/PathSelection.py
PathScripts/PathDrilling.py
PathScripts/PathEngrave.py
PathScripts/PathFacePocket.py
PathScripts/PathFaceProfile.py
PathScripts/PathFixture.py
PathScripts/PathCopy.py
PathScripts/PathCompoundExtended.py
PathScripts/PathFromShape.py
PathScripts/PathGeom.py
PathScripts/PathHop.py
PathScripts/PathInspect.py
PathScripts/PathJob.py
PathScripts/PathStock.py
PathScripts/PathKurveUtils.py
PathScripts/PathLoadTool.py
PathScripts/PathMillFace.py
PathScripts/PathPlane.py
PathScripts/PathPocket.py
PathScripts/PathPost.py
PathScripts/PathPostProcessor.py
PathScripts/PathLoadTool.py
PathScripts/PathToolLenOffset.py
PathScripts/PathComment.py
PathScripts/PathStop.py
PathScripts/PathFromShape.py
PathScripts/PathKurveUtils.py
PathScripts/PathAreaUtils.py
PathScripts/slic3r_pre.py
PathScripts/PathFaceProfile.py
PathScripts/PathFacePocket.py
PathScripts/PathArray.py
PathScripts/PathCustom.py
PathScripts/PathInspect.py
PathScripts/PathSimpleCopy.py
PathScripts/PathEngrave.py
PathScripts/PathSurface.py
PathScripts/PathPreferences.py
PathScripts/PathPreferencesPathJob.py
PathScripts/PathProfile.py
PathScripts/PathProfileEdges.py
PathScripts/PathRemote.py
PathScripts/PathSanity.py
PathScripts/PathSelection.py
PathScripts/PathSimpleCopy.py
PathScripts/PathStock.py
PathScripts/PathStop.py
PathScripts/PathSurface.py
PathScripts/PathToolLenOffset.py
PathScripts/PathToolLibraryManager.py
PathScripts/DogboneDressup.py
PathScripts/PathPreferencesPathJob.py
PathScripts/PathPreferences.py
PathScripts/PathUtils.py
PathScripts/PostUtils.py
PathScripts/TooltableEditor.py
PathScripts/__init__.py
PathScripts/centroid_post.py
PathScripts/comparams_post.py
PathScripts/dumper_post.py
PathScripts/dynapath_post.py
PathScripts/example_post.py
PathScripts/example_pre.py
PathScripts/generic_post.py
PathScripts/linuxcnc_post.py
PathScripts/opensbp_post.py
PathScripts/opensbp_pre.py
PathScripts/rml_post.py
PathScripts/slic3r_pre.py
PathTests/PathTestUtils.py
PathTests/TestPathGeom.py
PathTests/TestPathPost.py
PathTests/__init__.py
PathTests/test_linuxcnc_00.ngc
TestPathApp.py
)

SET(PathScripts_NC_SRCS
Expand Down
126 changes: 63 additions & 63 deletions src/Mod/Path/Gui/Resources/Path.qrc
@@ -1,94 +1,94 @@
<RCC>
<qresource>
<file>icons/preferences-path.svg</file>
<file>icons/Path-Toolpath.svg</file>
<file>icons/Path-3DSurface.svg</file>
<file>icons/Path-Array.svg</file>
<file>icons/Path-Axis.svg</file>
<file>icons/Path-BaseGeometry.svg</file>
<file>icons/Path-Comment.svg</file>
<file>icons/Path-Compound.svg</file>
<file>icons/Path-Shape.svg</file>
<file>icons/Path-Profile.svg</file>
<file>icons/Path-Contour.svg</file>
<file>icons/Path-Pocket.svg</file>
<file>icons/Path-Drilling.svg</file>
<file>icons/Path-Job.svg</file>
<file>icons/Path-Dressup.svg</file>
<file>icons/Path-Hop.svg</file>
<file>icons/Path-Datums.svg</file>
<file>icons/Path-Copy.svg</file>
<file>icons/Path-ToolTable.svg</file>
<file>icons/Path-LengthOffset.svg</file>
<file>icons/Path-Axis.svg</file>
<file>icons/Path-Stock.svg</file>
<file>icons/Path-Plane.svg</file>
<file>icons/Path-Post.svg</file>
<file>icons/Path-LoadTool.svg</file>
<file>icons/Path-Comment.svg</file>
<file>icons/Path-Stop.svg</file>
<file>icons/Path-Machine.svg</file>
<file>icons/Path-Kurve.svg</file>
<file>icons/Path-FaceProfile.svg</file>
<file>icons/Path-FacePocket.svg</file>
<file>icons/Path-Array.svg</file>
<file>icons/Path-Custom.svg</file>
<file>icons/Path-Inspect.svg</file>
<file>icons/Path-ToolChange.svg</file>
<file>icons/Path-SimpleCopy.svg</file>
<file>icons/Path-Engrave.svg</file>
<file>icons/Path-Sanity.svg</file>
<file>icons/Path-3DSurface.svg</file>
<file>icons/Path-Speed.svg</file>
<file>icons/Path-BaseGeometry.svg</file>
<file>icons/Path-Datums.svg</file>
<file>icons/Path-Depths.svg</file>
<file>icons/Path-Dressup.svg</file>
<file>icons/Path-Drilling.svg</file>
<file>icons/Path-Engrave.svg</file>
<file>icons/Path-FacePocket.svg</file>
<file>icons/Path-FaceProfile.svg</file>
<file>icons/Path-Face.svg</file>
<file>icons/Path-Heights.svg</file>
<file>icons/Path-Hop.svg</file>
<file>icons/Path-Inspect.svg</file>
<file>icons/Path-Job.svg</file>
<file>icons/Path-Kurve.svg</file>
<file>icons/Path-LengthOffset.svg</file>
<file>icons/Path-LoadTool.svg</file>
<file>icons/Path-MachineLathe.svg</file>
<file>icons/Path-MachineMill.svg</file>
<file>icons/Path-Machine.svg</file>
<file>icons/Path-OperationA.svg</file>
<file>icons/Path-OperationB.svg</file>
<file>icons/Path-Plane.svg</file>
<file>icons/Path-Pocket.svg</file>
<file>icons/Path-Post.svg</file>
<file>icons/Path-Profile-Edges.svg</file>
<file>icons/Path-Profile-Face.svg</file>
<file>icons/Path-Profile.svg</file>
<file>icons/Path-Sanity.svg</file>
<file>icons/Path-SelectLoop.svg</file>
<file>icons/Path-Face.svg</file>
<file>translations/Path_de.qm</file>
<file>icons/Path-Shape.svg</file>
<file>icons/Path-SimpleCopy.svg</file>
<file>icons/Path-Speed.svg</file>
<file>icons/Path-Stock.svg</file>
<file>icons/Path-Stop.svg</file>
<file>icons/Path-ToolChange.svg</file>
<file>icons/Path-Toolpath.svg</file>
<file>icons/Path-ToolTable.svg</file>
<file>icons/preferences-path.svg</file>
<file>panels/ContourEdit.ui</file>
<file>panels/DlgJobChooser.ui</file>
<file>panels/DlgSelectPostProcessor.ui</file>
<file>panels/DlgToolCopy.ui</file>
<file>panels/DogboneEdit.ui</file>
<file>panels/DrillingEdit.ui</file>
<file>panels/EngraveEdit.ui</file>
<file>panels/JobEdit.ui</file>
<file>panels/MillFaceEdit.ui</file>
<file>panels/PocketEdit.ui</file>
<file>panels/ProfileEdgesEdit.ui</file>
<file>panels/ProfileEdit.ui</file>
<file>panels/RemoteEdit.ui</file>
<file>panels/SurfaceEdit.ui</file>
<file>panels/ToolControl.ui</file>
<file>panels/ToolEdit.ui</file>
<file>panels/ToolLibraryEditor.ui</file>
<file>preferences/PathJob.ui</file>
<file>translations/Path_af.qm</file>
<file>translations/Path_zh-CN.qm</file>
<file>translations/Path_zh-TW.qm</file>
<file>translations/Path_hr.qm</file>
<file>translations/Path_cs.qm</file>
<file>translations/Path_nl.qm</file>
<file>translations/Path_de.qm</file>
<file>translations/Path_el.qm</file>
<file>translations/Path_es-ES.qm</file>
<file>translations/Path_fi.qm</file>
<file>translations/Path_fr.qm</file>
<file>translations/Path_hr.qm</file>
<file>translations/Path_hu.qm</file>
<file>translations/Path_it.qm</file>
<file>translations/Path_ja.qm</file>
<file>translations/Path_nl.qm</file>
<file>translations/Path_no.qm</file>
<file>translations/Path_pl.qm</file>
<file>translations/Path_pt-BR.qm</file>
<file>translations/Path_pt-PT.qm</file>
<file>translations/Path_ro.qm</file>
<file>translations/Path_ru.qm</file>
<file>translations/Path_sk.qm</file>
<file>translations/Path_sl.qm</file>
<file>translations/Path_sr.qm</file>
<file>translations/Path_es-ES.qm</file>
<file>translations/Path_sv-SE.qm</file>
<file>translations/Path_uk.qm</file>
<file>translations/Path_it.qm</file>
<file>translations/Path_pt-BR.qm</file>
<file>translations/Path_el.qm</file>
<file>translations/Path_sk.qm</file>
<file>translations/Path_tr.qm</file>
<file>translations/Path_sl.qm</file>
<file>panels/EngraveEdit.ui</file>
<file>panels/DrillingEdit.ui</file>
<file>panels/PocketEdit.ui</file>
<file>panels/ProfileEdit.ui</file>
<file>panels/SurfaceEdit.ui</file>
<file>panels/RemoteEdit.ui</file>
<file>panels/ToolControl.ui</file>
<file>panels/ToolLibraryEditor.ui</file>
<file>panels/JobEdit.ui</file>
<file>panels/DlgToolCopy.ui</file>
<file>panels/ToolEdit.ui</file>
<file>panels/DlgJobChooser.ui</file>
<file>panels/ContourEdit.ui</file>
<file>panels/MillFaceEdit.ui</file>
<file>panels/ProfileEdgesEdit.ui</file>
<file>panels/DogboneEdit.ui</file>
<file>panels/DlgSelectPostProcessor.ui</file>
<file>preferences/PathJob.ui</file>
<file>translations/Path_uk.qm</file>
<file>translations/Path_zh-CN.qm</file>
<file>translations/Path_zh-TW.qm</file>
</qresource>
</RCC>
3 changes: 1 addition & 2 deletions src/Mod/Path/InitGui.py
Expand Up @@ -25,8 +25,7 @@ class PathWorkbench (Workbench):
"Path workbench"

def __init__(self):
self.__class__.Icon = FreeCAD.getResourceDir(
) + "Mod/Path/Resources/icons/PathWorkbench.svg"
self.__class__.Icon = FreeCAD.getResourceDir() + "Mod/Path/Resources/icons/PathWorkbench.svg"
self.__class__.MenuText = "Path"
self.__class__.ToolTip = "Path workbench"

Expand Down
6 changes: 4 additions & 2 deletions src/Mod/Path/PathScripts/PathContour.py
Expand Up @@ -28,10 +28,11 @@
import TechDraw
from PathScripts import PathUtils
from PathScripts.PathUtils import depth_params
from PySide import QtCore

if FreeCAD.GuiUp:
import FreeCADGui
from PySide import QtCore, QtGui
from PySide import QtGui
# Qt tanslation handling
try:
_encoding = QtGui.QApplication.UnicodeUTF8
Expand Down Expand Up @@ -258,7 +259,8 @@ def execute(self, obj):
if obj.Active:
path = Path.Path(output)
obj.Path = path
obj.ViewObject.Visibility = True
if obj.ViewObject:
obj.ViewObject.Visibility = True

else:
path = Path.Path("(inactive operation)")
Expand Down

0 comments on commit 01fd5ce

Please sign in to comment.