K3D-tools / K3D-jupyter

K3D lets you create 3D plots backed by WebGL with high-level API (surfaces, isosurfaces, voxels, mesh, cloud points, vtk objects, volume renderer, colormaps, etc). The primary aim of K3D-jupyter is to be easy for use as stand alone package like matplotlib, but also to allow interoperation with existing libraries as VTK.
MIT License
942 stars 123 forks source link

Weird lines on surface color #290

Closed Davide-sd closed 3 years ago

Davide-sd commented 3 years ago

I'm not familiar with the way colors are drawn on the surface: I guess that a face color is computed with some kind of interpolation between the values of the attribute at the face vertices.

In the following example we can see a white line between the red and blue colors, which is one face wide. In my opinion, the result is incorrect: red faces should connect to blue faces. This problem is visible with any color map, even with cyclical color maps.

import k3d
import numpy as np
from matplotlib.tri import Triangulation

x = y = np.linspace(-3, 3, 100)
xx, yy = np.meshgrid(x, y)
zz = (xx + 1j * yy)**2
mag = np.absolute(zz)
arg = np.angle(zz)

plot = k3d.plot()

xx, yy, mag, arg = [t.flatten().astype(np.float32) for t in [xx, yy, mag, arg]]
vertices = np.vstack([xx, yy, mag]).T.astype(np.float32)
indices = Triangulation(xx, yy).triangles.astype(np.uint32)

surf = k3d.mesh(vertices, indices, side="double",
               color_map=k3d.basic_color_maps.CoolWarm,
               attribute=arg)

plot += surf
plot.display()

K3D-1624025690932

tgandor commented 3 years ago

To be honest, for y==0 there are real numbers, so the argument is 0 (which is white). The interpolation may or may not be perfect, but the white line is rightfully there.

Davide-sd commented 3 years ago

To be honest, for y==0 there are real numbers, so the argument is 0 (which is white).

Be careful, that weird line happens when x == 0, therefore when there are only pure complex numbers!

Same result with a cyclic color map:

