Commit Graph

55 Commits

Author SHA1 Message Date
Sergey Sharybin
87dcee0c0c Silence some annoying warnings when doing full build with strict flags
This mainly touches extern libraries and few debug-only places in intern.

Some summary:

- External libraries are not strict at all about missing declarations,
  so we can rather safely remove such warning together with other strict
  flags.

- Bullet has some static functions which are not used.
  Those were commented out.

- Carve now has some unused debug-only functions commented out as well.
  While we're on the way of getting rid of Carve, it makes sense to make
  things a bit cleaner for the time being.

- In LZMA we have some parts disabled which gives some set but unused
  variables which is rather correct.

- Elbeem had quite some variables set and never used because their usage
  is inside of debug-only code which is commented out.

Note about patching upstream libraries: surely one might say that we
have to make local patchset against this, but own experience says it
only gives extra work trying to merge such tweaks to a new upstream
version and usually it's just faster to re-apply such fixes again after
bundling new upstream library.
2016-04-22 10:59:15 +02:00
Sergey Sharybin
d9bf6b2d33 Carve: Silence 32/64 bit shit warning
There's no need to mix ints and size_t here at all
because all the values fits into integer.

It's unlikely we'll be re-bundling Carve, so didn't
bother with the patchset.
2016-02-20 14:06:10 +05:00
Sergey Sharybin
5feb3688fb Carve: Remove empty implementation files 2016-01-19 22:56:37 +01:00
Sergey Sharybin
5d99cde822 Remove SCons building system
While SCons building system was serving us really good for ages it's no longer
having much attention by the developers and started to become quite a difficult
task to maintain.

What's even worse -- there started to be quite serious divergence between SCons
and CMake which was only accumulating over the releases now. The fact that none
of the active developers are really using SCons and that our main studio is also
using CMake spotting bugs in the SCons builds became quite a difficult task and
we aren't always spotting them in time.

Meanwhile CMake became really mature building system which is available on every
platform we support and arguably it's also easier and more robust to use.

This commit includes:

- Removal of actual SCons building system
- Removal of SCons git submodule
- Removal of documentation which is stored in the sources and covers SCons
- Tweaks to the buildbot master to stop using SCons submodule
  (this change requires deploying to the server)
- Tweaks to the install dependencies script to skip installing or mentioning
  SCons building system
- Tweaks to various helper scripts to avoid mention of SCons folders/files
  as well

Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit

Reviewed By: campbellbarton, juicyfruit

Differential Revision: https://developer.blender.org/D1680
2016-01-04 14:20:48 +05:00
Campbell Barton
65574b0b03 cleanup: shebang lines
D888 by @sambler
2015-01-29 15:56:23 +11:00
Sergey Sharybin
f82f1513e0 Booleans: Boost is no longer a dependency for Carve
SCons is currently broken on my laptop, so can't test if it works for sure,
so please do tests of that.
2014-11-13 18:26:21 +05:00
Sergey Sharybin
0fe70b5e28 Fix T41360: Crash on Boolean Modifier
The issue was caused by the wrong attributes maps in certain
circumstances after union intersections.

Namely issue might have happen when more than one iteration of
union was happening and it was caused by the fact that new faces
might be allocated on the same address as freed face from the
old mesh.

Didn't find a nicer fix for this apart from correcting the whole
attributes map after each union step.

We could try removing attributes for the meshes which are getting
deleted, but in asymptotic it's gonna to give exactly the same
complexity as the current approach.
2014-08-11 20:55:52 +06:00
Nicholas Bishop
e123434397 Fix a few typos in carve-capi.h
The typos didn't cause any bug, but the mis-ordered parameter names in CarveExporter_InitGeomArrays were confusing.

Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D709
2014-08-05 10:36:45 -04:00
Sergey Sharybin
cba3498629 Update Carve to latest upstream version
This brings new copyright header which supports GPL2 and 3.

