Commit Graph

117 Commits

Author SHA1 Message Date
Russell Johnson
4c1951aedc Path: Allow parent job assignment
Modifications focus on allowing the creation of operations to include direct provision of parent job.
Path: Remove `useGui` implementation
2021-08-13 19:02:40 -05:00
Russell Johnson
666671e6d6 Path: Fix missing variable declaration for rotational scan
Missing default logical choice within `if...:` block.
Reported in forum at https://forum.freecadweb.org/viewtopic.php?style=3&f=15&t=44473&start=60#p412303
2020-11-08 22:56:49 -06:00
Russell Johnson
f428ba6050 Path: Restructure code to fix closedGap LGTM issue 2020-11-08 22:56:49 -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
dcf9989f12 lgtm cleanup
fix contradictory tooltip
2020-10-07 16:53:52 -05:00
Mark Ganson TheMarkster
181eaa1b7a coverity issue cid 305102 2020-07-23 13:55:32 +02:00
sliptonic
b5ba6b96bd Merge pull request #3629 from gwicke/line_simplification
[path] Implement Ramer-Douglas-Peucker line simplification
2020-06-19 11:12:35 -05:00
sliptonic
c238c7fd6f Merge pull request #3568 from Russ4262/3D_Surface_fixes_2
[Path] 3D Surface and Waterline: FinalDepth guess and `InternalFeaturesCut` fixes
2020-06-19 11:10:14 -05:00
Russell Johnson
27482c7eb0 Path: Fix initial guess for FinalDepth with no Base Geometry 2020-06-18 01:36:54 -05:00
Gabriel Wicke
a5bf29269b [path] Implement Ramer-Douglas-Peucker line simplification
Implement an iterative version of the Ramer-Douglas-Peucker line
simplification algorithm
(https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm),
which reduces line complexity to a limited linear deviation from the
original polyline. The ability to reason about linear deflection is the
key improvement over the previous linear implementation.

Worst case complexity is O(n^2), but expected complexity for typical
cases is O(n log n). A potentially faster alternative would be to call
out to libclipper, treating the line as a closed polygon. However, in
practice, performance of this implementation seems good enough. A
complex 3d surface operation optimizes in a few seconds, and reduces
output gcode size from about 220MB with the previous implementation to
10MB.
2020-06-17 20:10:18 -07:00
Russell Johnson
ae18b8cac0 Path: Convert SetupProperties() to dynamic code
This method will always synchronize with operation's class properties.
2020-06-16 02:01:30 -05:00
Russell Johnson
06a999759d Path: Initialize OCL_Tool class and implement in OCL-based operations
The purpose of this class is to properly translate both, Legacy and ToolBit, tools into OCL tool types where possible.
message fix
2020-06-16 02:01:30 -05:00
Gabriel Wicke
191e5532a8 Path: Fix for optimizeLinearSegments
Reduce cumulative error by holding onto the original point in a sequence
of linear optimizations. In testing, this fixes artifacts I have seen on
very finely sampled paths with very gradual curvature.

Further improvements are needed for this optimization, but at least this
change avoids a regression over the status quo.
2020-06-07 15:59:51 -07:00
Gabriel Wicke
ef223fc71c Path: Use _optimizeLinearSegments utility in _planarSinglePassProcess
Slightly clean up the code by separating linear segment optimization
from gcode generation. While the current optimization is not very
effective once there is any kind of meshing noise, having a single
method performing the optimization will make it easier to tweak
tolerances or strategies.
2020-06-05 18:21:24 -07:00
Gabriel Wicke
72524e9056 Path: More ambitious step-over and break optimizations
Extend the work from #3496 to allow the safe optimization of more
complex step transitions.

- Use the actual safePDC path for short step transitions and breaks,
  currently up to 2 cutter diameters. This value is chosen to cover
  basically all typical end step-overs, including those with heavy skew.
  Extending this much further (up to the break even point for a retract &
  rapid) will need some careful thinking for multi pass paths.
- Coordinate offset tolerances with per-operation tessellation
  tolerances, to avoid tessellation artifacts messing up paths by
  causing false retracts.  Such retracts can cause entire steps near
  vertical areas to be falsely skipped, which would cause a major
  deviation from the target model.  By considering per-job tolerances, we
  allow users to safely save computational resources by computing roughing
  operations with lower precision, or selectively increase precision for
  finish passes.
- Refine the default tessellation tolerance to GeometryTolerance / 4.
  This makes sure that the job GeometryTolerance is respected by
  operation defaults.
