Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

glowforge.cps post processor is broken with new JS engine (Array.slice is not a function)

chrismasto
Participant

glowforge.cps post processor is broken with new JS engine (Array.slice is not a function)

chrismasto
Participant
Participant

To reproduce:

 

  • In Preferences, turn on "Use Upgraded Post Engine" under Preview Features
  • Create a setup, cutting operation using a laser tool, and post-process it with the Glowforge post found in Fusion 360 library

Expected: successful creating of SVG (this works with "Use Upgraded Post Engine" turned off)

 

Actual: After a(n irrelevant) warning that the post may be unsafe, it fails with an error. The log contains:

 

Information: Configuration: Glowforge
Information: Vendor: Glowforge
Information: Posting intermediate data to '/Users/chris/Documents/Fusion 360/NC Programs/1001.svg'
Error: Failed to post process. See below for details.
...
Start time: Thu Jan  4 03:26:34 2024
Post processor engine: 5.69.0
Configuration path: /Users/chris/Library/Application Support/Autodesk/Autodesk Fusion 360/V7A9LSHM9NQ7/W.login/M/D20200426291109101/CAMPosts/glowforge 2.cps
Include paths: /Users/chris/Library/Application Support/Autodesk/Autodesk Fusion 360/V7A9LSHM9NQ7/W.login/M/D20200426291109101/CAMPosts
Configuration modification date: Thu Jan  4 03:26:02 2024
Output path: /Users/chris/Documents/Fusion 360/NC Programs/1001.svg
Checksum of intermediate NC data: 44504dede98a2d9b846d46eb7718a5a7
Checksum of configuration: ac8aa26b863719894b0bd3e4f646313c
Vendor url: https://www.glowforge.com
Legal: Copyright (C) 2015-2021 by Autodesk, Inc.
Generated by: Fusion 360 CAM 2.0.17954
...

###############################################################################
Error: Array.slice is not a function
Error at line: 226 (glowforge 2.cps)
Error in operation: '2D Profile1'
Failed while processing onCircular() for record 285.
###############################################################################

Error: Failed to invoke function 'onCircular'.
Error: Failed to invoke 'onCircular' in the post configuration.
Error: Failed to execute configuration.
Stop time: Thu Jan  4 03:26:34 2024
Post processing failed.

 

The important part is on line 20, "Array.slice is not a function". This JavaScript function has been deprecated for years, and it appears that it was finally removed in the new post engine. The code will need to be updated.

 

Me programmer, so I found the following to work. The problem is at line 226 in the file:

var activePathElements = [];
function addPathElement() {
  var args = Array.slice(arguments, 0);

  // don't allow moves after a rapid or similar move

 

Delete the offending line and change the function signature to use a rest parameter as follows:

var activePathElements = [];
function addPathElement(...args) {
  // don't allow moves after a rapid or similar move

 

Unfortunately, this is NOT backwards compatible with the old engine, so depending on how you want to proceed, you might choose a different fix (there's some hackier way to call slice from the prototype that I don't care to think about).

 

I did not inspect any of the other posts to see if they use Array.slice as well. I wouldn't be surprised if this isn't the only one that's broken by this change.

 

 

0 Likes
Reply
355 Views
3 Replies
Replies (3)

AchimN
Community Manager
Community Manager

Hi @chrismasto ,

thanks for bringing this to our attention, we will have a look into it.



Achim.N
Principal Technology Consultant
0 Likes

ahearnb
Community Visitor
Community Visitor

Has this been resolved? I am having the same problem since updating earlier this week. Can no longer post process .svg files to send to glowforge.

0 Likes

AchimN
Community Manager
Community Manager

Yes this has been resolved a while back already, please download the latest postprocessor from the our library: https://cam.autodesk.com/hsmposts?



Achim.N
Principal Technology Consultant
0 Likes