How to Create a B-Spline in FreeCAD Sketcher
Creating a B-spline curve in FreeCAD allows you to design smooth, complex, non-uniform curves within a 2D sketch for your 3D models. FreeCAD's Sketcher workbench provides two primary methods for generating B-splines: using control points or using knots (interpolation). This guide covers how to select the right B-spline tool, draw the curve, adjust its parameters, and apply geometric constraints to define its shape precisely.
Step 1: Open or Create a Sketch
- Open your project in FreeCAD and switch to either the Part Design Workbench or the Sketcher Workbench.
- Create a new sketch on your desired plane (e.g., XY-Plane) or double-click an existing sketch in the model tree to enter edit mode.
Step 2: Choose the B-Spline Tool
In the Sketcher toolbar, locate the B-spline dropdown menu. FreeCAD offers two main methods to construct a B-spline:
- B-spline by Control Points: You define the control polygon. The curve does not pass through the control points (except for the endpoints), but its curvature is pulled toward them. This is the recommended method for achieving smooth, organic transitions.
- B-spline by Knots (Interpolation): The curve passes directly through every point you click on the screen. FreeCAD automatically calculates the underlying control points behind the scenes.
Choose either the standard or periodic (closed-loop) version of either tool depending on your design requirements.
Step 3: Draw the Curve
- Click the first point on the sketch plane to define the start of the curve.
- Click consecutively to add intermediate control points or knot points.
- Once you place the final point, right-click your mouse or press Esc once to finish drawing the curve without exiting the sketch.
Step 4: Adjust the Curve and Control Polygon
After the curve is drawn, FreeCAD displays the curve along with its control polygon (indicated by dashed lines and control points):
- Move Points: Click and drag any point on the control polygon to reshape the curvature interactively.
- Show/Hide B-spline Information: Use the Sketcher B-spline tools menu to toggle the visibility of the control polygon, curvature comb (knot multiplicity), or internal knots.
- Increase or Decrease Degree: Select the B-spline curve and use the Increase B-spline degree or Decrease B-spline degree tools to alter the mathematical flexibility of the curve. Higher degrees allow more complex shapes within a single curve segment.
Step 5: Apply Constraints
To fully define your B-spline:
- Apply standard constraints (such as Distance, Coincident, or Horizontal/Vertical) directly to the control points or endpoints.
- Apply Tangent or Curvature (G2) constraints between the B-spline and adjacent lines, arcs, or other splines to ensure smooth mechanical transitions.