All Projects → torresjrjr → Bezier.py

torresjrjr / Bezier.py

Licence: GPL-3.0 License
➰ Create Bezier curves in Python [Mirror]

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Bezier.py

cloud gen
Procedural Generation of Clouds with Vector Graphics
Stars: ✭ 46 (+109.09%)
Mutual labels:  bezier, bezier-curves
BezierCanvas
Adobe Illustrator's pen tool style bezier editor on Unity.
Stars: ✭ 126 (+472.73%)
Mutual labels:  bezier, bezier-curves
SwiftUI-bez
Utilities for working with bezier curves in SwiftUI
Stars: ✭ 80 (+263.64%)
Mutual labels:  bezier-curves
BezierPathClosestPoint
Finding the closest point on UIBezierPath
Stars: ✭ 43 (+95.45%)
Mutual labels:  bezier-curves
BezierCurves2D
An implementation of 2D Bezier Curves in C++ using OpenGL, gl3w, glfw3 and imgui.
Stars: ✭ 41 (+86.36%)
Mutual labels:  bezier-curves
bezmouse
Simulate human mouse movements with xdotool
Stars: ✭ 110 (+400%)
Mutual labels:  bezier-curves
BezierKit
Bezier curves and paths in Swift for building vector applications
Stars: ✭ 190 (+763.64%)
Mutual labels:  bezier
phaser3-plugin-pathbuilder
Draw and edit Lines, Bezier Curves, Splines at runtime, explore your scene and export your paths to Phaser
Stars: ✭ 67 (+204.55%)
Mutual labels:  bezier-curves
BezierCurtainEffect
贝塞尔曲线窗帘效果BezierCurtainEffect,BezierCurtainView,CurtainEffect,CurtainView
Stars: ✭ 45 (+104.55%)
Mutual labels:  bezier
Bezier
Fast and lightweight class for Bezier curves of any order in C++
Stars: ✭ 59 (+168.18%)
Mutual labels:  bezier
SonogramView
Audio visualisation of song
Stars: ✭ 65 (+195.45%)
Mutual labels:  bezier
IVBezierPathRenderer
Alternative Path Renderer for Apple MapKit to render path with bezier curve
Stars: ✭ 31 (+40.91%)
Mutual labels:  bezier-curves
curve-editor
A simple bezier curve editor
Stars: ✭ 35 (+59.09%)
Mutual labels:  bezier
bezier-editor
A tool base on HTML5 canvas to create bezier curve like photoshop and then it can be exported as JavaScript code to create an animation path for an HTML element.
Stars: ✭ 21 (-4.55%)
Mutual labels:  bezier-curves
shapekeyimport
Blender add-on to import shapekeys
Stars: ✭ 31 (+40.91%)
Mutual labels:  bezier-curves
JPlotter
OpenGL based 2D Plotting Library for Java using AWT and LWJGL
Stars: ✭ 36 (+63.64%)
Mutual labels:  bezier
curve cad
Blender Addon: Bezier Curve CAD Tools for CNC Milling & Laser Cutting
Stars: ✭ 107 (+386.36%)
Mutual labels:  bezier-curves
motionLib
quaternion, euler angle, interpolation, cubic bezier, cubic spline, PCA, etc.
Stars: ✭ 23 (+4.55%)
Mutual labels:  bezier
Unity-Procedural
Spline based mesh generation
Stars: ✭ 67 (+204.55%)
Mutual labels:  bezier
CurveFitting
〰️ Curve fitting based on Schneider's algorithm. Written using C++11 and OpenSceneGraph (visualization)
Stars: ✭ 75 (+240.91%)
Mutual labels:  bezier-curves

Bezier.py

Create Bezier curves in Python

Preview plots with matplotlib

An assortment of Bezier curves plotted with matplotlib.pyplot

14-point 3D Bezier curve:

14-point 3D Bezier curve

Usage

Save the main file Bezier.py into your local directory to import into your python code. Import Bezier and numpy and use. Bezier only has 1 class for now, so you can use this snippet:

from Bezier import Bezier
import numpy as np

Create a Bezier curve with parameter t and a numpy array of inital points points1 of any dimension. Here's a 2D example:

t_points = np.arange(0, 1, 0.01) #................................. Creates an iterable list from 0 to 1.
points1 = np.array([[0, 0], [0, 8], [5, 10], [9, 7], [4, 3]]) #.... Creates an array of coordinates.
curve1 = Bezier.Curve(t_points, points1) #......................... Returns an array of coordinates.

You can plot your creations with matplotlib.

import matplotlib.pyplot as plt

plt.figure()
plt.plot(
	curve1[:, 0],   # x-coordinates.
	curve1[:, 1]    # y-coordinates.
)
plt.plot(
	points1[:, 0],  # x-coordinates.
	points1[:, 1],  # y-coordinates.
	'ro:'           # Styling (red, circles, dotted).
)
plt.grid()
plt.show()

The result:

The resulting plot

See examples.py for more.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].