GithubHelp home page GithubHelp logo

davidmr001 / beziermaker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from venshine/beziermaker

0.0 1.0 0.0 16.51 MB

通过de Casteljau算法绘制贝塞尔曲线,并计算它的切线,实现1-7阶贝塞尔曲线的形成动画

Java 100.00%

beziermaker's Introduction

BezierMaker

通过de Casteljau算法绘制贝塞尔曲线,并计算它的切线,实现1-7阶贝塞尔曲线的形成动画。

Features

  • 支持增加和删除控制点
  • 支持1阶到7阶贝塞尔曲线,限于屏幕大小,理论上可以支持N阶贝塞尔曲线
  • 支持自由移动控制点
  • 支持显示贝塞尔曲线形成过程的切线
  • 支持循环显示贝塞尔曲线的形成动画
  • 支持贝塞尔曲线显示速率
  • 支持显示控制点坐标

ScreenShot









Demo

Java:
    public class MainActivity extends Activity {

        BezierView mBezierView

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main)

            mBezierView = (BezierView) findViewById(R.id.bezier);
        }

        public void start(View view) {
            mBezierView.start();
        }

        public void stop(View view) {
            mBezierView.stop();
        }

        public void add(View view) {
            mBezierView.addPoint();
        }

        public void del(View view) {
            mBezierView.delPoint();
        }

    }
Methods:
method 方法 description 描述
void start() 开始贝塞尔曲线(required)
void stop() 停止贝塞尔曲线(optional)
boolean addPoint() 增加控制点(optional)
boolean delPoint() 删除控制点(optional)
int getOrder() 获取贝塞尔曲线阶数(optional)
void setRate(int rate) 设置移动速率(optional)
void setTangent(boolean tangent) 设置是否显示切线(optional)
void setLoop(boolean loop) 设置是否循环(optional)

About

License

Copyright (C) 2016 [email protected]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

beziermaker's People

Contributors

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