Questions tagged [threecsg]

ThreeCSG is a JavaScript wrapper for the csg.js library enabling the use of constructive solid geometry boolean operations with Three.js.

ThreeCSG is a JavaScript wrapper for the csg.js library enabling the use of constructive solid geometry boolean operations with Three.js. Constructive solid geometry allows for the creation of complex objects by combining simpler 3D solids.

35 questions
1
vote
1 answer

Three.js 2D CSG - intersect, union, subtract

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
vote
0 answers

Inverse() of a 3D shape with ThreeCSG

I'm trying to invert a 3D shape using ThreeCSG (get the empty spaces of the original shape) but it looks like they didn't include the inverse function from the original CSG: inverse: function() { var csg = this.clone(); …
shinzou
  • 5,850
  • 10
  • 60
  • 124
1
vote
1 answer

Three.js - Why is csg.js not working?

I tried to use csg.js-functions to cut a sphere out of a box, but it is not working? I read the tutorial on http://learningthreejs.com/blog/2011/12/10/constructive-solid-geometry-with-csg-js/ but its still not working. …
Ramón Wilhelm
  • 967
  • 2
  • 18
  • 39
1
vote
1 answer

subtracted geometries result in strange lighting

In three.js, I am trying to 'cut out' a window from a box geometry (a wall), using this csg (contructive solid geometry) extension I found here: https://github.com/chandlerprall/ThreeCSG I am successful in cutting the window, but then the surface of…
Hoff
  • 38,776
  • 17
  • 74
  • 99
1
vote
2 answers

How can I change the position of my CSG object before subtraction when usingThreejs and ThreeCSG

I'm trying to subtract "holes" in platforms using ThreeCSG. I want the holes to be subtracted in specific locations on the larger platform. var geometry = new THREE.CubeGeometry( 500, 10, 500 ); var hole_geometry = new THREE.CubeGeometry( 50,…
stahlneckr
  • 149
  • 5
1
vote
0 answers

threecsg.js and subdivision modifier distorted geometry

I have the latest threecsg.js library and my use of it has been okay, except when I try to use the subdivision modifier after a CSG operation. Here is example code, modified from the example.html file that comes with the library from github: var…
user4236713
0
votes
1 answer

React threejs merge two tubes to create a tee-piece with CSG not working as expected

I am trying to create a tee-piece which is a fitting in the plumbing domain. It consist of 2 tubes that are merged together and has 3 openings as shown in this picture. I have written some code in threejs where I am trying to create a tube mesh1 and…
Ali91
  • 25
  • 5
0
votes
0 answers

What is the "Uncaught RangeError: Maximum call stack size exceeded"

I am try to implement a threecsg library, but when trying to use the functions implemented I get an error saying: "Uncaught RangeError: Maximum call stack size exceeded at Plane.splitPolygon (code.html:229)" the code is: /******Code ommitted…
Fort-P
  • 5
  • 6
0
votes
1 answer

Compute UV coordinates for threecsg mesh

for a university project I created a threecsg subtract in ThreeJS. I want to apply a texture for this mesh. But the missing uv coordinates after the processing is causing me some trouble. This needs to be a threecsg, because this a project…
0
votes
0 answers

Using ThreeCSG with BufferGeometry is giving me weird results - missing faces

When trying to subtract or union two meshes (TextGeometry and BufferGeometry), result meshes have missing faces and opposite results, I am using ThreeCSG that supposedly support buffer geometry, I tried converting to normal Geometry and results were…
TimWP
  • 3
  • 3
0
votes
1 answer

Controlling the scaling of custom geometries in Three.js

I have a custom object which is a subtraction of two meshes. This subtraction creates a frame-like object. createFrame (x, y, z) { const frameMesh = new THREE.Mesh(new THREE.BoxGeometry(1,1,1)); frameMesh.scale.set(x, y, z); const…
Dawid Zbiński
  • 5,521
  • 8
  • 43
  • 70
0
votes
1 answer

ThreeCSG subtract method not working properly

I have: var bspWall = new ThreeBSP(wall.geometry); var bspDoor = new ThreeBSP(this.getDoorBoundingBox().geometry); var bspNewWall = bspWall.subtract(bspDoor) The door is of height 8 and width 8 The wall is of height 16, I am placing the door at…
nayan dhabarde
  • 1,734
  • 1
  • 19
  • 38
0
votes
2 answers

Three.js: how to force update matrix after cloning? (to use with CSG ThreeBSP)

I'm trying to clone and then scale a mesh, but scaling does not seem to be working immediately on the cloned object, for programming purposes using CSG ThreeBSP. I think I should call a function after the scaling to force the matrix or other…
chaotive
  • 182
  • 14
0
votes
1 answer

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…
Absulit
  • 1,885
  • 1
  • 17
  • 17
0
votes
1 answer

how to optimize CSG Library by decreasing the resolution or the size or number of BSP trees?

I am trying to perform a boolean operation on 2 mesh files imported from objloader using THREE.js and ThreeCSG interactively for multiple times and in real time. I just wanted to ask if there is any ways to optimize the CSG code to decrease the run…
Arezoo Tony
  • 69
  • 1
  • 8