First of all, Happy New Year to you all. Looking forward to a great year of CAD modeling.
Okay, this is kind of a wild question, I don't necessarily expect an answer, just wanted to get your thinking juices flowing. This question applies to really any CAD tool not just CadQuery/OCCT/FreeCAD.
Code for this is down below, it's really really simple. At every step of the way I define my "control shape" as planar (it's a rotating triangle), in the XY. This works great. However, with forms that have a spiraling nature, a spherical representation of the control shape is more suitable. With very complicated shapes especially. You can think IMAX versus typical movie theater. IMAX projects onto a sphere, movie theater projects onto plane. I was looking for a way to define a loft, or something similar, which has a spiraling/natural character and where the control surfaces are defined as spherical cross sections.
What soft of low-level hooks would I use to accomplish that, or what sorts of higher-level APIs are available to accomplish that. I can certainly get away with planar cross sections, no problem. But it would be nice... Kind of nifty...
Here is the code.
from cadquery import Workplane
profile = Workplane("XY")
profile = profile.workplane(offset= -64)
profile = profile.moveTo(0, 8)
profile = profile.lineTo(-8, -8)
profile = profile.lineTo(8, -8)
profile = profile.close()
profile = profile.workplane(offset= 64 - 32)
profile = profile.moveTo(-4, 0)
profile = profile.lineTo(4, -4)
profile = profile.lineTo(4, 4)
profile = profile.close()
profile = profile.workplane(offset= 32 - 16)
profile = profile.moveTo(0, -2)
profile = profile.lineTo(2, 2)
profile = profile.lineTo(-2, 2)
profile = profile.close()
profile = profile.workplane(offset= 16 - 8)
profile = profile.moveTo(1, 0)
profile = profile.lineTo(-1, -1)
profile = profile.lineTo(-1, 1)
profile = profile.close()
profile = profile.workplane(offset= 8 - 4)
profile = profile.moveTo(0, 1/2)
profile = profile.lineTo(-1/2, -1/2)
profile = profile.lineTo(1/2, -1/2)
profile = profile.close()
profile = profile.workplane(offset= 4 - 2)
profile = profile.moveTo(-1/4, 0)
profile = profile.lineTo(1/4, -1/4)
profile = profile.lineTo(1/4, 1/4)
profile = profile.close()
profile = profile.workplane(offset= 2 - 1)
profile = profile.moveTo(0, -1/8)
profile = profile.lineTo(1/8, 1/8)
profile = profile.lineTo(-1/8, 1/8)
profile = profile.close()
profile = profile.workplane(offset= 1 - 1/2)
profile = profile.moveTo(1/16, 0)
profile = profile.lineTo(-1/16, -1/16)
profile = profile.lineTo(-1/16, 1/16)
profile = profile.close()
spiral = profile.loft(ruled= False, combine= False)
show_object(spiral)