问题标签 [threecsg]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
three.js - Dynamic Clipping or CSG operations in Three.js
I've taken a look at the Clipping examples in the Threejs site, and the ThreeCSG operations, but I am not able to find an example that has "both".
To be more specific, I require a PlaneGeometry of PlaneBufferGeometry that applies a CSG operation as smooth as a Clipping, but this PlaneGeometry could be moving, changing its position and orientation.
As an example, a Sphere and a Plane are on the scene, the Plane starts facing in Z and is spinning in Y, cutting one side of the sphere at all times, but the plane could be a box or any other object.
Is it possible?
javascript - Three.js:克隆后如何强制更新矩阵?(与 CSG ThreeBSP 一起使用)
我正在尝试克隆然后缩放网格,但缩放似乎并没有立即在克隆的对象上起作用,用于使用 CSG ThreeBSP 进行编程。我想我应该在缩放之后调用一个函数来强制矩阵或其他内部变量立即重新计算,而不是等待渲染端的完整更新循环。
我的代码看起来像这样:
我错过了什么?也欢迎提出建议:)
three.js - 三个 CSG 的 3D 布尔运算
按照此处的示例:
http://learningthreejs.com/blog/2011/12/10/constructive-solid-geometry-with-csg-js/
并将 Three.js 与https://github.com/chandlerprall/ThreeCSG结合使用,我正在尝试对模型中的节点进行 3D 布尔运算。例如,如果我有一堵带窗户的墙,我想在上面做invert()
只是得到窗户。
我有一个函数可以返回节点多边形的所有顶点,这是一个没有孔的对象的顶点示例https://pastebin.com/8dhYzPwE。
我正在像这样使用 ThreeCSG:
但这就是我要进入的geometryCsg
:
我认为这是因为geometry.faces.length
0。
如何使顶点数组正确Three.Geometry
,以使面不会为空?Geometry.elementsNeedsUpdate不起作用...
有没有使用形状的多边形作为 Vector3s 数组并将其转换为 csg 的示例?
javascript - Three.js 2D CSG - 相交、联合、相减
我将 csg.js 与 three.js 一起使用,它似乎只支持 3D CSG。检查 这个
我想相交和联合 2D (three.js) 几何。有什么办法可以用 three.js 做 2D CSG 吗?
javascript - 在 Three.js 中控制自定义几何图形的缩放
我有一个自定义对象,它是两个网格的减法。这种减法创建了一个类似框架的对象。
现在,只要大小发生变化,我就会动态地缩放这个框架。问题是.scale
只使用让我的对象拉伸,而我希望它保持框架的宽度(在这种情况下为 4)。
是否可以指定对象应该如何缩放(比如编写我自己的缩放函数实现)或者是否有一个属性/方法可以使用它会导致保留“空白”与“对象”部分?先感谢您。
javascript - 将 ThreeCSG 与 BufferGeometry 一起使用给了我奇怪的结果 - 缺少面孔
当尝试减去或合并两个网格(TextGeometry 和 BufferGeometry)时,结果网格缺少面和相反的结果,我正在使用应支持缓冲区几何的ThreeCSG,我尝试转换为普通几何,结果是相同的。
工会:
减去 :
这是我的代码:
如果我取消注释这两行,我会得到不同的结果:
结果如下所示:
联合法线几何:
减去前面:
减去:
有什么我想念的想法吗?