Commit graph

222 commits

Author SHA1 Message Date
Hannah Li
8d3daeae78 Bezier-rs: Add trim for Subpath (#1006)
* Move compare.rs

* Update traits for Subpath and ManipulatorGroup

* Implement trim

* UI adjustments and more tests

* Add reverse, refactor code, rename variables

* Improve comments

* Comment nits

* Address comments

* Update trim behavior

* Update doc comment for trim

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-26 18:41:11 -05:00
0HyperCube
08b2782917 Bézier-rs: Add ids to manipulator groups (#1054)
* Add ids to manipulator groups

* Fix tests

* Rename trait from ManipulatorGroupId to Identifier

* Rename EmptyManipulatorGroupId to EmptyId
2023-02-25 16:23:58 +00:00
timblah
48dcc2774b Fix file paths mentioned in website's Contribute page (#1052)
* Updated paths for frontend / backend communication section of contribute page to reflect current project structure

* Added starting / for consistency with other paths on the page

* Mapping actually happens in subscription router

* Changed path to show code that dispatches FrontendMessage rather than the type def

* Missing / at start of path

* Fix files

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-23 02:40:28 -05:00
Thomas Cheng
f2d35f50de Bezier-rs: Add self_intersection to subpath (#1035)
* add self-intersection to subpath, rebased old work onto master

* fix interactive website after rebase

* fix rustdoc iframe placement

* remove double comment

* address comments

* revert evaluate change

* address comment + fix assert statement bug

* update function comments
2023-02-21 17:08:55 -05:00
Linda Zheng
37775eb9e9 Bezier-rs: Add bounding box, extrema, and inflection functions for subpath (#953)
* Create bbox function for subpath

* Create extrema and inflection function for subpath

* Address comments

* Prevent selecting text in SVG demo boxes

* Address Keavon's comments

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-20 13:40:38 -05:00
Hannah Li
98f172414a Bezier-rs: Add iframes to rustdoc (#1036)
* Add iframes examples

* Move TValue selection to bottom

* Remove spaces

* Add background, adjust heights

* Minor lint fix
2023-02-17 19:09:36 -05:00
Rob Nadal
9a52cae9b9 Bezier-rs: Add SubpathTValue and euclidean parameterization for subpaths (#1027)
* Added SubpathTValue and euclidean parameterization for subpaths

* Small fix

* Added bounds checking to get_segment

* Code review

* code review nit for clarity

---------

Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-17 15:33:52 -05:00
Rob Nadal
a64c856ec4 Bezier-rs: Updated Bezier function signatures to accept TValue (#967)
* Create helper for converting d to t values

* Add euclidean option for tangent and normal

* Modified bezier functions signatures to accept ComputeType

* Stylistic changes per review

* Added ComputeType documentation

* Renamed ComputeType to TValue

* Fixed comments

* Fixed failing unit tests

* Code review

* Fix comments in code review

* Renamed compute_type_to_parametric to t_value_to_parametric

---------

Co-authored-by: Linda Zheng <thelindazheng@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-13 12:31:51 -05:00
Hannah Li
ff51098c11 Bezier-rs: Add hash URLs for individual API examples (#968)
* Handle displaying single demos

* Address comments

* Update eslintrc

* Add hash links

* Use hash instead of pathname

* Address small nits

* Change url format

* CSS improvements

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-08 23:32:28 -05:00
Hannah Li
a328e7d3ef Bezier-rs: Add split for Subpath (#988)
* Add subpath split

* Update comment and colors

* Address comments

* Improve visualization clarity

* Code review

---------

Co-authored-by: Rob Nadal <Robnadal44@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-31 03:17:20 -05:00
Jackie Chen
511a8aa164 Bezier-rs: Add normal and tangent to subpath (#1003)
tangent and normal for subpath

Co-authored-by: Rob Nadal <Robnadal44@gmail.com>
2023-01-31 00:15:37 -05:00
Keavon Chambers
66e8325362 Update project readme and MSRV 2023-01-24 01:33:30 -08:00
Keavon Chambers
d2219cec36 Fix website RSS feed title 2023-01-22 00:59:26 -08:00
Rob Nadal
01853fe4b7 Bezier-rs: Refactor interactive demo to remove Vue (#959)
* Converted bezier example to vanilla js component

* Indent with tabs

* Add sliders

* Converted bezier example pane to vanilla js

* Implement the radio buttons + fixes

* Converted SubpathExample to vanilla js

* Converted SubpathExamplePane to vanilla js

* Removed vue components

* Remove App.vue

* Remove vue and other dependencies

* Minor fix in main.ts

* Added insert to subpath features

* Entry point tweaks

* Rename "example" to "demo"

* Kebab-case file names (except classes)

Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-13 04:04:39 -05:00
Hannah Li
758f757783 Bezier-rs: Insert function for subpath (#876)
* Add manipulator

* Add manipulator group

* Add UI

* Address comments and rebase

* Renamed add_manipulator_group to insert

Co-authored-by: Rob Nadal <robnadal44@gmail.com>
2023-01-12 18:26:25 -08:00
Rob Nadal
72cd204c64 Bezier-rs: Add project function for Subpaths (#914)
* Added subpath project function

* Set appropriate project default in single manipulator group case

* Lint

* Return optional from subpath project + stylistic changes per review

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-29 18:32:22 -05:00
0HyperCube
11401f8692 Avoid deprecated into_serde() (#906) 2022-12-23 19:16:23 +00:00
Keavon Chambers
49b9b8cfec Rename the legacy Graphene crate to document-legacy (#899)
* Rename /graphene to /document-legacy

* Update names in code
2022-12-22 02:12:05 -08:00
Rob Nadal
ef99c91226 Bezier-rs: Added function to find intersections between a bezier and a rectangle (#897)
* added function to find intersections for a rectangle

* Added is_contained_within function
2022-12-21 14:44:11 -08:00
Keavon Chambers
2f2daa25e9 Simplify website template code 2022-12-18 21:35:46 -08:00
Keavon Chambers
1bdbcfd9e7 Prepare Bezier-rs for publishing 2022-12-17 22:14:56 -08:00
TrueDoctor
7d8f94462a Bundle Graphite using Tauri (#873)
* Setup tauri component for graphite editor

Integrate graphite into tauri app

Split interpreted-executor out of graph-craft

* Add gpu execution node

* General Cleanup
2022-12-07 12:49:34 +01:00
Thomas Cheng
52cc770a1e Bezier-rs: Add parametric evaluate and line intersect to subpath (#852)
* add slider to subpath component + change evaluate to take an enum

Co-authored-by: Rob Nadal <RobNadal@users.noreply.github.com>

wip - add intersect to subpath, TODO fix bug

Co-authored-by: Rob Nadal <RobNadal@users.noreply.github.com>

add unit tests to subpath intersections

stress, testing

Co-authored-by: Hannah Li <hannahli2010@gmail.com>

* add parametric eval impl to subpath

* add line intersection to subpath

* Uncomment and #[ignore] disabled tests

* Reorder a few imports

* change subpath:eval slider to radio button

* fixed bug with solve_cubic, fixed unit tests, improved intersection accuracy

* fix failing test

Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-11 00:41:02 -05:00
Hannah Li
01a9724389 Bezier-rs: Add Euclidean parameterization to Bezier::evaluate (#828)
* Add enum to evaluate for differenciating compute type

* Add euclidean parameterization and update styling in the UI

Co-authored-by: Rob Nadal <robnadal44@gmail.com>

* Update usage of evaluate in graphite

* Add description

* Code review changes

* Update tests

* Improve ComputeType ergonomics

* Large code review/cleanup pass

Co-authored-by: Rob Nadal <robnadal44@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-18 20:37:52 -08:00
Rob Nadal
a220bfa759 Bezier-rs: Remove unused legacy drawing components and structs (#853)
* Removed unused legacy drawing components

* Removed Point abstraction from frontend code

* Code review fixes

* Helper lambdas to functions

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-18 00:34:52 -08:00
Keavon Chambers
14e0582494 Update bezier-rs interactive demos node.js packages 2022-11-16 18:31:21 -08:00
Keavon Chambers
cece6de2a9 Bump MSRV to 1.65.0 for let-else syntax
Closes #857
2022-11-16 18:04:04 -08:00
Rob Nadal
00c8fa83c2 Bezier-rs: Convert to_svg used in subpaths to match style used in beziers (#854)
Converted subpath::to_svg to Bezier style
2022-11-14 22:37:06 -08:00
Keavon Chambers
c4d14eed16 Update frontend and bezier-rs demo npm dependencies 2022-11-08 15:11:53 -08:00
Rob Nadal
56060b8e5f Bezier-rs: Added curve outline functions (#789)
* Implement offset and reverse

Co-authored-by: Rob Nadal <robnadal44@gmail.com>

* Initial work on graduated outline

Co-authored-by: Rob Nadal <robnadal44@gmail.com>

* Handle linear case for graduated scale

* Added skewed outline, fixed graduated scale hourglass bug

* Removed test code

* Update comments

* Fix linting issue

* Improve comments

* Comment fixes

Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-06 21:25:00 -08:00
Hannah Li
a695584d36 Bezier-rs: Add a pivot point to the 'rotate' function (#792)
* Add function to rotate around a point

* Update svg

* Improve rotation line-to-center styling

* Add second angle of lines

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-06 20:52:58 -08:00
Linda Zheng
9eb2b9f6a3 Bezier-rs: Convert 'arcs' wasm function from canvas to SVG rendering (#833)
* Convert rotate demo to svg

* Fix bugs in rotate

* Fix bugs in rotate

* Draft of decasteljau to svg

* fixed de casteljau points to_svg impl

* clean up wasm impl for de casteljau points

* Use svg format in wasm for arcs

* Update app.vue

* Fix arcs as svg

Co-authored-by: Linda Zheng <ll2zheng@uwaterloo.ca>

* Remove comments

* Reduce code duplication

Co-authored-by: Thomas Cheng <contact.chengthomas@gmail.com>
Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-06 23:04:30 -05:00
Linda Zheng
398f6618e4 Bezier-rs: Convert 'rotate' and 'de casteljau' wasm functions from canvas to SVG rendering (#793)
* Convert rotate demo to svg

* Fix bugs in rotate

* Fix bugs in rotate

* Draft of decasteljau to svg

* fixed de casteljau points to_svg impl

* clean up wasm impl for de casteljau points

* Address Hannah's comments

* Nits

Co-authored-by: Thomas Cheng <contact.chengthomas@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-06 21:34:53 -05:00
Jackie Chen
4483e98f21 Bezier-rs: Convert intersection functions to SVG (#791)
* Break handle of path being drawn by placing anchor on previous anchor with Pen tool (#814)

* Break path by placing anchor on previous one

* Fix offset on click without dragging

* Fix bug where ids reassigned from saved document

* Fix stuck overlay

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* convert intersection functions to svg

* fixed nits

Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-06 18:14:44 -08:00
Keavon Chambers
16afe91944 Change favicon/app manifest theme color to white 2022-11-06 01:55:48 -07:00
Keavon Chambers
0f0d30eb9a Add building instructions to the website contribute page 2022-10-14 10:09:37 -07:00
Brian Wo
197ec492f2 Fix wrong hyperlink on website home page (#785)
Fix wrong url path in website
2022-10-09 06:44:04 +08:00
Thomas Cheng
dccff784c5 Convert reduce() and offset() Bezier-rs wasm demo functions to render as SVG (#783)
* convert reduce and offset wasm func to return svg

* address comments
2022-10-05 23:54:02 -04:00
Hannah Li
55f6d13daf Bezier-rs: continue converting demos from canvas to SVG (#779)
* Convert constructor to use svg

* Convert the through_points functions to svg

* Convert length, lut, derivative, and tangent from canvas to svg

* Fixed bug when t1 == t2 in split

* Converted split and trim to use svg representation, and swapped slider options default to use quadratic options

* Convert normal and curvature to use svg representation in bezier-rs-demos

* Convert the project function to use svg representation in bezier-rs-demos

* Convert the local_extrema, bbox, and inflections to use svgs

* Add text offset constants

* Fix typo

Co-authored-by: Robert Nadal <Robnadal44@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-09-27 17:37:30 -07:00
Hannah Li
e9cd792635 Bezier-rs: Convert from canvas to svg for constructors (#776)
* Convert constructor to use svg

* Convert the through_points functions to svg

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-09-26 19:14:27 -07:00
Keavon Chambers
8dce2144c4 Add website link prompting to subscribe to the newsletter 2022-09-25 01:45:59 -07:00
Keavon Chambers
ab75f0fbfb Improve the website and readme with details and cleanup 2022-09-16 01:29:33 -07:00
Keavon Chambers
655831eedf Improve wording on the website home page; add a volunteer icon 2022-09-04 14:31:08 -07:00
Hannah Li
f74b6ed111 Refactor bezier-rs' to_svg functionality (#758)
* Change Bezier to_svg to include handles and endpoints

* Move params into brackets of format macro, remove unused comment

* Use write macro instead of format

* Fix path for watched directory

* Refactor functions to remove ToSVGOptions
2022-09-01 23:13:39 -04:00
Keavon Chambers
33cb6fcb00 Remove usage of 'null' in favor of 'undefined' 2022-08-25 21:32:27 -07:00
Keavon Chambers
3a84de32ac Clean up MenuList types and fix many Vue and Clippy warnings
Also remove hard-coded-in-Vue Graphite logo in the menu bar in favor of a Rust definition.
2022-08-25 14:41:16 -07:00
Keavon Chambers
1a90a4db86 Clean up camelCase and snake_case in frontend code 2022-08-23 13:36:27 -07:00
Hannah Li
49c236fcc2 Divide the large Bezier-rs implementation file into smaller ones (#751)
* Refactor bezier lib file into a separate folder

* Add better implementation comments

* Update import of Subpath from bezier-rs

* Add comment to describe compare.rs

* Remove printlns and adjust spacing
2022-08-18 18:47:36 -04:00
Keavon Chambers
4412b983cd Move bezier-rs into libraries folder and deploy its interactive docs 2022-08-14 16:17:27 -07:00
Keavon Chambers
dc0b38750c Update npm dependencies 2022-07-23 15:31:02 -07:00