Commit Graph

87 Commits

Author SHA1 Message Date
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
Campbell Barton
303cecf139 spelling cleanup: tesselate -> tessellate (last of these found) 2012-03-20 22:56:26 +00:00
Campbell Barton
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
Sergey Sharybin
a3a6f30403 Boolean modifier:
- Fixed convex quad detection (in some special cases non-convex quad was detecting as convex)
- Do not add faces with zero area to the output object.

This should resolve #30395: Degenerated triangles from BMesh + Difference
2012-02-29 13:48:19 +00:00
Campbell Barton
47c373c7a9 style cleanup (mostly whitespace) 2012-02-27 10:35:39 +00:00
Campbell Barton
6ca7d82932 code cleanup: white space, spelling & ';;' end of lines. 2012-02-25 16:04:03 +00:00
Campbell Barton
2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
Sergey Sharybin
6825577cad Carve fixes and optimizations:
- Fixed memory lead in Carve_getIntersectedOperandMeshes
- Union manifolds only if they intersects second operand, leave manifolds
  which doesn't intersect second operand as-is.
2012-02-14 13:24:04 +00:00
Sergey Sharybin
b5f08e60be Carve: improved handling of meshes with interesting manifolds
Unioning of intersecting manifold tried to perform as little union operations
as possible, but there were some not totally correct assumption which lead to
cases when unioning of manifolds of some mesh might be happened when one of
mesh sets already had got intersecting manifolds.

This commit corrects this incorrect behavior.

Discovered this when was looking into #30175: Boolean Difference causes 2.62 RC1 crash.
2012-02-14 09:43:35 +00:00
Sergey Sharybin
32c4ade29c Fix #30159: Boolean modifier creating non-concave faces
Issue was caused by merging triangles into quads policy which used to think
triangulation of non-planar/non-concave quads happens by 1-3 diagonal which
isn't actually correct in some OpenGL implementations.

Added check for non-concave faces when merging triangles. It will work fine if
original faces are flat. In case if original faces aren't flat this check might
fail and triangulate face when it's not actually needed or merge triangles in
a way which leads to OpenGL artifacts.
2012-02-13 13:23:23 +00:00
Sergey Sharybin
b410d06dde Fix #29976: Carve Boolenas crasher with Solidify
Issue was caused by union policy needed to deal with cases when operand intersects
two or more intersecting meshes of another operand.

Changed this policy to run union operation only if there's actual intersection
between two meshes of the same object. Should work in general but it's still
possible to make it behave incorrect -- for example object consist of two groups
if concentric cubes which intersects each other.
2012-01-30 09:19:38 +00:00
Sergey Sharybin
3062798de3 Fixed some possible issues and access non-initialized variable in Carve BOP interface.
Discovered when was investigating some crashes caused by Carve's triangulator.
2012-01-27 08:17:53 +00:00
Sergey Sharybin
69b7a3a72a Fix compilation error caused by code cleanup 2012-01-23 17:49:56 +00:00
Sergey Sharybin
e079bf8184 Carve booleans: corrected copyright header 2012-01-23 17:44:19 +00:00
Sergey Sharybin
7d22a41a3d Carve booleans: code and style cleanup 2012-01-23 17:44:05 +00:00
Sergey Sharybin
690c77dd7d Fix #29934: New Carve library can't execute boolean operations in some cases
Issue was caused by left boolean operand consist of several intersecting manifolds
which make Carve triangulator confused and which can't be resolved in general case.
Added mesh pre-processing before actual applying boolean operator on it. This
preprocessing applies union operation on intersecting manifolds of the same object
so intersection edge loop with second object wouldn't confuse tesselator and correct
result would be returned.
Detecting of intersecting manifolds is based on AABB intersection check which leads
to some extra union operation called, but it's possible to speed things up from
Carve side so union operation of two not intersecting meshes would work faster.
Additional condition for running union for manifold is this manifolds intersects
AABB of second operand, so mesh topology wouldn't be changed at all in areas
where there's definitely no intersection between operands. It might be improved
so only manifolds which actually intersects second operand would be joined
together, but it'll slow things down a bit and prefer to do it only if it'll
be really a problem.

Additional change is fixed memory leak when boolean operation fails to run -
it was missed "delete" call if exception happens in Carve library.

From side effects of this change might be named boolean operation between
suzanne and another object: suzanne is consist of three intersecting open
manifolds, so this new meshes preprocessing leads to missed eyes in result
because of failure of merging two open manifolds. Don't think making suzanne
work for all setups should really be a goal, it's a bit crappy mesh for CSG
algorithms.
2012-01-23 17:43:41 +00:00
Sergey Sharybin
d2f8be9aa2 Fix for compilation error when using scons and carve is disabled 2012-01-23 08:48:52 +00:00
Sergey Sharybin
7a85ad51bf Compilation error when using mingw+scons
Error was caused by boost library (which doesn't seem to be working with Cycles too
when compiling with mingw). Switched mingw to use TR1 unordered collections. Also,
there was re-declaration of strcasecmp when mingw is used.

