https://youtu.be/VIcZdc42F0g
the model is created by 3 sketches to generate a Surface and a lot of Draft arrays.
for gyroid see I use scipy minimize to find the minimum area surface
Code: Select all
#---------------------------
# finde otimale innenpole
import numpy as np
import scipy
from scipy.optimize import minimize
methods=[
'Nelder-Mead' ,
'Powell' ,
'CG' ,
'BFGS' ,
'L-BFGS-B',
'TNC',
'COBYLA',
'SLSQP',
]
alpha=[App.ActiveDocument.BePlane.Shape.Face1.CenterOfMass]*4
ptsa=np.array(App.ActiveDocument.BePlane.Shape.Face1.Surface.getPoles())
def areaMin(alpha):
'''function to minimize'''
poles=ptsa
alpha=alpha.reshape(2,2,3)
poles[1:3,1:3]=alpha
bs=Part.BSplineSurface()
bs.buildFromPolesMultsKnots(poles,[4,4],[4,4],[0,1],[0,1],False,False,3,3)
return bs.toShape().Area
for method in methods:
tol=10**5
rc=minimize(areaMin,alpha,method=method,tol=tol)
print (rc.success,rc.message)
alpha=np.array(list(rc.x)).reshape(2,2,3)
poles=ptsa
poles[1:3,1:3]=alpha
bs=Part.BSplineSurface()
bs.buildFromPolesMultsKnots(poles,[4,4],[4,4],[0,1],[0,1],False,False,3,3)
Part.show(bs.toShape())
new=bs.toShape().Area
old=App.ActiveDocument.BePlane.Shape.Area
print (method," improvement %",round((old-new)/old*100,2),new)
#----------------------------
I remember your solution. I don't know whether the surface wb calculates minimal surfaces.
I do experiments with a 4 x 9 nurbs where I start with arcs (Bezier approx.) as borders too.hammax wrote: ↑Thu Jan 31, 2019 8:28 am… to get minimal surfaces, the soap bubble should be the physical method.
I only used arcs for the border lines in the elemental gyroid-cube.
Applying a curvature comb, there is a discontinuity at the cubes corners for arcs.
Should there be a better solution when using sinus curves? (But which amplitude???)
Gyroid_n_2.PNG