Graphite/website/other/bezier-rs-demos
Elbert Ronnie 5a1c171fc3
Add Area and Centroid nodes (#1749)
* initial attempt for area node

* allow node preview for more types

* make AreaNode sync and add CentroidNode

* cargo fmt

* preview of DVec2

* make the nodes async again

* use segment domain instead of region domain

* modify the check for linearity

* create a limit for area in centroid calculation

* cargo fmt

* reverse unnecessary changes

* add threshold to area calculation too.

* handle zero area edge case

* add todo comment

* implement 1D centroid and use it as fallback

* formatting floats to skip last zero

* add Centroid Type radio button to Centroid Node

* rename docs to use area and perimeter centroid

* add web demos for perimeter centroid

* add tests for perimeter centroid

* add fallback to use average of points

* Fix for broken area

* missing fixes

* Code review and rename Perimeter Centroid to Length Centroid

* Use dummy footprint in Area and Centroid nodes

* add doc and todo to clarify when `is_linear` fails

* use epsilon instead of zero

---------

Co-authored-by: 0hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2024-05-22 13:11:11 -07:00
..
public Fix Bezier-rs interactive demos and migrate its Webpack bundler to Vite 2024-01-04 23:13:40 -08:00
src Add Area and Centroid nodes (#1749) 2024-05-22 13:11:11 -07:00
wasm Add Area and Centroid nodes (#1749) 2024-05-22 13:11:11 -07:00
.eslintrc.cjs Move node visibility flag from NodeNetwork to DocumentNode (#1708) 2024-03-27 05:17:08 -07:00
.gitignore Bezier-rs: Replace Vue-CLI with Webpack bundler 2023-03-29 16:58:51 -07:00
.prettierrc Fix Bezier-rs interactive demos and migrate its Webpack bundler to Vite 2024-01-04 23:13:40 -08:00
README.md Fix Bezier-rs interactive demos and migrate its Webpack bundler to Vite 2024-01-04 23:13:40 -08:00
index.html Fix Bezier-rs interactive demos and migrate its Webpack bundler to Vite 2024-01-04 23:13:40 -08:00
package-lock.json Update npm dependencies across the project 2024-03-09 17:59:23 -08:00
package.json Update npm dependencies across the project 2024-03-09 17:59:23 -08:00
tsconfig.json Fix Bezier-rs interactive demos and migrate its Webpack bundler to Vite 2024-01-04 23:13:40 -08:00
vite.config.ts Fix Bezier-rs interactive demos and migrate its Webpack bundler to Vite 2024-01-04 23:13:40 -08:00

README.md

Bezier-rs interactive documentation

Open these interactive docs: https://graphite.rs/libraries/bezier-rs/

This page also serves isolated demos for iframes used in the Rustdoc crate documentation.

Building and running

From this directory, first execute npm install to install the required Node dependencies. Then...

  • To run the development server with hot reloading:
    npm start
    
  • To compile an optimized production build:
    npm run build