Commit Graph

70 Commits

Author SHA1 Message Date
enricoturri1966
757b34f51f Fixed typo in its_collect_mesh_projection_points_above() and method TriangleMesh::slice() set as const 2021-05-20 09:09:19 +02:00
Vojtech Bubnik
fb262eaf93 Fixing 2021-05-19 16:51:25 +02:00
Vojtech Bubnik
5acbfa5ab5 Optimization of its_collect_mesh_projection_points_above(): Reserve points. 2021-05-19 13:59:34 +02:00
Vojtech Bubnik
ced430d5e5 Extracting its_collect_mesh_projection_points_above() out of
its_convex_hull_2d_above(), so that the projected points may get
collected over multiple volumes before applying Geometry::convex_hull()
2021-05-19 13:39:56 +02:00
Vojtech Bubnik
6a3ce5b0eb New functions: its_convex_hull_2d_above() 2021-05-19 11:35:42 +02:00
Vojtech Bubnik
25626f1c0a New utility function its_merge_vertices().
Implemented contour simplification inside slice_mesh_ex().
2021-05-18 17:57:55 +02:00
Vojtech Bubnik
39e17fd6b9 TriangleMeshSlicer: Got rid of admesh! 2021-05-18 15:05:30 +02:00
Vojtech Bubnik
499d8405e9 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
Vojtech Bubnik
c1ab2bcbd9 Merge branch 'vb_clipper_optimization' 2021-05-03 15:24:04 +02:00
Vojtech Bubnik
96a7a52715 Clipper optimization:
1) Removed the already commented-out scaling / unscaling when doing
   "safe offsetting"
2) Removed some of the "safe offsetting" at calls where it never was used.
3) Reworked Clipper & ClipperUtils to pass Polygons / ExPolygons / Surfaces
   as input parameters without conversion to ClipperLib::Paths. This
   should save a lot of memory allocation and copying.
4) Reworked conversions from ClipperLib::Paths & PolyTree to Polygons /
   ExPolygons to use the move operator to avoid many unnecessary allocations.
5) Reworked some "union with safe ofsetting" to "offset_ex", which should
   be cheaper.
2021-04-30 11:49:57 +02:00
Lukas Matena
fa71246ca4 Fix normal direction when exporting STL (#6406)
The export function does not depend on Model/ModelObject::mesh() family of functions,
changing them might break the already too brittle code.
2021-04-26 19:58:08 +02:00
Vojtech Bubnik
a1a50fe096 Marked the unsafe ClipperUtils offset functions with CLIPPERUTILS_UNSAFE_OFFSET
Replaced some of the unsafe offset functions with safe variants.
Please test the
1) print bed from STL function
2) concentric infill
2021-04-13 13:28:37 +02:00
tamasmeszaros
4baba84eb0 Exclude triangles of original interior mesh and drillholes from trimming 2021-03-08 17:38:10 +01:00
Vojtech Bubnik
e40485fc8a Fixed some clang warnings 2021-02-09 19:23:58 +01:00
Vojtech Bubnik
edf4fe7e4f 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
Vojtech Bubnik
f58ee46687 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
0f45ffbeef Fix missing initialization in TriangleMesh constructor 2020-09-10 14:52:26 +02:00
Vojtech Bubnik
9b7e2216e0 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
7769f9740b 64bit coord_t
Vec3i as a vertex index to TriangleMesh constructor
2020-03-25 14:35:41 +01:00
bubnikv
a394d821a6 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
7b9a62321d 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
5fd50a5b80 Ported test_trianglemesh from upstream slic3r, thanks @lordofhyphens 2019-10-15 13:49:28 +02:00
tamasmeszaros
234ccd8551 Add test obj and address for support under ground level if no elevation 2019-10-03 14:23:22 +02:00
bubnikv
dcb1875e40 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
d30229cc5f 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
297928fecc Fix build against system-provided qhull 2019-07-02 11:43:07 +02:00
bubnikv
f1965f46dd Further C++isation of the admesh library & TriangleMesh
(copy & move constructors / operators)
2019-06-13 16:33:50 +02:00
bubnikv
c1fed74010 Sharing TriangleMesh objects between the front end (UI) and back end
(background processing)
2019-06-11 17:08:47 +02:00
bubnikv
9023e0bcba admesh refactoring: Use Eigen vec3i for indexed triangles. 2019-06-10 21:14:58 +02:00
bubnikv
c073749ee1 admesh refactoring: separation of the shared vertices / indices
into an indexed_triangle_set structure
2019-06-10 18:30:54 +02:00
bubnikv
068263a62d 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
362c229a5c Refactored admesh to get rid of the error and fp members of stl_file. 2019-06-10 17:17:36 +02:00
bubnikv
e934e5550a Fix of the previous refactoring. 2019-06-10 11:04:09 +02:00
bubnikv
bbcb22248d Merge remote-tracking branch 'remotes/origin/master' into vb_admesh_fix 2019-06-06 21:01:19 +02:00
tamasmeszaros
bab4611ee7 Future-proof qhull dependency handling 2019-06-05 19:19:49 +02:00
bubnikv
0e26eb0aeb WIP: Admesh - replacement of C memory allocation with std vectors 2019-06-04 22:06:42 +02:00
bubnikv
3ebd5d94f6 Fix of mesh decimation (the admesh library).
Fixes "Unable to save project (#2445)"
2019-06-04 18:25:53 +02:00
Jason Tibbitts
298ab4df7f 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
7715725991 Merge branch 'master' into vb_wold_object_manipulation 2019-05-04 20:59:57 +02:00
bubnikv
0871ca2662 Fixed make_cylinder() / make_sphere() functions to produce meshes
without errors.
2019-05-04 14:03:50 +02:00
bubnikv
b0830d062b 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
13ee8c3bd5 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
8ad52f0461 Vojtech's improvements in the SLA preview cutting dialog. 2019-04-11 15:44:32 +02:00
Lukas Matena
579b44c479 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
85a6ac60de 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
380f5fbfa5 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
93798b9a5e 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
358ea1b1db 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
ab03a61901 Use number_of_parts for is_splittable
It's there, why not use it
2019-04-01 12:09:44 +02:00
Sijmen Schoon
7ee4009ef4 Move repaired check to find_unvisited_neighbors 2019-04-01 12:09:44 +02:00