Commit Graph

61 Commits

Author SHA1 Message Date
Vojtech Bubnik
53a5c23d0f 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
9142fcc109 WIP: admesh eradication
follow-up to 58d8ab3dea
2021-09-14 14:51:40 +02:00
tamasmeszaros
adb7fc5f43 Fix warnings when newer CMake is used.
project() call should always come AFTER cmake_minimum_required(). This caused various hard-to-debug issues when searching for packages. 

Newer CMake versions complain that compatibility is broken with v2.6
2021-08-20 13:42:10 +02:00
tamasmeszaros
997c446a05 SLA backend refactored, except Hollowing 2021-06-08 10:27:35 +02:00
Lukas Matena
d125c498b5 Fixed several locales issues on file import/export 2021-05-24 12:22:00 +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
d62aace663 Reduction on compiler warnings, mainly on MSVC.
Fix of the new gap_fill_enable flag: Take it into account when comparing
regions.
2021-02-10 17:29:07 +01:00
Vojtech Bubnik
38f01adaae Improved robustness of stl_fix_normal_directions(stl_file *stl)
by further C++isation of the legacy C code.
2021-02-05 14:54:05 +01:00
Megidd
5706c1f137 Replace deprecated Boost header in "admesh" 2020-10-12 11:34:31 +02:00
Vojtech Bubnik
b3e936bda3 Refactoring of adaptive cubic / support cubic:
1) Octree is built directly from the triangle mesh by checking
   overlap of a triangle with an octree cell. This shall produce
   a tighter octree with less dense cells.
2) The same method is used for both the adaptive / support cubic infill,
   where for the support cubic infill the non-overhang triangles are
   ignored.
The AABB tree is no more used.
3) Optimized extraction of continuous infill lines in O(1) instead of O(n^2)
2020-09-17 18:39:28 +02:00
Enrico Turri
ec805d1e1a Fixed crash while repairing imported model 2019-12-09 13:27:21 +01:00
Enrico Turri
0750cc8bdd Fixed normals transformation in functions stl_transform() 2019-11-19 11:43:20 +01:00
Lukas Matena
7da60b9f0b Fixing Linux build
GCC 4.8 does not fully support C++11 and in-class char array initialization
2019-09-27 11:31:16 +02:00
Lukas Matena
2fbc4c37fc Fixed memsetting non-trivially-copyable types
Types stl_stats, stl_normal and SurfaceFillParams should not be zeroed by memset
This is not correct and also triggered warnings on gcc
2019-09-24 17:09:07 +02:00
Jason Tibbitts
7f698d3b86 Relocate declaration of stl_internal_reverse_quads
On little-endian hosts, stl_internal_reverse_quads will be called before
it is declared.  Move the declaration up to the beginning of the file to
fix build breakage seen on an s390x host.
2019-09-24 08:54:35 +02:00
bubnikv
1836fd1f80 Another fix of admesh on big endian architectures, fixes #2879 2019-09-19 08:56:47 +02:00
bubnikv
0eea5fc0ac Merge remote-tracking branch 'remotes/origin/master' into dev 2019-09-12 10:19:09 +02:00
bubnikv
d5e6578bce Fix of 2.1.0-rc2 Fails to open "certain' STL files #2906 2019-09-12 10:16:52 +02:00
bubnikv
2e377cdbe2 Merge remote-tracking branch 'remotes/origin/master' into dev 2019-09-09 17:49:07 +02:00
bubnikv
a6c5f90dfa Fix of a regression big endian issue in admesh
fixes 2.1.0-rc build error in admesh (unusual architecture only) (#2879)
2019-09-09 09:18:53 +02:00
Enrico Turri
a5e8100a8e Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into dev 2019-09-06 17:53:17 +02:00
bubnikv
18d63e34e5 Fighting the ASCII STL import.
Fix of 2.1.0-rc: Loading MMU STL's results in object placement off the plater (#2868)
It has been broken with 9abef2241d
when trying to fix "Error on importing stl" #2813
2019-09-05 14:29:34 +02:00
Lukas Matena
3f67201fb9 Fixed couple of warnings
Turned several includes into forward declarations
Removed several sprintf calls in favor of std::to_string
2019-09-02 16:27:48 +02:00
bubnikv
43ff86311d The ASCII STL import was made more tolerant to non-standard input format,
namely:
1) Whitespaces are allowed at the end of lines
2) A freeform is allowed after "endloop", "endfacet" and "endsolid", if separated
from the keyword by a whitespace. Some ASCII STL exporters likely add their
annotations in there.

Fixes "Error on importing stl" #2813
2019-08-26 09:50:28 +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
bubnikv
bc46cd3036 Fix of the Undo / Redo for Cut.
Added some more operations (for example Rotation) to the Undo / Redo.
2019-07-05 19:46:48 +02:00
bubnikv
7667540d06 Merge branch 'vb_admesh_fix' 2019-06-18 08:54:50 +02:00
bubnikv
c75d35190f Removed unnecessary copy / move constructors / assignment operators. 2019-06-14 15:47:40 +02:00
bubnikv
93505406b3 Fix of admesh import due to boost::pool::destroy taking O(n).
Why on earth?!
2019-06-14 11:07: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
tamasmeszaros
ecff6b721d Build fix when boost is not in prefix/boost 2019-06-13 14:19:24 +02:00
bubnikv
2974a8eef4 Fix of previous commit 2019-06-11 17:15:07 +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
598370ceab admesh refactoring: Using boost::object_pool for linked list memory
allocation.
2019-06-11 09:29:32 +02:00
bubnikv
dc1a18f217 Fix of a typo. 2019-06-10 22:43:42 +02:00
bubnikv
9023e0bcba admesh refactoring: Use Eigen vec3i for indexed triangles. 2019-06-10 21:14:58 +02:00
bubnikv
4b5741c2d7 admesh refactoring: replaced various diagnostics outputs with boost::log 2019-06-10 19:45:38 +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
d2b1a6bd69 admesh refactoring: Move the hashing structure out of stl_file 2019-06-10 16:53:08 +02:00
bubnikv
e934e5550a Fix of the previous refactoring. 2019-06-10 11:04:09 +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
tamasmeszaros
6815ca85b7 Build system tweaks to get rid of cmake and boost warnings. 2019-05-30 17:48:32 +02:00
bubnikv
0092e54c95 Changed references to renamed github project
https://github.com/prusa3d/PrusaSlicer
2019-05-14 19:46:01 +02:00
bubnikv
05e1356a5e Merge branch 'master' of https://github.com/prusa3d/Slic3r 2019-05-07 15:45:17 +02:00
Enrico Turri
6e713c0c11 Workaround to fix crash reported in #2209 2019-05-07 15:09:15 +02:00
bubnikv
100f2edf99 Yet another template gymnastics 2019-04-29 16:59:31 +02:00