2020-06-05 18:21:24 -07:00
Russell Johnson
452f1d6d9d Path: Add opUpdateDepths() method to fix FinalDepth guess 2020-06-05 00:11:43 -05:00
Russell Johnson
4b9b1e3c76 Path: Clean up messaging and add translation() usage 2020-06-03 19:00:59 -05:00
Russell Johnson
d94ae6e813 Path: Simplify creation of debug objects
Path: Improve debug messages
2020-06-03 18:59:46 -05:00
Russell Johnson
3e83b1d8e5 Path: Add missing cut patterns and organize the enumeration lists 2020-06-03 18:59:46 -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
sliptonic
2a2182e4d1 Merge pull request #3496 from gwicke/transition_fixes
Path: Fix step transition optimizations
2020-05-31 09:47:52 -05:00
Gabriel Wicke
1f22269be0 Path: Safer step over optimization
- Only apply aggressive optimizations to short horizontal moves within
  cutter diameter. The safe model STL does not accurately reflect stock
  state, so using it for determining long distance move safe heights is
  not safe. There would be a high chance of hitting the stock at rapid
  speeds.

  Thankfully, the vast majority of step-overs tend to be short, so are
  still optimized.
- For short moves, only allow completely lift-free transitions when
  there is (almost) no Z change, and the min safe travel height does not
  rise above the same level.
  Otherwise, lift to the max of end points and min safe travel height
  first, then move horizontally. A future optimization would be to
  directly use the drop scan for transition path generation.
2020-05-23 20:18:37 -07:00
Russell Johnson
00c1038ffd Path: Expose property creation process to user access; Code cleanup
Path: EOL syncs with source

PathSurface and PathWaterline modules have incorrect, Windows, line endings and need to be converted to Unix style.
2020-05-21 23:24:17 -05:00
Russell Johnson
691c3900c1 Path: LGTM cleanup and PEP8 2020-05-21 23:24:17 -05:00
Russell Johnson
374df7838a Path: Relocate common 3D Surface and Waterline methods to support module 2020-05-21 23:24:17 -05:00
Russell Johnson
29b5c39924 Path: Move more common methods to PathSurfaceSupport module 2020-04-16 00:20:46 -05:00
Russell Johnson
5d5a21e5a7 Path: Simplify if ... is True: statements. 2020-04-16 00:17:47 -05:00
Russell Johnson
e23aecc667 Path: New class - PathGeometryGenerator; new CutPattern - Offset
Converted _planarMakePathGeom() into independent class, PathGeometryGenerator, as preparation to share common code with Waterline.
Implementation of new class within existing code.
Added new cut pattern: Offset.  It is ported from Waterline.
2020-04-16 00:17:40 -05:00
Russell Johnson
b0a73d1266 Path: Improve compatibility between file versions
Verify enumerations on document reload, maintaining the existing value for the property.
2020-04-16 00:17:33 -05:00
Russell Johnson
8e58f10f7f Path: Fix weakness in face analysis for unique OuterWire cases 2020-04-16 00:17:24 -05:00
Russell Johnson
75ad65ecf1 Path: Added Spiral cut pattern; Adjusted tooltip language 2020-04-16 00:17:16 -05:00
Russell Johnson
c8ece0c437 Path: Multiple fixes; code optimizations and cleanup
Fix _processRotationalOp() arguments and erroneous call thereto.
Fix isOnLineSegment() usage.
Fix transition between profile edge and clearing.
Fix _planarSinglepassProcess() method.
Fix `ProfileEdges` feature.
Fix Y-axis rotation error in G-code and display.
Fix error handling of `import ocl` test.
Raise `import ocl` test in code sequence.
Convert ocl.Point scan results and handling to FreeCAD.Vector() type throughout `Rotational` scan code.
Change properties group from `Rotational` to `Rotation`.
Make operation property details accessible through class.
Relocate Draft import to dependent function.
Improve property visibility in Data tab.
Issue warning for Rotational scans if faces are selected.
Compact setup() function.
LGTM cleanup throughout.
Delete unnecessary comments.
2020-04-16 00:17:05 -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
Eric Trombly
56769f1a27 change isOnLine to isOnLineSegment 2020-04-06 06:34:53 -05:00
Eric Trombly
1ac9c2f4e9 move getFacets from Path to Part 2020-04-06 06:34:53 -05:00
Eric Trombly
6bb5873e3e add changes to Waterline 2020-04-06 06:34:53 -05:00
Eric Trombly
c8901cd5af clean up commented old code 2020-04-06 06:34:53 -05:00
Eric Trombly
7cc190fff0 remove debug profiling from surface 2020-04-06 06:34:53 -05:00
Eric Trombly
a0e45bffaa remove parallel processing, replace mesh generation with getting facets 2020-04-06 06:34:53 -05:00
Eric Trombly
144d3b62f3 changed some for loops to list comprehensions, added openmp for area to make two loops parallel, changed a fuse to a compound 2020-04-06 06:34:53 -05:00
Eric Trombly
f210d71f18 remove sleep calls, change some for loops to list comp, move isPointOnLine to base vector 2020-04-06 06:34:53 -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
75d4a66ca1 Path: Synchronize tooltips. Apply DepthOffset. Hide properties.
Sync tooltip text between 3D Surface and Waterline.
Also, apply `DepthOffset` to Experimental Waterline algorithm.
Hide some properties in Data tab.
2020-03-30 23:24:47 -05:00
Russell Johnson
e7b328c6cf Path: Fix bug that fails Multi-pass usage 2020-03-30 22:34:57 -05:00
Russell Johnson
458a6a2244 Path: Four bug fixes per forum discussion
Fix grammar mistake.
Fix Gcode comment formatting.
Fix application of `Optimize Step Over Transitions` by adjusting the offset tolerance for creating the offset cut area for the operation.
Fix math error in circular based cut patterns for small diameter cutters.
Identification of bugs begins in the forum at https://forum.freecadweb.org/viewtopic.php?style=3&f=15&t=41997&start=210.
Path: Lower SampleInterval minimum to 0.0001mm
2020-03-30 22:34:57 -05:00
Russell Johnson
186a98a8e2 Path: Restructure initOperation() for backward compatibility
Added initOpProperties() to handle independent creation of properties for backward compatibility and to allow for future storage of enumeration property lists within the operation.
Path: Change from PathSurface code to `Waterline`


