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.
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.
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.
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.
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.
- 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.
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.
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.
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
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
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
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.