GithubHelp home page GithubHelp logo

zhangjianhu10 / beziercurvdraw Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cuixiaorui/beziercurvdraw

0.0 0.0 0.0 794 KB

基于贝塞尔曲线拟合算法实现绘制平滑曲线

JavaScript 97.43% TypeScript 2.14% HTML 0.42%

beziercurvdraw's Introduction

bezierCurvDraw

基于贝塞尔曲线拟合算法实现绘制平滑曲线

算法

JavaScript implementation of Algorithm for Automatically Fitting Digitized Curves by Philip J. Schneider "Graphics Gems", Academic Press, 1990

实现

  • 基于拟合算法生成对应的贝塞尔曲线点
  • 基于生成的贝塞尔曲线点生成对应的绘制点
  • 基于绘制点生成对应的线条

演示

功能

  • 可动态编辑参数
    1. MaxError: 最大错误控制点(越小生成的线条准确点越高)
    2. Tension: 张力(可控制曲线的样式)
    3. Segments: 精准度(越大线条越平滑,生成的点也更多)
  • 可拖拽控制点
  • 可在线条空白处生成控制点
  • 双击线条可选中(改变颜色)

演示地址

说明

demo 基于 egret 编写,在 canvas 的基础上实现的。

  • 生成贝塞尔曲线点的库为 curve
  • 生成绘制点的逻辑在 DrawCurveCore.ts 内

参考

beziercurvdraw's People

Contributors

cuixiaorui 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.