├── .gitignore ├── README.md ├── demo ├── index.html └── scene.config.js ├── dist └── THREE.CSG.js ├── lib ├── CSG.js └── FontSet.js ├── package.json ├── rollup.config.js └── src └── index.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled source # 2 | ################### 3 | *.com 4 | *.class 5 | *.dll 6 | *.exe 7 | *.o 8 | *.so 9 | 10 | # Packages # 11 | ############ 12 | # it's better to unpack these files and commit the raw source 13 | # git has its own built in compression methods 14 | *.7z 15 | *.dmg 16 | *.gz 17 | *.iso 18 | *.jar 19 | *.rar 20 | *.tar 21 | *.zip 22 | 23 | # Logs and databases # 24 | ###################### 25 | *.log 26 | *.sql 27 | *.sqlite 28 | 29 | # OS generated files # 30 | ###################### 31 | .DS_Store 32 | .DS_Store? 33 | ._* 34 | .Spotlight-V100 35 | .Trashes 36 | ehthumbs.db 37 | Thumbs.db 38 | 39 | # Node modules # 40 | ###################### 41 | node_modules/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # THREE.CSG 2 | > A [THREE.js](http://threejs.org/) plugin to allow implementing boolean operations on THREE Objects(Mesh, Geometry). The boolean operations are supported by [csg.js](http://threejs.org/). For an overview of the CSG process, see the orginal [csg.js](https://evanw.github.io/csg.js/) code. 3 | 4 | ## Include in Your HTML 5 | Remember to include THREE.js before including this plugin. 6 | ``` bash 7 | 8 | ``` 9 | 10 | 11 | ## Usage 12 | 13 | ### Convert between THREE object and CSG object 14 | ``` bash 15 | # convert THREE.Geometry to CSG format 16 | var csg = THREE.CSG.fromGeometry(geometry) 17 | 18 | # convert THREE.Mesh to CSG format 19 | var csg = THREE.CSG.fromMesh(mesh) 20 | 21 | # convert to THREE.Geometry 22 | var geometry = THREE.CSG.toGeometry(csg) 23 | 24 | # convert to THREE.Mesh 25 | var mesh = THREE.CSG.toMesh(csg, material) 26 | ``` 27 | 28 | ### Boolean Operations 29 | ``` bash 30 | # Union 31 | var result = A.union(B) 32 | 33 | # Subtract 34 | var result = A.subtract(B) 35 | 36 | # Intersect 37 | var result = A.intersect(B) 38 | ``` 39 | NOTE: Both A and B should be in CSG format for boolean operations. 40 | 41 | ## Live Demo 42 | [live Demo](http://oathihs.github.io/ThreeCSG/) 43 | 44 | ## Development 45 | ``` bash 46 | # install dependencies 47 | npm install 48 | 49 | # build for production 50 | npm run build 51 | ``` 52 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 49 | 50 | -------------------------------------------------------------------------------- /demo/scene.config.js: -------------------------------------------------------------------------------- 1 | // SCENE 2 | window.scene = new THREE.Scene() 3 | var container, scene, camera, renderer, controls, stats 4 | 5 | // INITIALIZE 6 | (function () { 7 | scene = window.scene 8 | 9 | // CAMERA 10 | var SCREEN_WIDTH = window.innerWidth, SCREEN_HEIGHT = window.innerHeight 11 | var VIEW_ANGLE = 45, ASPECT = SCREEN_WIDTH / SCREEN_HEIGHT, NEAR = 0.1, FAR = 20000 12 | camera = new THREE.OrthographicCamera( 13 | -SCREEN_WIDTH / 2, // left 14 | SCREEN_WIDTH / 2, // right 15 | SCREEN_HEIGHT / 2, // top 16 | -SCREEN_HEIGHT / 2, // bottom 17 | NEAR, // near 18 | FAR // far 19 | ) 20 | scene.add(camera) 21 | camera.position.set(0,-500, 400) 22 | camera.lookAt(scene.position) 23 | 24 | // RENDERER 25 | if ( Detector.webgl ) { 26 | renderer = new THREE.WebGLRenderer({antialias:true}) 27 | } else { 28 | renderer = new THREE.CanvasRenderer() 29 | } 30 | renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT) 31 | renderer.setClearColor(new THREE.Color(0xf7f8f9, 1.0)) 32 | container = document.getElementById( 'ThreeJS' ) 33 | container.appendChild(renderer.domElement) 34 | 35 | // CONTROLS 36 | controls = new THREE.OrbitControls(camera, renderer.domElement) 37 | 38 | // STATS 39 | stats = new Stats() 40 | stats.domElement.style.position = 'absolute' 41 | stats.domElement.style.bottom = '0px' 42 | stats.domElement.style.zIndex = 100 43 | container.appendChild(stats.domElement) 44 | 45 | // LIGHT 46 | var light = new THREE.DirectionalLight(0x444444, 1) 47 | light.position.set(0, 0, 1).normalize() 48 | scene.add(light) 49 | 50 | // GRID 51 | var grid1 = new THREE.GridHelper(SCREEN_WIDTH / 2, 6) 52 | grid1.rotation.x = Math.PI / 2 53 | grid1.setColors(0x444444, 0xe1e2e3) 54 | scene.add(grid1) 55 | 56 | var grid2 = new THREE.GridHelper(SCREEN_WIDTH / 2, 30) 57 | grid2.rotation.x = Math.PI / 2 58 | grid2.setColors(0x444444, 0xc1c2c3) 59 | scene.add(grid2) 60 | })() 61 | animate() 62 | 63 | function animate () { 64 | requestAnimationFrame(animate) 65 | render() 66 | update() 67 | } 68 | 69 | function update () { 70 | controls.update() 71 | stats.update() 72 | } 73 | 74 | function render () { 75 | renderer.render(scene, camera) 76 | } -------------------------------------------------------------------------------- /lib/FontSet.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // -- data below from http://paulbourke.net/dataformats/hershey/ 3 | var simplexFont = [ 4 | 0,16, /* Ascii 32 */ 5 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 6 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 7 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 8 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 9 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 10 | 8,10, /* Ascii 33 */ 11 | 5,21, 5, 7,-1,-1, 5, 2, 4, 1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,-1,-1,-1,-1,-1,-1, 28 | 26,20, /* Ascii 36 */ 29 | 8,25, 8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21, 8,21, 5,20, 3, 30 | 18, 3,16, 4,14, 5,13, 7,12,13,10,15, 9,16, 8,17, 6,17, 3,15, 1,12, 0, 31 | 8, 0, 5, 1, 3, 3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 32 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 33 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 34 | 31,24, /* Ascii 37 */ 35 | 21,21, 3, 0,-1,-1, 8,21,10,19,10,17, 9,15, 7,14, 5,14, 3,16, 3,18, 4, 36 | 20, 6,21, 8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17, 7,15, 6,14, 4, 37 | 14, 2,16, 0,18, 0,20, 1,21, 3,21, 5,19, 7,17, 7,-1,-1,-1,-1,-1,-1,-1, 38 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 39 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 40 | 34,26, /* Ascii 38 */ 41 | 23,12,23,13,22,14,21,14,20,13,19,11,17, 6,15, 3,13, 1,11, 0, 7, 0, 5, 42 | 1, 4, 2, 3, 4, 3, 6, 4, 8, 5, 9,12,13,13,14,14,16,14,18,13,20,11,21, 43 | 9,20, 8,18, 8,16, 9,13,11,10,16, 3,18, 1,20, 0,22, 0,23, 1,23, 2,-1, 44 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 45 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,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-1,-1,-1,-1,-1, 148 | 29,20, /* Ascii 56 */ 149 | 8,21, 5,20, 4,18, 4,16, 5,14, 7,13,11,12,14,11,16, 9,17, 7,17, 4,16, 150 | 2,15, 1,12, 0, 8, 0, 5, 1, 4, 2, 3, 4, 3, 7, 4, 9, 6,11, 9,12,13,13, 151 | 15,14,16,16,16,18,15,20,12,21, 8,21,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 152 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 153 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 154 | 23,20, /* Ascii 57 */ 155 | 16,14,15,11,13, 9,10, 8, 9, 8, 6, 9, 4,11, 3,14, 3,15, 4,18, 6,20, 9, 156 | 21,10,21,13,20,15,18,16,14,16, 9,15, 4,13, 1,10, 0, 8, 0, 5, 1, 4, 3, 157 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 158 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 159 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 160 | 11,10, /* Ascii 58 */ 161 | 5,14, 4,13, 5,12, 6,13, 5,14,-1,-1, 5, 2, 4, 1, 5, 0, 6, 1, 5, 2,-1, 162 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 163 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 164 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 165 | -1,-1,-1,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 183 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 184 | 3,24, /* Ascii 62 */ 185 | 4,18,20, 9, 4, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 186 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 187 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 188 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 189 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 190 | 20,18, /* Ascii 63 */ 191 | 3,16, 3,17, 4,19, 5,20, 7,21,11,21,13,20,14,19,15,17,15,15,14,13,13, 192 | 12, 9,10, 9, 7,-1,-1, 9, 2, 8, 1, 9, 0,10, 1, 9, 2,-1,-1,-1,-1,-1,-1, 193 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 194 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 195 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 196 | 55,27, /* Ascii 64 */ 197 | 18,13,17,15,15,16,12,16,10,15, 9,14, 8,11, 8, 8, 9, 6,11, 5,14, 5,16, 198 | 6,17, 8,-1,-1,12,16,10,14, 9,11, 9, 8,10, 6,11, 5,-1,-1,18,16,17, 8, 199 | 17, 6,19, 5,21, 5,23, 7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12, 200 | 21, 9,20, 7,19, 5,17, 4,15, 3,12, 3, 9, 4, 6, 5, 4, 7, 2, 9, 1,12, 0, 201 | 15, 0,18, 1,20, 2,21, 3,-1,-1,19,16,18, 8,18, 6,19, 5, 202 | 8,18, /* Ascii 65 */ 203 | 9,21, 1, 0,-1,-1, 9,21,17, 0,-1,-1, 4, 7,14, 7,-1,-1,-1,-1,-1,-1,-1, 204 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 205 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 206 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 207 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 208 | 23,21, /* Ascii 66 */ 209 | 4,21, 4, 0,-1,-1, 4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13, 210 | 11,-1,-1, 4,11,13,11,16,10,17, 9,18, 7,18, 4,17, 2,16, 1,13, 0, 4, 0, 211 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 212 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 213 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 214 | 18,21, /* Ascii 67 */ 215 | 18,16,17,18,15,20,13,21, 9,21, 7,20, 5,18, 4,16, 3,13, 3, 8, 4, 5, 5, 216 | 3, 7, 1, 9, 0,13, 0,15, 1,17, 3,18, 5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 217 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,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-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 286 | 21,22, /* Ascii 79 */ 287 | 9,21, 7,20, 5,18, 4,16, 3,13, 3, 8, 4, 5, 5, 3, 7, 1, 9, 0,13, 0,15, 288 | 1,17, 3,18, 5,19, 8,19,13,18,16,17,18,15,20,13,21, 9,21,-1,-1,-1,-1, 289 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 290 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 291 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 292 | 13,21, /* Ascii 80 */ 293 | 4,21, 4, 0,-1,-1, 4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13, 294 | 10, 4,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 295 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 296 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 297 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 298 | 24,22, /* Ascii 81 */ 299 | 9,21, 7,20, 5,18, 4,16, 3,13, 3, 8, 4, 5, 5, 3, 7, 1, 9, 0,13, 0,15, 300 | 1,17, 3,18, 5,19, 8,19,13,18,16,17,18,15,20,13,21, 9,21,-1,-1,12, 4, 301 | 18,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 302 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 303 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 304 | 16,21, /* Ascii 82 */ 305 | 4,21, 4, 0,-1,-1, 4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13, 306 | 11, 4,11,-1,-1,11,11,18, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 307 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 308 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 309 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 310 | 20,20, /* Ascii 83 */ 311 | 17,18,15,20,12,21, 8,21, 5,20, 3,18, 3,16, 4,14, 5,13, 7,12,13,10,15, 312 | 9,16, 8,17, 6,17, 3,15, 1,12, 0, 8, 0, 5, 1, 3, 3,-1,-1,-1,-1,-1,-1, 313 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 314 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 315 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 316 | 5,16, /* Ascii 84 */ 317 | 8,21, 8, 0,-1,-1, 1,21,15,21,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 318 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 319 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 320 | -1,-1,-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1,-1,-1,-1,-1,-1,-1,-1,-1, 405 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 406 | 14,18, /* Ascii 99 */ 407 | 15,11,13,13,11,14, 8,14, 6,13, 4,11, 3, 8, 3, 6, 4, 3, 6, 1, 8, 0,11, 408 | 0,13, 1,15, 3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 409 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 410 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 411 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 412 | 17,19, /* Ascii 100 */ 413 | 15,21,15, 0,-1,-1,15,11,13,13,11,14, 8,14, 6,13, 4,11, 3, 8, 3, 6, 4, 414 | 3, 6, 1, 8, 0,11, 0,13, 1,15, 3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 415 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 416 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 417 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 418 | 17,18, /* Ascii 101 */ 419 | 3, 8,15, 8,15,10,14,12,13,13,11,14, 8,14, 6,13, 4,11, 3, 8, 3, 6, 4, 420 | 3, 6, 1, 8, 0,11, 0,13, 1,15, 3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 421 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 422 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 423 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 424 | 8,12, /* Ascii 102 */ 425 | 10,21, 8,21, 6,20, 5,17, 5, 0,-1,-1, 2,14, 9,14,-1,-1,-1,-1,-1,-1,-1, 426 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 427 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 428 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 429 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 430 | 22,19, /* Ascii 103 */ 431 | 15,14,15,-2,14,-5,13,-6,11,-7, 8,-7, 6,-6,-1,-1,15,11,13,13,11,14, 8, 432 | 14, 6,13, 4,11, 3, 8, 3, 6, 4, 3, 6, 1, 8, 0,11, 0,13, 1,15, 3,-1,-1, 433 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 434 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 435 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 436 | 10,19, /* Ascii 104 */ 437 | 4,21, 4, 0,-1,-1, 4,10, 7,13, 9,14,12,14,14,13,15,10,15, 0,-1,-1,-1, 438 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 439 | -1,-1,-1,-1,-1,-1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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 559 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 560 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 561 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 562 | 39,14, /* Ascii 125 */ 563 | 5,25, 7,24, 8,23, 9,21, 9,19, 8,17, 7,16, 6,14, 6,12, 8,10,-1,-1, 7, 564 | 24, 8,22, 8,20, 7,18, 6,17, 5,15, 5,13, 6,11,10, 9, 6, 7, 5, 5, 5, 3, 565 | 6, 1, 7, 0, 8,-2, 8,-4, 7,-6,-1,-1, 8, 8, 6, 6, 6, 4, 7, 2, 8, 1, 9, 566 | -1, 9,-3, 8,-5, 7,-6, 5,-7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 567 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 568 | 23,24, /* Ascii 126 */ 569 | 3, 6, 3, 8, 4,11, 6,12, 8,12,10,11,14, 8,16, 7,18, 7,20, 8,21,10,-1, 570 | -1, 3, 8, 4,10, 6,11, 8,11,10,10,14, 7,16, 6,18, 6,20, 7,21,10,21,12, 571 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 572 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 573 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 574 | ] 575 | 576 | export default simplexFont 577 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ThreeCSG", 3 | "version": "0.0.1", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "rollup -c", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/oathihs/ThreeCSG.git" 13 | }, 14 | "author": "Stan Guo", 15 | "license": "ISC", 16 | "bugs": { 17 | "url": "https://github.com/oathihs/ThreeCSG/issues" 18 | }, 19 | "homepage": "https://github.com/oathihs/ThreeCSG", 20 | "devDependencies": { 21 | "rollup": "^0.26.3" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | entry: 'src/index.js', 3 | format: 'iife', 4 | moduleName: 'ThreeCSG', 5 | dest: 'dist/THREE.CSG.js' 6 | } -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import { CSG } from '../lib/CSG' 2 | import simplexFont from '../lib/FontSet' 3 | /* 4 | adapted from THREE.CSG 5 | @author Chandler Prall http://chandler.prallfamily.com 6 | Wrapper for Evan Wallace's CSG library (https://github.com/evanw/csg.js/) 7 | Provides CSG capabilities for Three.js models. 8 | Provided under the MIT License 9 | */ 10 | export default (function () { 11 | var THREE 12 | // check dependency 13 | if (window.THREE) { 14 | THREE = window.THREE 15 | } else if (global.THREE) { 16 | THREE = global.THREE 17 | } else { 18 | global.throw("THREE is undefined, please include THREE.js") 19 | } 20 | 21 | THREE.CSG = CSG 22 | /** 23 | * Construct a CSG solid from a `THREE.Geometry` instance. 24 | * 25 | * @method fromGeometry 26 | * @return CSG instance 27 | */ 28 | THREE.CSG.fromGeometry = function (geometry) { 29 | var polygons = [] 30 | if (geometry instanceof THREE.BufferGeometry) { 31 | geometry = new THREE.Geometry().fromBufferGeometry(geometry) 32 | } 33 | for (var i = 0; i < geometry.faces.length; i++) { 34 | var face = geometry.faces[i] 35 | var pos 36 | var vertex 37 | var vertices = [] 38 | var polygon 39 | 40 | if (face instanceof THREE.Face3) { 41 | vertex = geometry.vertices[face.a] 42 | pos = new CSG.Vector3D(vertex.x, vertex.y, vertex.z) 43 | vertices.push(new CSG.Vertex(pos)) 44 | 45 | vertex = geometry.vertices[face.b] 46 | pos = new CSG.Vector3D(vertex.x, vertex.y, vertex.z) 47 | vertices.push(new CSG.Vertex(pos)) 48 | 49 | vertex = geometry.vertices[face.c] 50 | pos = new CSG.Vector3D(vertex.x, vertex.y, vertex.z) 51 | vertices.push(new CSG.Vertex(pos)) 52 | } else if (face instanceof THREE.Face4) { 53 | vertex = geometry.vertices[face.a] 54 | pos = new CSG.Vector3D(vertex.x, vertex.y, vertex.z) 55 | vertices.push(new CSG.Vertex(pos)) 56 | 57 | vertex = geometry.vertices[face.b] 58 | pos = new CSG.Vector3D(vertex.x, vertex.y, vertex.z) 59 | vertices.push(new CSG.Vertex(pos)) 60 | 61 | vertex = geometry.vertices[face.c] 62 | pos = new CSG.Vector3D(vertex.x, vertex.y, vertex.z) 63 | vertices.push(new CSG.Vertex(pos)) 64 | 65 | vertex = geometry.vertices[face.d] 66 | pos = new CSG.Vector3D(vertex.x, vertex.y, vertex.z) 67 | vertices.push(new CSG.Vertex(pos)) 68 | } else { 69 | throw 'Invalid face type at index ' + i 70 | } 71 | 72 | polygon = new CSG.Polygon(vertices) 73 | polygon.checkIfConvex() // throw a error if not convex 74 | polygons.push(polygon) 75 | } 76 | return CSG.fromPolygons(polygons) 77 | } 78 | 79 | /** 80 | * Construct a CSG solid from a `THREE.Mesh` instance. 81 | * 82 | * @method fromMesh 83 | * @return CSG instance 84 | */ 85 | THREE.CSG.fromMesh = function (mesh) { 86 | mesh.updateMatrix() 87 | this.matrix = new CSG.Matrix4x4(mesh.matrix.clone().elements) 88 | var _geometry 89 | if (mesh.geometry instanceof THREE.BufferGeometry) { 90 | _geometry = new THREE.Geometry().fromBufferGeometry(mesh.geometry) 91 | } else { 92 | _geometry = mesh.geometry 93 | } 94 | var csg = THREE.CSG.fromGeometry(_geometry) 95 | return csg.transform(this.matrix) 96 | } 97 | 98 | THREE.CSG.fromText = function (text, parameters) { 99 | var polylines = vector_text(0, 0, text) 100 | var o = [] 101 | var weight = parameters.weight || 3 // Weight of font. Default is 3 102 | var height = parameters.height || 5 // Thickness to extrude text. Default is 5 103 | var size = parameters.size || 20 // font size. Default is 20 104 | 105 | polylines.forEach(function (pl) { 106 | o.push(rectangular_extrude(pl, {w: weight, h: height})) 107 | }) 108 | 109 | var csg = new CSG().union(o) 110 | csg = csg.scale(size / 20) 111 | return csg 112 | } 113 | 114 | THREE.CSG.resultFromCompactBinary = function (resultin) { 115 | function fromCompactBinary (r) { 116 | var result 117 | if (r.class === 'CSG') { 118 | result = CSG.fromCompactBinary(r) 119 | } else { 120 | throw new Error('Cannot parse result') 121 | } 122 | return result 123 | } 124 | var resultout 125 | if (resultin instanceof Array) { 126 | resultout = resultin.map(function (resultelement) { 127 | var r = resultelement 128 | r = fromCompactBinary(resultelement) 129 | return r 130 | }) 131 | } else { 132 | resultout = fromCompactBinary(resultin) 133 | } 134 | return resultout 135 | } 136 | 137 | THREE.CSG.resultToCompactBinary = function (resultin) { 138 | var resultout 139 | if (resultin instanceof Array) { 140 | resultout = resultin.map(function (resultelement) { 141 | var r = resultelement 142 | r = resultelement.toCompactBinary() 143 | return r 144 | }) 145 | } else { 146 | resultout = resultin.toCompactBinary() 147 | } 148 | return resultout 149 | } 150 | 151 | // convert CSG object to three.js geometry. 152 | THREE.CSG.toGeometry = function (csg) { 153 | var face 154 | var three_geometry = new THREE.Geometry() 155 | var polygons = csg.toPolygons() 156 | 157 | polygons.forEach(function (polygon) { 158 | var vertices = polygon.vertices.map(function (vertex) { 159 | return getGeometryVertex(three_geometry, vertex.pos) 160 | }, this) 161 | 162 | if (vertices[0] === vertices[vertices.length - 1]) { 163 | vertices.pop() 164 | } 165 | 166 | for (let i = 2; i < vertices.length; i++) { 167 | face = new THREE.Face3(vertices[0], vertices[i - 1], vertices[i], new THREE.Vector3().copy(polygon.plane.normal)) 168 | three_geometry.faces.push(face) 169 | } 170 | }, this) 171 | 172 | return three_geometry 173 | } 174 | 175 | // convert CSG object to three.js mesh. 176 | THREE.CSG.toMesh = function (csg, material) { 177 | var three_geometry = THREE.CSG.toGeometry(csg) 178 | var three_mesh = new THREE.Mesh(three_geometry, material) 179 | return three_mesh 180 | } 181 | 182 | function getGeometryVertex (geometry, vertex_position) { 183 | geometry.vertices.push(new THREE.Vector3(vertex_position.x, vertex_position.y, vertex_position.z)) 184 | return geometry.vertices.length - 1 185 | } 186 | 187 | function rectangular_extrude (pa, p) { 188 | var w = 1 189 | var h = 1 190 | var fn = 8 191 | var closed = false 192 | var round = true 193 | if (p) { 194 | if (p.w) w = p.w 195 | if (p.h) h = p.h 196 | if (p.fn) fn = p.fn 197 | if (p.closed !== undefined) closed = p.closed 198 | if (p.round !== undefined) round = p.round 199 | } 200 | return new CSG.Path2D(pa, closed).rectangularExtrude(w, h, fn, round) 201 | } 202 | 203 | function vector_char (x, y, c) { 204 | c = c.charCodeAt(0) 205 | c -= 32 206 | if (c < 0 || c >= 95) { 207 | return { 208 | width: 0, 209 | segments: [] 210 | } 211 | } 212 | var off = c * 112 213 | var n = simplexFont[off++] 214 | var w = simplexFont[off++] 215 | var l = [] 216 | var segs = [] 217 | for (var i = 0; i < n; i++) { 218 | var xp = simplexFont[off + i * 2] 219 | var yp = simplexFont[off + i * 2 + 1] 220 | if (xp === -1 && yp === -1) { 221 | segs.push(l) 222 | l = [] 223 | } else { 224 | l.push([xp + x, yp + y]) 225 | } 226 | } 227 | if (l.length) segs.push(l) 228 | return { 229 | width: w, 230 | segments: segs 231 | } 232 | } 233 | 234 | function vector_text (x, y, s) { 235 | var o = [] 236 | var x0 = x 237 | for (var i = 0; i < s.length; i++) { 238 | var c = s.charAt(i) 239 | if (c === '\n') { 240 | x = x0 241 | y -= 30 242 | } else { 243 | var d = vector_char(x, y, c) 244 | x += d.width 245 | o = o.concat(d.segments) 246 | } 247 | } 248 | return o 249 | } 250 | })() 251 | --------------------------------------------------------------------------------