Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'dict object' has no attribute 'polygon' #14679

Closed
2 tasks
ckvsoft opened this issue Feb 25, 2023 · 25 comments
Closed
2 tasks

'dict object' has no attribute 'polygon' #14679

ckvsoft opened this issue Feb 25, 2023 · 25 comments
Labels
Type: Bug The code does not produce the intended behavior.

Comments

@ckvsoft
Copy link
Contributor

ckvsoft commented Feb 25, 2023

Application Version

5.3 Beta Appimage

Platform

Ubuntu 20.04

Printer

everyone

Reproduction steps

Slice, upload to printer and use exclude objects map

Actual results

"BED_MESH_CALIBRATE 'dict object' has no attribute 'polygon'"

Expected results

.

Checklist of files to include

  • Log file
  • Project file

Additional information & file uploads

With 5.3 Beta 1 I have the problem that exclude objects no longer works. Is this a bug or was it changed on purpose?
With version 5.2 everything works with the 5.3 Beta1 I get the error in klipper or also via Octoprint: dict object' has no attribute 'polygon'
Unfortunately I can't describe it any better.

@ckvsoft ckvsoft added Status: Triage This ticket requires input from someone of the Cura team Type: Bug The code does not produce the intended behavior. labels Feb 25, 2023
@ckvsoft
Copy link
Contributor Author

ckvsoft commented Feb 27, 2023

I discovered a difference.
Cura 5.2
writes:
;MESH:NONMESH

and Cura 5.3 Beta1 writes:
;MESH:NOMESH

into the gcode file

@ckvsoft
Copy link
Contributor Author

ckvsoft commented Feb 27, 2023

Ok
It is a Typo in Ultimaker/CuraEngine LayerPlan.cpp

@martinziener
Copy link

martinziener commented Mar 7, 2023

What's new is in the gcode the name=nomesh object gets added:

EXCLUDE_OBJECT_DEFINE NAME=3dbenchy_stl CENTER=169.468,167.494 POLYGON=[[137.691,152.25],[137.691,182.746],[197.304,182.746],[197.304,152.25]]
EXCLUDE_OBJECT_DEFINE NAME=NOMESH

in klipper the printer.exclude_object.objects | map(attribute='polygon') doesn't like the nomesh because it has no polygon attribute

@gillesguillemin
Copy link

This causes some major issues with Klipper indeed (like breaking Adaptive Meshing).

@ckvsoft
Copy link
Contributor Author

ckvsoft commented Mar 8, 2023

Its a Typo in CuraEngine
Ultimaker/CuraEngine#1855

@ckvsoft
Copy link
Contributor Author

ckvsoft commented Mar 8, 2023

A workaround is to use the search and replace post processing script

search NOMESH
replace NONMESH

@martinziener
Copy link

martinziener commented Mar 8, 2023

no, it's not (just) a spelling error
!! Error evaluating 'gcode_macro Adaptive_MESH:gcode': jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'polygon'

the adaptive_mesh macro contains
{% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %}
The object called NOMESH or NONMESH doesn't have a polygon attribute.

A workaround would be removing "EXCLUDE_OBJECT_DEFINE NAME=NOMESH" from the gcode

@martinziener
Copy link

I just found out that it's not cura who generates the EXCLUDE_OBJECT_DEFINE-gcode but that klipper adds it to the gcode at upload.

But why does klipper suddenly see two objects where before it only saw one?

@ckvsoft
Copy link
Contributor Author

ckvsoft commented Mar 8, 2023

For me, renaming works in the GCode that Cura generates. This must of course be done before sending it to the printer.
Thus will
EXCLUDE_OBJECT_DEFINE NAME=NOMESH not created at all.
In any case, an Exclude Object and an Adaptive mesh work for me.

Changing the GCode in Mainsail / Fluid does nothing, it has to be changed in the original gcode

@martinziener
Copy link

martinziener commented Mar 8, 2023

if i save the gcode that cura generates to a file, there is no mentioning of a EXCLUDE_OBJECT_DEFINE.
But uploaded it gets added: preprocess-cancellation. v0.2.0

@ckvsoft
Copy link
Contributor Author

ckvsoft commented Mar 8, 2023

