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

Feature Request: Gcode processing plugin/language #3750

Open
lordofhyphens opened this issue Mar 11, 2017 · 10 comments
Open

Feature Request: Gcode processing plugin/language #3750

lordofhyphens opened this issue Mar 11, 2017 · 10 comments
Assignees
Labels
Milestone

Comments

@lordofhyphens
Copy link
Member

I've been thinking about libslic3r and some of the prerequisites that would be necessary to move it completely to C++, as well as some of the pitfalls with currently how post-processing scripts are done.

Presently, the only "universally" available post-processing script interface for Slic3r is Perl (as the interpreter is still necessary for the GUI). What I think may be useful to solve a few related test cases (arithmetic in start/end/toolchange gcode, etc), is to embed a scripting engine into libslic3r.

Ideally, it'd be lightweight and easy to use and wouldn't need to define our own parser (or deal with lex/yacc).

The first language that came to mind was Javascript/ECMAScript. It has several engines that have low/no external dependencies available with compatible licenses, and it's relatively straightforward to learn and use.

We could import the basic engine and provide interfaces to Slic3r's variables.

@lordofhyphens lordofhyphens added this to the 1.4.0 milestone Mar 11, 2017
@lordofhyphens lordofhyphens self-assigned this Mar 11, 2017
@a4jp-com
Copy link

Thank you for all your work @lordofhyphens

I like the current version because I can compile it myself and make small changes where I want them but if it is easy to compile a C++ version in Windows that's okay with me. ^^

One company I do 3D printing with moved to Simplify3D a year ago as the calculations in Slic3r of small objects didn't work out before for some reason. I'd love to test a few old files on this newer version of Slic3r though. I guess a lot has changed in a year.

@Patola
Copy link

Patola commented Mar 11, 2017

Javascript would have some appeal to web developers, but I think nowadays mindset is more geared towards python for these kinds of filters and embedded scripts.

I, for one, am very weary about the weird javascript typing and object system. That's why I usually stay away from it.

@lordofhyphens
Copy link
Member Author

lordofhyphens commented Mar 11, 2017 via email

@nathanielhudson
Copy link

nathanielhudson commented Mar 13, 2017

IMHO Javascript would be very nice.

Lua might also be a viable option without some of the weirdness typically associated with js, and it was specifically designed for this sort of use case. I also feel the Lua standard library is better suited to this sort of thing, and it's relatively simple to hook up to C/C++ programs.

@Patola
Copy link

Patola commented Mar 13, 2017

I find lua nice too.

@bubnikv
Copy link
Contributor

bubnikv commented Mar 14, 2017 via email

@gege2b
Copy link
Contributor

gege2b commented Mar 14, 2017

I didn't use LUA either but it seems to be a good candidate for this feature, as it is designed to be embeded in applications

@alranel
Copy link
Member

alranel commented Mar 14, 2017

Post-processing scripts don't generally use libslic3r, they just parse G-code independently so they can be written in any language.
Are you aware of a post-processing script using libslic3r?

By the way, I think we should just provide/encourage bindings for libslic3r from all the most popular languages.

@lordofhyphens
Copy link
Member Author

I mean an internal, lightweight scripting language, baked into our official frontend that is self-contained. We have that with Perl until we drop Perl from our frontend.

Extra requirements: Should also be difficult, if not impossible to do damage to people's systems with this language (earlier comments about perl and eval()).

@ghost
Copy link

ghost commented Apr 1, 2017

I agree with the comments about Lua. It can run arbitrary code inside a "sandbox" environment, and the sandbox is fairly easy to create, to remove things such as system calls and other undesirable features for a use case. It's also quite small and fast, so shouldn't get too in the way of real-time slicing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants