have you also worked on flexure clothoids
I have not, but I imagine this could be decomposed to two similar problems of a single clothoid and circular arc.
continuity clothoids
Here is a reference that might be helpful. https://math.stackexchange.com/questions/1785816/calculating-coordinates-along-a-clothoid-betwen-2-curves
Also, since I’m not very familiar with IfcOpenShell, could you share some practical examples of how clothoids are used ?
At this time, IfcOpenShell can only process the geometry of horizontal clothoids. If you define them in a model, IfcOpenShell can be used to compute a 4x4 placement matrix at any point along the clothoid. In the US, for highway and road works, clothoid is rarely used so I lack practical examples. Clothoids are occasionally encountered if working on an old section of roadway. Clothoids are used in rail applications but I don't have experience with that.
Is there any reference code to create an alignment by using ifcopenshell?
There is a discussion at https://wiki.osarch.org/index.php?title=IFC_-_Industry_Foundation_Classes/IFC_alignment along with some examples.
As far as authoring alignments in Bonsai, there aren't any features for this yet. I've been working on a feature to allow alignments to be defined by the PI method in a CSV and then import that into an IFC model in Bonsai. There is a pending pull request, https://github.com/IfcOpenShell/IfcOpenShell/pull/6234, that hopefully we can get all the loose ends cleaned up by the end of the week.
Attached is a jupyter notebook that illustrates how to compute the 4x4 matrix at a point along an IfcCompositeCurve.