Commit Graph

55 Commits

Author SHA1 Message Date
Vojtech Bubnik
067cde85f1 WIP Refactoring of exceptions:
1) All slicer's exceptions are now derived from Slic3r::Exception.
2) New exceptions are defined for slicing errors.
3) Exceptions are propagated to the Plater to show.
It remains to modify the slicing back-end to throw the new SlicingError
exceptions instead of std::runtime_error and to show the other exceptions
by a message dialog instead of a notification.
2020-09-14 18:03:22 +02:00
Lukáš Hejl
e55d184a7d Fix missing initialization in TriangleMesh constructor 2020-09-10 14:52:26 +02:00
Vojtech Bubnik
b101a8e266 Fixes of the offset curves from Voronoi diagram.
The offset curve extractor is already quite usable,
though singular cases are still not covered yet
when the offset curve intersects or nearly intersects
a Voronoi vertex.

Removal of the PRINTF_ZU "%zu" Visual Studio printf compatibility macro.
Fixes of a contours self intersection test for collinear segments.
SVG exporter now exports white background, so that the GNOME Eye viewer is usable.
2020-06-16 13:15:48 +02:00
bubnikv
c27297f6cc 64bit coord_t
Vec3i as a vertex index to TriangleMesh constructor
2020-03-25 14:35:41 +01:00
bubnikv
4e11552da9 Spiral vase improvements and bugfixes.
Fixes Connecting / expanding Bottom Layers to Vase Perimeter #253
Fixes Slicing error in vase mode #452
Fixes Slicing Issue (Vase Mode, 0.6mm dmr nozzle) #1887
Fixes Top fill pattern isn't used in spiral vase mode #2533
Fixes Cisar's vase doesn't slice correctly, creates artefacts #3595

When the model is sliced, all the contours are newly oriented
counter-clockwise (even holes), merged and then only the largest area
contour is retained. In perimeter generator, if the largest contour
splits into multiple perimeters, newly only the largest area perimeter
is retained in spiral vase mode. These two changes solve #3595 and similar.

The infill is newly calculated only for the bottom solid layers
if the spiral vase mode is active (removes various unwanted infill
along the vase walls), and the last bottom solid layer is switched
to a top solid pattern (solves #2533).

The thin walls are newly enforced to be disabled in spiral vase mode,
and the "ensure vertical shell wall" is enforced in spiral vase mode
to extend the bottom of the vase to the vase hull (fixes #253).
2020-02-08 21:36:43 +01:00
tamasmeszaros
f8a5796ca5 add mesh simplification.
SPE-1072 
Working but flipped normals with the interior.
Testing on treefrog passed
Oversampling for hollowed mesh should not be less than 3x
Flip back normals after simplify and remove redundant test code.
2020-01-23 10:58:18 +01:00
bubnikv
c99e7cb0df Ported test_trianglemesh from upstream slic3r, thanks @lordofhyphens 2019-10-15 13:49:28 +02:00
tamasmeszaros
c4d50ea639 Add test obj and address for support under ground level if no elevation 2019-10-03 14:23:22 +02:00
bubnikv
cd95b52dcd Undo / Redo memory conservation strategy: Release recoverable data
starting from the objects of lowest ObjectID.
(convex hulls are recoverable as well as the indexed triangle sets
inside the TriangleMeshes or the triangle connectivity information).

Now the top most snapshot (the temp one taken before Undo jump) will
never be released.
2019-07-18 11:51:06 +02:00
bubnikv
3a74e7ab69 WIP: Undo / Redo memory limiting by releasing the least recently
used snapshots. Memory limit set to 10% of physical system memory.
2019-07-17 15:48:53 +02:00
Vojtech Kral
f09fb92b61 Fix build against system-provided qhull 2019-07-02 11:43:07 +02:00
bubnikv
9379fedd43 Further C++isation of the admesh library & TriangleMesh
(copy & move constructors / operators)
2019-06-13 16:33:50 +02:00
bubnikv
0bb8ee149e Sharing TriangleMesh objects between the front end (UI) and back end
(background processing)
2019-06-11 17:08:47 +02:00
bubnikv
af5017c46c admesh refactoring: Use Eigen vec3i for indexed triangles. 2019-06-10 21:14:58 +02:00
bubnikv
6defabea53 admesh refactoring: separation of the shared vertices / indices
into an indexed_triangle_set structure
2019-06-10 18:30:54 +02:00
bubnikv
65238a89b1 admesh refactoring: Removed the shared_vertices counter as it is now
contained inside v_shared std::vector
2019-06-10 17:36:15 +02:00
bubnikv
a1c38794fb Refactored admesh to get rid of the error and fp members of stl_file. 2019-06-10 17:17:36 +02:00
bubnikv
025f86ca3f Fix of the previous refactoring. 2019-06-10 11:04:09 +02:00
bubnikv
7dd842b294 Merge remote-tracking branch 'remotes/origin/master' into vb_admesh_fix 2019-06-06 21:01:19 +02:00
tamasmeszaros
6136fe7d92 Future-proof qhull dependency handling 2019-06-05 19:19:49 +02:00
bubnikv
8da54139c4 WIP: Admesh - replacement of C memory allocation with std vectors 2019-06-04 22:06:42 +02:00
bubnikv
3ab886b747 Fix of mesh decimation (the admesh library).
Fixes "Unable to save project (#2445)"
2019-06-04 18:25:53 +02:00
Jason Tibbitts
ef028cd8b1 Use generic qhull include location
Currently the qhull includes are referenced absolutely, but the compiler
is always called with the src directory in the include path and so it
should be safe to specify a more generic path.
2019-05-22 10:29:54 +02:00
bubnikv
31e724abac Merge branch 'master' into vb_wold_object_manipulation 2019-05-04 20:59:57 +02:00
bubnikv
e515ef4fbe Fixed make_cylinder() / make_sphere() functions to produce meshes
without errors.
2019-05-04 14:03:50 +02:00
bubnikv
6526a8fcaf WIP: Transformation of instances in world coordinate space:
Ulocking the "anisotropic" scaling checkbox will bake the transformation
into meshes to allow for scaling in world axes.

Optimized and templated the stl_transform functions, now also available for 3x3 matrices.
The Canvas3D::reload_scene() now maintains selection even if all volumes of an instance changed their IDs.
2019-04-26 17:28:31 +02:00
Lukas Matena
f33e9bf609 TriangleMeshSlicer is now initialized by const-pointer to the mesh, responsibility for calling require_shared_vertices is left to the caller 2019-04-16 09:04:04 +02:00
bubnikv
4a210aeecf Vojtech's improvements in the SLA preview cutting dialog. 2019-04-11 15:44:32 +02:00
Lukas Matena
bbda1896f9 The gizmo is now able to triangulate and show the cut, the triangulated cut is cached 2019-04-08 10:31:19 +02:00
Enrico Turri
a9223aeb5f Follow-up of 763a91e2ca -> take in account of ModelObject::origin_translation when saving parts and modifiers to stl 2019-04-05 10:08:34 +02:00
bubnikv
382326ffc8 Fixed FFF slicing of meshes with left hand oriented transformations applied.
Slight optimization of FFF slicing - optimized copy of an object with just
a single volume.
2019-04-03 11:12:03 +02:00
bubnikv
fbce7b001b Some optimizations of "Fix crash on splitting some models #2042"
replaced std::vector<bool> with std::vector<unsigned char>
as std::vector<bool> is a specialized version optimized for memory,
not speed (8 bools are packed into a single boolean).
The triangle neighbor traversal was optimized to not push visited
or non-neighbors into the queue.
2019-04-01 14:50:40 +02:00
bubnikv
d728f4be5e Revert "Use number_of_parts for is_splittable"
It is too dangerous to rely on the admesh flag without inspecting the
admesh code line by line and a through test.

This reverts commit cd3cec3e45.
2019-04-01 12:27:45 +02:00
Sijmen Schoon
cd3cec3e45 Use number_of_parts for is_splittable
It's there, why not use it
2019-04-01 12:09:44 +02:00
Sijmen Schoon
4a9e05194c Move repaired check to find_unvisited_neighbors 2019-04-01 12:09:44 +02:00
Sijmen Schoon
69199215b0 Fix a bunch of warnings 2019-04-01 12:09:44 +02:00
Sijmen Schoon
19dc89bfab Clean up and fix TriangleMesh::split and relatives 2019-04-01 12:09:44 +02:00
bubnikv
18025cc669 Reworked the command line interface based on the current state
of the upstream.
Thanks @alexrj, @lordofhyphens for the original code of slic3r.cpp
2019-03-13 15:44:50 +01:00
bubnikv
c482933845 Fixed a regression issue in the triangle mesh slicing code, where
a broken contour was not glued together using the closest neighbors.
2019-03-11 17:18:38 +01:00
bubnikv
e3cba0a65a Introduced the "slice_closing_radius" to define, how large gaps
will be closed after triangle mesh slicing.
The value is set to 0.049 by default, which corresponds to the hard
coded default in Slic3r-1.41.3.

See issues #520 #820 #1029 #1364 for the reference of why we need
the parameter for being able to print some specific models.
2019-03-01 17:53:02 +01:00
bubnikv
d0553ece0e Extended tesselation wrapper for other 3d and 2d point types. 2019-02-08 09:26:48 +01:00
bubnikv
8982664551 Improved stability (fixed crashes) of the Cut by plane function by
replacing the cut triangulation with freeglu tesselator.
Added performance tracing output of the Cut by plane function.
Added wait cursor to split to parts / objects, object cut, save to AMF/3MF.
2019-02-05 20:23:24 +01:00
bubnikv
588c07c12a Performance improvements:
Lazy "Place on face" gizmo update.
Caching of MeshObject::raw_mesh_bounding_box() for the object size display.
ModelObject::bounding_box(), raw_mesh_bounding_box(), full_raw_mesh_bounding_box() will not copy the mesh.
TriangleMesh::transformed_bounding_box(const Transform3d &trafo) will not copy the mesh data.
get_options_for_bundle() will not return reference to temp value
is_splittable() calls cheap mesh.has_multiple_patches()
2019-01-26 18:51:34 +01:00
bubnikv
49487c16e6 Improvements of the triangulation of SLA layer preview. 2019-01-24 19:08:58 +01:00
bubnikv
0af11c51e3 Fixed update on reset of the variable layer height profile.
Fixed update of the layer height profile on PrintObject when changing profiles.
Fixed crash due to the layer height editing refactoring & wipe tower.
2019-01-23 14:00:03 +01:00
bubnikv
befccb0734 Fixed assert in mesh slicing code. 2019-01-14 19:39:45 +01:00
bubnikv
cf8e4fd7b0 Merged some of the late changes on slicing robustness
from the 1.41.2 (stable) to the current 1.42.0-alpha3
This should fix a number of errors reported (#1562, #1592, #1614, #1633)
2019-01-14 11:06:52 +01:00
bubnikv
2b9f52c33c Set a safety offset on a freshly sliced mesh to 0.0001
to satisfy GH #520, #1029, #1364
This change needs to be tested throughly on a large data set of meshes.
2018-12-12 10:29:42 +01:00
bubnikv
5ea8df0ca0 Manual merge of the TriangleMesh.cpp from the stable branch. 2018-12-12 10:02:01 +01:00
bubnikv
74ba1eaa16 WIP: Support of SLA suport & pad GLVolumes, couple of fixes. 2018-11-17 17:23:56 +01:00