It wasn't really an issue before because we had agreement with
Tobias, but now it's all documented in sources.
2014-06-27 15:56:50 +06:00
Sergey Sharybin
e53c00a2db Add patchset to recent Carve changes
In the future i'd rather have this reported to an
upstream instead of adding local changes. It's really
easy to override this changes if patchset is not added
and this is to be fixed in upstream. Also the function
was never used so it was rather totally harmless warning
for us.
2014-06-11 13:13:36 +06:00
Jens Verwiebe
a6a38de4d6 Fix a warning in carve by initializing var 2014-06-10 20:15:50 +02:00
Sergey Sharybin
05fa464a25 Fix T40551: Boolean Modifier distorts UVs
Mapping to original face was never working 100% reliably actually,
now use more robust method for this.
2014-06-10 19:27:09 +06:00
Campbell Barton
b3972aeea0 Math Lib: optimize axis_dominant_v3_to_m3, approx 6x speedup
build the matrix directly rather then calculating with axis/angle

also remove unused function calc_poly_plane
2014-04-16 21:07:28 +10:00
Sergey Sharybin
ccf9afddba Fix T39608: Blender 2.70 crashes when performing union
This was a nasty bug which was caused by specific of how face-edge
attributes are stored in Carve.

Face pointer is used in the map key which works just fine in all
cases except for the cases when some face is getting freed after
it was stored in the map.

This might give real issues when new face is allocating because
it's possible new face would have the same address as the freed
one.

Such cases used to happen when union of separate manifolds is
needed for the operands AND jemalloc is enabled.

Solved by dropping attributes for the freed faces from the map.
Maybe not the fastest ever approach, but not sure how to make
it faster actually. Should work just fine. It only happens for
complex setups with intersecting manifolds in the operands.
2014-04-09 14:27:34 +06:00
Sergey Sharybin
f0106d2985 Unbreak carve build for clang
Based on D420
2014-03-28 14:41:04 +06:00
Sergey Sharybin
94379277dd Fix T39151: Boolean modifier freeze
This re-applied patch from 25cbd13 which was lost at some point
since missing patchset in series.

This revision is to be back-ported to the final release.
2014-03-13 15:40:55 +06:00
Sergey Sharybin
2e128baefd Fix T39111: Boolean assert failure on widows
In fact we had this change a while ago, not sue what happened.
2014-03-12 23:12:34 +06:00
Sergey Sharybin
a659d73b1d Added back code which was commented out for debug reasons
Also added a patchset for Carve's memory leak fix.
2014-03-05 14:52:00 +06:00
Sergey Sharybin
ef40e889ca Fix compilation error windows 2014-03-04 20:37:19 +06:00
Sergey Sharybin
34c7fd1a11 Fix T38918: Boolean modifier crashes when using specific topology
There were loads of issues in the code still which are mow likely fixed:

- Hole resolver hook had memory leak -- it didn't free face with holes
  when triangulating it.

- Original edge mapping didn't work correct. old code related on the fact
  that loop order is not changing when constructing the MeshSet class, but
  in fact it does change.

  Currently used edge map for this because it was easiest way to do it now,
  but after the release we're to change it. Main reason is that face mapping
  is not correct as well (and it was never correct actually). So we'll need
  to construct Mesh structures by our own to be sure we're using correct
  original index mapping.

- Carve might produce faces with ears, which is forbidden in Blender.
  it wasn't an issue in old integration because triangulation will remove
  the ears. So for now simply added ears removing back as a hook.

  But actual reason of the ears is to be investigated really.

  This hook will only work for NGons, quads are assumed not be able to
  have ears. So this additional hook shouldn't slow down things much.

- Carve's hole resolver produces duplicated faces in some cases. Still not
  sure what is the reason of this. Code here is not so much straightforward,
  this is to be investigated later.

  For now solved the issue as own hole resolver which checks for duplicated
  faces after the hole resolving.

  The additional checks here will only run if the mesh actually have hole
  and wouldn't introduce slowdown for faces which doesn't have holes.

