[Soc-2017-dev] Weekly Report #12 - Silhouette Operator

Sebastian Witt W.Basti at gmx.de
Sat Aug 19 13:35:12 CEST 2017


**

*Weekly Report #12 - Silhouette Operator*

*

One week and ~800 Lines of code later all features are in. Now I will 
work on fixing Bugs and writing the documentation.

I invested a lot of extra time this week so a lot has been done:


Calculating interior and exterior vertices

Based on the intersection ring and the surface normals i developed a 
method to calculate whether vertices are inside the original mesh or 
outside.

This also takes multiple rings into account supporting complex 
intersections.

(3ab49cae0e8c 
<https://developer.blender.org/rB3ab49cae0e8c5e86c7e23a5a81ee322a1ef599bd>) 
(fa86bbb05428 
<https://developer.blender.org/rBfa86bbb054281c0b3911c08549f4781f5af3bd6d>)

Flooding Bugs

The method to calculate the vertices depends on a continuous 
intersection ring. Otherwise there is no in/outside. I tried two 
intersection methods and different tolerances.  I was able to improve it 
but errors still occur. Turns out: Cross PBVH-Node intersections have 
faulty bounding boxes. I can track this down to another bug I tried 
fixing last week but wasn’t successful yet.

(4c567c578ab1 
<https://developer.blender.org/rB4c567c578ab14596f640aea050645383bf21c056>)


After that I collected and copied all necessary data for final geometry 
generation. For the fillets I only need the two edge loops and the exact 
points on the intersection.

(30aea5e13e74 
<https://developer.blender.org/rB30aea5e13e74687fe30114c80af0f03c2957cf93>)


Generating the fillet geometry

The fillet geometry is generated in 3 steps:

 1.

    Find a “smooth” triangulation mapping between the two loops

 2.

    Calculate an intermediate step on the exact intersection

 3.

    Generate verts/edges/loops/polys


Step one took by far the longest time. I designed an Algorithm which 
decides a smooth triangulation dependent on multiple aspects.

  *

    Orientation, 180° should be connected to 180° on both rings

  *

    Position, closest points should be connected

  *

    Order, no crossing, maximise points connected


Depending on the triangulation the closest points on the exact 
intersection are calculated. With this results new vertices are added 
and edges, loops, polys with it.

(d0cb5c8fd964 
<https://developer.blender.org/rBd0cb5c8fd964675b35e67a2db8c127b9086f1166>) 
(b0b11017166f 
<https://developer.blender.org/rBb0b11017166fc379a0a6e7d3ecc097335e28580e>) 
(30d32fa602e2 
<https://developer.blender.org/rB30d32fa602e24525eb0f2441caa621b3ea597cb5>)


Clipping functionality

I added a subtract mode to the operator! Since the Silhouette 
intersection calculates which parts are on the inside and which are on 
the outside, flipping in and out results in a subtract mode. So with 
just a flip of a bool the silhouette operator now supports a “clipping 
brush” like behaviour.

(b77d3ecb5c94 
<https://developer.blender.org/rBb77d3ecb5c949cf9d2c3f2f30ee023b966fe73d8>)


I created a small gif which demonstrates the new methods:

http://imgur.com/a/mB7xm


Bugs

A lot of new code means a lotof new bugs. The operator rarely works 
currently. Now I will work as hard as possible to resolve bugs. Two or 
three big bugs are currently invalidating almost every second stroke. If 
I resolve those I expect the operator to run better.


So next week bug fixing and documentation!

*

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/soc-2017-dev/attachments/20170819/d340864b/attachment-0001.html>


More information about the Soc-2017-dev mailing list