Some time ago I struggled to build a twisted gear with the “loft” tool inside FreeCAD for the logo of our company.
There’s a much easier way: still inside FreeCAD the “sweep” tool used along a helix. It’s enough to draw a helix and sweep the face of the gear along it. The face (in grey) lays on the x-y plane and is centred around the z axis; the helix (in green) is also centered around the z axis. The helix is used as “sweep path” and the face is the object to be swept.
The only tricky part to pay attention to is that the upper surface of the sweep solid will not be parallel to the base: it’s enough to have the helix’s height bigger than the height needed for the twisted gear and intersect the resulting twisted solid with a cuboid with the base larger than the gear face and the exact needed height.
The twisted gear is ready: