To get a smooth border the tangents must be perpendicular to the mirror plane (yz).
I do this by given the 2nd and last but ones poles row the same y values as the first and last rows have.
The change is minimal but surfaceand mirror are now tangent.
- dp_04_23_001.png (208.16 KiB) Viewed 1762 times
here the model and the script
Code: Select all
f=App.ActiveDocument.Approximastion_Curve.Shape.Face1
c=f.Surface
poles=c.getPoles()
uk = c.getUKnots()
mu = c.getUMultiplicities()
ud = c.UDegree
uperiodic = c.isUPeriodic
vk = c.getVKnots()
mv = c.getVMultiplicities()
vd = c.VDegree
vperiodic = c.isVPeriodic
poles=c.getPoles()
polesa=np.array(poles)
polesb=polesa.swapaxes(0,1)
# polesb=np.round(polesb,1)
polesb[1,:,1]=polesb[0,:,1]
polesb[-2,:,1]=polesb[-1,:,1]
polesc=polesb.swapaxes(0,1)
sf=Part.BSplineSurface()
sf.buildFromPolesMultsKnots(polesc,mu,mv,uk,vk,False,False,ud,vd)
a=FreeCAD.ActiveDocument.getObject("ShapeA")
if a is None:
a=FreeCAD.ActiveDocument.addObject("Part::Feature","ShapeA")
a.Shape=sf.toShape()