Daniel Cárdenas

Full-Stack Builder: Firmware · Web · AI

I design and ship end-to-end systems—from STM32 firmware and edge data capture to Go/Python backends and multilingual RAG experiences.

XPLevel 1
0 XP150 to level up
Sep 2025Co-author & Developer2 min read

B-Spline Curve Generator

An interactive Python application for generating and visualizing 2D and 3D B-Spline curves using De Boor's algorithm and least-squares approximation.

Numerical MethodsInteractive Plotting3D Visualization
PythonNumPyMatplotlibScientific Computing

Outcomes

  • Implementation of De Boor's algorithm for curve generation.
  • Least-squares approximation for curve fitting.
  • Interactive mode for real-time curve manipulation.

Team & Process

This project was a collaborative effort by a team of five students. The team included mathematics students who focused on the theoretical foundations and proofs, while others focused on the software implementation. Our approach was heavily research-driven, involving the study of academic papers such as "Least-squares B-spline curve approximation with arbitrary end derivatives" to correctly implement the underlying algorithms.

Overview

This was a final project for a Scientific Programming course, focused on the implementation and visualization of B-Spline curves, a fundamental concept in geometric design and computer graphics. The project explores different methods for generating and manipulating these complex curves.

Core Features

The project is built in Python using NumPy for numerical operations and Matplotlib for 2D and 3D plotting. It's structured around three main functionalities:

  1. Direct Generation (De Boor's Algorithm): The application can take a set of control points and a knot vector from text files and render the corresponding B-Spline curve. This demonstrates the foundational algorithm for evaluating points on a curve.

  2. Least-Squares Approximation: Given a set of data points (observations), this feature calculates the optimal control points to generate a B-Spline curve that best approximates the data. This is essential for curve fitting applications.

  3. Interactive Mode: This is the project's most dynamic feature. It opens an interactive Matplotlib window where the user can click to add points, right-click to remove them, and drag them around. The B-Spline curve is recalculated and redrawn in real-time, providing immediate visual feedback on how control points influence the curve's shape.