简体   繁体   English

Three.js网格或几何内容

[英]Three.js Mesh or Geometry content

I'm new to Three.js; 我是Three.js的新手。 Is there a way to get separate objects (elements/shells) from a Mesh or Geometry object? 有没有办法从网格或几何对象中获取单独的对象(元素/壳)?

If there's no native way to do that, how could I implement a method for separating faces that are not connected to an ensemble and then detaching them so they form there own Mesh object? 如果没有本机的方法,我该如何实现一种方法来分离未连接到整体的面,然后将其分离以使其形成自己的Mesh对象?

Background: I'm loading a 3d model and would like to be able to unify this model using ThreeBSP, I need to separate the objects before applying the boolean operations. 背景:我正在加载3D模型,并且希望能够使用ThreeBSP统一该模型,因此在应用布尔操作之前,我需要先将对象分离。

Thank you 谢谢

Dig into the Geometry object. 挖入几何对象。 It has an array of faces. 它具有一系列的面孔。 I don't think there is a native way to check to see which ones are contiguous. 我认为没有一种原生方法可以检查哪些是连续的。

Shooting from the hip, "contagious" in this case means faces that share points with something something that shares points with something that shares points etc. So pick a face. 从臀部射击,在这种情况下,“具有传染性”是指与某些东西共享点的脸与某些共享点的东西等。因此,选择一张脸。 Store it's defining points, find any faces that also use those points, store there points, find all the face that share any of the expanded points etc. Check out the "Flood Fill" function for some direction how to use recursion, as well as how to do the bookkeeping needed to avoid duplicates from keeping you searching in a loop forever. 存储其定义点,找到也使用这些点的任何面,存储在那里的点,找到共享任何扩展点的所有面,等等。请查看“填充”功能,以获取有关如何使用递归的一些指导,以及如何进行簿记以避免重复重复使您永远循环搜索。

Good Luck 祝好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM