3

I have an object A. Object A is a 3D object (a scan of a cavity).

I have an object B. Object B is a simple plane. It passes though the centre of Object A.

I would like to split Object A into two separate objects using the plane. Is there a way to subtract objects in threejs? enter image description here

Mubashir Ali
  • 349
  • 1
  • 10

1 Answers1

2

So, three.js does not do constructive geometry by itself. Some packages will help you achieve that, for example, three-csg-ts. their docs explain how to use that package, so you should go through them.

You should note, though, that deps.dev* rated it at 4.7 on their scorecard**, so if that's a concern for you, you should check their analysis and decide for yourself (though it looks harmless to me)


  • if you don't know what deps.dev is - it's a website built by OSSF (The Open Source Security Foundation - a cross-industry collaboration to improve the security of open-source software (OSS)); representatives govern the organization from the Linux foundation, google, GitHub, meta, sonatype, snyk and community reps and much more. deps.dev provides data and scores for open-source packages to help you keep your code safe from supply-chain attacks.

  • the scorecard provides security health metrics for open source projects.


Full disclosure, I do work in a supply-chain security team in the industry, but I have no relation to deps.dev nor do I get any benefit from recommending them. this is a free, fantastic and important open-source tool that I believe should be more used

Guy Nachshon
  • 2,411
  • 4
  • 16