• R/O
  • HTTP
  • SSH
  • HTTPS

fermisurfer: Commit

fermisurfer Git


Commit MetaInfo

Revisionbaf22e34450b1fe54394a8efcc34d80291e3ebf9 (tree)
Zeit2020-11-12 17:29:25
AutorMitsuaki Kawamura <kawamitsuaki@gmai...>
CommiterMitsuaki Kawamura

Log Message

Backup

Ändern Zusammenfassung

Diff

--- a/javascript/fermisurfer.html
+++ b/javascript/fermisurfer.html
@@ -6,160 +6,169 @@
66 integrity="sha512-zhHQR0/H5SEBL3Wn6yYSaTTZej12z0hVZKOv3TwCUXT1z5qeqGcXJLLrbERYRScEDDpYIJhPC1fk31gqR783iQ=="
77 crossorigin="anonymous" defer>
88 </script>
9+ <?php if ($_GET['frmsf'] == ""): ?>
10+ <script type="text/javascript">
11+ var frmsf = "";
12+ </script>
13+ <?php else: ?>
14+ <script type="text/javascript" src="<?=$_GET['frmsf']?>"></script>
15+ <?php endif; ?>
916 <script type="text/javascript" src="./fermisurfer.js" defer></script>
1017 </head>
11- <body>
12- File: <input type="file" id="inputfile" name="inputfile">
13- <input type="button" value="read" onclick="read_file();">
14- <table border="0">
15- <tr align="left">
16- <td><canvas id="glcanvas" width="600" height="600" style="border:solid black 1px;"></canvas></td>
17- <td>
18- <table border="0">
19- <tr align="left">
20- <td><input type="button" value="update" onclick="test();"></td>
21- <td>Line width :</td>
22- <td><input type="number" name="linewidth" id="linewidth" onclick="test();" value="1"></td>
23- <td><input type="checkbox" name="ongamma" id="ongamma" value="ongamma" checked="checked">On Gamma</td>
24- </tr>
25- <tr align="left">
26- <td>Section-v : </td>
27- <td><input type="number" name="sectionv0" id="sectionv0" value="0"></td>
28- <td><input type="number" name="sectionv1" id="sectionv1" value="0"></td>
29- <td><input type="number" name="sectionv2" id="sectionv2" value="1"></td>
30- </tr>
31- <tr align="left">
32- <td>Equator-v : </td>
33- <td><input type="number" name="equatorv0" id="equatorv0" value="0"></td>
34- <td><input type="number" name="equatorv1" id="equatorv1" value="0"></td>
35- <td><input type="number" name="equatorv2" id="equatorv2" value="1"></td>
36- </tr>
37- <tr align="left">
38- <td>Interpol ratio : </td>
39- <td><input type="number" name="interpol" id="interpol" value="1"></td>
40- <td>Fermi energy : </td>
41- <td><input type="number" name="fermienergy" id="fermienergy" value="0.0"></td>
42- </tr>
43- <tr align="left">
44- <td>Min. of Scale : </td>
45- <td><input type="text" name="scalemin" id="scalemin" value=""></td>
46- <td>Max. of Scale : </td>
47- <td><input type="text" name="scalemax" id="scalemax" value=""></td>
48- </tr>
49- <tr align="left">
50- <td>Tetrahedron : </td>
51- <td></td>
52- <td></td>
53- <td></td>
54- </tr>
55- <tr align="left">
56- <form id="tetrahedron">
57- <td><input type="radio" name="tetrahedron" value="1" checked="checked">1</td>
58- <td><input type="radio" name="tetrahedron" value="2">2</td>
59- <td><input type="radio" name="tetrahedron" value="3">3</td>
60- <td><input type="radio" name="tetrahedron" value="3">4</td>
61- </form>
62- </tr>
63- <tr align="left">
64- <td>Color-scale mode : </td>
65- <td></td>
66- <td></td>
67- <td></td>
68- </tr>
69- <tr align="left">
70- <form id="colorscalemode">
71- <td><input type="radio" name="colorscalemode" value="1" checked="checked">Input(1D)</td>
72- <td><input type="radio" name="colorscalemode" value="2">Input(2D)</td>
73- <td><input type="radio" name="colorscalemode" value="3">Input(3D)</td>
74- <td><input type="radio" name="colorscalemode" value="4">Fermi velocity</td>
75- </form>
76- </tr>
77- <tr align="left">
78- <td>Brillouin zone : </td>
79- <form id="brillouinzone">
80- <td><input type="radio" name="brillouinzone" value="1" checked="checked">First</td>
81- <td><input type="radio" name="brillouinzone" value="-1">Premitive</td>
82- </form>
83- <td></td>
84- </tr>
85- <tr align="left">
86- <td>Stereogram : </td>
87- <form id="stereogram">
88- <td><input type="radio" name="stereogram" value="1" checked="checked">None</td>
89- <td><input type="radio" name="stereogram" value="2">Parallel</td>
90- <td><input type="radio" name="stereogram" value="3">Cross</td>
91- </form>
92- </tr>
93- <tr align="left">
94- <td>Mouse drag : </td>
95- <form id="mousedrag">
96- <td><input type="radio" name="mousedrag" value="1" checked="checked">Rotate</td>
97- <td><input type="radio" name="mousedrag" value="2">Scale</td>
98- <td><input type="radio" name="mousedrag" value="3">Translate</td>
99- </form>
100- </tr>
101- <tr align="left">
102- <td>BZ number : </td>
103- <td><input type="number" name="bznumber1" id="bznumber0" value="1"></td>
104- <td><input type="number" name="bznumber2" id="bznumber1" value="1"></td>
105- <td><input type="number" name="bznumber3" id="bznumber2" value="1"></td>
106- </tr>
107- <tr align="left">
108- <td>Backgraound (RGB) : </td>
109- <td><input type="number" name="backgraoundr" id="backgraoundr" value="0"></td>
110- <td><input type="number" name="backgraoundg" id="backgraoundg" value="0"></td>
111- <td><input type="number" name="backgraoundb" id="backgraoundb" value="0"></td>
112- </tr>
113- <tr align="left">
114- <td>Line color (RGB) : </td>
115- <td><input type="number" name="linecolorr" id="linecolorr" value="1"></td>
116- <td><input type="number" name="linecolorg" id="linecolorg" value="1"></td>
117- <td><input type="number" name="linecolobr" id="linecolorb" value="1"></td>
118- </tr>
119- <tr align="left">
120- <td><input type="button" value="Rotate"></td>
121- <td><input type="number" name="rotatex" id="rotatex" value="0"></td>
122- <td><input type="number" name="rotatey" id="rotatey" value="0"></td>
123- <td><input type="number" name="rotatez" id="rotatez" value="0"></td>
124- </tr>
125- <tr align="left">
126- <td>Scale : <input type="number" name="scale" id="scale" value="1"></td>
127- <td>Position : </td>
128- <td><input type="number" name="positionx" id="positionx" value="0"></td>
129- <td><input type="number" name="positiony" id="positiony" value="0"></td>
130- </tr>
131- <tr align="left">
132- <td><input type="checkbox" name="colorbar" id="colorbar" value="colorbar" checked="checked">Color bar</td>
133- <td><input type="checkbox" name="equator" id="equator" value="equator">Equator</td>
134- <td><input type="checkbox" name="nodalline" id="nodalline" value="nodalline">Nodal line</td>
135- <td><input type="checkbox" name="section" id="section" value="section">Section</td>
136- </tr>
137- <tr align="left">
138- <td>Lighting : </td>
139- <form id="lighting">
140- <td><input type="radio" name="lighting" value="1.0" checked="checked">Both</td>
141- <td><input type="radio" name="lighting" value="-1.0">Occupy</td>
142- <td><input type="radio" name="lighting" value="1.0">Unoccupy</td>
143- </form>
144- </tr>
145- <tr align="left">
146- <form id="barcolor">
147- <td><input type="radio" name="barcolor" value="bgr" checked="checked">BGR</td>
148- <td><input type="radio" name="barcolor" value="cmy">CMY</td>
149- <td><input type="radio" name="barcolor" value="mcy">MCY</td>
150- </form>
151- </tr>
152- <tr align="left">
153- <td><input type="button" value="Section file"></td>
154- <td><input type="checkbox" name="band0" id="band0" value="band0" checked="checked">Band 0</td>
155- <td><input type="checkbox" name="band1" id="band1" value="band1" checked="checked">Band 1</td>
156- <td><input type="checkbox" name="band2" id="band2" value="band2" checked="checked">Band 2</td>
157- </tr>
158- </table>
159- </td>
160- </tr>
161- </table>
18+<body>
19+ <img src="ads.png" height="200">
20+ <br>
21+ File: <input type="file" id="inputfile" name="inputfile">
22+ <input type="button" value="read" onclick="read_file();">
23+ <table border="0">
24+ <tr align="left">
25+ <td><canvas id="glcanvas" width="600" height="600" style="border:solid black 1px;"></canvas></td>
26+ <td>
27+ <table border="0">
28+ <tr align="left">
29+ <td><input type="button" value="update" onclick="update_delay();"></td>
30+ <td>Line width :</td>
31+ <td><input type="number" name="linewidth" id="linewidth" value="1" onchange="update_now();" step="0.1" min="0"></td>
32+ <td><input type="checkbox" name="ongamma" id="ongamma" value="ongamma" checked="checked">On Gamma</td>
33+ </tr>
34+ <tr align="left">
35+ <td>Section-v : </td>
36+ <td><input type="number" name="sectionv0" id="sectionv0" value="0"></td>
37+ <td><input type="number" name="sectionv1" id="sectionv1" value="0"></td>
38+ <td><input type="number" name="sectionv2" id="sectionv2" value="1"></td>
39+ </tr>
40+ <tr align="left">
41+ <td>Equator-v : </td>
42+ <td><input type="number" name="equatorv0" id="equatorv0" value="0"></td>
43+ <td><input type="number" name="equatorv1" id="equatorv1" value="0"></td>
44+ <td><input type="number" name="equatorv2" id="equatorv2" value="1"></td>
45+ </tr>
46+ <tr align="left">
47+ <td>Interpol ratio : </td>
48+ <td><input type="number" name="interpol" id="interpol" value="1" step="1" min="1" onchange="update_interpol();"></td>
49+ <td>Fermi energy : </td>
50+ <td><input type="number" name="fermienergy" id="fermienergy" value="0.0" onchange="update_efermi();"></td>
51+ </tr>
52+ <tr align="left">
53+ <td>Min. of Scale : </td>
54+ <td><input type="number" name="scalemin" id="scalemin" value="" onchange="update_minmax();"></td>
55+ <td>Max. of Scale : </td>
56+ <td><input type="number" name="scalemax" id="scalemax" value="" onchange="update_minmax();"></td>
57+ </tr>
58+ <tr align="left">
59+ <td>Tetrahedron : </td>
60+ <td></td>
61+ <td></td>
62+ <td></td>
63+ </tr>
64+ <tr align="left">
65+ <form id="tetrahedron">
66+ <td><input type="radio" name="tetrahedron" value="1" checked="checked">1</td>
67+ <td><input type="radio" name="tetrahedron" value="2">2</td>
68+ <td><input type="radio" name="tetrahedron" value="3">3</td>
69+ <td><input type="radio" name="tetrahedron" value="3">4</td>
70+ </form>
71+ </tr>
72+ <tr align="left">
73+ <td>Color-scale mode : </td>
74+ <td></td>
75+ <td></td>
76+ <td></td>
77+ </tr>
78+ <tr align="left">
79+ <form id="colorscalemode">
80+ <td><input type="radio" name="colorscalemode" value="1" checked="checked" onchange="update_color();">Input(1D)</td>
81+ <td><input type="radio" name="colorscalemode" value="2" onchange="update_color();">Input(2D)</td>
82+ <td><input type="radio" name="colorscalemode" value="3" onchange="update_color();">Input(3D)</td>
83+ <td><input type="radio" name="colorscalemode" value="4" onchange="update_color();">Fermi velocity</td>
84+ </form>
85+ </tr>
86+ <tr align="left">
87+ <td>Brillouin zone : </td>
88+ <form id="brillouinzone">
89+ <td><input type="radio" name="brillouinzone" value="1" checked="checked">First</td>
90+ <td><input type="radio" name="brillouinzone" value="-1">Premitive</td>
91+ </form>
92+ <td></td>
93+ </tr>
94+ <tr align="left">
95+ <td>Stereogram : </td>
96+ <form id="stereogram">
97+ <td><input type="radio" name="stereogram" value="1" checked="checked">None</td>
98+ <td><input type="radio" name="stereogram" value="2">Parallel</td>
99+ <td><input type="radio" name="stereogram" value="3">Cross</td>
100+ </form>
101+ </tr>
102+ <tr align="left">
103+ <td>Mouse drag : </td>
104+ <form id="mousedrag">
105+ <td><input type="radio" name="mousedrag" value="1" checked="checked">Rotate</td>
106+ <td><input type="radio" name="mousedrag" value="2">Scale</td>
107+ <td><input type="radio" name="mousedrag" value="3">Translate</td>
108+ </form>
109+ </tr>
110+ <tr align="left">
111+ <td>BZ number : </td>
112+ <td><input type="number" name="bznumber1" id="bznumber0" value="1"></td>
113+ <td><input type="number" name="bznumber2" id="bznumber1" value="1"></td>
114+ <td><input type="number" name="bznumber3" id="bznumber2" value="1"></td>
115+ </tr>
116+ <tr align="left">
117+ <td>Backgraound (RGB) : </td>
118+ <td><input type="number" name="backgraoundr" id="backgraoundr" value="0" onchange="update_now();" step="0.1" min="0" max="1"></td>
119+ <td><input type="number" name="backgraoundg" id="backgraoundg" value="0" onchange="update_now();" step="0.1" min="0" max="1"></td>
120+ <td><input type="number" name="backgraoundb" id="backgraoundb" value="0" onchange="update_now();" step="0.1" min="0" max="1"></td>
121+ </tr>
122+ <tr align="left">
123+ <td>Line color (RGB) : </td>
124+ <td><input type="number" name="linecolorr" id="linecolorr" value="1" onchange="update_now();" step="0.1" min="0" max="1"></td>
125+ <td><input type="number" name="linecolorg" id="linecolorg" value="1" onchange="update_now();" step="0.1" min="0" max="1"></td>
126+ <td><input type="number" name="linecolobr" id="linecolorb" value="1" onchange="update_now();" step="0.1" min="0" max="1"></td>
127+ </tr>
128+ <tr align="left">
129+ <td><input type="button" value="Rotate"></td>
130+ <td><input type="number" name="rotatex" id="rotatex" value="0" onchange="update_now();"></td>
131+ <td><input type="number" name="rotatey" id="rotatey" value="0" onchange="update_now();"></td>
132+ <td><input type="number" name="rotatez" id="rotatez" value="0" onchange="update_now();"></td>
133+ </tr>
134+ <tr align="left">
135+ <td>Scale : <input type="number" name="scale" id="scale" value="1" onchange="update_now();" step="0.1" min="0"></td>
136+ <td>Position : </td>
137+ <td><input type="number" name="positionx" id="positionx" value="0" onchange="update_now();"></td>
138+ <td><input type="number" name="positiony" id="positiony" value="0" onchange="update_now();"></td>
139+ </tr>
140+ <tr align="left">
141+ <td><input type="checkbox" name="colorbar" id="colorbar" value="colorbar" checked="checked" onchange="update_now();">Color bar</td>
142+ <td><input type="checkbox" name="equator" id="equator" value="equator" onchange="update_now();">Equator</td>
143+ <td><input type="checkbox" name="nodalline" id="nodalline" value="nodalline" onchange="update_now();">Nodal line</td>
144+ <td><input type="checkbox" name="section" id="section" value="section" onchange="update_now();">Section</td>
145+ </tr>
146+ <tr align="left">
147+ <td>Lighting : </td>
148+ <form id="lighting">
149+ <td><input type="radio" name="lighting" value="1.0" checked="checked" onchange="update_now();">Both</td>
150+ <td><input type="radio" name="lighting" value="-1.0" onchange="update_now();">Occupy</td>
151+ <td><input type="radio" name="lighting" value="1.0" onchange="update_now();">Unoccupy</td>
152+ </form>
153+ </tr>
154+ <tr align="left">
155+ <form id="barcolor">
156+ <td><input type="radio" name="barcolor" value="bgr" checked="checked">BGR</td>
157+ <td><input type="radio" name="barcolor" value="cmy">CMY</td>
158+ <td><input type="radio" name="barcolor" value="mcy">MCY</td>
159+ </form>
160+ </tr>
161+ <tr align="left">
162+ <td><input type="button" value="Section file"></td>
163+ <td><input type="checkbox" name="band0" id="band0" value="band0" checked="checked" onchange="update_now();">Band 0</td>
164+ <td><input type="checkbox" name="band1" id="band1" value="band1" checked="checked" onchange="update_now();">Band 1</td>
165+ <td><input type="checkbox" name="band2" id="band2" value="band2" checked="checked" onchange="update_now();">Band 2</td>
166+ </tr>
167+ </table>
168+ </td>
169+ </tr>
170+ </table>
162171
163- <pre id="log" style="border: 1px solid #ccc; max-width: 80em; overflow: auto; max-height: 10em;"></pre>
164- </body>
172+ <pre id="log" style="border: 1px solid #ccc; max-width: 80em; overflow: auto; max-height: 10em;"></pre>
173+</body>
165174 </html>
--- a/javascript/fermisurfer.js
+++ b/javascript/fermisurfer.js
@@ -66,7 +66,7 @@ function main() {
6666
6767 highp vec4 transformedNormal = uNormalMatrix * vec4(aVertexNormal, 1.0);
6868
69- highp float directional = max(dot(transformedNormal.xyz, directionalVector), 0.0);
69+ highp float directional = abs(dot(transformedNormal.xyz, directionalVector));
7070 vLighting = ambientLight + (directionalLightColor * directional);
7171 }
7272 `;
@@ -123,7 +123,7 @@ function main() {
123123 function drawScene() {
124124 let ib = 0, ii = 0, jj = 0;
125125
126- gl.clearColor(0.0, 0.0, 0.0, 1.0); // Clear to black, fully opaque
126+ gl.clearColor(BackGroundColor[0], BackGroundColor[1], BackGroundColor[2], BackGroundColor[3]); // Clear to black, fully opaque
127127 gl.clearDepth(1.0); // Clear everything
128128 gl.enable(gl.DEPTH_TEST); // Enable depth testing
129129 gl.depthFunc(gl.LEQUAL); // Near things obscure far things
@@ -175,6 +175,8 @@ function drawScene() {
175175 mat4.invert(normalMatrix, modelViewMatrix);
176176 mat4.transpose(normalMatrix, normalMatrix);
177177
178+ gl.lineWidth(linewidth);
179+
178180 {
179181 let vertexCount = 0;
180182 for (ib = 0; ib < nb; ib++) {
@@ -263,8 +265,15 @@ function drawScene() {
263265 }
264266 }//for (i = 0; i< 2; ++i)
265267 }//for (ibzl = 0; ibzl < nbzl; ++ibzl)
266- for (i = 0; i < nclr; ++i) colors[i] = 1.0;
267-
268+ icount = 0;
269+ for (ibzl = 0; ibzl < nbzl; ++ibzl) {
270+ for (i = 0; i < 2; ++i) {
271+ for (j = 0; j < 3; ++j) {
272+ colors[icount] = LineColor[j];
273+ icount += 1;
274+ }
275+ }
276+ }
268277 draw2(projectionMatrix, modelViewMatrix, normalMatrix,
269278 vertexCount, gl.LINES,
270279 new Float32Array(positions), new Float32Array(colors), new Float32Array(vertexNormals));
@@ -3133,12 +3142,66 @@ function compute_patch_segment() {
31333142 refresh_equator = 0;
31343143 }
31353144 }
3136-function button_update() {
3137- let ii = 0, jj = 0;
3145+function update_delay() {
3146+ terminal("uptedate\n");
3147+ compute_patch_segment()
3148+ drawScene();
3149+}
3150+function update_now() {
3151+ linewidth = document.getElementById("linewidth").value;
31383152 /*
3139- Line width
3153+ Line color
31403154 */
3141- linewidth = Number(document.getElementById("linewidth"));
3155+ LineColor[0] = document.getElementById("linecolorr").value;
3156+ LineColor[1] = document.getElementById("linecolorg").value;
3157+ LineColor[2] = document.getElementById("linecolorb").value;
3158+ //
3159+ // Back ground color
3160+ //
3161+ BackGroundColor[0] = document.getElementById("backgraoundr").value;
3162+ BackGroundColor[1] = document.getElementById("backgraoundg").value;
3163+ BackGroundColor[2] = document.getElementById("backgraoundb").value;
3164+ //
3165+ //Rotate, scale, translate
3166+ //
3167+ thetax = document.getElementById("rotatex").value;
3168+ thetay = document.getElementById("rotatey").value;
3169+ thetaz = document.getElementById("rotatez").value;
3170+ trans[0] = document.getElementById("positionx").value;
3171+ trans[1] = document.getElementById("positiony").value;
3172+ rot[0][0] = Math.cos(thetay) * Math.cos(thetaz);
3173+ rot[0][1] = -Math.cos(thetay) * Math.sin(thetaz);
3174+ rot[0][2] = Math.sin(thetay);
3175+ rot[1][0] = Math.cos(thetaz) * Math.sin(thetax) * Math.sin(thetay) + Math.cos(thetax) * Math.sin(thetaz);
3176+ rot[1][1] = Math.cos(thetax) * Math.cos(thetaz) - Math.sin(thetax) * Math.sin(thetay) * Math.sin(thetaz);
3177+ rot[1][2] = -Math.cos(thetay) * Math.sin(thetax);
3178+ rot[2][0] = -Math.cos(thetax) * Math.cos(thetaz) * Math.sin(thetay) + Math.sin(thetax) * Math.sin(thetaz);
3179+ rot[2][1] = Math.cos(thetaz) * Math.sin(thetax) + Math.cos(thetax) * Math.sin(thetay) * Math.sin(thetaz);
3180+ rot[2][2] = Math.cos(thetax) * Math.cos(thetay);
3181+ scl = document.getElementById("scale").value;
3182+
3183+ drawScene();
3184+}
3185+function update_interpol() {
3186+ interpol = document.getElementById("interpol").value;
3187+ refresh_interpol = 1;
3188+}
3189+function update_efermi(){
3190+ EF = document.getElementById("fermienergy").value;
3191+ refresh_patch = 1;
3192+}
3193+function update_color() {
3194+ color_scale = Number(document.getElementById('colorscalemode').colorscalemode.value);
3195+ refresh_color = 1;
3196+}
3197+function update_minmax() {
3198+ patch_min = document.getElementById("scalemin").value;
3199+ patch_max = document.getElementById("scalemax").value;
3200+ refresh_color = 1;
3201+ skip_minmax = 1;
3202+}
3203+function button_update() {
3204+ let ii = 0, jj = 0;
31423205 /*
31433206 Section vector
31443207 */
@@ -3164,25 +3227,11 @@ function button_update() {
31643227 for (jj = 0; jj < 3; jj++) {
31653228 eqvec[ii] += eqvec_fr[jj] * bvec[jj][ii];
31663229 }/*for (jj = 0; jj < 3; jj++)*/
3167- }/*for (ii = 0; ii < 3; ii++)*/
3168- /*
3169- * Interpolation
3170- */
3171- interpol = Number(document.getElementById("interpol"));
3172- /*
3173- Fermi energy
3174- */
3175- EF = Number(document.getElementById("fermienergy"));
3176- /*
3177- * Min. and Max. of scale
3178- */
3179- patch_min = Number(document.getElementById("scalemin"));
3180- patch_max = Number(document.getElementById("scalemax"));
3230+ }/*for (ii = 0; ii < 3; ii++)*/
31813231 /* */
31823232 itet = Number(document.getElementById('tetrahedron').tetrahedron.value);
31833233 init_corner();
31843234 /**/
3185- color_scale = Number(document.getElementById('colorscalemode').colorscalemode.value);
31863235 fbz = Number(document.getElementById('brillouinzone').brillouinzone.value);
31873236 lstereo = Number(document.getElementById('stereogram').stereogram.value);
31883237 lmouse = Number(document.getElementById('mousedrag').mousedrag.value);
@@ -3192,37 +3241,7 @@ function button_update() {
31923241 BZ_number[0] = Number(document.getElementById("bznumber0"));
31933242 BZ_number[1] = Number(document.getElementById("bznumber1"));
31943243 BZ_number[2] = Number(document.getElementById("bznumber2"));
3195- /*
3196- Back ground color
3197- */
3198- BackGroundColor[0] = Number(document.getElementById("backgraoundr"));
3199- BackGroundColor[1] = Number(document.getElementById("backgraoundg"));
3200- BackGroundColor[2] = Number(document.getElementById("backgraoundb"));
32013244 glClearColor(BackGroundColor[0], BackGroundColor[1], BackGroundColor[2], BackGroundColor[3]);
3202- /*
3203- Line color
3204- */
3205- LineColor[0] = Number(document.getElementById("linecolorr"));
3206- LineColor[1] = Number(document.getElementById("linecolorg"));
3207- LineColor[2] = Number(document.getElementById("linecolorb"));
3208- /*
3209- Rotate, scale, translate
3210- */
3211- thetax = Number(document.getElementById("rotatex"));
3212- thetay = Number(document.getElementById("rotatey"));
3213- thetaz = Number(document.getElementById("rotatez"));
3214- trans[0] = Number(document.getElementById("positionx"));
3215- trans[1] = Number(document.getElementById("positiony"));
3216- scl = Number(document.getElementById("scale"));
3217- rot[0][0] = Math.cos(thetay) * Math.cos(thetaz);
3218- rot[0][1] = -Math.cos(thetay) * Math.sin(thetaz);
3219- rot[0][2] = Math.sin(thetay);
3220- rot[1][0] = Math.cos(thetaz) * Math.sin(thetax) * Math.sin(thetay) + Math.cos(thetax) * Math.sin(thetaz);
3221- rot[1][1] = Math.cos(thetax) * Math.cos(thetaz) - Math.sin(thetax) * Math.sin(thetay) * Math.sin(thetaz);
3222- rot[1][2] = -Math.cos(thetay) * Math.sin(thetax);
3223- rot[2][0] = -Math.cos(thetax) * Math.cos(thetaz) * Math.sin(thetay) + Math.sin(thetax) * Math.sin(thetaz);
3224- rot[2][1] = Math.cos(thetaz) * Math.sin(thetax) + Math.cos(thetax) * Math.sin(thetay) * Math.sin(thetaz);
3225- rot[2][2] = Math.cos(thetax) * Math.cos(thetay);
32263245 /**/
32273246 if (document.getElementById("colorbar")) lcolorbar = 1;
32283247 else lcolorbar = 0;
@@ -3595,7 +3614,7 @@ function read_from_text(datas) {
35953614 //
35963615 compute_patch_segment();
35973616
3598- main();
3617+ main();
35993618 }
36003619 /**
36013620 @brief Input from Fermi surface file
@@ -3939,5 +3958,5 @@ function calc_section() {
39393958
39403959 if (frmsf != "") {
39413960 let datas = frmsf.replace(/\n/g, ' ').replace(/^ +/, '').split(/ +/);
3942- read_from_text(datas);
3961+ read_from_text(datas);
39433962 }
\ No newline at end of file
--- /dev/null
+++ b/javascript/frmsf2js.sh
@@ -0,0 +1,6 @@
1+#!/bin/bash
2+
3+sed -e '1i frmsf="' -e '$a ";' ${1} | \
4+ perl -pe 's/\n/ /g' | \
5+ sed -E -e 's/ +/ /g' -e 's/" /"/g' -e 's/ "/"/g' > \
6+ ${1%frmsf}js
Show on old repository browser