I was working on a Part.Spiral bug : spiral goes weird when the number of turns is too high.
It is similar to what happened to Part.Helix.
FC bug #954
OCC bug #23314
For the default Spiral, the bug appears at 43.4 turns.
This is caused by calling BRepLib::BuildCurves3d
Here are the default arguments :
BRepLib::BuildCurves3d(shape, Tolerance=1e-5, Continuity=GeomAbs_Shape::GeomAbs_C1, MaxDegree=14, MaxSegments=0);
MaxSegments=0 means the the tool self-computes the max number of segments : EvaluateMaxSegment
If I force MaxSegments=1,2,3,... the spiral goes wrong pretty fast, after a couple of turns only.
For MaxSegments=30, I get the failing limit to 43.4 turns (same as automatic mode MaxSegments=0)
Setting a much bigger number (MaxSegments=9999) allows to build big valid spirals (more than 500 turns).
So it seems the bug is in EvaluateMaxSegment that only raises the number of segments for BSpline curves ans surfaces, while it should probably also consider periodic surfaces.
This where I am stuck for now.
Maybe someone will want to join the bug hunt ...
BTW : I think this is probably related to this other bug :
Code: Select all
import FreeCAD
import Part
from math import pi
vec2 = FreeCAD.Base.Vector2d
cylFace = Part.makeCylinder(10,10).Face1
cyl = cylFace.Surface
line = Part.Geom2d.Line2dSegment(vec2(),vec2(100*pi,100))
edge1 = line.toShape(cyl)
Part.show(edge1)