• Stars
    star
    698
  • Rank 64,841 (Top 2 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Rust library for manipulating curves

kurbo, a Rust 2D curves library

Build Status Docs Crates.io

The kurbo library contains data structures and algorithms for curves and vector paths. It is probably most appropriate for creative tools, but is general enough it might be useful for other applications.

The name "kurbo" is Esperanto for "curve".

There is a focus on accuracy and good performance in high-accuracy conditions. Thus, the library might be useful in engineering and science contexts as well, as opposed to visual arts where rough approximations are often sufficient. Many approximate functions come with an accuracy parameter, and analytical solutions are used where they are practical. An example is area calculation, which is done using Green's theorem.

The library is still in fairly early development stages. There are traits intended to be useful for general curves (not just Béziers), but these will probably be reorganized.

Minimum supported Rust version

Since version 0.9, kurbo makes use of generic associated types and thus requires rustc version 1.65 or greater.

Similar crates

Here we mention a few other curves libraries and touch on some of the decisions made differently here.

  • lyon_geom has a lot of very good vector algorithms. It's most focused on rendering.

  • flo_curves has good Bézier primitives, and seems tuned for animation. It's generic on the coordinate type, while we use f64 for everything.

  • vek has both 2D and 3D Béziers among other things, and is tuned for game engines.

Some code has been copied from lyon_geom with adaptation, thus the author of lyon_geom, Nicolas Silva, is credited in the AUTHORS file.

More info

To learn more about Bézier curves, A Primer on Bézier Curves by Pomax is indispensable.

Contributing

Contributions are welcome. The Rust Code of Conduct applies. Please feel free to add your name to the AUTHORS file in any substantive pull request.

More Repositories

1

druid

A data-first Rust-native UI design toolkit.
Rust
9,543
star
2

xilem

An experimental Rust native UI framework
Rust
3,444
star
3

vello

A GPU compute-centric 2D renderer.
Rust
2,315
star
4

piet

An abstraction for 2D graphics.
Rust
1,251
star
5

runebender

A font editor written in Rust.
Rust
762
star
6

masonry

Rust UI design toolkit - moved.
Rust
405
star
7

skribo

A Rust library for low-level text layout.
Rust
325
star
8

glazier

Deprecated Rust Window Creation Library
Rust
209
star
9

parley

Rich text layout library
Rust
197
star
10

piet-metal

Experimental Metal-based GPU renderer for piet 2D graphics.
Rust
140
star
11

bevy_vello

An integration to render with Vello in Bevy game engine.
Rust
117
star
12

spline

A spline for interactive 2D curve design
Rust
112
star
13

druid-widget-nursery

A place where Druid widgets come to mature before moving to the Druid repo.
Rust
87
star
14

velato

An integration to parse and render Lottie with Vello.
Rust
71
star
15

norad

Rust crate for working with Unified Font Object files
Rust
43
star
16

rbf-interp

An implementation of Radial Basis Function multidimensional interpolation
Rust
35
star
17

gpu-stroke-expansion-paper

Rust
35
star
18

2d.graphics

Repo for an ideational book on 2D graphics, plus tools to make images
26
star
19

peniko

Primitive types for styling vector graphics.
Rust
22
star
20

vello_svg

An integration to render SVG files with Vello.
Rust
15
star
21

wiki

Wiki and documentation for 2D graphics projects
9
star
22

android_trace

Support for Android NDK Tracing in Rust
Rust
6
star
23

rfcs

Suggestions for major changes to the linebender ecosystem
6
star
24

linebender.github.io

Main webpage for linebender org
SCSS
5
star
25

interpoli

Rust
3
star
26

runebender.app

Ruby
2
star
27

piet-snapshots

Data for snapshot testing of piet backends
2
star