Path: Updates and fixes


Path: Simplify code

Remove `Algorithm` and `AreaParams` property usage.
Remove other unused properties.
Simplify setupEditorProperties().
Path: Remove unused methods


Path: Update property initialization and handling

Make properties backward compatible with previous versions of the operation.
Remove references to unused properties due to 3D Surface and Waterline separation.
Path: Insert placeholder for `Experimental` algorithm


Path: Fix missing property and fix syntax

Missing `Algrorithm
2020-03-30 22:34:57 -05:00
luz.paz
65f6347953 [skip ci] Fix typos
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-03-24 11:14:24 +01:00
Russell Johnson
a95a53f6eb Fix application of DepthOffset property 2020-03-18 12:32:45 -05:00
Russell Johnson
71de5955a9 Expose linear and angular deflection for mesh conversion 2020-03-18 12:21:37 -05:00
Russell Johnson
2b094f0160 PathSurface: Add select-face(s) feature and other improvements
New feature: Limit 3D Surface op to selected faces.

Disabled the IgnoreWaste feature, until it can be made compatible with new features.

New feature:  Face avoidance using new `AvoidLastXFaces` property.

New cut patterns: `Circular` and `CircularZigZag`.  New patterns include customizable center point and optional optimizations. Implemented G2/G3 gcode commands.

New feature: Safe travel for transitional paths. New methods to allow safe travel over stock, cut area, and avoided features.

New feature: Start point for operation. Choose a custom XY start point for the operation.

Restructure code to improve management and prepare for separation of the `Waterline` algorithm into an independent operation in the PathWB.

New feature: `ProfileEdges`.  Allows the user to profile the edges(boundary) of the selected face(s) with or without cutting the entire face area.

Add my name to the `Credits` tab in the `About FreeCAD` documentation.

Added new feature and property: `CutPatternReversed`. This will make Circular, Line, and ZigZag patterns work in reverse order - outside to inside. 
PathSurface: Add select-face(s) feature and other improvements

New feature: Limit 3D Surface op to selected faces.

Disabled the IgnoreWaste feature, until it can be made compatible with new features.

New feature:  Face avoidance using new `AvoidLastXFaces` property.

New cut patterns: `Circular` and `CircularZigZag`.  New patterns include customizable center point and optional optimizations. Implemented G2/G3 gcode commands.

New feature: Safe travel for transitional paths. New methods to allow safe travel over stock, cut area, and avoided features.

New feature: Start point for operation. Choose a custom XY start point for the operation.

Restructure code to improve management and prepare for separation of the `Waterline` algorithm into an independent operation in the PathWB.

New feature: `ProfileEdges`.  Allows the user to profile the edges(boundary) of the selected face(s) with or without cutting the entire face area.

Add my name to the `Credits` tab in the `About FreeCAD` documentation.
2020-03-18 12:21:37 -05:00