Giter Site home page Giter Site logo

nbezier's Introduction

nbezier

license crates.io docs

nbezier aims to be a general purpose library for working with bezier curves of any degree.

It uses nalgebra (hence the name) to implement a generic BezierCurve.

This library also provides a non-generic type SimpleCurve hiding nalgebra's complexity. SimpleCurve is optimised for cubic bezier curves while supporting arbitrary degree.

Current Features

  • store curve as list of control points (a matrix' column vector to be precise)
  • de Castlejau's Algorithm
    • evaluate a point
    • split a curve
  • compute a curve's polynomial and its derivative
    • normal and tangental vectors
  • a curve's control points' axis aligned bounding box and convex hull
  • raise or reduce a curve's degree

Experimental Features

  • find a point on a curve
  • find all intersection points between two curves

Planned Features

  • any suggestions?

How is SimpleCurve optimised?

Using nalgebra BezierCurve is generic over its degree. SimpleCurve is an enum storing curves of degree 1, 2, 3 and anything above in its 4 variants. Since these low degrees are their own variant with dedicated type, rust can monomorphize these computing a lot of "magical constants" at compile time. Also these degree's variants are stored exclusively on the stack giving them an enormous performance boost.

nbezier's People

Contributors

gammelalf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.