Commit Graph

113 Commits

Author SHA1 Message Date
sliptonic
6f941c34d1 lgtm cleanup
fix contradictory tooltip
2020-10-07 16:53:52 -05:00
Mark Ganson TheMarkster
0491fa4ab9 coverity issue cid 305102 2020-07-23 13:55:32 +02:00
sliptonic
e3a67e247d Merge pull request #3629 from gwicke/line_simplification
[path] Implement Ramer-Douglas-Peucker line simplification
2020-06-19 11:12:35 -05:00
sliptonic
7c3d0040e5 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
1ef278b061 Path: Fix initial guess for FinalDepth with no Base Geometry 2020-06-18 01:36:54 -05:00
Gabriel Wicke
6b3815a766 [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
33d1d281ec 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
f4e522c95b 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
7c654878d0 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
0c69eebda4 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
84113fbd17 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
16a65cc720 Path: Add opUpdateDepths() method to fix FinalDepth guess 2020-06-05 00:11:43 -05:00
Russell Johnson
9ca855476b Path: Clean up messaging and add translation() usage 2020-06-03 19:00:59 -05:00
Russell Johnson
bebdf2d006 Path: Simplify creation of debug objects
Path: Improve debug messages
2020-06-03 18:59:46 -05:00
Russell Johnson
a1d7cffaee Path: Add missing cut patterns and organize the enumeration lists 2020-06-03 18:59:46 -05:00
Gabriel Wicke
cc84287515 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
58b86ad9f8 Merge pull request #3496 from gwicke/transition_fixes
Path: Fix step transition optimizations
2020-05-31 09:47:52 -05:00
Gabriel Wicke
4a87209cb5 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
786d96ae60 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
49853d5484 Path: LGTM cleanup and PEP8 2020-05-21 23:24:17 -05:00
Russell Johnson
562b834f54 Path: Relocate common 3D Surface and Waterline methods to support module 2020-05-21 23:24:17 -05:00
Russell Johnson
341da1092d Path: Move more common methods to PathSurfaceSupport module 2020-04-16 00:20:46 -05:00
Russell Johnson
0bd0d52baf Path: Simplify if ... is True: statements. 2020-04-16 00:17:47 -05:00
Russell Johnson
ccfd52477f 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
fd34891c99 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
a6cb530d57 Path: Fix weakness in face analysis for unique OuterWire cases 2020-04-16 00:17:24 -05:00
Russell Johnson
f41ec732e1 Path: Added Spiral cut pattern; Adjusted tooltip language 2020-04-16 00:17:16 -05:00
Russell Johnson
b5048f4f02 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
7fe094ac02 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
5ecbc89f30 change isOnLine to isOnLineSegment 2020-04-06 06:34:53 -05:00
Eric Trombly
b631c5600a move getFacets from Path to Part 2020-04-06 06:34:53 -05:00
Eric Trombly
2b8cd1be42 add changes to Waterline 2020-04-06 06:34:53 -05:00
Eric Trombly
0cbf56886a clean up commented old code 2020-04-06 06:34:53 -05:00
Eric Trombly
54022ea630 remove debug profiling from surface 2020-04-06 06:34:53 -05:00
Eric Trombly
fbc266c158 remove parallel processing, replace mesh generation with getting facets 2020-04-06 06:34:53 -05:00
Eric Trombly
651c383925 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
5f648aa2c1 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
cafed2a137 [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
ebb383cc6c 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
7d4b2f2a50 Path: Fix bug that fails Multi-pass usage 2020-03-30 22:34:57 -05:00
Russell Johnson
a907585f0d 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
4109f0c7df 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
76a77e4f88 [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
9b47226953 Fix application of DepthOffset property 2020-03-18 12:32:45 -05:00
Russell Johnson
e63a9ee0f2 Expose linear and angular deflection for mesh conversion 2020-03-18 12:21:37 -05:00
Russell Johnson
54bb4db54f 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
Markus Lampert
81f809cfcf Removed dead code for debugging shortcut warnings. 2020-01-03 23:13:55 -08:00
mlampert
ee937d52b1 Merge branch 'master' into feature/tool-bit-poc 2019-12-03 18:56:16 -08:00
luz.paz
379d041664 Fix typos and some trailing whitespace
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,currenty,dof,doubleclick,dum,eiter,elemente,feld,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
```
2019-12-03 12:22:59 +01:00
Markus Lampert
7438623869 Added Ballend and Bullnose shapes and consolidated shape names. 2019-11-28 17:31:37 -08:00