This document describes the internal architecture and construction flow of an S-Bend geometry generator implemented in Python. The S-Bend is constructed using cubic Bézier curves derived directly from their mathematical formulation.
The S-Bend geometry is based on the cubic Bézier curve, defined as:
Each Bézier segment is fully defined by four control points:
The S-Bend is composed of two cubic Bézier segments connected continuously:
The endpoint of the first segment is reused as the starting point of the second segment to guarantee geometric continuity.
Each Bézier segment is parameterized using NumPy vectors representing the control points in Cartesian space.
P0, P1, P2, P3 → First Bézier segment
Q0, Q1, Q2, Q3 → Second Bézier segment
The midpoint P3 of the first segment is reused as Q0
for the second segment, ensuring a smooth transition.
A dedicated function evaluates the cubic Bézier equation by sampling the
parameter t uniformly in the range [0, 1].
def cubic_bezier(A, B, C, D, n):
t = linspace(0, 1, n)
return B(t)
Vectorized computation is used to efficiently generate curve points.
The generated curve is plotted using Matplotlib:
This separation clearly illustrates the relationship between the mathematical model and the resulting physical geometry.
This architecture demonstrates a clean separation between:
Such an approach is well-suited for parametric photonic and semiconductor layout generation.