Slic3r/xs/xsp/ConditionalGcode.xsp
Joseph Lenox 202a90ff90 Math evaluation in gcode (#4157)
* Prototype gcode infix math, very basic.

* Adding exprtk math parser library, header only.
@ArashPartow
https://github.com/ArashPartow/exprtk@4e1315a87dcc99a1ccad21fae1def0c2d4913c0f

* Now evaluating strings with exprtk, only support no variables in input
strings.

* Moved executable code to cpp file, stubbed out xsp and let the testing begin...

* Added conditional gcode parser into export path, added tests.

* Added one more test to ensure that {if0} only removes up to newlines.

* Test failure to parse

* Add some compiler flags to compile out stuff from exprtk

* Fix debug messages to be more specific, don't use deleted stringstream = method.

* Trade expression speed for apparently around 50MB of object size.

* Removed an extra trim that was breaking existing tests.

* fix test

Fixes #3390
2017-10-20 21:40:05 -05:00

19 lines
278 B
Plaintext

%module{Slic3r::XS};
%{
#include <xsinit.h>
#include "libslic3r/ConditionalGcode.hpp"
%}
%package{Slic3r::ConditionalGCode};
%{
PROTOTYPES: DISABLE
std::string apply_math(std::string input)
CODE:
RETVAL = Slic3r::apply_math(input);
OUTPUT:
RETVAL
%}