Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
three-2-csg
Advanced tools
This is a converter which enables conversion of ThreeJS objects into CSG and back (it works both ways).
CSG objects created by this converter can then be manipulated via @jscad/csg.
This solution is based on ThreeCSG.js converter by Chandler Prall.
npm i three-2-csg
The following example is based on a Stack overflow example by 4m1r:
import { toCSG, fromCSG } from 'three-2-csg';
//sphere
var sphere = new THREE.SphereGeometry(2,20,20);
var sphereMesh = new THREE.Mesh( sphere, material );
var sphereCSG = toCSG( sphereMesh ); // converting ThreeJS object to CSG
// cyl
var cylinder = new THREE.CylinderGeometry(0.5, 0.5, 5, 32 );
var cylinderMesh = new THREE.Mesh( cylinder, material );
var cylinderCSG = toCSG( cylinderMesh ); // converting ThreeJS object to CSG
//result
var subtractCSG = sphereCSG.subtract( cylinderCSG );
var result = fromCSG(subtractCSG); // converting CSG back into ThreeJS object
result.geometry.computeVertexNormals();
scene.add( result );
CSG_solid
Converts a ThreeJS 3D object into a CSG solid
THREE_Geometry
Converts a CSG solid (3d object) into regular ThreeJS geometry
CSG_solid
Converts a ThreeJS 3D object into a CSG solid
Kind: global function
Param | Type | Description |
---|---|---|
three_model | ThreeJS_Mesh | ThreeJS Mesh (or Geometry) which needs to be converted |
THREE_Geometry
Converts a CSG solid (3d object) into regular ThreeJS geometry
Kind: global function
Param | Type | Description |
---|---|---|
csg_model | CSG_solid | = CSG solid to be converted |
MIT License, http://www.opensource.org/licenses/MIT
FAQs
converts ThreeJS object into CSG and back
The npm package three-2-csg receives a total of 3 weekly downloads. As such, three-2-csg popularity was classified as not popular.
We found that three-2-csg demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.