Only visible edges are used to create the "sliding vector". The test used to detect whether edges were visible or not was working for solid shading, but useless in wire draw mode (as all edges are visible in this mode!)...
It was wrongly calculated bucket number per side in cases when some
of segments is filling the whole bounding box across some of dimension.
Solved by limiting buckets at least to 1 in such cases.
The GetWidth() and GetHeight() functions of the canvas' display area seem to give values that are both off by one for what OpenGL wants. Adding 1 to both values seems to fix the problem.
Made some minor optimization such as:
- Avoid using "%" operation in loops, replace with a check
for index "overflow".
- Use pre-computed values for scaling feather coordinates
to 0 .. 1 space.
This allowed to reach couple of milliseconds of boost.
Another change is to use higher number of buckets (up to 512).
This doesn't took significantly more memory (like uses only 10MB
of memory for average splines) and allows to have 30-50x boost
for average splines.
Use dynamically calculated number of buckets for this, to be
sure segments would fit two buckets.
Also fixed intersection detection in some cases when edge is
shared between two buckets -- it is possible that such edge
would cross third bucket and intersect edge from there.
- Initialize color management settings if creating new scene
- Copy settings from active scene if creating with copying settings
or if using other copy/link object settings
This also should fix issue with Export UV Layout operator
Real fix would be to find a point which is definitely now on loop
to be collapsed, but that's for a bit later. This commit should
remove possible stoppers.
This implements simple function which collapses internal loops
caused by self-intersections into a singularity.
This loops can't be removed because rasterizer expects points
of feather be aligned with points from spline itself.
When OpenMP is enabled, memory allocation needs to be protected.
Fixes bug [#32111] Memory management regression from svn_46520
projects.blender.org/tracker/index.php?func=detail&aid=32111&group_id=9&atid=498