Hi everyone!,
I’m using the dwgnest command in QCAD Professional to automate nesting processes, and I was wondering if there’s a way to force a solution to be accepted automatically after a certain time has passed.
Sometimes the nesting process runs four hours without reaching a final layout. Even with a number of iterations and rotation low (for example -iterations=30 -rotations=2). Consuming a lot of CPU during the process.
I’d like to know if it's possible to configure the nesting engine to accept the best-found solution after a timeout period (e.g., 2 hours), even if it hasn’t fully optimized the layout.
Is there a parameter or workaround for this in the CLI or scripting environment?
Any suggestions or guidance would be greatly appreciated.
The dxf used where this:
28 parts of mannitestw268.dxf
25 parts of mannitestw265.dxf
57 parts of mannitestw263.dxf
Force Nesting Solution After Timeout in dwgnest Command
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Indicate the post processor used.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Indicate the post processor used.
Attach drawing files and screenshots.
Post one question per topic.
-
estibalizEchevarria
- Newbie Member
- Posts: 5
- Joined: Fri Feb 23, 2024 9:27 am
Force Nesting Solution After Timeout in dwgnest Command
- Attachments
-
- mannitestw263.dxf
- (143.6 KiB) Downloaded 392 times
-
- mannitestw265.dxf
- (149.37 KiB) Downloaded 362 times
-
- mannitestw268.dxf
- (142.95 KiB) Downloaded 446 times
-
CVH
- Premier Member
- Posts: 4994
- Joined: Wed Sep 27, 2017 4:17 pm
Re: Force Nesting Solution After Timeout in dwgnest Command
Hi,
In your example files I don't see a contour of a sheet to nest on or a related layer.
I associate CLI or command-line interface with the QCAD OS command line tools e.g. dwgnest
Nesting is part of proprietary code and further undocumented.
Those scripts are not open source, there is thus no easy scripting solution.
Your best option is filing a feature request on QCAD Bugtracker.
The purpose of nesting is to cut up as less of virgin material as possible.
As far as I know the nesting feature of QCAD in GUI mode it list the current best fit at the top.
You can halt the process at any time and opt for that 'best fit'.
The maximum number of iterations is a tool preference but the optimal solution can be one of the iterations that is not yet tried.
Halting automatically after a certain time is not a real benchmark.
Nesting tries every layout conceivable, with many parts and many options to rotate a piece the number of permutations may become so larger that an optimal is probably never reached in a short time, a few hours or even not in this lifetime.
With only a few parts and harsh limitations it may.
At some point the gain in uncut virgin material will no longer outweigh the CPU effort or your personal time.
Using the GUI compare the best solution after 10min with that after 30min, an hour and so on.
When the cost of the extra time and labor exceeds the gain then you have reached an affordable optimum.
Executed as command line tool it has to run the given number of iterations.
BTW: The outline of 263 is almost rectangular ... It is no rocket science to figure out a best fit.
The more complex a shape, the more computational effort is required per iteration.
263 include holes that don't contribute to the overall shape but these must be moved, rotated and trialed with the outline.
268 is probably best fitted alternating 1 normal with 1 rotated 180° degrees.
A real nesting challenge is to nest all 110 parts together.
Regards,
CVH
In your example files I don't see a contour of a sheet to nest on or a related layer.
I associate CLI or command-line interface with the QCAD OS command line tools e.g. dwgnest
Nesting is part of proprietary code and further undocumented.
Those scripts are not open source, there is thus no easy scripting solution.
Your best option is filing a feature request on QCAD Bugtracker.
The purpose of nesting is to cut up as less of virgin material as possible.
As far as I know the nesting feature of QCAD in GUI mode it list the current best fit at the top.
You can halt the process at any time and opt for that 'best fit'.
The maximum number of iterations is a tool preference but the optimal solution can be one of the iterations that is not yet tried.
Halting automatically after a certain time is not a real benchmark.
Nesting tries every layout conceivable, with many parts and many options to rotate a piece the number of permutations may become so larger that an optimal is probably never reached in a short time, a few hours or even not in this lifetime.
With only a few parts and harsh limitations it may.
At some point the gain in uncut virgin material will no longer outweigh the CPU effort or your personal time.
Using the GUI compare the best solution after 10min with that after 30min, an hour and so on.
When the cost of the extra time and labor exceeds the gain then you have reached an affordable optimum.
Executed as command line tool it has to run the given number of iterations.
BTW: The outline of 263 is almost rectangular ... It is no rocket science to figure out a best fit.
The more complex a shape, the more computational effort is required per iteration.
263 include holes that don't contribute to the overall shape but these must be moved, rotated and trialed with the outline.
268 is probably best fitted alternating 1 normal with 1 rotated 180° degrees.
A real nesting challenge is to nest all 110 parts together.
Regards,
CVH