colormap = [0.0, 0.6549019607843137, 0.4666666666666667, 0.047058823529411764, 0.00392156862745098, 0.6599769319492502, 0.46277585544021527, 0.05365628604382929, 0.00784313725490196, 0.6650519031141868, 0.4588850442137639, 0.06025374855824683, 0.011764705882352941, 0.6701268742791234, 0.4549942329873126, 0.06685121107266435, 0.01568627450980392, 0.67520184544406, 0.4511034217608612, 0.07344867358708189, 0.0196078431372549, 0.6802768166089965, 0.44721261053440986, 0.08004613610149942, 0.023529411764705882, 0.685351787773933, 0.44332179930795845, 0.08664359861591696, 0.027450980392156862, 0.6904267589388697, 0.43943098808150716, 0.09324106113033448, 0.03137254901960784, 0.6955017301038062, 0.43554017685505575, 0.09983852364475203, 0.03529411764705882, 0.7005767012687428, 0.43164936562860434, 0.10643598615916955, 0.0392156862745098, 0.7056516724336793, 0.427758554402153, 0.11303344867358707, 0.043137254901960784, 0.7107266435986159, 0.4238677431757017, 0.1196309111880046, 0.047058823529411764, 0.7158016147635525, 0.4199769319492503, 0.12622837370242215, 0.050980392156862744, 0.720876585928489, 0.4160861207227989, 0.1328258362168397, 0.054901960784313725, 0.7259515570934256, 0.4121953094963476, 0.1394232987312572, 0.058823529411764705, 0.7310265282583621, 0.40830449826989623, 0.14602076124567473, 0.06274509803921569, 0.7361014994232987, 0.4044136870434448, 0.1526182237600923, 0.06666666666666667, 0.7411764705882353, 0.4005228758169934, 0.15921568627450977, 0.07058823529411765, 0.7462514417531718, 0.3966320645905421, 0.16581314878892733, 0.07450980392156863, 0.7513264129181084, 0.39274125336409077, 0.17241061130334487, 0.0784313725490196, 0.7564013840830449, 0.38885044213763936, 0.17900807381776238, 0.08235294117647059, 0.7614763552479816, 0.38495963091118796, 0.18560553633217994, 0.08627450980392157, 0.7665513264129181, 0.38106881968473666, 0.19220299884659744, 0.09019607843137255, 0.7716262975778546, 0.3771780084582853, 0.19880046136101498, 0.09411764705882353, 0.7753171856978086, 0.3724567474048443, 0.20622837370242214, 0.09803921568627451, 0.7787004998077662, 0.36755094194540566, 0.213840830449827, 0.10196078431372549, 0.782083813917724, 0.3626451364859669, 0.22145328719723184, 0.10588235294117647, 0.7854671280276816, 0.3577393310265282, 0.22906574394463666, 0.10980392156862745, 0.7888504421376393, 0.3528335255670896, 0.2366782006920415, 0.11372549019607843, 0.7922337562475971, 0.3479277201076509, 0.24429065743944636, 0.11764705882352941, 0.7956170703575548, 0.34302191464821224, 0.2519031141868512, 0.12156862745098039, 0.7990003844675125, 0.33811610918877355, 0.25951557093425603, 0.12549019607843137, 0.8023836985774702, 0.33321030372933486, 0.2671280276816609, 0.12941176470588234, 0.8057670126874279, 0.3283044982698962, 0.2747404844290657, 0.13333333333333333, 0.8091503267973856, 0.3233986928104575, 0.2823529411764706, 0.13725490196078433, 0.8125336409073433, 0.3184928873510188, 0.28996539792387543, 0.1411764705882353, 0.8159169550173011, 0.3135870818915802, 0.29757785467128023, 0.14509803921568626, 0.8193002691272587, 0.3086812764321415, 0.3051903114186851, 0.14901960784313725, 0.8226835832372165, 0.30377547097270285, 0.31280276816609, 0.15294117647058825, 0.8260668973471742, 0.2988696655132641, 0.32041522491349483, 0.1568627450980392, 0.8294502114571318, 0.29396386005382547, 0.3280276816608997, 0.16078431372549018, 0.8328335255670896, 0.2890580545943868, 0.3356401384083045, 0.16470588235294117, 0.8362168396770473, 0.28415224913494813, 0.34325259515570933, 0.16862745098039217, 0.839600153787005, 0.2792464436755094, 0.3508650519031142, 0.17254901960784313, 0.8429834678969628, 0.2743406382160708, 0.35847750865051903, 0.1764705882352941, 0.8463667820069204, 0.2694348327566321, 0.3660899653979238, 0.1803921568627451, 0.8497500961168781, 0.26452902729719335, 0.37370242214532867, 0.1843137254901961, 0.8514109957708574, 0.2596232218377547, 0.38368319876970397, 0.18823529411764706, 0.8520876585928489, 0.254717416378316, 0.39501730103806226, 0.19215686274509802, 0.8527643214148405, 0.24981161091887738, 0.40635140330642056, 0.19607843137254902, 0.853440984236832, 0.24490580545943869, 0.4176855055747789, 0.2, 0.8541176470588235, 0.24, 0.42901960784313725, 0.20392156862745098, 0.8547943098808151, 0.23509419454056132, 0.44035371011149554, 0.20784313725490194, 0.8554709727028067, 0.23018838908112266, 0.4516878123798539, 0.21176470588235294, 0.8561476355247981, 0.22528258362168396, 0.4630219146482122, 0.21568627450980393, 0.8568242983467897, 0.22037677816224527, 0.4743560169165706, 0.2196078431372549, 0.8575009611687812, 0.2154709727028066, 0.4856901191849288, 0.22352941176470587, 0.8581776239907728, 0.21056516724336796, 0.4970242214532872, 0.22745098039215686, 0.8588542868127643, 0.20565936178392924, 0.5083583237216455, 0.23137254901960785, 0.8595309496347558, 0.20075355632449057, 0.5196924259900039, 0.23529411764705882, 0.8602076124567474, 0.19584775086505188, 0.5310265282583622, 0.2392156862745098, 0.860884275278739, 0.1909419454056132, 0.5423606305267206, 0.24313725490196078, 0.8615609381007304, 0.18603613994617454, 0.5536947327950787, 0.24705882352941178, 0.8622376009227221, 0.18113033448673585, 0.5650288350634372, 0.25098039215686274, 0.8629142637447136, 0.17622452902729718, 0.5763629373317954, 0.2549019607843137, 0.8635909265667051, 0.17131872356785852, 0.5876970396001538, 0.2588235294117647, 0.8642675893886966, 0.16641291810841985, 0.5990311418685121, 0.2627450980392157, 0.8649442522106882, 0.16150711264898113, 0.6103652441368704, 0.26666666666666666, 0.8656209150326797, 0.15660130718954246, 0.6216993464052287, 0.27058823529411763, 0.8662975778546713, 0.15169550173010382, 0.6330334486735871, 0.27450980392156865, 0.8647443291041906, 0.1506343713956171, 0.6439061899269513, 0.2784313725490196, 0.8605151864667436, 0.1541868512110727, 0.6542252979623222, 0.2823529411764706, 0.8562860438292964, 0.15773933102652826, 0.6645444059976933, 0.28627450980392155, 0.8520569011918493, 0.16129181084198382, 0.6748635140330642, 0.2901960784313725, 0.8478277585544022, 0.16484429065743944, 0.6851826220684352, 0.29411764705882354, 0.8435986159169551, 0.16839677047289506, 0.6955017301038063, 0.2980392156862745, 0.8393694732795078, 0.17194925028835065, 0.7058208381391773, 0.30196078431372547, 0.8351403306420607, 0.1755017301038062, 0.7161399461745482, 0.3058823529411765, 0.8309111880046136, 0.17905420991926185, 0.7264590542099194, 0.30980392156862746, 0.8266820453671665, 0.18260668973471744, 0.7367781622452904, 0.3137254901960784, 0.8224529027297193, 0.186159169550173, 0.7470972702806612, 0.3176470588235294, 0.8182237600922723, 0.1897116493656286, 0.7574163783160323, 0.32156862745098036, 0.813994617454825, 0.19326412918108415, 0.7677354863514032, 0.3254901960784314, 0.8097654748173779, 0.1968166089965398, 0.7780545943867744, 0.32941176470588235, 0.8055363321799308, 0.2003690888119954, 0.7883737024221453, 0.3333333333333333, 0.8013071895424837, 0.20392156862745098, 0.7986928104575163, 0.33725490196078434, 0.7970780469050365, 0.2074740484429066, 0.8090119184928874, 0.3411764705882353, 0.7928489042675895, 0.21102652825836218, 0.8193310265282584, 0.34509803921568627, 0.7886197616301422, 0.21457900807381777, 0.8296501345636293, 0.34901960784313724, 0.7843906189926951, 0.21813148788927333, 0.8399692425990004, 0.3529411764705882, 0.780161476355248, 0.2216839677047289, 0.8502883506343712, 0.3568627450980392, 0.7759323337178009, 0.22523644752018454, 0.8606074586697424, 0.3607843137254902, 0.7717031910803537, 0.22878892733564016, 0.8709265667051134, 0.36470588235294116, 0.766643598615917, 0.2331257208765859, 0.879354094579008, 0.3686274509803922, 0.7593694732795079, 0.2395540176855056, 0.8827374086889658, 0.37254901960784315, 0.7520953479430988, 0.24598231449442523, 0.8861207227989235, 0.3764705882352941, 0.7448212226066898, 0.25241061130334486, 0.8895040369088811, 0.3803921568627451, 0.7375470972702808, 0.2588389081122645, 0.8928873510188389, 0.38431372549019605, 0.7302729719338718, 0.2652672049211841, 0.8962706651287966, 0.38823529411764707, 0.7229988465974625, 0.2716955017301038, 0.8996539792387543, 0.39215686274509803, 0.7157247212610534, 0.27812379853902347, 0.9030372933487121, 0.396078431372549, 0.7084505959246443, 0.28455209534794307, 0.9064206074586697, 0.4, 0.7011764705882352, 0.29098039215686283, 0.9098039215686274, 0.403921568627451, 0.6939023452518261, 0.29740868896578243, 0.9131872356785852, 0.40784313725490196, 0.6866282199154171, 0.30383698577470203, 0.9165705497885428, 0.4117647058823529, 0.6793540945790081, 0.3102652825836217, 0.9199538638985006, 0.4156862745098039, 0.672079969242599, 0.3166935793925413, 0.9233371780084583, 0.4196078431372549, 0.6648058439061899, 0.323121876201461, 0.926720492118416, 0.4235294117647059, 0.6575317185697809, 0.3295501730103806, 0.9301038062283737, 0.42745098039215684, 0.6502575932333717, 0.33597846981930024, 0.9334871203383314, 0.43137254901960786, 0.6429834678969626, 0.34240676662821995, 0.9368704344482891, 0.43529411764705883, 0.6357093425605536, 0.3488350634371396, 0.9402537485582468, 0.4392156862745098, 0.6284352172241445, 0.3552633602460592, 0.9436370626682046, 0.44313725490196076, 0.6211610918877355, 0.3616916570549788, 0.9470203767781623, 0.44705882352941173, 0.6138869665513265, 0.36811995386389845, 0.9504036908881199, 0.45098039215686275, 0.6066128412149173, 0.3745482506728182, 0.9537870049980777, 0.4549019607843137, 0.5991080353710112, 0.38085351787773936, 0.9566166858900423, 0.4588235294117647, 0.5892964244521338, 0.38592848904267585, 0.9539100346020761, 0.4627450980392157, 0.5794848135332564, 0.3910034602076125, 0.95120338331411, 0.4666666666666667, 0.569673202614379, 0.39607843137254906, 0.9484967320261438, 0.47058823529411764, 0.5598615916955016, 0.4011534025374856, 0.9457900807381777, 0.4745098039215686, 0.5500499807766244, 0.40622837370242215, 0.9430834294502115, 0.4784313725490196, 0.5402383698577471, 0.4113033448673587, 0.9403767781622453, 0.4823529411764706, 0.5304267589388696, 0.4163783160322953, 0.9376701268742791, 0.48627450980392156, 0.5206151480199923, 0.42145328719723185, 0.9349634755863129, 0.49019607843137253, 0.5108035371011149, 0.4265282583621684, 0.9322568242983468, 0.49411764705882355, 0.5009919261822374, 0.431603229527105, 0.9295501730103806, 0.4980392156862745, 0.49118031526336015, 0.43667820069204155, 0.9268435217224145, 0.5019607843137255, 0.4813687043444828, 0.4417531718569781, 0.9241368704344483, 0.5058823529411764, 0.47155709342560553, 0.44682814302191465, 0.9214302191464822, 0.5098039215686274, 0.4617454825067282, 0.4519031141868512, 0.9187235678585159, 0.5137254901960784, 0.45193387158785087, 0.4569780853517878, 0.9160169165705498, 0.5176470588235293, 0.44212226066897353, 0.4620530565167243, 0.9133102652825836, 0.5215686274509804, 0.4323106497500959, 0.467128027681661, 0.9106036139946174, 0.5254901960784314, 0.42249903883121864, 0.47220299884659755, 0.9078969627066512, 0.5294117647058824, 0.4126874279123413, 0.47727797001153405, 0.9051903114186851, 0.5333333333333333, 0.402875816993464, 0.48235294117647065, 0.9024836601307189, 0.5372549019607843, 0.39306420607458664, 0.48742791234140714, 0.8997770088427528, 0.5411764705882353, 0.3832525951557093, 0.49250288350634375, 0.8970703575547866, 0.5450980392156862, 0.37344098423683203, 0.49757785467128024, 0.8943637062668205, 0.5490196078431373, 0.36409073433294864, 0.5006535947712419, 0.8871972318339099, 0.5529411764705883, 0.354786620530565, 0.5035294117647059, 0.879584775086505, 0.5568627450980392, 0.3454825067281813, 0.5064052287581701, 0.8719723183391002, 0.5607843137254902, 0.3361783929257977, 0.509281045751634, 0.8643598615916954, 0.5647058823529412, 0.32687427912341405, 0.512156862745098, 0.8567474048442907, 0.5686274509803921, 0.31757016532103033, 0.5150326797385621, 0.8491349480968858, 0.5725490196078431, 0.30826605151864667, 0.5179084967320261, 0.841522491349481, 0.5764705882352941, 0.298961937716263, 0.5207843137254902, 0.8339100346020761, 0.580392156862745, 0.2896578239138794, 0.5236601307189542, 0.8262975778546713, 0.5843137254901961, 0.28035371011149546, 0.5265359477124184, 0.8186851211072664, 0.5882352941176471, 0.2710495963091118, 0.5294117647058824, 0.8110726643598616, 0.592156862745098, 0.2617454825067281, 0.5322875816993464, 0.8034602076124567, 0.596078431372549, 0.2524413687043444, 0.5351633986928105, 0.7958477508650519, 0.6, 0.24313725490196078, 0.5380392156862744, 0.788235294117647, 0.6039215686274509, 0.23383314109957715, 0.5409150326797386, 0.7806228373702422, 0.6078431372549019, 0.22452902729719346, 0.5437908496732026, 0.7730103806228374, 0.611764705882353, 0.21522491349480952, 0.5466666666666666, 0.7653979238754324, 0.615686274509804, 0.20592079969242588, 0.5495424836601308, 0.7577854671280275, 0.6196078431372549, 0.1966166858900422, 0.5524183006535948, 0.7501730103806228, 0.6235294117647059, 0.18731257208765856, 0.5552941176470588, 0.7425605536332179, 0.6274509803921569, 0.1780084582852749, 0.5581699346405229, 0.7349480968858131, 0.6313725490196078, 0.16870434448289123, 0.561045751633987, 0.7273356401384083, 0.6352941176470588, 0.15940023068050757, 0.5639215686274509, 0.7197231833910036, 0.6392156862745098, 0.1537870049980777, 0.5655670895809304, 0.7118646674356018, 0.6431372549019607, 0.1495578623606306, 0.5667512495194157, 0.7039138792772012, 0.6470588235294118, 0.14532871972318334, 0.5679354094579008, 0.6959630911188004, 0.6509803921568628, 0.14109957708573626, 0.569119569396386, 0.6880123029603998, 0.6549019607843137, 0.1368704344482891, 0.5703037293348713, 0.6800615148019992, 0.6588235294117647, 0.132641291810842, 0.5714878892733564, 0.6721107266435987, 0.6627450980392157, 0.12841214917339486, 0.5726720492118416, 0.664159938485198, 0.6666666666666666, 0.12418300653594776, 0.5738562091503269, 0.6562091503267974, 0.6705882352941176, 0.11995386389850063, 0.575040369088812, 0.6482583621683969, 0.6745098039215687, 0.1157247212610534, 0.5762245290272971, 0.640307574009996, 0.6784313725490196, 0.11149557862360628, 0.5774086889657825, 0.6323567858515955, 0.6823529411764706, 0.10726643598615916, 0.5785928489042675, 0.6244059976931949, 0.6862745098039216, 0.10303729334871203, 0.5797770088427527, 0.6164552095347943, 0.6901960784313725, 0.09880815071126492, 0.580961168781238, 0.6085044213763937, 0.6941176470588235, 0.09457900807381779, 0.5821453287197231, 0.6005536332179932, 0.6980392156862745, 0.09034986543637068, 0.5833294886582084, 0.5926028450595925, 0.7019607843137254, 0.08612072279892356, 0.5845136485966935, 0.584652056901192, 0.7058823529411764, 0.08189158016147643, 0.5856978085351787, 0.5767012687427914, 0.7098039215686275, 0.0776624375240292, 0.586881968473664, 0.5687504805843905, 0.7137254901960784, 0.07343329488658208, 0.5880661284121492, 0.56079969242599, 0.7176470588235294, 0.06920415224913497, 0.5892502883506343, 0.5528489042675895, 0.7215686274509804, 0.06497500961168784, 0.5904344482891196, 0.5448981161091888, 0.7254901960784313, 0.060745866974240725, 0.5916186082276048, 0.5369473279507883, 0.7294117647058823, 0.06103806228373696, 0.5923414071510956, 0.5280738177623991, 0.7333333333333333, 0.0650980392156862, 0.5926797385620914, 0.5184313725490198, 0.7372549019607844, 0.06915801614763555, 0.5930180699730873, 0.5087889273356401, 0.7411764705882353, 0.07321799307958478, 0.5933564013840831, 0.49914648212226065, 0.7450980392156863, 0.07727797001153401, 0.5936947327950789, 0.4895040369088812, 0.7490196078431373, 0.08133794694348326, 0.5940330642060746, 0.47986159169550174, 0.7529411764705882, 0.08539792387543249, 0.5943713956170703, 0.4702191464821224, 0.7568627450980392, 0.08945790080738172, 0.5947097270280661, 0.46057670126874295, 0.7607843137254902, 0.09351787773933096, 0.5950480584390619, 0.45093425605536347, 0.7647058823529411, 0.09757785467128019, 0.5953863898500577, 0.4412918108419841, 0.7686274509803921, 0.10163783160322944, 0.5957247212610535, 0.4316493656286046, 0.7725490196078432, 0.10569780853517878, 0.5960630526720492, 0.4220069204152249, 0.7764705882352941, 0.109757785467128, 0.596401384083045, 0.4123644752018455, 0.7803921568627451, 0.11381776239907723, 0.5967397154940407, 0.40272202998846607, 0.7843137254901961, 0.11787773933102647, 0.5970780469050365, 0.39307958477508664, 0.788235294117647, 0.12193771626297571, 0.5974163783160323, 0.38343713956170716, 0.792156862745098, 0.12599769319492496, 0.5977547097270282, 0.3737946943483278, 0.796078431372549, 0.1300576701268742, 0.5980930411380238, 0.3641522491349483, 0.8, 0.13411764705882354, 0.5984313725490196, 0.35450980392156867, 0.803921568627451, 0.13817762399077277, 0.5987697039600154, 0.3448673587081892, 0.807843137254902, 0.142237600922722, 0.5991080353710112, 0.33522491349480976, 0.8117647058823529, 0.14629757785467123, 0.5994463667820069, 0.32558246828143034, 0.8156862745098039, 0.1503575547866205, 0.5997846981930026, 0.3159400230680509, 0.8196078431372549, 0.15786236063052644, 0.5992618223760092, 0.3059900038446753, 0.8235294117647058, 0.17139561707035728, 0.5972318339100346, 0.2955017301038065, 0.8274509803921568, 0.18492887351018805, 0.59520184544406, 0.28501345636293757, 0.8313725490196078, 0.19846212995001886, 0.5931718569780854, 0.2745251826220687, 0.8352941176470589, 0.21199538638985005, 0.5911418685121108, 0.2640369088811995, 0.8392156862745098, 0.22552864282968083, 0.5891118800461361, 0.2535486351403307, 0.8431372549019608, 0.23906189926951163, 0.5870818915801616, 0.24306036139946183, 0.8470588235294118, 0.25259515570934243, 0.5850519031141869, 0.23257208765859294, 0.8509803921568627, 0.2661284121491732, 0.5830219146482123, 0.22208381391772408, 0.8549019607843137, 0.279661668589004, 0.5809919261822376, 0.2115955401768552, 0.8588235294117647, 0.29319492502883476, 0.578961937716263, 0.2011072664359863, 0.8627450980392157, 0.30672818146866604, 0.5769319492502883, 0.19061899269511715, 0.8666666666666667, 0.3202614379084968, 0.5749019607843137, 0.18013071895424831, 0.8705882352941177, 0.3337946943483276, 0.5728719723183392, 0.16964244521337943, 0.8745098039215686, 0.34732795078815837, 0.5708419838523645, 0.15915417147251057, 0.8784313725490196, 0.36086120722798914, 0.5688119953863899, 0.1486658977316417, 0.8823529411764706, 0.37439446366782003, 0.5667820069204152, 0.13817762399077282, 0.8862745098039215, 0.3879277201076508, 0.5647520184544406, 0.12768935024990397, 0.8901960784313725, 0.4014609765474816, 0.562722029988466, 0.11720107650903511, 0.8941176470588235, 0.4149942329873124, 0.5606920415224914, 0.10671280276816622, 0.8980392156862745, 0.4285274894271436, 0.5586620530565166, 0.09622452902729706, 0.9019607843137255, 0.44206074586697436, 0.556632064590542, 0.0857362552864282, 0.9058823529411765, 0.4555940023068052, 0.5546020761245675, 0.07524798154555931, 0.9098039215686274, 0.46814302191464824, 0.5522645136485966, 0.06651287966166859, 0.9137254901960784, 0.47626297577854676, 0.5485428681276432, 0.06566705113417917, 0.9176470588235294, 0.4843829296424452, 0.5448212226066897, 0.06482122260668974, 0.9215686274509803, 0.4925028835063437, 0.5410995770857363, 0.06397539407920032, 0.9254901960784314, 0.5006228373702424, 0.5373779315647826, 0.06312956555171087, 0.9294117647058824, 0.5087427912341408, 0.5336562860438292, 0.06228373702422144, 0.9333333333333333, 0.5168627450980393, 0.5299346405228758, 0.061437908496732016, 0.9372549019607843, 0.5249826989619377, 0.5262129950019223, 0.060592079969242596, 0.9411764705882353, 0.5331026528258362, 0.5224913494809688, 0.05974625144175317, 0.9450980392156862, 0.5412226066897347, 0.5187697039600153, 0.05890042291426374, 0.9490196078431372, 0.5493425605536332, 0.5150480584390619, 0.05805459438677432, 0.9529411764705882, 0.5574625144175316, 0.5113264129181084, 0.057208765859284895, 0.9568627450980391, 0.5655824682814301, 0.5076047673971551, 0.056362937331795475, 0.9607843137254902, 0.5737024221453287, 0.5038831218762014, 0.05551710880430603, 0.9647058823529412, 0.5818223760092273, 0.500161476355248, 0.0546712802768166, 0.9686274509803922, 0.5899423298731258, 0.4964398308342945, 0.05382545174932718, 0.9725490196078431, 0.5980622837370242, 0.492718185313341, 0.05297962322183775, 0.9764705882352941, 0.6061822376009227, 0.48899653979238755, 0.05213379469434833, 0.9803921568627451, 0.6143021914648211, 0.48527489427143405, 0.051287966166858906, 0.984313725490196, 0.6224221453287196, 0.48155324875048067, 0.05044213763936948, 0.9882352941176471, 0.6305420991926183, 0.4778316032295271, 0.04959630911188004, 0.9921568627450981, 0.6386620530565168, 0.4741099577085736, 0.04875048058439061, 0.996078431372549, 0.6467820069204152, 0.4703883121876201, 0.04790465205690119, 1.0, 0.6549019607843137, 0.4666666666666667, 0.047058823529411764]

K3D-1624201689171

tgandor commented 3 years ago

Yes, this looks more strange. I would guess, these lines are +pi/2 and -pi/2, but... I'm not sure if I'm right here. I would still try to look at the arg spatially (as zz), to see if there are any discontinuities that could cause it. Complex numbers are not my domain ;)

artur-trzesiok commented 3 years ago

Hi @Davide-sd !

Periodic interpolation is a hard topic in opengl: https://github.com/K3D-tools/K3D-jupyter/issues/239

I tried figure out something smart there but the easiest method is a manually duplication of vertices on "stitching"

On "stitching" arg values are attached to vertices and that looks like: image