Commit Graph

81 Commits

Author SHA1 Message Date
Russell Johnson
03cce806f3 Path: Remove first-draft rotational code Path
Remove all first-draft rotational-related code from Path workbench to make way for more stable, long-term integration of a rotational indexing capability.
2021-05-27 10:04:31 -05:00
Russell Johnson
ee0d220bc4 Path: Remove Expand Profile feature from Profile op 2021-01-29 19:36:14 -06:00
Russell Johnson
60249f543c Path: Delete irrelevant code 2020-11-13 16:34:59 -06:00
Russell Johnson
6046e0600b Path: Fix div by zero error
Fix MillFace div by zero error reported in forum at https://forum.freecadweb.org/viewtopic.php?f=15&t=51415.
Rotational-related variables were exposed to non-rotational code block.  They have been moved into correct rotational code block.
2020-11-13 16:34:59 -06:00
Russell Johnson
5bb979e34a Path: LGTM cleanup 2020-11-13 16:34:59 -06:00
Russell Johnson
947bfa345d Path: Improve accuracy of isFaceUp() method
This method is used in rotational operations and some standard operations to identify if a face's normal-direction Z value is +1.0
2020-11-13 16:07:18 -06:00
luz paz
60c055e62d Path: Fix header uniformity and remove trailing whitespace
This PR fixes header uniformity across all Path files. It also removes all trailing whitespace.
2020-11-05 19:57:21 +01:00
sliptonic
6db220a458 Merge pull request #3763 from Russ4262/PocketShape_fix_t4411
Path: PocketShape - Fixes ticket #4411
2020-08-04 10:40:53 -05:00
Russell Johnson
10b5cbc115 Path: Fix reference to undefined ns, and adjust comments
This `ns` fix might need further attention after testing.  The section to which it pertains deals with optimizing rotations between ops with similar rotational axes.
2020-08-02 13:27:32 -05:00
Russell Johnson
32f82a9b5e Path: Fix InverseAngle feature
The `ReverseDirection` property is now hidden by default.  It should not be necessary due to recent implementation of `isFaceUp()` method.
2020-08-02 13:27:32 -05:00
Russell Johnson
015eb0421b Path: PocketShape - Fixes ticket #4411
Existing code to determine if shape volume indeed existed, failed.
Added additional pre-check for existing edges in shape to determine if shape geometry indeed exists.
In forum:
[Ticket #4411 - Can only generate pocket once for this shape, then it fails.](https://forum.freecadweb.org/viewtopic.php?style=3&f=15&t=49035).
2020-08-02 13:27:32 -05:00
Eric Trombly
cf9fec5ffd don't generate gcode if op isn't valid. Don't plunge to start height if safe and clearance height are the same. 2020-07-15 19:35:18 -05:00
Russell Johnson
8dd767239c Path: Add ExpandProfile feature
Two new properties, `ExpandProfile` (length) and `ExpandProfileStepOver` (percent) added for new feature.
New feature converts the normal single offset profile into a compound profile containing multiple increasing/decreasing offsets.
The new feature clears a each layer completely before stepping down to the next layer.
Adjust sorting procedure in PathAreaOp due to `ExpandProfile` modifications to open edges code.
2020-06-18 01:39:26 -05:00
Gabriel Wicke
86cd9f2124 Path: Opt into automatic git newline normalization
Avoid spurious diffs from inadvertent newline changes by letting git
normalize newlines in the path module as well, just as a list of other
modules including Draft already do.

This effectively standardizes all checked-in code to Unix newlines, but
checkouts might use CRLF if that is the user preference.
2020-05-31 08:33:29 -07:00
Russell Johnson
c5e577be89 Path: Initiate unification of ProfileFaces and ProfileEdges operations
ProfileFaces now accepts and processes faces and edges.
Full functionality is maintained (so far as tested) with respect to original operations.
2020-05-10 18:19:42 -05:00
Eric Trombly
c10eed7eb0 pass endVectorin PathAreaOp and clean up gcode generation 2020-04-24 20:05:39 -05:00
Eric Trombly
24e681c63b add lazyloader support
lazy_loader is copied to Ext now, modified external imports to lazy_load

add a few more imports to be lazy loaded, think the install path is correct now

[TD]"<" symbol embedded in html

revert changes to path modules for testing

use lazyloader in PathAreaOp.py

add back in deferred loading

temp change to print error message in tests

temp change to print error message in tests

add _init__.py to lazy_loader

make install in CMakeLists.txt one line
2020-04-13 21:14:34 -05:00
luz.paz
1663fbb1cd [skip ci] Fix typos in Path WB
Found via 
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-04-01 13:28:48 +02:00
Russell Johnson
988038c5d2 Path: Remove unnecessary comments
PathAreaOp
PathProfileFaces
2020-03-26 10:43:32 -05:00
Russell Johnson
8e3a72b6a8 Path: Improve rotational transitions between operations
Check previous and next operations for rotation, and eliminate rotational reset if can be done.
2020-03-26 10:43:32 -05:00
Russell Johnson
2dc4496e9a Fix failed Job creation due EnableRotation property error
PathAreaOp:   Add SetupProperties() function
PathPocketBase:   Modify SetupProperties() function to include return from same in PathAreaOp.
PathPocketShape:  remove blank indents
PathProfileBase:  Modify SetupProperties() function to include return from same in PathAreaOp.
PathProfileFaces:  fix `EnableRotation` issue
2020-03-21 11:05:46 -05:00
Patrick Felixberger
61d578bb61 Code clean up 2020-03-16 18:30:30 +01:00
Russell Johnson
8e9d704556 4th-axis fixes and improvements
Fix rotational orientation of pockets.  Need to apply same fix to ProfileFaces.
Fix final depth issue based upon error in rotational orientation fixed here.
Add property, `LimitDepthToFace` to facilitate easier pockets and face profiling on rotational-enabled operations.
Hide rotational support properties when operations do not use rotation.
Remove unnecessary property, `B_AxisErrorOverride`, and delete dead code that used it.
2020-03-14 11:36:21 -05:00
Patrick Felixberger
a08ca59766 Fixed broken final depth calculation for rotational axis in pocket, profile and drill; Added EnableRotation to GUI; Fix some weird gcode generation 2020-03-11 21:16:21 +01:00
Russell Johnson
98eaca97f9 ProfileEdges: New feature - profile open edges
Open edges, exterior or interior, can now be used to generate paths.

The new feature behaves as though the parent face is vertically oriented (standing).  It is preferred that the user select upper (top) edges.  Selecting bottom edges in some cases may not produce a path.

Path ends calculations might need slight adjustment in the code.  Path ends are *near* perpendicular to ends of edge.

Cut direction seems sporadic, but the `Direction` property will switch the direction of cut.  The `CW` and `CCW` direction labels might not align with the actual direction.  Additional algorithm modification is necessary to enforce fidelity to the labels.

Existing properties, `UseComp` and `OffsetExtra` are observed with open faces.  Negative values for `OffsetExtra` have not been tested - only zero and positive.
2020-02-25 19:13:07 -06:00
Russell Johnson
f8a4e20adc Restore manual override of FinalDepth values
Manual entries of FinalDepth values are now respected, even if below the calculated bottom of selected geometry.
Affected modules include PathPocketShape, PathPocket, PathCircularHoleBase, and PathAreaOp-based operations.

Fix format syntax issues
2020-02-14 19:38:35 -06:00
Daniel Wood
55ba721155 Add coolant feature to Ops 2019-08-28 19:40:08 +01:00
Russell Johnson
00703a5179 3D Pocket: upgrade to adaptive start and finish
apply algorithms to some pockets to eliminate air milling and adapt start and finish heights and paths to top and bottom of certain pockets.
Depth correction & flake8 formatting
use list to track successive cuts so variations of settings are tracked and applied correctly
Apply faceType specific depth calculations
Planar face requires one depth source, non-planar requires a different source.
2019-07-21 21:21:24 -05:00
Russell Johnson
b0410c2b56 4th-axis rotation analysis Z-orientation fix
orientation == 'Z' was failing in some cases due to undefined "axis" variable. "axis" declaration was commented out in an earlier commit. Declaration now restored for all orientations.
2019-07-12 01:17:26 -05:00
luz.paz
a0f5f52caf Misc. typo fixes
Found via `codespell -q 2`
2019-07-11 19:17:07 +02:00
sliptonic
d044c0d95a Merge pull request #2313 from sliptonic/lgtm3
Additional LGTM cleanup of post processors and unneeded imports
2019-07-02 09:17:27 -05:00
Markus Lampert
3bd64e1329 Addressed pylint warnings for PathAreaOp 2019-07-01 15:49:38 -07:00
sliptonic
463c195835 Path: lgtm cleanup PathAreaOp 2019-07-01 17:18:15 -05:00
Russell Johnson
6ce105f7ee 4th-axis update (#2311)
Improve property creation
Improve property setup
Implement PathLog.debug() for troubleshooting.
Improve default property values.
Remove unused and incomplete method
Remove unnecessary comments; fix final depth issue
4th-axis improvements
rotation method improvements
remove extra comment blocks
fix incorrect variable references
fix -0.0 re-introduction after initial filter
negative zero re-introduced causes problems with naming method for temp clones
Update faceRotationAnalaysis() method
update opFeatures()
Commented out call to PathOp.FeatureRotation
This feature not yet implemented.
delete call to removed method - self.reportThis()
Remove unnecessary comments
2019-07-01 09:30:58 -05:00
Markus Lampert
c4cf901c60 Removed redundant log message 2019-06-29 18:16:56 -07:00
luz.paz
94cfe2d130 Misc. typo and whitespace fixes
Found via `codespell`
2019-06-28 11:39:36 -03:00
sliptonic
617c619d2f remove unnecessary imports. normalize debug log levels 2019-06-21 13:01:01 -05:00
sliptonic
082c1e71f1 Path: PEP8 and Proxy changes. 2019-06-17 09:17:38 -05:00
Russell Johnson
0030a17241 Delete disabled code blocks
within guiMessage() method
2019-06-15 12:19:17 -05:00
Russell Johnson
babc848af7 added missing self.stockBB instantiation
job boundbox object was missing in opSetDefaultValues()
2019-06-15 12:05:58 -05:00
Russell Johnson
58e41ea5fd Isolate FreeCADGui dependency
Thanks @mlampert and @sliptonic for assisting in tracking down the error via unit test analysis.
FreeCADGui usage has to be behind an 'if FreeCAD.GuiUp:` test
2019-06-13 15:42:56 -05:00
Russell Johnson
183228cc25 Misc. fixes
Clean up code, improve comments, improve user feedback.
Improve temp clone management.
Correct depth issue with self.finDep
Add comment descriptions for new methods
Clean up comments and contribution information
Initiate recognition of type()==SurfaceOfExtrusion
Adopt standard PathGeom.isRoughly() and .Tolerance rather than idependent precision settings
2019-06-13 10:55:32 -05:00
Russell Johnson
73e00617d1 Fixes for depths and AttemptInverseAngle
Depth correction to obj.FinalDepth.Value in single feature operations
Fix AttemptInverseAngle to be uni-directional
Clean up debug and other user provided feedback
2019-06-13 10:55:31 -05:00
Russell Johnson
33008fbb17 Handle FreeCADGui module with IF: case 2019-06-13 10:55:31 -05:00
Russell Johnson
a7202f151f Improve code structure; correct 4th-axis depth issues 2019-06-13 10:55:30 -05:00
Russell Johnson
8aa27693c9 Improve 4th-axis integration
Improvements to 4th-axis readiness for other PathAreaOp based tools in PathWB.
Add guiMessage() method for rendering GUI messages to user.
2019-06-13 10:55:27 -05:00
Zheng, Lei
d280fc575b Path: handle PathAreaOp object migration 2019-06-10 09:29:01 +08:00
luz.paz
ec12ffae0c Path: source comment typo fixes
Found via `codespell`
2019-05-30 19:57:25 +02:00
Russell Johnson
3d2a8504c8 Path: Integrate 4th-axis feature to PathPocketShape and 3D Surface ops (#2114)
* PathSurface: Add StepDown support

Add StepDown support for PathSurface operation.
A low-level optimization algorithm is included.

* Update PageOpSurfaceEdit.ui

* PathSurface: Activate CompletionMode input

Update code to use CompletionMode selection from user.

* PathSurfaceGui: Add Completion Mode selection box

Add Completion Mode selection box for user input.

* PathSurface: Use depth_params() for step control

Implemented PathUtils.depth_params() for control of step downs to maintain consistency throughout PathWB.
Suggested by Sliptonic.

* PathSurface: Improve stability - Rev3

Organized code better, improved path optimization algorithm

* PathSurface: Add XY rotational surfacing

Add options to perform 3D surfacing by rotating object around X or Y axis.

* PathSurface: update setup function

Add properties to setup function

* PathSurface: Remove extraneous code

removed commented lines that consume processing time

* PathSurface: Correct nxt.z point assignment

Corrected error in nxt.z value assignment. Was assigning value to pnt.z instead of nxt.z

* PathSurface: Update 4th axis operation

Provided both parallel and perpendicular to axis  scans when performing rotational operation.

* PathSurface: Corrected Y-axis rotation to gcode

Inverted Y-axis scan values in gcode to produce correct result

* PathSurface: Adjust gcode feed rates

Adjust feed rates for axial rotations

* PathSurface: Implement waterline alternative

Used OCL dropcutter scan as data base for python algorithm to extract a waterline.  Waterline also incorporates step down feature.

* PathSurface: Update to 3m-Usable

stability improvements
fixed step on multi-pass 4th axis scans
initiate code to accommodate cut modes: zigzag, line
initiate code to accommodate offset cutter on 4th axis scans to simulate a tilted cutter for ball end mills

* PathSurface: Update 3m-Usable_r1

change instantiated static class attributes from value None, to 0.0

* PathSurface: Revert to 3i-Usable_r1

Further testing needed for 3m-Usable release

* PathSurface: Update to Rev. 3s Usable

fixed step over in rotational scans
start/stop indexes
tilt cutter adaptation for ball end mill
cut pattern: zigzag, line partially implemented
ignore waste option initiated for planar scans
cut mode partially implemented: conventional & climb

* PathSurface: Update to Rev. 3t Usable

Corrected rotational errors
corrected cutter tilt rotation
added "ignore waste" feature for planar surface operation

* Implement 4th-axis feature

Implement 4th-axis feature:
add gcode commands for rotation
re-compute operation heights, to consider rotation radii

* Deleted reference to undeclared variable

* Added missing class attributes/variables

* Added missing class variables/attributes

* Relocate class variables to higher class

* Remove references to undeclared variables

relocated class variables here
delete references to undeclared variables

* Correct rotation direction for normal-to-Y faces

* Remove X oriented 180 degree rotation adjustment

Probable error in FreeCAD gcode renderer, producing incorrect B axis rotation

* Update 4th-axis integration

Address FC error with B axis rotation rendering: user input to override error for visual alignment with model.
Correct pocket depths with Final Depth input enforced.
Add Reverse Direction flag input for reversing direction of pocket: necessary in some use cases.
NOTE: 4th-axis throws errors with Extension Corners feature.  EC feature needs 4th-axis rotation integration when calculating extensions for a particular part feature/face.
General testing needed.

* PathSurface: Add StepDown support

Add StepDown support for PathSurface operation.
A low-level optimization algorithm is included.

* Update PageOpSurfaceEdit.ui

* PathSurface: Activate CompletionMode input

Update code to use CompletionMode selection from user.

* PathSurfaceGui: Add Completion Mode selection box

Add Completion Mode selection box for user input.

* PathSurface: Use depth_params() for step control

Implemented PathUtils.depth_params() for control of step downs to maintain consistency throughout PathWB.
Suggested by Sliptonic.

* PathSurface: Improve stability - Rev3

Organized code better, improved path optimization algorithm

* PathSurface: Add XY rotational surfacing

Add options to perform 3D surfacing by rotating object around X or Y axis.

* PathSurface: update setup function

Add properties to setup function

* PathSurface: Remove extraneous code

removed commented lines that consume processing time

* PathSurface: Correct nxt.z point assignment

Corrected error in nxt.z value assignment. Was assigning value to pnt.z instead of nxt.z

* PathSurface: Update 4th axis operation

Provided both parallel and perpendicular to axis  scans when performing rotational operation.

* PathSurface: Corrected Y-axis rotation to gcode

Inverted Y-axis scan values in gcode to produce correct result

* PathSurface: Adjust gcode feed rates

Adjust feed rates for axial rotations

* PathSurface: Implement waterline alternative

Used OCL dropcutter scan as data base for python algorithm to extract a waterline.  Waterline also incorporates step down feature.

* PathSurface: Update to 3m-Usable

stability improvements
fixed step on multi-pass 4th axis scans
initiate code to accommodate cut modes: zigzag, line
initiate code to accommodate offset cutter on 4th axis scans to simulate a tilted cutter for ball end mills

* PathSurface: Update 3m-Usable_r1

change instantiated static class attributes from value None, to 0.0

* PathSurface: Revert to 3i-Usable_r1

Further testing needed for 3m-Usable release

* PathSurface: Update to Rev. 3s Usable

fixed step over in rotational scans
start/stop indexes
tilt cutter adaptation for ball end mill
cut pattern: zigzag, line partially implemented
ignore waste option initiated for planar scans
cut mode partially implemented: conventional & climb

* PathSurface: Update to Rev. 3t Usable

Corrected rotational errors
corrected cutter tilt rotation
added "ignore waste" feature for planar surface operation

* Implement 4th-axis feature

Implement 4th-axis feature:
add gcode commands for rotation
re-compute operation heights, to consider rotation radii

* Deleted reference to undeclared variable

* Added missing class attributes/variables

* Added missing class variables/attributes

* Relocate class variables to higher class

* Remove references to undeclared variables

relocated class variables here
delete references to undeclared variables

* Remove X oriented 180 degree rotation adjustment

Probable error in FreeCAD gcode renderer, producing incorrect B axis rotation

* Correct rotation direction for normal-to-Y faces

* Update 4th-axis integration

Address FC error with B axis rotation rendering: user input to override error for visual alignment with model.
Correct pocket depths with Final Depth input enforced.
Add Reverse Direction flag input for reversing direction of pocket: necessary in some use cases.
NOTE: 4th-axis throws errors with Extension Corners feature.  EC feature needs 4th-axis rotation integration when calculating extensions for a particular part feature/face.
General testing needed.

* Apply XYZ Model translations to paths; Add rotation axis selection property

* Spelling correction

ln 110

* Geometry list box: shrink height

560 to 400 height

* Update 4th-axis integration

Clean up code
Add comments for visionary elements
Apply axis selection to opHeights rotational calculations

* Update 4th-axis integration

Prepare sorting of vertical faces per axis_angle grouping, just as horizontal faces are sorted, for analysis as connected shapes

* Reset to FreeCAD master current

* Reset to current FreeCAD master version

* Update PathPocketBase.py

* Reset to current FreeCAD master

* Corrected __created__ date

* Convert all print() to PathLog.debug()

* Convert print() to PathLog.debug(); Clean up code

Use PathLog.debug over print() for troubleshooting
Clean up large commented sections of code.

* Convert print() to PathLog.debug(); combine duplicate methods

* Update last modified stamp

* Update last mofified timestamp

Also, removed commented-out code

* Typo corrected: "selt." to "self."

Discovered in https://api.travis-ci.org/v3/job/526456071/log.txt
on 30 April 2019 while searching for errors related to failure of PR #2114

* Restore initialization of self.depthparams

PR is failing Travis CI build test. Previous deletion of this code appears to be the reason.
See report at: https://api.travis-ci.org/v3/job/526492709/log.txt

* Convert tuple sizes from other PathWB ops

* B-axis rotation: render correction

* Revert "rebase to FC master 2019-05-02"

* Correct depthparams opOnDocumentRestored() issue

* Relocate "UseRotation" property from PathAreaOp.py

* Improve meshFromShape() calculation per @sliptonic

faster mesh creation
helps smooth jagged lines in path results

* Part: Make 3rd party libraries into PCH

* PartDesign: 3rdParty to PCH

* Sketcher: PCH

* PartDesign: PCH GUI

* Sketcher: GUI PCH

* Travis windows build (#2110)

Travis windows build

* Travis: enable clcache debug

* disable travis clcache debug

* respect user settings for dialog used in merge-document command

* msbuild verbose and logo

* Travis force wait 60 minutes

* Travis: Use & between vars sourcing and msbuild

* Travis: Move building to external batch script (#2131)

* Travis: Move building to external batch script

* Travis: double quotes to escape route

* Travis: use cmd.exe to call batch file

* Crowdin: fix grammatical error + whitespace 

https://crowdin.com/translate/freecad/569/en-fi#6498705

* Crowdin: experiment to fix crowdin 'ghost' strings

The following translation strings still perpetuate after updating crowdin translations. This commit experiments with removing their source counterparts in the FC .ts files. I'm not sure why they are not rendered obsolete by the normal operations. 
  
* https://crowdin.com/translate/freecad/6766/en-en#6499472  
* https://crowdin.com/translate/freecad/6766/en-en#6573450

* fix for edit tracker draw styles

* deleted commented code

* Travis: filter out

* AddonManager: allow to add custom repositories

* Revert "rebase to FC master 2019-05-02"

* Draft: Fixed Draft text justification

* Arch: Fixed bug in arch windows creation

* Arch: Fixed export of windows colors to IFC

* Draft: Fixed 0.18.1 bug in DXF importer

* Arch: Fixed wrong exported objects in IFC export

* Arch: Fixed export of sites to IFC

* Start: Fixed bad default icon in start page

* Correct depthparams opOnDocumentRestored() issue

* Relocate "UseRotation" property from PathAreaOp.py

* Improve meshFromShape() calculation per @sliptonic

faster mesh creation
helps smooth jagged lines in path results

* Relocate "UseRotation" property in PathAreaOp.py

* Syntax correction

Travis CI python 3.7 build test fails regularly due to syntax error at this point

* Correct rebase issue: PR #2114

* Correct rebase issue: PR #2114

* Correct rebase issue: PR #2114

* Correct rebase issue: PR #2114

* Correct rebase issue: PR #2114

* Correct rebase issue: PR #2114

* path pep8 cleanup

* Multi-face geometry selection repaired

Previous version broke ability to select process multiple faces selected by user in geometry tab in operation task window.
Also performed some syntax cleaning per PEP8 linter

* Update script version info
2019-05-06 21:29:08 -05:00
Sabin Iacob
72676b4690 path: use XMax/YMax for sorting shapes in PathAreaOp 2019-03-30 16:02:14 +01:00