keithsloan52 wrote: ↑Sun Apr 11, 2021 8:34 pm
Same bug if two circles
In OpenSCAD hull() doesn't work in 3D on 2D objects, It projects the objects onto the xy-plane, so I didn't expect it to work on circles that were not co-planar.
https://en.wikibooks.org/wiki/OpenSCAD_ ... tions#hull
On the other hand, it should be expected to work for two spheres regardless of their placement. Looking at your code (I can't debug it readily, see
https://forum.freecadweb.org/viewtopic.php?f=4&t=57657), it appears you haven't ensured that all your four circles are in the same plane. They need to be all in some plane containing the line between their centers. Note that their Placement.Rotation.Axis are irrelevant. You can rotate a sphere around any axis and it remains unchanged. You need to define Part.Circle.Axis in a common direction orthogonal to v1 - v2. One way is to cross-product v1 - v2 with the three axis directions and choose one that is non-zero. You need to special case v1=v2 anyway - return the larger sphere.
The other thing that looks like an error to me is the definition of l2, surely it should be
- l2 = Part.makeLine(c2.value(t3), c1.value(t3 + Math.pi))
or it won't connect up with a2?