- Made it so if edge user triangulation gets a split (for example, in cases
  when this edge intersects with the second operand) it wouldn't be dissolved.

  This prevents cases of crappy topology after dissolving in several cases.

- Edge dissolver didn't check for whether edge is a non-manifold. We couldn't
  really dissolve open manifold edges.

  The bad thing about this is that mesh triangulation might produce non-manifold
  edges and they wouldn't be dissolved. Not worst case in the world, but would
  be nice to have it solved somehow.

- Exporting mesh form Carve to Blender might have produced duplicated edges
  in cases when several non-manifold faces shared the edge. This is also fixed
  now.

- Mesh triangulation might have produced duplicated faces, which is really bad.
  Fixed by keeping a track on which faces we've created and skipping adding new
  triangle if we already have one.

This all might introduce some slowdown, but we're too close to the release now,
so would rather have it slower but robust. After the release we might look into
ways to speed things up.
2014-03-04 20:18:16 +06:00
Sergey Sharybin
6e970e1a33 Update patch for mesh_simplifier 2014-02-28 19:09:22 +06:00
Tamito Kajiyama
036d35dd24 Fix for MSVC 2008 compiler errors. 2014-02-25 01:16:52 +09:00
Sergey Sharybin
9643b2e5b5 Preserve non-flat faces in boolean modifier
This commit implements dissolving of edges which were used
to triangulate non-flat faces. This slows things down a bit
(around 5% on heave mesh with all faces triangulated).

We could improve speed of dissolve a bit here (so not a bell
to add an option for triangulation yet).

Also fixed wrong edge origindex mapping.
2014-02-24 18:10:33 +06:00
Sergey Sharybin
97b90d89f4 Fix T38637: Boolean produces faces with holes which isn't supported by BMesh
Simple fix -- use CarveHoleResolver hook for CSG which will split faces
containing holes.
2014-02-18 11:53:04 +06:00
Sergey Sharybin
7fb7ce789f Fix T38631: Blender crashes when selection faces after new boolean modifier
Own mistake in edges carve->blender export, didn't count them correct.
2014-02-14 14:26:26 +06:00
Jens Verwiebe
9185ab5d9c Fix scons compiling after carve changes 2014-02-13 23:21:13 +01:00
Sergey Sharybin
6a65161966 fixed an for loop variable type and delete operator in cave-utils.cc
Patch by wutzi (Benedikt Bergenthal), thanks!

Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D314
2014-02-13 20:09:51 +06:00
Sergey Sharybin
83617d24d5 Rework carve integration into boolean modifier
Goal of this commit is to support NGons for boolean modifier
(currently mesh is being tessellated before performing boolean
operation) and also solve the limitation of loosing edge custom
data layers after boolean operation is performed.

Main idea is to make it so boolean modifier uses Carve library
directly via it's C-API, avoiding BSP intermediate level which
was doubling amount of memory needed for the operation and which
also used quite reasonable amount of overhead time.

Perhaps memory usage and CPU usage are the same after all the
features are implemented but we've got support now:

- ORIGINDEX for all the geometry
- Interpolation of edge custom data (seams, crease)
- NGons support

Triangulation rule is changed now as well, so now non-flat
polygons are not being merged back after Carve work. This is
so because it's not so trivial to support for NGons and
having different behavior for quads and NGons is even more
creepy.

Reviewers: lukastoenne, campbellbarton

