1

I'm using csg.js with three.js and it seems it only supports 3D CSG. Check this

I would like to intersect and union 2D (three.js)geometries. Is there any way I can do 2D CSG with three.js ?

hyewon330
  • 45
  • 1
  • 12

1 Answers1

1

The thing you must consider is that planes are infinitely thin. So when 2 planes intersect, you'll get a one-dimensional line, which has no faces to render. If you use a 2D plane with a solid, it might still not work, since one of the inputs is not a solid and the plugin name suggests it works on solids.

Take into consideration what types of output you'll get when two types of geometry intersect:

If you want a plane as output, I recommend you intersect with a very thin box, for example a 2 x 2 x 0.01, instead of using real 2D planes. Think of it as a cookie-cutter.

Also, make sure you're using manifold geometry, instead of non-manifold, which you can read up on here: https://blender.stackexchange.com/questions/7910/what-is-non-manifold-geometry

M -
  • 26,908
  • 11
  • 49
  • 81
  • I'm trying to have 2D geometry as a result geometry and make it 3D geometry with a certain height using ExtrudedGeometry in three.js . To do this, first I applied the height and intersect, but it wasn't so accurate with curves in the geometry. Like you said if I give ignorable height to the 2D geometry and make it 3D geometry, then could I convert the result 3D geometry back to 2D geometry ? Thanks. – hyewon330 Aug 28 '17 at 11:00
  • Sorry, I'm trying to help you, but it's difficult to visualize what you're trying to achieve without seeing some examples. Can you update your question with images? Also, if what you want is a flat shape, have you tried the method in this example: https://threejs.org/examples/?q=shape#webgl_geometry_shapes ? It's starting to sound like all you need is a `THREE.Shape` object. – M - Aug 28 '17 at 20:16