Commit Graph

126 Commits

Author SHA1 Message Date
Russell Johnson
5321edca3c Path: Fixes #6775 - Check for end of range
Change transition target point to last point at Safe Height if no more parts are available for processing.
2022-04-25 21:50:10 -05:00
Markus Lampert
d52fc71663 Blanket black formatting for Path python files 2022-03-20 13:23:48 -07:00
Russell Johnson
e72ffc41c7 Path: Correct restoration of property enumerations
Correct method call to new class method `propertyEnumerations()` as determined with recent translation fixes in Path workbench.
2022-02-15 00:02:05 -06:00
sliptonic
752d8cf964 Remove unnecessary third argument from translate() calls 2022-01-31 14:27:11 -06:00
sliptonic
2044515d59 surface and waterline translation 2022-01-26 18:36:06 -06:00
sliptonic
554de6f18f surface translation cleanup 2022-01-26 18:36:06 -06:00
luz paz
19e984f8c9 Fix various typos
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,apoints,ba,beginn,behaviour,bloaded,bottome,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,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,./build/doc/SourceDocu`
2022-01-12 14:50:39 -06:00
Russell Johnson
344d1b4dc4 Black formatting only 2021-12-25 00:29:05 -06:00
Russell Johnson
763057a1a2 Path: Fix 'NoneType' argument error in '_stepTransitionCmds()'
The 'p1' argument is passed in as 'None' on occasion.  This fix cancels the efficient transition between the two points.  3D Surface is and experimental op, and therefore this fix needs additional user testing with various complex models.
2021-12-25 00:27:19 -06:00
Russell Johnson
cfca2a790a 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
70473ab422 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
4c558f1a30 Path: Restructure code to fix closedGap LGTM issue 2020-11-08 22:56:49 -06:00
luz paz
b75cd3dd52 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
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