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 ?

3
  • Well, did you try it? What was the outcome? Commented Aug 24, 2017 at 18:47
  • Yes I tried. When trying intersect, there is no outcome and when trying union, it gives itself not united with the parameter. Commented Aug 25, 2017 at 10:31
  • The provided link no longer works Commented Jan 9, 2023 at 16:31

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

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.
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: threejs.org/examples/?q=shape#webgl_geometry_shapes ? It's starting to sound like all you need is a THREE.Shape object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.