New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

three-csg-ts

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three-csg-ts - npm Package Compare versions

Comparing version 3.1.6 to 3.1.7

10

package.json
{
"name": "three-csg-ts",
"version": "3.1.6",
"version": "3.1.7",
"description": "CSG library for use with THREE.js",

@@ -37,5 +37,5 @@ "main": "lib/cjs/index.js",

"devDependencies": {
"@types/jest": "^26.0.23",
"@types/jest": "^27.0.1",
"@types/node": "^14.14.45",
"@types/three": "^0.130.0",
"@types/three": "^0.131.0",
"@typescript-eslint/eslint-plugin": "^4.23.0",

@@ -53,4 +53,4 @@ "@typescript-eslint/parser": "^4.23.0",

"standard-version": "^9.3.0",
"three": "^0.130.1",
"ts-jest": "^27.0.3",
"three": "^0.131.3",
"ts-jest": "^27.0.5",
"ts-loader": "^9.2.3",

@@ -57,0 +57,0 @@ "typescript": "^4.2.4",

@@ -9,2 +9,4 @@ # three-csg-ts

![Screenshot 2021-07-19 at 17 32 20](https://user-images.githubusercontent.com/935782/126194933-45ac18d0-2459-4213-97d2-d46ffb67483c.png)
## Concept

@@ -33,15 +35,15 @@

// Make 2 box meshes..
const meshA = new THREE.Mesh(new THREE.BoxGeometry(1,1,1), new THREE.MeshNormalMaterial());
const meshB = new THREE.Mesh(new THREE.BoxGeometry(1,1,1));
// Make 2 meshes..
const box = new THREE.Mesh(new THREE.BoxGeometry(2, 2, 2), new THREE.MeshNormalMaterial());
const sphere = new THREE.Mesh(new THREE.SphereGeometry(1.2, 8, 8));
// Offset one of the boxes by half its width..
meshB.position.add(new THREE.Vector3(0.5, 0.5, 0.5));
// Make sure the .matrix of each mesh is current
meshA.updateMatrix();
meshB.updateMatrix();
box.updateMatrix();
sphere.updateMatrix();
// Subtract meshB from meshA
const meshResult = CSG.subtract(meshA, meshB);
// Perform CSG operations
// The result is a THREE.Mesh that you can add to your scene...
const subRes = CSG.subtract(box, sphere);
const uniRes = CSG.union(box, sphere);
const intRes = CSG.intersect(box, sphere);
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc