Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I union multiple transparent SCNShape objects?

I'm adding multiple transparent SCNShape objects to an ARSCNSceneView scene.

  • These shapes are based on user input and should overlap.
  • They are all flat shapes made with UIBezierPath on the same plane
  • Shapes has to be transparent, so the user can see the camera input behind

The problem is that overlapping shapes are very visible, and I'd like it to show as a single shape - the union of all shapes.

Failed approaches:

  • Putting it under same node and use parent opacity.
  • Merging the UIBezier paths.
  • Blend modes
  • Transparency modes
  • Drawing using primitive triangles instead of UIBezierPath

Wanted vs current results

like image 583
Avishay Cohen Avatar asked Aug 20 '17 14:08

Avishay Cohen


1 Answers

You could have a look at VectorBoolean which is a swift library to deal with boolean operations like the union you are looking for. I haven't tried it myself but have heard some good things about it.

like image 105
Fortia Avatar answered Sep 28 '22 06:09

Fortia