mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-01 13:12:38 -06:00
Vojtech likes to use Sublime on Windows to get the wheels rolling.
This commit is contained in:
parent
d392858ee3
commit
7da68c91a5
26 changed files with 408 additions and 864 deletions
|
|
@ -38,7 +38,7 @@ if (defined $ENV{BOOST_DIR}) {
|
|||
qw(C:\Boost\lib /lib);
|
||||
|
||||
if ($^O eq 'MSWin32') {
|
||||
for my $path (glob('C:\dev\boost*'), glob ('C:\boost*')) {
|
||||
for my $path (glob('C:\dev\boost*'), glob ('C:\boost*'), glob ('d:\src\boost*')) {
|
||||
push @boost_include, $path;
|
||||
push @boost_libs, $path . "/stage/lib";
|
||||
}
|
||||
|
|
@ -89,6 +89,9 @@ path through the BOOST_DIR environment variable:
|
|||
|
||||
EOF
|
||||
|
||||
# Enable C++ 0x features of the language.
|
||||
#push @cflags, qw(-std=c++0x);
|
||||
|
||||
if ($ENV{SLIC3R_DEBUG}) {
|
||||
# only on newer GCCs: -ftemplate-backtrace-limit=0
|
||||
push @cflags, qw(-DSLIC3R_DEBUG -g);
|
||||
|
|
|
|||
16
xs/MANIFEST
16
xs/MANIFEST
|
|
@ -28,6 +28,20 @@ src/libslic3r/ExtrusionEntity.cpp
|
|||
src/libslic3r/ExtrusionEntity.hpp
|
||||
src/libslic3r/ExtrusionEntityCollection.cpp
|
||||
src/libslic3r/ExtrusionEntityCollection.hpp
|
||||
src/libslic3r/ExtrusionSimulator.cpp
|
||||
src/libslic3r/ExtrusionSimulator.hpp
|
||||
src/libslic3r/Fill/FillBase.cpp
|
||||
src/libslic3r/Fill/FillBase.hpp
|
||||
src/libslic3r/Fill/FillConcentric.cpp
|
||||
src/libslic3r/Fill/FillConcentric.hpp
|
||||
src/libslic3r/Fill/FillHoneycomb.cpp
|
||||
src/libslic3r/Fill/FillHoneycomb.hpp
|
||||
src/libslic3r/Fill/Fill3DHoneycomb.cpp
|
||||
src/libslic3r/Fill/Fill3DHoneycomb.hpp
|
||||
src/libslic3r/Fill/FillPlanePath.cpp
|
||||
src/libslic3r/Fill/FillPlanePath.hpp
|
||||
src/libslic3r/Fill/FillRectilinear.cpp
|
||||
src/libslic3r/Fill/FillRectilinear.hpp
|
||||
src/libslic3r/Flow.cpp
|
||||
src/libslic3r/Flow.hpp
|
||||
src/libslic3r/GCode.cpp
|
||||
|
|
@ -129,6 +143,8 @@ xsp/Extruder.xsp
|
|||
xsp/ExtrusionEntityCollection.xsp
|
||||
xsp/ExtrusionLoop.xsp
|
||||
xsp/ExtrusionPath.xsp
|
||||
xsp/ExtrusionSimulator.xsp
|
||||
xsp/Filler.xsp
|
||||
xsp/Flow.xsp
|
||||
xsp/GCode.xsp
|
||||
xsp/GCodeSender.xsp
|
||||
|
|
|
|||
|
|
@ -123,6 +123,26 @@ sub clone {
|
|||
);
|
||||
}
|
||||
|
||||
package Slic3r::ExtrusionSimulator;
|
||||
|
||||
sub new {
|
||||
my ($class, %args) = @_;
|
||||
return $class->_new();
|
||||
}
|
||||
|
||||
package Slic3r::Filler;
|
||||
|
||||
sub fill_surface {
|
||||
my ($self, $surface, %args) = @_;
|
||||
$self->set_width($args{width}) if defined($args{width});
|
||||
$self->set_density($args{density}) if defined($args{density});
|
||||
$self->set_distance($args{distance}) if defined($args{distance});
|
||||
$self->set_dont_connect($args{dont_connect}) if defined($args{dont_connect});
|
||||
$self->set_dont_adjust($args{dont_adjust}) if defined($args{dont_adjust});
|
||||
$self->set_complete($args{complete}) if defined($args{complete});
|
||||
return $self->_fill_surface($surface);
|
||||
}
|
||||
|
||||
package Slic3r::Flow;
|
||||
|
||||
sub new {
|
||||
|
|
@ -215,6 +235,8 @@ for my $class (qw(
|
|||
Slic3r::ExtrusionLoop
|
||||
Slic3r::ExtrusionPath
|
||||
Slic3r::ExtrusionPath::Collection
|
||||
Slic3r::ExtrusionSimulator
|
||||
Slic3r::Filler
|
||||
Slic3r::Flow
|
||||
Slic3r::GCode
|
||||
Slic3r::GCode::AvoidCrossingPerimeters
|
||||
|
|
|
|||
|
|
@ -594,6 +594,10 @@ void union_pt_chained(const Slic3r::Polygons &subject, Slic3r::Polygons* retval,
|
|||
{
|
||||
ClipperLib::PolyTree pt;
|
||||
union_pt(subject, &pt, safety_offset_);
|
||||
if (&subject == retval)
|
||||
// It is safe to use the same variable for input and output, because this function makes
|
||||
// a temporary copy of the results.
|
||||
retval->clear();
|
||||
traverse_pt(pt.Childs, retval);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ MultiPoint::rotate(double angle)
|
|||
double s = sin(angle);
|
||||
double c = cos(angle);
|
||||
for (Points::iterator it = points.begin(); it != points.end(); ++it) {
|
||||
(*it).rotate(angle);
|
||||
double cur_x = (double)it->x;
|
||||
double cur_y = (double)it->y;
|
||||
it->x = (coord_t)round(c * cur_x - s * cur_y);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ struct Chaining
|
|||
|
||||
#ifndef sqr
|
||||
template<typename T>
|
||||
inline sqr(T x) { return x * x; }
|
||||
inline T sqr(T x) { return x * x; }
|
||||
#endif /* sqr */
|
||||
|
||||
template<typename T>
|
||||
|
|
@ -43,7 +43,6 @@ inline int nearest_point_index(const std::vector<Chaining> &pairs, const Point &
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
|
|
@ -64,12 +63,13 @@ Polylines PolylineCollection::chained_path_from(
|
|||
if (! no_reverse)
|
||||
c.last = src[i].last_point();
|
||||
c.idx = i;
|
||||
endpoints.push_back(c);
|
||||
}
|
||||
|
||||
Polylines retval;
|
||||
while (! endpoints.empty()) {
|
||||
// find nearest point
|
||||
int endpoint_index = nearest_point_index<double>(endpoints, start_near, no_reverse);
|
||||
assert(endpoint_index >= 0 && endpoint_index < endpoints.size() * 2);
|
||||
#if SLIC3R_CPPVER > 11
|
||||
retval.push_back(std::move(src[endpoints[endpoint_index/2].idx]));
|
||||
#else
|
||||
|
|
@ -80,6 +80,7 @@ Polylines PolylineCollection::chained_path_from(
|
|||
endpoints.erase(endpoints.begin() + endpoint_index/2);
|
||||
start_near = retval.back().last_point();
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
#if SLIC3R_CPPVER > 11
|
||||
|
|
|
|||
|
|
@ -445,7 +445,8 @@ TriangleMeshSlicer::slice(const std::vector<float> &z, std::vector<Polygons>* la
|
|||
float min_z = fminf(facet->vertex[0].z, fminf(facet->vertex[1].z, facet->vertex[2].z));
|
||||
float max_z = fmaxf(facet->vertex[0].z, fmaxf(facet->vertex[1].z, facet->vertex[2].z));
|
||||
|
||||
#ifdef SLIC3R_DEBUG
|
||||
#if 0
|
||||
// #ifdef SLIC3R_DEBUG
|
||||
printf("\n==> FACET %d (%f,%f,%f - %f,%f,%f - %f,%f,%f):\n", facet_idx,
|
||||
facet->vertex[0].x, facet->vertex[0].y, facet->vertex[0].z,
|
||||
facet->vertex[1].x, facet->vertex[1].y, facet->vertex[1].z,
|
||||
|
|
@ -457,7 +458,8 @@ TriangleMeshSlicer::slice(const std::vector<float> &z, std::vector<Polygons>* la
|
|||
std::vector<float>::const_iterator min_layer, max_layer;
|
||||
min_layer = std::lower_bound(z.begin(), z.end(), min_z); // first layer whose slice_z is >= min_z
|
||||
max_layer = std::upper_bound(z.begin() + (min_layer - z.begin()), z.end(), max_z) - 1; // last layer whose slice_z is <= max_z
|
||||
#ifdef SLIC3R_DEBUG
|
||||
#if 0
|
||||
// #ifdef SLIC3R_DEBUG
|
||||
printf("layers: min = %d, max = %d\n", (int)(min_layer - z.begin()), (int)(max_layer - z.begin()));
|
||||
#endif
|
||||
|
||||
|
|
@ -473,7 +475,8 @@ TriangleMeshSlicer::slice(const std::vector<float> &z, std::vector<Polygons>* la
|
|||
layers->resize(z.size());
|
||||
for (std::vector<IntersectionLines>::iterator it = lines.begin(); it != lines.end(); ++it) {
|
||||
size_t layer_idx = it - lines.begin();
|
||||
#ifdef SLIC3R_DEBUG
|
||||
#if 0
|
||||
// #ifdef SLIC3R_DEBUG
|
||||
printf("Layer %zu:\n", layer_idx);
|
||||
#endif
|
||||
this->make_loops(*it, &(*layers)[layer_idx]);
|
||||
|
|
@ -488,7 +491,8 @@ TriangleMeshSlicer::slice(const std::vector<float> &z, std::vector<ExPolygons>*
|
|||
|
||||
layers->resize(z.size());
|
||||
for (std::vector<Polygons>::const_iterator loops = layers_p.begin(); loops != layers_p.end(); ++loops) {
|
||||
#ifdef SLIC3R_DEBUG
|
||||
#if 0
|
||||
// #ifdef SLIC3R_DEBUG
|
||||
size_t layer_id = loops - layers_p.begin();
|
||||
printf("Layer %zu (slice_z = %.2f):\n", layer_id, z[layer_id]);
|
||||
#endif
|
||||
|
|
@ -712,7 +716,8 @@ TriangleMeshSlicer::make_loops(std::vector<IntersectionLine> &lines, Polygons* l
|
|||
}
|
||||
loops->push_back(p);
|
||||
|
||||
#ifdef SLIC3R_DEBUG
|
||||
#if 0
|
||||
// #ifdef SLIC3R_DEBUG
|
||||
printf(" Discovered %s polygon of %d points\n", (p.is_counter_clockwise() ? "ccw" : "cw"), (int)p.points.size());
|
||||
#endif
|
||||
|
||||
|
|
@ -833,7 +838,8 @@ TriangleMeshSlicer::make_expolygons(const Polygons &loops, ExPolygons* slices)
|
|||
ExPolygons ex_slices;
|
||||
offset2(p_slices, &ex_slices, +safety_offset, -safety_offset);
|
||||
|
||||
#ifdef SLIC3R_DEBUG
|
||||
#if 0
|
||||
// #ifdef SLIC3R_DEBUG
|
||||
size_t holes_count = 0;
|
||||
for (ExPolygons::const_iterator e = ex_slices.begin(); e != ex_slices.end(); ++e) {
|
||||
holes_count += e->holes.size();
|
||||
|
|
@ -1052,7 +1058,8 @@ TriangleMeshSlicer::TriangleMeshSlicer(TriangleMesh* _mesh) : mesh(_mesh), v_sca
|
|||
}
|
||||
this->facets_edges[facet_idx][i] = edge_idx;
|
||||
|
||||
#ifdef SLIC3R_DEBUG
|
||||
#if 0
|
||||
// #ifdef SLIC3R_DEBUG
|
||||
printf(" [facet %d, edge %d] a_id = %d, b_id = %d --> edge %d\n", facet_idx, i, a_id, b_id, edge_idx);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#ifdef SLIC3RXS
|
||||
#include <xsinit.h>
|
||||
#include <assert.h>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
|
|
@ -10,6 +11,8 @@ REGISTER_CLASS(ExtrusionPath, "ExtrusionPath");
|
|||
REGISTER_CLASS(ExtrusionLoop, "ExtrusionLoop");
|
||||
// there is no ExtrusionLoop::Collection or ExtrusionEntity::Collection
|
||||
REGISTER_CLASS(ExtrusionEntityCollection, "ExtrusionPath::Collection");
|
||||
REGISTER_CLASS(ExtrusionSimulator, "ExtrusionSimulator");
|
||||
REGISTER_CLASS(Filler, "Filler");
|
||||
REGISTER_CLASS(Flow, "Flow");
|
||||
REGISTER_CLASS(AvoidCrossingPerimeters, "GCode::AvoidCrossingPerimeters");
|
||||
REGISTER_CLASS(OozePrevention, "GCode::OozePrevention");
|
||||
|
|
@ -391,6 +394,7 @@ void from_SV(SV* poly_sv, MultiPoint* THIS)
|
|||
void from_SV_check(SV* poly_sv, MultiPoint* THIS)
|
||||
{
|
||||
if (sv_isobject(poly_sv) && (SvTYPE(SvRV(poly_sv)) == SVt_PVMG)) {
|
||||
// (MultiPoint*)SvIV((SV*)SvRV( poly_sv ))
|
||||
*THIS = *(MultiPoint*)SvIV((SV*)SvRV( poly_sv ));
|
||||
} else {
|
||||
from_SV(poly_sv, THIS);
|
||||
|
|
|
|||
|
|
@ -112,6 +112,14 @@ ExtrusionLoop* O_OBJECT_SLIC3R
|
|||
Ref<ExtrusionLoop> O_OBJECT_SLIC3R_T
|
||||
Clone<ExtrusionLoop> O_OBJECT_SLIC3R_T
|
||||
|
||||
ExtrusionSimulator* O_OBJECT_SLIC3R
|
||||
Ref<ExtrusionSimulator> O_OBJECT_SLIC3R_T
|
||||
Clone<ExtrusionSimulator> O_OBJECT_SLIC3R_T
|
||||
|
||||
Filler* O_OBJECT_SLIC3R
|
||||
Ref<Filler> O_OBJECT_SLIC3R_T
|
||||
Clone<Filler> O_OBJECT_SLIC3R_T
|
||||
|
||||
Flow* O_OBJECT_SLIC3R
|
||||
Ref<Flow> O_OBJECT_SLIC3R_T
|
||||
Clone<Flow> O_OBJECT_SLIC3R_T
|
||||
|
|
@ -214,6 +222,7 @@ GLVertexArray* O_OBJECT_SLIC3R
|
|||
Axis T_UV
|
||||
ExtrusionLoopRole T_UV
|
||||
ExtrusionRole T_UV
|
||||
ExtrusionSimulationType T_UV
|
||||
FlowRole T_UV
|
||||
PrintStep T_UV
|
||||
PrintObjectStep T_UV
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@
|
|||
%typemap{ExPolygonCollection*};
|
||||
%typemap{Ref<ExPolygonCollection>}{simple};
|
||||
%typemap{Clone<ExPolygonCollection>}{simple};
|
||||
%typemap{Filler*};
|
||||
%typemap{Ref<Filler>}{simple};
|
||||
%typemap{Clone<Filler>}{simple};
|
||||
%typemap{Flow*};
|
||||
%typemap{Ref<Flow>}{simple};
|
||||
%typemap{Clone<Flow>}{simple};
|
||||
|
|
@ -81,6 +84,9 @@
|
|||
%typemap{ExtrusionLoop*};
|
||||
%typemap{Ref<ExtrusionLoop>}{simple};
|
||||
%typemap{Clone<ExtrusionLoop>}{simple};
|
||||
%typemap{ExtrusionSimulator*};
|
||||
%typemap{Ref<ExtrusionSimulator>}{simple};
|
||||
%typemap{Clone<ExtrusionSimulator>}{simple};
|
||||
%typemap{TriangleMesh*};
|
||||
%typemap{Ref<TriangleMesh>}{simple};
|
||||
%typemap{Clone<TriangleMesh>}{simple};
|
||||
|
|
@ -223,6 +229,12 @@
|
|||
$CVar = (ExtrusionRole)SvUV($PerlVar);
|
||||
%};
|
||||
};
|
||||
%typemap{ExtrusionSimulationType}{parsed}{
|
||||
%cpp_type{ExtrusionSimulationType};
|
||||
%precall_code{%
|
||||
$CVar = (ExtrusionSimulationType)SvUV($PerlVar);
|
||||
%};
|
||||
};
|
||||
%typemap{FlowRole}{parsed}{
|
||||
%cpp_type{FlowRole};
|
||||
%precall_code{%
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue