Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sean-bradley/bender
Bend Geometries in Threejs
https://github.com/sean-bradley/bender
Last synced: 1 day ago
JSON representation
Bend Geometries in Threejs
- Host: GitHub
- URL: https://github.com/sean-bradley/bender
- Owner: Sean-Bradley
- License: mit
- Created: 2020-10-04T08:39:34.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-07T21:43:59.000Z (8 months ago)
- Last Synced: 2024-05-02T02:13:39.598Z (7 months ago)
- Language: TypeScript
- Size: 966 KB
- Stars: 18
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bender
Bend Geometries in Threejs. Works with geometries of base type THREE.Geometry and THREE.BufferGeometry.
Example 1 : https://sbcode.net/threejs/bender/
Example 2 : https://sbcode.net/threejs/engraving/
## Usage
```typescript
bend(geometry: THREE.BufferGeometry, axis: string, angle: number)
```![Bending a cube](docs/cube.jpg)
![Bending text](docs/text.jpg)
```bash
git clone https://github.com/Sean-Bradley/Bender.git
cd Bender
npm install
npm run dev
```This is a typescript project consisting of two subprojects with their own *tsconfigs*.
To edit this example, then modify the files in `./src/client/` or `./src/server/`. The projects will auto recompile if you started by using `npm run dev`
Visit http://127.0.0.1:8080
## Importing
You can import via CDN
```typescript
import Bender from 'https://cdn.jsdelivr.net/gh/Sean-Bradley/Bender@main/dist/client/bender.js'
```Or, you can import the generated `./dist/client/bender.js` directly into your project as a module.
```html
```
Or, you can use an ES6 import if it is placed within the source folder of your project.
```typescript
import Bender from './path/to/bender.js'
```View on SBEDIT : https://sbedit.net/17fe262c1243efd58860343f8ae87712318706fe
## Threejs TypeScript Course
Visit https://github.com/Sean-Bradley/Three.js-TypeScript-Boilerplate for a Threejs TypeScript boilerplate containing many extra branches that demonstrate many examples of Threejs.
> To help support this Threejs example, please take a moment to look at my official Threejs TypeScript course at
[![Threejs TypeScript Course](docs/threejs-course-image.png)](https://www.udemy.com/course/threejs-tutorials/?referralCode=4C7E1DE91C3E42F69D0F)
[Three.js and TypeScript](https://www.udemy.com/course/threejs-tutorials/?referralCode=4C7E1DE91C3E42F69D0F)
Discount Coupons for all my courses can be found at [https://sbcode.net/coupons](https://sbcode.net/coupons)