Additional changes are related on using own process spawning when BF_TOOLSET is set to
mingw. Seems to be working fine now (i've got too long command line error) and no
warning are supressing now (as it was told in comment for commented own process spawning).
2012-01-17 10:32:17 +00:00
Sergey Sharybin
e81f2853c8 Carve booleans library integration
==================================

Merging Carve library integration project into the trunk.

This commit switches Boolean modifier to another library which handles
mesh boolean operations in much stable and faster way, resolving old
well-known limitations of intern boolop library.

Carve is integrating as alternative interface for boolop library and
which makes it totally transparent for blender sources to switch between
old-fashioned boolop and new Carve backends.

Detailed changes in this commit:

- Integrated needed subset of Carve library sources into extern/
  Added script for re-bundling it (currently works only if repo
  was cloned by git-svn).
- Added BOP_CarveInterface for boolop library which can be used by
  Boolean modifier.
- Carve backend is enabled by default, can be disabled by WITH_BF_CARVE
  SCons option and WITH_CARVE CMake option.
- If Boost library is found in build environment it'll be used for
  unordered collections. If Boost isn't found, it'll fallback to TR1
  implementation for GCC compilers. Boost is obligatory if MSVC is used.

Tested on Linux 64bit and Windows 7 64bit.

NOTE: behavior of flat objects was changed. E.g. Plane-Sphere now gives
      plane with circle hole, not plane with semisphere. Don't think
      it's really issue because it's not actually defined behavior in
      such situations and both of ways might be useful. Since it's
      only known "regression" think it's OK to deal with it.

Details are there http://wiki.blender.org/index.php/User:Nazg-gul/CarveBooleans

Special thanks to:

- Ken Hughes: author of original carve integration patch.
- Campbell Barton: help in project development, review tests.
- Tobias Sargeant: author of Carve library, help in resolving some
                   merge stoppers, bug fixing.
2012-01-16 16:46:00 +00:00
Campbell Barton
e84c0980a3 correct indentation and some whitespace edits (no functional changes) 2011-11-11 13:09:14 +00:00
Campbell Barton
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Campbell Barton
5792bd7cc7 cmake: cleanup include paths, some duplicates and going up some unneeded dirs. 2011-07-17 09:11:13 +00:00
Campbell Barton
09da9d4393 cmake maintenance
blender_add_lib now takes a separate include argument to suppress warnings in system includes (mostly ffmpeg & python).
also only build wm_apple.c on apple+carbon configuration.
2011-05-31 01:15:44 +00:00
Nathan Letwory
bd610e942a doxygen: intern/boolop tagged 2011-02-25 10:32:33 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
Campbell Barton
89c617a116 remove nan-makefiles 2011-01-30 15:29:22 +00:00
Campbell Barton
5e382eb8e5 rename blenderlib to blender_add_lib 2010-12-22 23:09:30 +00:00
Campbell Barton
afacd18498 use lowercase for cmake builtin names and macros, remove contents in else() and endif() which is no longer needed. 2010-12-08 08:43:06 +00:00
Campbell Barton
e8397e6193 include headers in cmake source, added a script to check for consistency, reporting missing headers & C files.
this is important so IDE's using CMake integration always get blender headers. - QtCreator & MSVC for eg, probably others too.
2010-11-29 04:35:56 +00:00
Brecht Van Lommel
9a6fee750a Fix #24775: boolean modifier crash in rendering on Mac. Problem was that this
ran out of stack memory, now it passes some arguments by reference instead of
by value to use less stack space.
2010-11-26 03:26:57 +00:00
Campbell Barton
f383e2e0e6 Remove msvc build files which are not needed anymore. 2010-10-23 15:14:54 +00:00
Campbell Barton
c6976e7351 use explicit file paths for CMake rather then globing, This is recommended by cmake devs.
globbing vs explicit is discussed here.
http://www.cmake.org/pipermail/cmake/2008-December/025694.html

Practical implications are:
- developers need to keep CMakeLists.txt files up to date.
- Users wont get strange linking errors if they build after a file is added, since CMake detects CMakeLists.txt is modified and automatically reconfigure.
2010-10-23 04:05:55 +00:00
Campbell Barton
58683fa993 enable DEBUG define in CMake and scons, also change booleans debug option to BOP_DEBUG, which was used inconsistently, and had to add a define for superlu. 2010-10-18 11:21:22 +00:00
Campbell Barton
dea59cc5eb warning fixes and minor cmake changes. 2010-09-18 03:55:56 +00:00
Campbell Barton
4b40d73bfb rename most scons build targets to match cmake 2010-08-25 04:30:47 +00:00
Campbell Barton
6464718083 rename some cmake build targets 2010-08-24 04:29:23 +00:00
Campbell Barton
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Matt Ebb
a657920fba Fix for [#20229] Booleans crash on edge case. 2009-12-04 00:54:40 +00:00
Benoit Bolsee
1483fafd13 Merge of itasc branch. Project files, scons and cmake should be working. Makefile updated but not tested. Comes with Eigen2 2.0.6 C++ matrix library. 2009-09-24 21:22:24 +00:00
Brecht Van Lommel
874c29cea8 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
2009-04-20 15:06:46 +00:00
Chris Want
77e0199dc3 Makefile updates for Blender 2.5 (from GSR) 2009-03-19 01:50:45 +00:00
Nathan Letwory
93d9e7749d 2.5 / SCons
I did a very drastic cleanup for the different libgroups, there's now only a few left. It compiled with scons/msvc, will be testing in a bit on linux, too.
If you get any problems, please reply to this commit message on the taskforce ML.
2008-12-23 16:07:24 +00:00
Kent Mein
edc06b0b5b A couple of small fixes to clear up some warnings.
BOP_Merge2.cpp 
	had same variable name at different scopes so I renamed a couple.
resources.c 
	added include that was missing.  (This maybe was going to move? the old one
	was commented out)
ed_markers.c
	initalized a var that needed it.

Kent
2008-12-03 17:36:30 +00:00
Brecht Van Lommel
bdfe7d89e2 Merge of trunk into blender 2.5:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416

Issues:
* GHOST/X11 had conflicting changes. Some code was added in 2.5, which was
  later added in trunk also, but reverted partially, specifically revision
  16683. I have left out this reversion in the 2.5 branch since I think it is
  needed there.
  http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683
* Scons had various conflicting changes, I decided to go with trunk version
  for everything except priorities and some library renaming.
* In creator.c, there were various fixes and fixes for fixes related to the -w
  -W and -p options. In 2.5 -w and -W is not coded yet, and -p is done
  differently. Since this is changed so much, and I don't think those fixes
  would be needed in 2.5, I've left them out.
* Also in creator.c: there was code for a python bugfix where the screen was not
  initialized when running with -P. The code that initializes the screen there
  I had to disable, that can't work in 2.5 anymore but left it commented as a
  reminder.

Further I had to disable some new function calls. using src/ and python/, as
was done already in this branch, disabled function calls:
* bpath.c: error reporting
* BME_conversions.c: editmesh conversion functions.
* SHD_dynamic: disabled almost completely, there is no python/.
* KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled.
* text.c: clipboard copy call.
* object.c: OB_SUPPORT_MATERIAL.
* DerivedMesh.c and subsurf_ccg, stipple_quarttone.

Still to be done:
* Go over files and functions that were moved to a different location but could
  still use changes that were done in trunk.
2008-11-12 21:16:53 +00:00
Benoit Bolsee
61a83d2fba Add MSVC90 project files - part 3. Extern and Intern projects are merged in projectfiles_vc9\blender\blender.sln solution, you just need to open that solution to compile everything with VS2008. 2008-11-10 21:22:22 +00:00
Benoit Bolsee
8eec6cecc0 Add MSVC90 project files - part 1. 2008-11-10 15:36:58 +00:00
Benoit Bolsee
df2364ab1a Update MSVC project files for new Boolean Operation file (BOP_Merge2.cpp) 2008-08-03 21:57:52 +00:00
Campbell Barton
e632b966ec BKE_global.h include path wasnt correct. made boxpack2d.c a bit more
readable. no functionality changes.
2008-08-02 21:39:01 +00:00
Joshua Leung
451c00697f Scons - Mingw Compiling Fix:
When using BF_SPLIT_SRCS as a hack to get some of the larger libs compiled, there were some problems linking Blender related to some boolean calls. This commit tweaks the priorities for the boolean libs for the 'intern' group so that they get linked before the src libs are.
2008-08-02 00:25:50 +00:00
Ken Hughes
cb0aa467cd Tools
-----
New boolean merge algorithm.  The current code often does a poor job of merging tris and quads after the operation, resulting in many unnecessary faces.  This commit add a new algorithm which takes advantage of topology information saved in the interal BOP structures.

The file intern/boolop/intern/BOP_Misc.h has two #defines which control which algorithm(s) are compiled.  They are set now to compile both, with the new algorithm as the default.  The original algorithm can be enabled by setting the "rt" debugging button on the Scene panel (F10) to 100.

One note: the current boolean code still occasionally creates a non-manifold mesh from an operation on two manifold meshes.  The original merge algorithm would sometimes "close" these meshes and sometimes not.  The new algorithms behaves the same way, but sometimes closes a mesh the original would not and sometimes leaves open a mesh the original would close.  My fairly extensive tests did not indicate any significant difference in the percentage of final non-manifold meshes.
2008-07-31 18:37:03 +00:00