2014-01-05 12:16:13 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
2015-12-07 23:39:54 +00:00
|
|
|
#include <xsinit.h>
|
2014-08-03 17:42:29 +00:00
|
|
|
#include "libslic3r/Flow.hpp"
|
2014-01-05 12:16:13 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::Flow} class Flow {
|
|
|
|
~Flow();
|
2014-06-11 23:00:13 +00:00
|
|
|
%name{_new} Flow(float width, float height, float nozzle_diameter);
|
2014-04-27 17:18:53 +00:00
|
|
|
Clone<Flow> clone()
|
|
|
|
%code{% RETVAL = THIS; %};
|
2014-01-05 12:16:13 +00:00
|
|
|
|
2021-03-08 13:29:23 +00:00
|
|
|
float width();
|
|
|
|
float height();
|
|
|
|
float nozzle_diameter();
|
|
|
|
bool bridge();
|
2014-06-11 23:00:13 +00:00
|
|
|
float spacing();
|
2018-02-12 17:16:10 +00:00
|
|
|
int scaled_width();
|
|
|
|
int scaled_spacing();
|
2014-06-11 23:00:13 +00:00
|
|
|
double mm3_per_mm();
|
2014-01-05 12:16:13 +00:00
|
|
|
%{
|
|
|
|
|
|
|
|
Flow*
|
2021-03-08 13:29:23 +00:00
|
|
|
_new_from_width(CLASS, role, width, nozzle_diameter, height)
|
2014-01-05 12:16:13 +00:00
|
|
|
char* CLASS;
|
|
|
|
FlowRole role;
|
|
|
|
std::string width;
|
|
|
|
float nozzle_diameter;
|
|
|
|
float height;
|
|
|
|
CODE:
|
|
|
|
ConfigOptionFloatOrPercent optwidth;
|
Support for forward compatibility of configurations, user and system
config bundles, project files (3MFs, AMFs). When loading these files,
the caller may decide whether to substitute some of the configuration
values the current PrusaSlicer version does not understand with
some reasonable default value, and whether to report it. If substitution
is disabled, an exception is being thrown as before this commit.
If substitution is enabled, list of substitutions is returned by the
API to be presented to the user. This allows us to introduce for example
new firmware flavor key in PrusaSlicer 2.4 while letting PrusaSlicer
2.3.2 to fall back to some default and to report it to the user.
When slicing from command line, substutions are performed by default
and reported into the console, however substitutions may be either
disabled or made silent with the new "config-compatibility" command
line option.
Substitute enums and bools only. Allow booleans to be parsed as
true: "1", "enabled", "on" case insensitive
false: "0", "disabled", "off" case insensitive
This will allow us in the future for example to switch the draft_shield
boolean to an enum with the following values: "disabled" / "enabled" / "limited".
Added "enum_bitmask.hpp" - support for type safe sets of options.
See for example PresetBundle::load_configbundle(...
LoadConfigBundleAttributes flags) for an example of intended usage.
WIP: GUI for reporting the list of config substitutions needs to be
implemented by @YuSanka.
2021-06-27 14:04:23 +00:00
|
|
|
optwidth.deserialize(width, ForwardCompatibilitySubstitutionRule::Disable);
|
2021-03-08 13:29:23 +00:00
|
|
|
RETVAL = new Flow(Flow::new_from_config_width(role, optwidth, nozzle_diameter, height));
|
2014-01-05 12:16:13 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
%}
|
|
|
|
};
|
|
|
|
|
|
|
|
%package{Slic3r::Flow};
|
|
|
|
%{
|
|
|
|
|
|
|
|
IV
|
|
|
|
_constant()
|
|
|
|
ALIAS:
|
2014-06-09 19:14:48 +00:00
|
|
|
FLOW_ROLE_EXTERNAL_PERIMETER = frExternalPerimeter
|
2014-01-05 12:16:13 +00:00
|
|
|
FLOW_ROLE_PERIMETER = frPerimeter
|
|
|
|
FLOW_ROLE_INFILL = frInfill
|
|
|
|
FLOW_ROLE_SOLID_INFILL = frSolidInfill
|
|
|
|
FLOW_ROLE_TOP_SOLID_INFILL = frTopSolidInfill
|
|
|
|
FLOW_ROLE_SUPPORT_MATERIAL = frSupportMaterial
|
|
|
|
FLOW_ROLE_SUPPORT_MATERIAL_INTERFACE = frSupportMaterialInterface
|
|
|
|
PROTOTYPE:
|
|
|
|
CODE:
|
|
|
|
RETVAL = ix;
|
|
|
|
OUTPUT: RETVAL
|
|
|
|
|
|
|
|
%}
|
|
|
|
|