I'm a fan of OpenSCAD but recognize the limitations within the program. Part of the feature bundle of OpenSCAD is the parametric aspect. If you want to aim in that direction and can handle a GUI type of CAD program, consider to check out SolveSpace. All images courtesy of linked site.
Additionally, there is a Tutorial link on the site with a series of ...
Not sure what you're asking exactly, but you can use this workflow:
SideFX Houdini: math function + STL file generation
(optional) FreeCAD: Import STL as mesh, do whatever you need to do in FreeCAD, export to STL
a slicer: import the STL and slice it.
You may generate a .stl file from your mathematical definition. You may write a program using a language of your choice to compute the .stl file.
Your image shows a lot of rectangles, each rectangle may be described as two triangles. The .stl file is a (very long) list of all that triangles. Each triangle is defined by the X, Y, and Z coordinates of the ...