Commit Graph

3397 Commits

Author SHA1 Message Date
Vojtech Bubnik
33b2478b69 Ported Infill unit tests from Perl to C++. 2022-05-02 14:34:50 +02:00
Vojtech Bubnik
d88e9634f5 Little more reduce of Perl bindings 2022-05-02 14:34:50 +02:00
Vojtech Bubnik
3687bc28d5 Some reduction of Perl dependencies on ClipperLib,
ported some ClipperLib polyline clipping tests to C++.
2022-05-02 14:34:50 +02:00
Vojtech Bubnik
7d02647ebf Removed various Point::ccw() and Point::ccw_angle() methods, they were
provided for Perl bindings and their semantic was confusing.
Implemented free function angle() to measure angle between two vectors.
Reworked Polygon::convex/concave_points(), changed the meaning of their
angle threshold parameter.
Removed some unused methods from Perl bindings and tests.
Reworked the "wipe inside at the external perimeter" function
after Point::ccw_angle() was removed.
2022-04-25 12:42:51 +02:00
tamasmeszaros
f1276332ba Fix compilation of perl xs on Windows with boost 1.78 2022-04-08 13:47:45 +02:00
Lukáš Hejl
81e9582761 Changed how the libasan library path is determined for Perl unit tests to work also on the build server.
On Centos 7 calling "gcc -print-file-name=libasan.so" returns a path to "ld script" instead of a path to a shared library.
2022-02-09 13:24:09 +01:00
Lukáš Hejl
1138c563b2 Added preload of library libasan.so for Perl unit tests. 2022-02-07 11:16:23 +01:00
Vojtech Bubnik
cc44089440 New BuildVolume class was created, which detects build volume type (rectangular,
circular, convex, concave) and performs efficient collision detection agains these build
volumes. As of now, collision detection is performed against a convex
hull of a concave build volume for efficency.

GCodeProcessor::Result renamed out of GCodeProcessor to GCodeProcessorResult,
so it could be forward declared.

Plater newly exports BuildVolume, not Bed3D. Bed3D is a rendering class,
while BuildVolume is a purely geometric class.

Reduced usage of global wxGetApp, the Bed3D is passed as a parameter
to View3D/Preview/GLCanvas.

Convex hull code was extracted from Geometry.cpp/hpp to Geometry/ConvexHulll.cpp,hpp.
New test inside_convex_polygon().
New efficent point inside polygon test: Decompose convex hull
to bottom / top parts and use the decomposition to detect point inside
a convex polygon in O(log n). decompose_convex_polygon_top_bottom(),
inside_convex_polygon().

New Circle constructing functions: circle_ransac() and circle_taubin_newton().

New polygon_is_convex() test with unit tests.
2021-11-16 10:15:51 +01:00
Vojtech Bubnik
7ff76d0768 New ClipperUtils functions: opening(), closing() as an alternative
for offset2() with clear meaning.
New ClipperUtils functions: expand(), shrink() as an alternative
for offset() with clear meaning.
All offset values for the new functions are positive.

Various offsetting ClipperUtils (offset, offset2, offset2_ex) working
over Polygons were marked as unsafe, sometimes producing invalid output
if called for more than one polygon. These functions were reworked
to offset polygons one by one. The new functions working over Polygons
shall work the same way as the old safe ones working over ExPolygons,
but working with Polygons shall be computationally more efficient.

Improvements in FDM support generator:
1) For both grid and snug supports: Don't filter out supports for which
   the contacts are completely reduced by support / object XY separation.
2) Rounding / merging of supports using the closing radius parameter is
   now smoother, it does not produce sharp corners.
3) Snug supports: When calculating support interfaces, expand the projected
   support contact areas to produce wider, printable and more stable interfaces.
4) Don't reduce support interfaces for snug supports for steep overhangs,
   that would normally not need them. Snug supports often produce very
   narrow support interface regions and turning them off makes the support
   interfaces disappear.
2021-10-14 09:11:31 +02:00
YuSanka
8d749d2a9e Fix for build 2021-10-06 13:49:03 +02:00
Vojtech Bubnik
8a2a9dba2f Eradicated admesh from TriangleMesh:
TriangleMesh newly only holds indexed_triangle_set and
TriangleMeshStats. TriangleMeshStats contains an excerpt of stl_stats.
TriangleMeshStats are updated when initializing with indexed_triangle_set.

