Jump to content

Problem launching OpenScad from Cura plugin


Recommended Posts

Posted · Problem launching OpenScad from Cura plugin

I have a rather involved problem that is entirely beyond my skill to figure out.  I'm hoping that *someone* here can help.  I'll try to lay out the problem as clearly as possible.


I'm developing a plugin that relies on being able to launch OpenScad to automatically generate an STL file.  This worked fine for me in Cura 4.13.1, but not now with Cura 5.1.


I use Linux (Xubuntu), where Cura is only available as an AppImage.  I suspect this is the source of the problem, although I'm not positive.


OpenScad runs just fine when I launch it from a normal terminal.


My plugin runs OpenScad using the processing.run() function.  


Under Cura 4.13.1, OpenScad runs fine and generates STLs.  Under Cura 5.1, OpenScad fails with messages (see below) that suggest to me that it can't find the correct version of Qt it needs to run.  OpenScad seems to use Qt 5, while Cura 5.1 now uses Qt 6.


I would hope that, by launching OpenScad as a separate process, there wouldn't be any dependencies between it and Cura, but I'm guessing that OpenScad is stuck running within Cura's AppImage environment.


I've created a test plugin that does nothing other than attempt to launch OpenScad, so that I can rule out everything else.  The plugin simply creates a menu item that allows me to launch OpenScad and report any error messages.  Here's the command I'm using:


errorMessage = subprocess.run('openscad', capture_output=True, text=True, shell=False).stderr.strip()


and here are the error messages that result:


openscad: /tmp/.mount_curaUfAqOM/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/libboost_program_options.so.1.74.0)
openscad: /tmp/.mount_curaUfAqOM/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/libboost_regex.so.1.74.0)
openscad: /tmp/.mount_curaUfAqOM/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/libqscintilla2_qt5.so.15)
openscad: /tmp/.mount_curaUfAqOM/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/libQt5Widgets.so.5)
openscad: /tmp/.mount_curaUfAqOM/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/libQt5Network.so.5)
openscad: /tmp/.mount_curaUfAqOM/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/libQt5Core.so.5)
openscad: /tmp/.mount_curaUfAqOM/libstdc++.so.6: version `CXXABI_1.3.13' not found (required by /lib/x86_64-linux-gnu/libQt5Core.so.5)


Again, it appears that OpenScad is being launched inside the Cura AppImage sandbox and that's the source of the problem - since the AppImage environment doesn't have the correct Qt (and other) libraries, OpenScad fails.  Any idea if it's possible to launch OpenScad outside of the AppImage sandbox so that it can run normally?  Alternatively, is it possible for my plugin to include the needed libraries for Linux?


Again, this is a complicated problem.  Not sure if that entirely makes sense or if anyone can help.

  • Link to post
    Share on other sites

    Posted · Problem launching OpenScad from Cura plugin

    And, of course, after posting this, I just discovered that manually correcting LD_LIBRARY_PATH before executing OpenScad seems to allow the program to run normally.


    Solved, maybe?

  • Link to post
    Share on other sites

    Posted · Problem launching OpenScad from Cura plugin

    Yeah, okay.  Thanks for watching me talk to myself.


    It looks like the problem is that the Cura AppImage sets LD_LIBRARY_PATH to point to its own library directory.  Simply 'unset'ing LD_LIBRARY_PATH before executing OpenScad solves the issue for me.


    Nothing to see here.  Move along.

    • Like 1
    Link to post
    Share on other sites

    Posted · Problem launching OpenScad from Cura plugin

    Hi Brad and anyone else,


    "Long" time no seen..

    Missed this one, -not very active in here those days.


    Anyway, I'll think most people do not know how good your "tools" is for 3 D printing, esp. when it come to tuning different types of filament for optimal result.


    Well, here it goes:


    As Cura 5.0 and 5.1 arrived, you were asked to uninstall the "Auto Tower" plugin found under  the menu "Extension" in Cura and do a re installation of this plugin.


    As I'm using this plugin for tuning, I've never uninstalled Brads plugin cause it working perfect in Curas ver. 14.3.1 🙂


    When installing this plugin, you have to install OpenSCAD a freeware.


    (I'm going to install the new version after some more testing of 5.1)




    OpenSCAD version 2021.01

    Copyright (C) 2009-2021 The OpenSCAD Developers


    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

    Please visit this link for a copy of the license: GPL 2.0




    Here is some pictures of how it looks in Cura.


    Here is Cura 14.3.1



    This is how "Auto Tower" looks under "Extension" tab.

    Here you'll see all possible "Auto Tower" types that's generated to the heat bed by "OpenSCAD".



    First one is "Fan Tower" and you can define a few parameters as well, (same for the other "Auto Towers").



    First the "stl file" of the "Fan Tower" and ofc you van use preview as on any other model.



    Next is the "Retraction Towers", one for the distance and the other for the speed.



    Here is the "Retraction Tower" versus Speed.



    The last one I'll show is a PLA filament "Temperature Tower" ranging from (220 to 180) Deg. Celsius.



    Here you'll see there is a few of the most common filaments, but you can add and test out your favorite filament with great result.

    Hope this give some more interest in this tool.


    Thank you Brad.



    • Like 1
    Link to post
    Share on other sites

    • 4 months later...
    Posted · Problem launching OpenScad from Cura plugin

    Hi everyone, especially @bradk3.  I love this plugin!


    I am struggling with having the custom features work though.  I have installed OpenSCAD as a flat pack and as a debian source.  No matter what I do I can't get the plugin to see it.  I even have told it to go directly to the source (/usr/bin/openscad) and it just won't find it.


    Cura 5.2.1 is running in a flatpak, and I have used flatseal to open all the permissions but it just doesn't seem to want to access it.


    Does anyone have any thoughts?






  • Link to post
    Share on other sites

    Posted (edited) · Problem launching OpenScad from Cura plugin

    I, clearly, need to check in here more often.  


    Thank you for the write-up, @Torgeir!  That's incredibly kind and useful of you.  I'm very glad people are finding this plugin helpful!  I'm also relieved that it's still working with Cura 4.13.1, since I haven't had a chance to test it for a while.


    Thank you for the kind words and the help you've given me in the past!

    Edited by bradk3
    • Thanks 1
    Link to post
    Share on other sites

    Posted · Problem launching OpenScad from Cura plugin

    @Jmacwill, thank you for the kind words!  Again, I'm very glad that what started out largely as a way for me to procrastinate homework is useful for other people!


    Getting my plugin to find the openscad executable has been far trickier than I expected.  I'm not sure why it's failing in your case, though.  With openscad installed in /usr/bin, it should be in the path and the plugin should be able to find it by default.


    Can I ask a couple of questions?


    What version of openscad do you have?  I believe only the newest, 2021, version will work.  If you have the 2019 version installed, it is not supported.


    Can you run openscad from a terminal window by just typing 'openscad'?  Honestly, this really shouldn't matter since you've already tried specifying the full path to it, but I'm interested in understanding this better.


    I don't think my plugin provides any helpful error messages when trying to find openscad.  I'll see if I can change that.  In the meantime, I'll do some investigating on my own to see if I can figure out what's going wrong.


    Thank you for letting me know!

  • Link to post
    Share on other sites

    Posted · Problem launching OpenScad from Cura plugin

    Hi @bradk3


    Thanks for your help!  I actually can start Openscad from the command line.  It is also located in the /usr/bin directory.


    I am on openSCAD v 2021.01


    I have openscad installed from a deb file, and Cura is running via flatpack


    I have also taken flatseal and given cura full access to the file system, and still no love


    I am at a loss - I don't know how to troubleshoot it on my end - I would love to help you and figure this out.


    I am somewhat competent, I would be happy to debug on my end - but some gentle tutelage on your end would be needed to get me started.








  • Link to post
    Share on other sites

    Posted · Problem launching OpenScad from Cura plugin

    I always get OpenSCAD not installed trying to use AutoTowerGenerator v2.6.0 to create a custom temp tower.

    and tried setting OpenSCAD path, it gives me path not valid.

    D:\Program Files\OpenSCAD\

    Using Cura 5.4.0-beta.1 and OpenSCAD  2021.01on Windows 10 64bit

    but have both software installed on D:\Program Files,  not sure if that matters


  • Link to post
    Share on other sites

    Posted (edited) · Problem launching OpenScad from Cura plugin

    Hi @3dFirefly,


    Welcome in here.


    I'll think you'll need to install OpenScad to the C disk, but else as above, -cause of Windows..




    Edited by Torgeir
    Text error...
  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.4 stable released
        The full stable release of UltiMaker Cura 5.4 is here and it makes it easier than ever to remove brims and supports from your finished prints. UltiMaker S series users can also look forward to print profiles for our newest UltiMaker PET CF composite material!
          • Like
        • 58 replies
    • Create New...