Jump to content

Problem launching OpenScad from Cura plugin


bradk3
Go to solution Solved by Slashee_the_Cow,

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
    • Laugh 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

    License

    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

    Auto_Tower_Test_1.thumb.jpg.c4b6c4a28bd72e11322b08dd56667528.jpg

     

    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".

    Auto_Tower_Test_2.thumb.jpg.dd1c30d2a1867495bc4dd71c6d1618d6.jpg

     

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

    Auto_Tower_Test_3.thumb.jpg.84dc9901008af66274c80b03bc07385c.jpg

     

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

    Auto_Tower_Test_4.thumb.jpg.49b90b77317b3cb203c501546ee0925e.jpg

     

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

    Auto_Tower_Test_5.thumb.jpg.7afe735c95b5b47cae086493763cda7d.jpg

     

    Here is the "Retraction Tower" versus Speed.

    Auto_Tower_Test_6.thumb.jpg.a54ca1449d0bbddc9d08e8d07de85d01.jpg

     

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

    Auto_Tower_Test_7.thumb.jpg.f0499077a487c9f53ab0dc5824cc290e.jpg

     

    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.

     

    Torgeir

    • 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?

     

    Thanks

     

    Jonathan

     

  • 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.

     

    Thanks!

     

    Jonathan

     

     

     

  • 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..

     

    Thanks

    Torgeir

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

    Posted · Problem launching OpenScad from Cura plugin

    Please could I know how to enable OpenSCad to work with Autotowers generator 2.6.0?   I wish to make a tower for FOrmfutura's Flexifil that prints 200-230.     I have Cura 5.4.0      I am a novice and do not understand when people talk about flatback etc?   THanks

  • Link to post
    Share on other sites

    • Solution
    Posted · Problem launching OpenScad from Cura plugin
    9 minutes ago, medicalmodeller said:

    Please could I know how to enable OpenSCad to work with Autotowers generator 2.6.0?   I wish to make a tower for FOrmfutura's Flexifil that prints 200-230.     I have Cura 5.4.0      I am a novice and do not understand when people talk about flatback etc?   THanks

    Flatpacks have to do with Linux so if you're running Windows or macOS you don't have to worry about it.

     

    To set up the plugin, open Cura, go to Extensions > Auto Towers > Settings (it's right at the bottom). Then you just need to put in the full path to where the OpenSCAD executable is, in my case (probably the default) it's C:\Program Files\OpenSCAD\openscad.exe

     

    (This is assuming you have OpenSCAD installed already, if not, you can get it from here)

  • Link to post
    Share on other sites

    Posted · Problem launching OpenScad from Cura plugin

    Hello,

     

    I also had the problem under Windows 11 that Cura 5.5.0 kept calling the OpenSCAD path as not valid.

     

    I simply installed OpenSCAD in C:\OpenSCAD\ and not in C:\Program Files\OpenSCAD\.

    Now it works perfectly with Cura.

     

    Best Regards

     

    Dirk

  • Link to post
    Share on other sites

    Posted (edited) · Problem launching OpenScad from Cura plugin
    43 minutes ago, DirkBockemuehl said:

    Hello,

    I also had the problem under Windows 11 that Cura 5.5.0 kept calling the OpenSCAD path as not valid.

    I simply installed OpenSCAD in C:\OpenSCAD\ and not in C:\Program Files\OpenSCAD\.

    Now it works perfectly with Cura.

    Best Regards

    Dirk

    What is it with people and that text formatting?

     

    Anyway, you may need to put the path in quotes "C:\Program Files\OpenSCAD\openscad.exe" because it has a space in it. Sometimes it's a problem, sometimes it isn't. Sometimes it figures it out by itself, sometimes it doesn't.

     

    There's also what I like to think of more smartarse ideas (although really they're just a little more technical) like creating a directory symbolic link called ProgramFiles that leads to Program Files so you can use a path without a space in it (because the program will still see it as C:\ProgramFiles\whatever even though it's actually C:\Program Files\whatever

     

    Instructions available on request... but quotes usually do the job.

    Edited by Slashee_the_Cow
  • Link to post
    Share on other sites

    Posted (edited) · Problem launching OpenScad from Cura plugin

    Hi,

     

    i understand that with "quotes" or without quotes. "C:\Program Files\OpenSCAD\openscad.exe" or C:\Program Files\OpenSCAD\openscad.exe, but both wan't work to me!

     

    only C:\OpenSCAD\openscad.exe or "C:\OpenSCAD\openscad.exe" work fine to me.

     

    Drive letters don't seem to matter, the main thing is that it's not installed under C:\Program Files\ with or without quotes (Cura automatically inserts quotes). Nevertheless, every time I restart Cura I have to go to Auto Tower, Settings and press OK, then it works... for whatever reason!

     

     

    Edited by DirkBockemuehl
  • Link to post
    Share on other sites

    Posted · Problem launching OpenScad from Cura plugin

    Try reinstalling the plugin. If OpenSCAD is installed in its default location the plugin should be able to find it automatically (but it didn't for me).

     

    Also, please stop it with the formatted text. You don't need to yell. I'm assuming to actually get it you're copying and pasting from something else, but when you paste it in here there should be a bar that comes up at the bottom of the text box offering to paste it as plain text instead, or you can hold CTRL and right click in the text box to get the option to "Paste without formatting". It irks me and I'm a lot less inclined to help people who are doing that unnecessarily.

    • Like 1
    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.8 beta released
        Another Cura release has arrived and in this 5.8 beta release, the focus is on improving Z seams, as well as completing support for the full Method series of printers by introducing a profile for the UltiMaker Method.
          • Like
        • 1 reply
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Thanks
          • Like
        • 3 replies
    ×
    ×
    • Create New...