Admesh triangle mesh fixing is newly only used when loading an STL.
AMF / 3MF / OBJ file formats are already indexed triangle sets, thus
they are no more converted to admesh stl_file format, nor fixed
through admesh repair machinery. When importing AMF / 3MF / OBJ files,
volume is calculated and if negative, all faces are flipped. Also
a bounding box and number of open edges is calculated.

Implemented its_number_of_patches(), its_num_open_edges()
Optimized its_split(), its_is_splittable() using a visitor pattern.

Reworked QHull integration into TriangleMesh:
    1) Face normals were not right.
    2) Indexed triangle set is newly emitted instead of duplicating
       vertices for each face.

Fixed cut_mesh(): Orient the triangulated faces correctly.
2021-09-20 17:12:22 +02:00
Vojtech Bubnik
58d8ab3dea Removed the PRUS format parser. WIP: admesh eradication:
stl_stats are newly only accessed by TriangleMesh::stats(),
most of the direct access to TriangleMesh::stl is gone with the exception
of parsing input files (3MF, AMF, obj).
2021-09-14 11:58:14 +02:00
Vojtech Bubnik
03b6048684 Follow-up to beee18f229
WIP to G-code export parallelization through pipelining:
Decoupled CoolingBuffer from GCode / GCodeWriter, ready to be
pipelined on a different thread.
2021-09-10 11:43:59 +02:00
Vojtech Bubnik
d154752c38 Commenting out untested and unused Polyline::simplify_by_visibility() 2021-09-03 16:21:44 +02:00
Vojtech Bubnik
03fce23570 Fixed Perl bindings 2021-08-27 15:05:18 +02:00
Lukas Matena
cf17d16481 Fixed Perl bindings 2021-07-14 16:02:04 +02:00
Vojtech Bubnik
0f3cabb5d9 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 16:57:05 +02:00
Vojtech Bubnik
70b4915f9c TriangleMeshSlicer: Got rid of admesh! 2021-05-18 15:05:30 +02:00
Vojtech Bubnik
308d6b7809 WIP: Reworked slicing
1) Slicing code moved to TriangleMeshSlicer.cpp,hpp from TriangleMesh.cpp,hpp
2) Refactored to use as little as possible of admesh.
2021-05-17 20:25:59 +02:00
YuSanka
b9910669e8 Fix of #2825 - Add the length of each filament used 2021-05-07 12:48:34 +02:00
Vojtech Bubnik
52b3c655ff Fixed Polygon::centroid()
Ported Polygon unit tests from Perl to C++.
2021-05-07 11:42:21 +02:00
Vojtech Bubnik
b5573f959b Refactoring for code clarity: Replaced this->m_xxx with m_xxx
as the m_ prefix already signifies a class local variable.
2021-05-06 14:43:36 +02:00
Vojtech Bubnik
f16d4953be Removing offset2 from Perl bindings and other minor cleanup. 2021-05-06 14:29:20 +02:00
Vojtech Bubnik
1c6333e557 Fixing Perl integration 2021-05-06 13:58:37 +02:00
Vojtech Bubnik
b8db1922f7 Fixing perl bindings 2021-05-05 17:03:11 +02:00
Vojtech Bubnik
714149dab2 WIP: Moving ownership of PrintRegions to PrintObjects. 2021-05-05 16:21:55 +02:00
Vojtech Bubnik
d21b9aa089 Fixing perl integration 2021-05-05 15:05:52 +02:00
Vojtech Bubnik
5764d8984c Fixed perl unit tests 2021-05-05 13:27:00 +02:00
Vojtech Bubnik
d1cfdcb49e Refactoring of StaticPrintConfig & derived classes:
1) Using boost::preprocessor to reduce code duplicities when defining
   new configuration values.
2) Implemented static hash() and operator== on StaticPrintConfig derived
   classes to support hash tables of instances thereof.
