Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boytchev/meshedgesgeometry
Extract edges from a Three.js object
https://github.com/boytchev/meshedgesgeometry
edges geometry mesh object threejs
Last synced: 4 months ago
JSON representation
Extract edges from a Three.js object
- Host: GitHub
- URL: https://github.com/boytchev/meshedgesgeometry
- Owner: boytchev
- License: mit
- Created: 2024-07-14T08:35:47.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-15T07:38:58.000Z (7 months ago)
- Last Synced: 2024-10-14T07:50:41.825Z (4 months ago)
- Topics: edges, geometry, mesh, object, threejs
- Language: JavaScript
- Homepage: https://boytchev.github.io/MeshEdgesGeometry/
- Size: 542 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MeshEdgesGeometry
**MeshEdgesGeometry** is a simple class to extract edges from a [**Three.js**](https://threejs.org/) object
– a mesh or a group with children. The hierarchy and substructures of the
input object are flattened out. Their positions, scales and rotations are baked
into world coordinates.**MeshEdgesGeometry** is like [**THREE.EdgesGeometry**](https://threejs.org/docs/index.html#api/en/geometries/EdgesGeometry),
except that it does not work on [**THREE.BufferGeometry**](https://threejs.org/docs/index.html#api/en/core/BufferGeometry), but on
[**THREE.Object3D**](https://threejs.org/docs/index.html#api/en/core/Object3D).### Code example
```js
var box = new THREE.Mesh(
new THREE.BoxGeometry( 2, 2, 2 ),
);
var edges = new THREE.LineSegments(
new MeshEdgesGeometry( box ),
new THREE.LineBasicMaterial( {color: 'black'} )
)
```### Demonstrations
Somewhat minimalistic demos of using **MeshEdgesGeometry** on a cube, on a group
of pyramids and on GLTF models. Click on an image to run it live:[
](https://boytchev.github.io/MeshEdgesGeometry/demos/demo-cube.html)
[](https://boytchev.github.io/MeshEdgesGeometry/demos/demo-group.html)
[](https://boytchev.github.io/MeshEdgesGeometry/demos/demo-model.html)
### Source code
[https://github.com/boytchev/MeshEdgesGeometry](https://github.com/boytchev/MeshEdgesGeometry)