Differential Revision: https://developer.blender.org/D274
2014-02-13 17:16:53 +06:00
Sergey Sharybin
9896508e14 Fix compilation error with msvc2012 and 2013 as well 2014-01-31 15:33:48 +06:00
Sergey Sharybin
3d408e10a4 Correct typo in the patch file as well 2014-01-28 02:16:44 +06:00
Thomas Dinges
8870556def Fix compilation on Windows, syntax error. 2014-01-27 20:53:42 +01:00
Sergey Sharybin
efaadc3104 Attempt to fix compilation error with MSVC-2008 2014-01-28 01:37:41 +06:00
Sergey Sharybin
31d679b667 Update Carve to latest update
Fixes some issues with NaN vertices in special cases.
Also adds edge interpolation routines which are currently
unused but which are requires to implement edge CD interpolation.
2014-01-27 17:04:06 +06:00
Sergey Sharybin
113ff51476 Compilation error fix for NetBSD
Based on the patch from Joerg Sonnenberger.
2014-01-09 16:15:24 +06:00
Sergey Sharybin
dc71cb5f6e Fix Carve compilation on FreeBSD
Based on the patch from Marcus von Appen, thanks!
2013-11-28 14:00:10 +06:00
Sergey Sharybin
a628ca9ebe Update Carve to upstream version be054bc7ed86 2013-11-28 14:00:10 +06:00
Sergey Sharybin
1c14ead46f Carve bundler script cleanup
- random.hpp was only removed from actual include
  directory, but not from patches/files.

- Files list generator didn't ignore config.h file
  which in fact is not needed.
2013-11-28 14:00:10 +06:00
Campbell Barton
225c5fee6b move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)
remove MEM_sys_types.h which was a duplicate.
2013-05-28 19:35:26 +00:00
Sergey Sharybin
8a7ce9c924 Fix #34707: Blender crash on enabling of boolean modifier
Stupid mistake by my own with recent Carve update which
undid fix for MSVC STL library.
2013-03-21 08:47:18 +00:00
Sergey Sharybin
18fd4bd9f4 Update Carve to newest upstream version with some assorted fixes
Perhaps some warnings could be silenced, but not in mood of writing
local patches at this moment. They're all harmless anyway.
2013-02-25 10:02:43 +00:00
Sergey Sharybin
25cbd13d22 Workaround for deadlock in face/hole merge function in carve
which could happen in cases of degenerated faces.
2013-02-05 14:27:24 +00:00
Sergey Sharybin
c4a422ffbb Fix/workaround for carve aborts on windows
The issue was caused by passing start iterator larger than end iterator
to std::copy in triangulation module. It'll do nothing on linux but will
throw an exception on windows. Now behavior will be identical on both
platforms.

Proper solution would be to figure out why exactly this happened, but it's
easier to be forwarded to Tobias and we'll need to get rid of triangulation
anyway.

This should solve issues:
#30100: boolean intersect crashes blender
#33001: Crash on applying Boolean difference modifier
#33045: Boolean modifier crash with mirrored objects
2012-11-05 11:34:53 +00:00
Campbell Barton
dc8340fa33 correct some include dirs not being included as SYSTEM paths in cmake. 2012-10-02 03:18:48 +00:00
Campbell Barton
7180551890 fix for carve memory leak, update carve to hg bf36d92ff093
reported: http://code.google.com/p/carve/issues/detail?id=33
2012-07-04 16:07:01 +00:00
Sergey Sharybin
4bf0e61de2 Style cleanup: use 2 spaces for indentation in bundle scripts 2012-05-10 11:17:15 +00:00
Sergey Sharybin
cc5f18693f Carve and libmv bundling scripts: should work with svn checkout now 2012-05-10 11:08:25 +00:00
Sergey Sharybin
89b61e5430 Bundle updated version of carve. Should be no functional changes, small code cleanup 2012-05-10 11:00:02 +00:00
Antony Riakiotakis
4782522379 Add libMV and Scons support for MinGW-w64, patches by Caleb Joseph with slight modifications.
Thanks!
2012-04-24 12:57:58 +00:00
Sergey Sharybin
e3cfca511f Bundle latest version of Carve library which shall resolve compilation issues with clang 2012-03-12 21:18:28 +00:00
Campbell Barton
758c228263 update gpl header in cmake files 2012-02-11 04:05:00 +00:00