2021-04-26 18:37:10 +02:00
Vojtech Bubnik
9f4e9da5c6 Merge branch 'tm_vb_clipper_eigen' 2021-04-23 11:44:25 +02:00
Vojtech Bubnik
1d588dad90 Fixed Perl bindings of Clipper after Clipper was adapted to Slic3r::Point 2021-04-23 11:02:16 +02:00
Vojtech Bubnik
8d0950ce12 Convincing ClipperLib to use Slic3r's own Point type internally. 2021-04-21 20:15:49 +02:00
Vojtech Bubnik
bb8112f099 and the final Perl unit test fix 2021-04-21 15:47:28 +02:00
Vojtech Bubnik
dcfa1d10cf Yet another Perl test 2021-04-21 15:46:47 +02:00
Vojtech Bubnik
ee53894c40 Another last perl unit test fix 2021-04-21 15:43:41 +02:00
Vojtech Bubnik
c013b73308 Fixing perl unit tests 2021-04-21 15:38:00 +02:00
Vojtech Bubnik
a9c3d270e6 ConfigOptions: GUI type as enum, not string.
Fixing compilation error in the new Platform code.
Fixing one issue in FDM support after splitting the top/bottom
interface layers.
2021-03-15 09:55:57 +01:00
Vojtech Bubnik
f01f02154c Reworked the "new" bridging to respect the bridge_flow_ratio
by maintaining extrusion spacing, but modifying the extrusion width
and / or height.
2021-03-15 09:55:56 +01:00
Vojtech Bubnik
8e27e355c2 Fixing unit tests. 2021-03-15 09:55:56 +01:00
Vojtech Bubnik
65f5ac4f8a The perl binding is killing Vojtech 2021-02-18 11:47:06 +01:00
Vojtech Bubnik
b03c318ed7 Fixing the Perl bindings for the last time 2021-02-18 11:42:35 +01:00
Vojtech Bubnik
0b45b312f9 Finally the Perl binding fix arrived! 2021-02-18 10:39:46 +01:00
Vojtech Bubnik
ce8986348c Cooling buffer - fix of Perl bindings 2021-02-18 10:31:15 +01:00
Vojtech Bubnik
31bc52a5cb Fix of Perl integration after cooling buffer rework 2021-02-18 10:16:56 +01:00
Vojtech Bubnik
2e55898d78 Removal of not numerically robust libraries "poly2tree" and "polypartition".
Adjustment of GUI/3DBed.cpp,hpp to use the more stable triangulation algoritm
derived from SGI glut.
Fix of an extremely slow bridging calculation, caused by an extremely
slow bridged area detection function, of which the results were never used.
Fixes "slicing fails or takes too long #5974"
2021-02-09 18:36:28 +01:00
Vojtech Bubnik
73c9f939e0 Squash merge of lh_brim_rework,
brim separated to Brim.cpp,hpp
Refactored accessors to PrintObjectPtrs, PrintRegionPtrs, LayerPtrs,
SupportLayerPtrs for const correctness.
2021-02-03 15:12:53 +01:00
Vojtech Bubnik
d06aa60691 Fixing Perl bindings after update of Boost. 2021-01-15 19:47:51 +01:00
Vojtech Bubnik
a2959ec944 Fix of re-slicing with multiple regions.
This is a fix of a bug, which was in Slic3r forever, where raw slices
were not cached, but recalculated from classified regions, where
merging the regions did not produce the original contour reliably.
Fixes [2.3.0-beta2] Odd bad slicing related to infill (?) percentage #5407
2020-12-11 12:21:07 +01:00
Vojtech Bubnik
364300055e Fix of spiral vase mode with holes in the bottom: Holes in the bottom layers
(non-spiral vase layers) were being closed.
Fixes Bad slicing in vase mode (unexpected bridge and solid infill layers) #3326
Fixes Model with holes in the base does not slice properly in "Vase Mode" #5359
2020-12-09 14:54:26 +01:00
Lukáš Hejl
87879034f6 Merge remote-tracking branch 'origin/master' into lh_avoid_crossing_perimeters
# Conflicts:
#	src/libslic3r/MotionPlanner.cpp
#	src/libslic3r/libslic3r.h
2020-11-29 17:27:23 +01:00