if i save the gcode that cura generates to a file, there is no mentioning of a EXCLUDE_OBJECT_DEFINE. But uploaded it gets added: preprocess-cancellation. v0.2.0

Yes. In the saved gcode, change NOMESH to NONMESH
Then it works. You can let Cura do it right away.

@martinziener
Copy link

Ah ok, I didn't know that.
How can I let Cura write the EXCLUDE_OBJECT_DEFINE gcode lines?

@ckvsoft
Copy link
Contributor Author

ckvsoft commented Mar 8, 2023

Ah ok, I didn't know that. How can I let Cura write the EXCLUDE_OBJECT_DEFINE gcode lines?

No, just replace NOMESH

Cura -> Menu -> Extensions -> Post Processing -> Modify GCode

Then Add a Script -> Search and Replace
Search is NOMESH
Replace is NONMESH

thats all

@martinziener
Copy link

martinziener commented Mar 8, 2023

Right, I see!
In the cura gcode recplacing all the ;MESH:NOMESH to ;MESH:NONMESH prevents EXCLUDE_OBJECT_DEFINE NAME=NOMESH from ever getting created by the preprocess-cancellation-thingy in klipper

Thanks!

@henryabra
Copy link

@ckvsoft Worked for me! Thanks

@MariMakes MariMakes added Status: Under Investigation The issue has been confirmed or is assumed to be likely to be a real issue. It's pending discussion. and removed Status: Triage This ticket requires input from someone of the Cura team labels Mar 20, 2023
@MariMakes
Copy link
Contributor

Hey All,

Sorry, it took us a while to get back to you 😞
Thanks for the report!

I'll bring it up to the team to see what they can do to improve it.
It seems to be just a typo. Thanks for the investigation and the workaround @ckvsoft ❤️

Fingers crossed that we can share a fix soon🤞

@ckvsoft
Copy link
Contributor Author

ckvsoft commented Mar 24, 2023

fixed in CuraEngine #1855

@Extrusions3D
Copy link

SO DOES ANYONE KNOW WHY THE CURA 5.3.0 has been out for a minute but they have not released 5.3.1 with the typo fixed so we can continue using KAMP without modify g code?

@MariMakes
Copy link
Contributor

Hey @Extrusions3D,

Cura 5.3.1 should be available. 🎉
You can download it here https://github.com/Ultimaker/Cura/releases/tag/5.3.1

We had a delay because implementing the updated translations seemed to be more work than we anticipated. 😞
But that's resolved 💪

@Johnn201
Copy link

Johnn201 commented Jul 5, 2023

superslicer has this same issue Error evaluating 'gcode_macro BED_MESH_CALIBRATE:gcode': UndefinedError: 'dict object' has no attribute 'polygon'

@ckvsoft
Copy link
Contributor Author

ckvsoft commented Jul 5, 2023

That's already fixed in Cura. Superslicer does not depend on Cura.

@MariMakes MariMakes removed the Status: Under Investigation The issue has been confirmed or is assumed to be likely to be a real issue. It's pending discussion. label Jul 11, 2023
@hypersmc
Copy link

That's already fixed in Cura. Superslicer does not depend on Cura.

The fix is NOT just a typo... ALL of you have ignore the 1 user who acually found the issue.

martinziener found the issue and all of you never care about the actual fix.

Remove EXCLUDE_OBJECT_DEFINE NAME=NOMESH or if you renamed it EXCLUDE_OBJECT_DEFINE NAME=NONMESH
does the job.

@MariMakes
Copy link
Contributor

Hey @hypersmc,

We see that there is a rise in 3D printers that are running Klipper firmware. As UltiMaker employees we focus on the motion controller that our UltiMaker printers use. So we are less exposed to the finer details of Klipper. But we are interested and want Cura and Klipper to work smoothly together.

We are collecting input on how we can make Cura better for Klipper printers. If you have some feedback, we would love to hear about it here: #16012

@d3dorsett
Copy link

FYI: KAMP and GCode Preview work correctly for me in Cura 5.6.0, with fluidd (klipper)

@tipitorsten
Copy link

Cura 5.6. have incorect EXCLUDE_OBJECT_DEFINE NAME for me. Kamps doesent work with cura on klipper. orca slicer works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The code does not produce the intended behavior.
Projects
None yet
Development

No branches or pull requests

10 participants