diff options
author | Karl Berry <karl@freefriends.org> | 2020-06-07 20:38:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-06-07 20:38:49 +0000 |
commit | 0d6294a01690ace95d88ecdbc70242dc89912368 (patch) | |
tree | eef4df79d70ac95cc8fe2fea1fbf0625370f7790 /Master/texmf-dist | |
parent | 4429ead320ce6d8f38632b2255fc52a0fa086165 (diff) |
luamesh (7jun20)
git-svn-id: svn://tug.org/texlive/trunk@55468 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/lualatex/luamesh/README | 9 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.listing | 84 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.pdf | bin | 168735 -> 173181 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex | 45 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/luamesh/luameshdoc.cls (renamed from Master/texmf-dist/doc/lualatex/luamesh/lltxdoc.cls) | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/luamesh/maillagev4.msh | 453 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/luamesh/luamesh-polygon.lua | 6 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/luamesh/luamesh-tex.lua | 5 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/luamesh/luamesh.lua | 112 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lualatex/luamesh/luamesh.sty | 72 |
10 files changed, 628 insertions, 164 deletions
diff --git a/Master/texmf-dist/doc/lualatex/luamesh/README b/Master/texmf-dist/doc/lualatex/luamesh/README index be387c79e69..926aaf6afd4 100644 --- a/Master/texmf-dist/doc/lualatex/luamesh/README +++ b/Master/texmf-dist/doc/lualatex/luamesh/README @@ -1,6 +1,6 @@ -*- coding: utf-8 -*- -luamesh package by Maxime Chupin -Version 0.51 dated 2017/04/15 +luamesh package by Maxime Chupin +Version 0.6 dated 2020/06/06 The LuaLaTeX package luamesh allows to compute and draw 2D Delaunay triangulation. The algorithm is written with lua, and depending on the choice of the “engine”, @@ -26,13 +26,14 @@ dum.bbl dum.tex fond.mp fond.pdf -lltxdoc.cls +luameshdoc.cls luamesh-doc.listing luamesh-doc.pdf luamesh-doc.tex luamesh-title.pdf maillage.geo maillage.msh +maillagev4.msh meshgarde.txt ===== Lua Script File ===== @@ -44,4 +45,4 @@ luamesh-tex.lua luamesh.sty ================== -The archive luamesh-v0-5.zip contains all the files to insert into your texmf. +The archive luamesh-v0-6.zip contains all the files to insert into your texmf. diff --git a/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.listing b/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.listing deleted file mode 100644 index e2c890627d1..00000000000 --- a/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.listing +++ /dev/null @@ -1,84 +0,0 @@ - \documentclass{article} - %% lualatex compilation - \usepackage[margin=2.5cm]{geometry} - \usepackage{luamesh} - \usepackage{fontspec} - \usepackage{multido} - \pagestyle{empty} - \def\drawPath{draw (-2,-2)*u--(8,-2)*u--(8,6)*u--(-2,6)*u--cycle withcolor 0.99white;} - \def\clipPath{clip currentpicture to (-2,-2)*u--(8,-2)*u--(8,6)*u--(-2,6)*u--cycle;} - \begin{document} - \drawPointsMeshinc[mode=ext, bbox = show,colorBbox = blue!20,print=points]{mesh.txt}% - {% - beginfig(0); - \drawPath - }% - {% - \clipPath - endfig; - } - \newpage\buildMeshBWinc[mode=ext,bbox = show,colorBbox = blue!20,print=points]{meshInit.txt}% - {% - beginfig(0); - \drawPath - }% - {% - \clipPath - endfig; - } - \multido{\ii=5+1}{4}{% - \newpage\meshAddPointBWinc[mode=ext,step=badtriangles,colorNew - =green!20!red,colorBack=red!10,colorCircle = blue,bbox = - show,colorBbox = blue!20]{mesh.txt}{\ii}% - {% - beginfig(0); - \drawPath - }% - {% - \clipPath - endfig; - } \newpage - \meshAddPointBWinc[mode=ext,step=cavity,colorNew - =green!20!red,colorBack=red!10,colorCircle = blue,bbox = - show,colorBbox = blue!20]{mesh.txt}{\ii}% - {% - beginfig(0); - \drawPath - }% - {% - \clipPath - endfig; - } \newpage - \meshAddPointBWinc[mode=ext,step=newtriangles,colorNew - =green!20!red,colorBack=red!10,colorCircle = blue,bbox = - show,colorBbox = blue!20]{mesh.txt}{\ii}% - {% - beginfig(0); - \drawPath - }% - {% - \clipPath - endfig; - } - } - \newpage - \buildMeshBWinc[mode=ext,bbox = show,colorBbox = blue!20,print=points]{mesh.txt}% - {% - beginfig(0); - \drawPath - }% - {% - \clipPath - endfig; - } - \newpage - \buildMeshBWinc[mode=ext,print=points]{mesh.txt}% - {% - beginfig(0); - \drawPath - }% - {% - \clipPath - endfig; - } -\end{document} diff --git a/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.pdf b/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.pdf Binary files differindex 92a1162b9ea..0d66dbf5573 100644 --- a/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.pdf +++ b/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.pdf diff --git a/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex b/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex index e2e2bdfc434..07b6125f0fc 100644 --- a/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex +++ b/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex @@ -1,13 +1,13 @@ % luamesh: compute and draw meshes with lua, luamplib and tikz % -% Originally written by Maxime Chupin <mc@melusine.eu.org>, -% 2010. +% Originally written by Maxime Chupin <notezik@gmail.com>, +% 2017. % % Distributed under the terms of the GNU free documentation licence: % http://www.gnu.org/licenses/fdl.html % without any invariant section or cover text. -\documentclass{lltxdoc} +\documentclass{luameshdoc} \usepackage{tcolorbox} \usepackage{enumitem} \usepackage[tikz]{bclogo} @@ -15,7 +15,7 @@ \usepackage{animate} \title{\Verb+luamesh+: compute and draw meshes with \lualatex} -\author{Maxime Chupin \email{mc@melusine.eu.org}} +\author{Maxime Chupin \email{notezik@gmail.com}} \date{\today} @@ -167,8 +167,8 @@ } \vfill \begin{center} - Version 0.5, 2017, February, 9th \\ - \url{http://melusine.eu.org/syracuse/G/delaunay/} + Version 0.6, 2020, June, 6th \\ + \url{https://plmlab.math.cnrs.fr/mchupin/luamesh} \end{center} %% == Page de garde ==================================================== \newpage @@ -196,8 +196,15 @@ I would also like to thank the first user, an intensive \tableofcontents + \section{Installation} +\luamesh is on the CTAN and can be installed with the package manager of +your distribution. + +\begin{center} + \url{https://www.ctan.org/pkg/luamesh} +\end{center} Of course, you can just put the two files \Verb+luamesh.lua+ and \Verb+luamesh.sty+ in the working directory but this is not @@ -590,7 +597,6 @@ mesh. The followed method is, given a parameter $h$: \item to mesh the complete set of points (using the Bowyer and Watson algorithm). \end{itemize} - One can use the macro as follows: \begin{Exemple} \meshPolygon[step=polygon,scale=2cm]{(0,0);(1,0);(1,0.5);(0,0.5);(-0.20,0.35);(-0.25,0.25);(-0.20,0.15)} @@ -655,7 +661,7 @@ Here is an example of customizing the drawing. tikz, color = blue!70, meshpoint = \alpha, - colorPolygon=red!120, + colorPolygon=red!100, scale=4cm, step=mesh, print=points, @@ -1006,8 +1012,16 @@ This macro draws the triangulation produced by Gmsh and exported in the \Verb+msh+ format. The argument is the name of the file to be read (e.g.: \Verb+maillage.msh+). +Since the version 0.6, \luamesh support both version 2 and 4 of the \emph{MSH ASCII file format}. + + \begin{Exemple} -\drawGmsh{maillage.msh} +\drawGmsh{maillage.msh} % version 2.2 of MSH ASCII file format +\end{Exemple} + + +\begin{Exemple} + \drawGmsh{maillagev4.msh} % version 4.1 of MSH ASCII file format \end{Exemple} There are several options to customize the drawing. @@ -1089,7 +1103,7 @@ There are several options to customize the drawing. \end{optionsenum} \begin{Exemple} - \gmshVoronoi[tikz,scale=1.5cm, delaunay=show,styleVoronoi=dashed]{maillage.msh} + \gmshVoronoi[tikz,scale=3cm, delaunay=show,styleVoronoi=dashed]{maillagev4.msh} \end{Exemple} @@ -1207,6 +1221,17 @@ using the \Verb+animate+ package. %\animategraphics[controls]{1}{animation-crop}{}{} %\end{Exemple} + +\section{History} + +\begin{itemize} +\item June, 6th, 2020, v 0.6, correction of bug produced by the + deleted \Verb+\mplibcolor+ function of \Verb+luamplib+ package. +\item June, 6th, 2020, v 0.6, add support of version 4 of the + \emph{MSH ASCII file format}. +\end{itemize} + + \input{dum.bbl} \end{document} diff --git a/Master/texmf-dist/doc/lualatex/luamesh/lltxdoc.cls b/Master/texmf-dist/doc/lualatex/luamesh/luameshdoc.cls index d0b4d47fde5..c8d507d329c 100644 --- a/Master/texmf-dist/doc/lualatex/luamesh/lltxdoc.cls +++ b/Master/texmf-dist/doc/lualatex/luamesh/luameshdoc.cls @@ -1,8 +1,8 @@ -% private class for lualatex-doc +% copy of the private class for lualatex-doc, lltxdoc.sty. 2017 version. % see lualatex-doc.tex for copying conditions % Manuel Pégourié-Gonnard -\ProvidesClass{lltxdoc} +\ProvidesClass{luameshdoc} \LoadClass[a4paper]{scrartcl} \RequirePackage{luamesh} @@ -102,4 +102,4 @@ \small }{% \endlist -}
\ No newline at end of file +} diff --git a/Master/texmf-dist/doc/lualatex/luamesh/maillagev4.msh b/Master/texmf-dist/doc/lualatex/luamesh/maillagev4.msh new file mode 100644 index 00000000000..5f414cae379 --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/luamesh/maillagev4.msh @@ -0,0 +1,453 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$Entities +9 8 1 0 +1 0 0 0 0 +2 2 0 0 0 +3 2 1 0 0 +4 0 1 0 0 +5 1 0.5 0 0 +6 1.5 0.5 0 0 +7 1 0.75 0 0 +8 0.5 0.5 0 0 +9 1 0.25 0 0 +1 0 0 0 2 0 0 0 2 1 -2 +2 2 0 0 2 1 0 0 2 2 -3 +3 0 1 0 2 1 0 0 2 3 -4 +4 0 0 0 0 1 0 0 2 4 -1 +5 1 0.5 0 1.5 0.75 0 0 2 6 -7 +6 0.5 0.5 0 1 0.75 0 0 2 7 -8 +7 0.5 0.25 0 1 0.5 0 0 2 8 -9 +8 1 0.25 0 1.5 0.5 0 0 2 9 -6 +1 0 0 0 2 1 0 0 8 1 2 3 4 -8 -7 -6 -5 +$EndEntities +$Nodes +18 95 1 95 +0 1 0 1 +1 +0 0 0 +0 2 0 1 +2 +2 0 0 +0 3 0 1 +3 +2 1 0 +0 4 0 1 +4 +0 1 0 +0 5 0 1 +5 +1 0.5 0 +0 6 0 1 +6 +1.5 0.5 0 +0 7 0 1 +7 +1 0.75 0 +0 8 0 1 +8 +0.5 0.5 0 +0 9 0 1 +9 +1 0.25 0 +1 1 0 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +0.1999999999996293 0 0 +0.3999999999991157 0 0 +0.5999999999985328 0 0 +0.7999999999979498 0 0 +0.9999999999973885 0 0 +1.199999999997894 0 0 +1.39999999999842 0 0 +1.599999999998947 0 0 +1.799999999999474 0 0 +1 2 0 4 +19 +20 +21 +22 +2 0.1999999999995579 0 +2 0.3999999999989749 0 +2 0.5999999999989468 0 +2 0.7999999999994734 0 +1 3 0 9 +23 +24 +25 +26 +27 +28 +29 +30 +31 +1.799999999999167 1 0 +1.6 1 0 +1.400000000001387 1 0 +1.200000000002774 1 0 +1.000000000004117 1 0 +0.8000000000033287 1 0 +0.6000000000024965 1 0 +0.4000000000016644 1 0 +0.200000000000832 1 0 +1 4 0 4 +32 +33 +34 +35 +0 0.7999999999999998 0 +0 0.6000000000013869 0 +0 0.4000000000016644 0 +0 0.2000000000008322 0 +1 5 0 3 +36 +37 +38 +1.429166487020014 0.6282732692525027 0 +1.297235955115133 0.7010290942791583 0 +1.150779560124165 0.7383618699838352 0 +1 6 0 3 +39 +40 +41 +0.8492204391961987 0.7383618698763567 0 +0.7027640436394702 0.701029093818806 0 +0.5708335122175866 0.6282732686148088 0 +1 7 0 3 +42 +43 +44 +0.5708335129870858 0.3717267307415588 0 +0.702764044912523 0.298970905710619 0 +0.8492204398974336 0.261638130012749 0 +1 8 0 3 +45 +46 +47 +1.150779560764304 0.2616381301173972 0 +1.297235956377622 0.2989709061875121 0 +1.429166487836711 0.3717267314306073 0 +2 1 0 48 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +1.575754773693516 0.3727680526541947 0 +0.4242452263117927 0.6272319474069891 0 +1.575754773386917 0.6272319482587808 0 +0.4242452266006865 0.3727680517327859 0 +1.82006075891254 0.5000000002497784 0 +0.1799392410800134 0.4999999997649647 0 +1.506554911128919 0.2581927120523169 0 +1.664526598907325 0.2419484780735156 0 +0.4934450889280959 0.741807287986066 0 +0.335473401080529 0.7580515220625742 0 +1.506554910223461 0.7418072885976703 0 +1.664526598882498 0.7580515234014276 0 +0.4934450897845141 0.2581927113866551 0 +0.3354734011037487 0.2419484765476321 0 +1.840742812866083 0.6870274567184909 0 +0.1592571871277452 0.3129725432767637 0 +0.1592571870957545 0.6870274562353395 0 +1.840742812899947 0.3129725437997585 0 +0.7476263426605293 0.8528501324398146 0 +1.252373657339898 0.1471498675516256 0 +1.252373656782735 0.8528501325612595 0 +0.7476263432310521 0.1471498674360577 0 +0.3500620806703637 0.4999999996661191 0 +1.649937919326001 0.5000000003544357 0 +0.9137187557487293 0.8693222882414073 0 +1.086281244247427 0.1306777117579327 0 +0.9138546712285419 0.1315776182011232 0 +1.086145328777087 0.8684223817977503 0 +1.845840914421956 0.154159085577822 0 +0.1541590855654224 0.8458409144347685 0 +1.845840914596291 0.8458409145963616 0 +0.1541590854015815 0.1541590854018572 0 +1.714028605157862 0.3817276988989023 0 +0.2859713948485624 0.6182723011483432 0 +1.714028604805168 0.6182723020649582 0 +0.2859713951811274 0.3817276979436318 0 +1.387846812549787 0.1971375120799924 0 +0.6121531874993122 0.8028624879094739 0 +1.387846811532008 0.8028624882376136 0 +0.6121531884857123 0.1971375117529554 0 +1.525843663542067 0.1259771457351219 0 +0.4741563365246392 0.8740228542887083 0 +1.525843662648386 0.8740228546085549 0 +0.4741563373640486 0.1259771453787467 0 +1.69999999999921 0.1029091578165097 0 +0.3000000000012482 0.8970908422636076 0 +1.699999999999584 0.8970908430271125 0 +0.2999999999993725 0.1029091569416843 0 +$EndNodes +$Elements +18 197 1 197 +0 1 15 1 +1 1 +0 2 15 1 +2 2 +0 3 15 1 +3 3 +0 4 15 1 +4 4 +0 5 15 1 +5 5 +0 6 15 1 +6 6 +0 7 15 1 +7 7 +0 8 15 1 +8 8 +0 9 15 1 +9 9 +1 1 1 10 +10 1 10 +11 10 11 +12 11 12 +13 12 13 +14 13 14 +15 14 15 +16 15 16 +17 16 17 +18 17 18 +19 18 2 +1 2 1 5 +20 2 19 +21 19 20 +22 20 21 +23 21 22 +24 22 3 +1 3 1 10 +25 3 23 +26 23 24 +27 24 25 +28 25 26 +29 26 27 +30 27 28 +31 28 29 +32 29 30 +33 30 31 +34 31 4 +1 4 1 5 +35 4 32 +36 32 33 +37 33 34 +38 34 35 +39 35 1 +1 5 1 4 +40 6 36 +41 36 37 +42 37 38 +43 38 7 +1 6 1 4 +44 7 39 +45 39 40 +46 40 41 +47 41 8 +1 7 1 4 +48 8 42 +49 42 43 +50 43 44 +51 44 9 +1 8 1 4 +52 9 45 +53 45 46 +54 46 47 +55 47 6 +2 1 2 142 +56 60 61 91 +57 58 59 90 +58 57 56 89 +59 55 54 88 +60 91 61 95 +61 90 59 94 +62 57 89 93 +63 55 88 92 +64 25 68 86 +65 12 69 87 +66 66 29 85 +67 67 16 84 +68 20 21 52 +69 33 34 53 +70 47 46 84 +71 41 40 85 +72 37 36 86 +73 43 42 87 +74 25 26 68 +75 12 13 69 +76 28 29 66 +77 15 16 67 +78 52 21 62 +79 53 34 63 +80 20 52 65 +81 33 53 64 +82 21 22 62 +83 34 35 63 +84 19 20 65 +85 32 33 64 +86 65 55 76 +87 64 57 77 +88 59 62 78 +89 61 63 79 +90 2 19 76 +91 18 2 76 +92 4 32 77 +93 31 4 77 +94 3 23 78 +95 22 3 78 +96 1 10 79 +97 35 1 79 +98 54 47 84 +99 56 41 85 +100 42 60 87 +101 36 58 86 +102 11 91 95 +103 24 90 94 +104 89 30 93 +105 88 17 92 +106 36 6 50 +107 42 8 51 +108 8 41 49 +109 6 47 48 +110 71 52 82 +111 70 53 83 +112 52 71 80 +113 53 70 81 +114 66 39 72 +115 67 45 73 +116 38 68 75 +117 44 69 74 +118 49 41 56 +119 42 51 60 +120 48 47 54 +121 36 50 58 +122 46 45 67 +123 40 39 66 +124 38 37 68 +125 44 43 69 +126 39 7 72 +127 45 9 73 +128 7 38 75 +129 9 44 74 +130 60 51 61 +131 58 50 59 +132 49 56 57 +133 48 54 55 +134 72 7 75 +135 73 9 74 +136 76 55 92 +137 77 57 93 +138 59 78 94 +139 61 79 95 +140 85 29 89 +141 84 16 88 +142 25 86 90 +143 12 87 91 +144 13 14 74 +145 26 27 75 +146 27 28 72 +147 14 15 73 +148 28 66 72 +149 15 67 73 +150 68 26 75 +151 69 13 74 +152 19 65 76 +153 32 64 77 +154 62 22 78 +155 63 35 79 +156 52 62 82 +157 53 63 83 +158 65 52 80 +159 64 53 81 +160 51 8 70 +161 50 6 71 +162 8 49 70 +163 6 48 71 +164 55 65 80 +165 62 59 82 +166 57 64 81 +167 63 61 83 +168 11 12 91 +169 24 25 90 +170 29 30 89 +171 16 17 88 +172 61 51 83 +173 59 50 82 +174 49 57 81 +175 48 55 80 +176 17 18 92 +177 30 31 93 +178 23 24 94 +179 10 11 95 +180 27 72 75 +181 14 73 74 +182 71 48 80 +183 70 49 81 +184 50 71 82 +185 51 70 83 +186 46 67 84 +187 40 66 85 +188 68 37 86 +189 69 43 87 +190 18 76 92 +191 31 77 93 +192 78 23 94 +193 79 10 95 +194 54 84 88 +195 56 85 89 +196 86 58 90 +197 87 60 91 +$EndElements diff --git a/Master/texmf-dist/scripts/luamesh/luamesh-polygon.lua b/Master/texmf-dist/scripts/luamesh/luamesh-polygon.lua index fd8a228aa3e..37dc7c0487b 100755 --- a/Master/texmf-dist/scripts/luamesh/luamesh-polygon.lua +++ b/Master/texmf-dist/scripts/luamesh/luamesh-polygon.lua @@ -1,3 +1,9 @@ +----------------------------------------------------------------------- +-- FILE: luamesh-polygon.lua +-- DESCRIPTION: functions of luamesh package to mesh a polygon +-- AUTHOR: Maxime Chupin +----------------------------------------------------------------------- + -- Given three colinear points p, q, r, the function checks if -- point q lies on line segment 'pr' function onSegment(p,q,r) diff --git a/Master/texmf-dist/scripts/luamesh/luamesh-tex.lua b/Master/texmf-dist/scripts/luamesh/luamesh-tex.lua index 11e31a4c77c..34755092ed4 100755 --- a/Master/texmf-dist/scripts/luamesh/luamesh-tex.lua +++ b/Master/texmf-dist/scripts/luamesh/luamesh-tex.lua @@ -1,3 +1,8 @@ +----------------------------------------------------------------------- +-- FILE: luamesh-tex.lua +-- DESCRIPTION: functions of luamesh package to produce LaTeX code +-- AUTHOR: Maxime Chupin +----------------------------------------------------------------------- -- trace Voronoi with MP function traceVoronoiMP(listPoints, triangulation,listVoronoi, points, tri,styleD,styleV) if(styleD == "dashed") then diff --git a/Master/texmf-dist/scripts/luamesh/luamesh.lua b/Master/texmf-dist/scripts/luamesh/luamesh.lua index a1023aace9c..e03703c6d72 100755 --- a/Master/texmf-dist/scripts/luamesh/luamesh.lua +++ b/Master/texmf-dist/scripts/luamesh/luamesh.lua @@ -1,3 +1,9 @@ +----------------------------------------------------------------------- +-- FILE: luamesh.lua +-- DESCRIPTION: core functions of luamesh package +-- REQUIREMENTS: local scripts (luamesh-polygon and luamesh-tex) +-- AUTHOR: Maxime Chupin +----------------------------------------------------------------------- require "luamesh-polygon" require "luamesh-tex" @@ -509,36 +515,88 @@ function readGmsh(file) Jnodes = 0 boolElements = false Jelements = 0 + J=0 - for i=1,#lines-J do - if(lines[i+J] == "$EndNodes") then - boolNodes = false - -- go to the next line - end - if(boolNodes) then -- we are in the Nodes environment - xy=split(lines[i+J]," +") - table.insert(listPoints,{x=tonumber(xy[2]),y=tonumber(xy[3])}) - end - if(lines[i+J] == "$Nodes") then - boolNodes = true - -- go to the next line - J=J+1 - end - if(lines[i+J] == "$EndElements") then - boolElements = false - -- go to the next line - end - if(boolElements) then -- we are in the Nodes environment - xy=split(lines[i+J]," +") - if(tonumber(xy[2]) == 2) then -- if the element is a triangle - nbrTags = xy[3]+1 - table.insert(triangulation,{tonumber(xy[2+nbrTags+1]),tonumber(xy[2+nbrTags+2]),tonumber(xy[2+nbrTags+3])}) + format=split(lines[2]," +") + if((tonumber(format[1])>=2.0) and (tonumber(format[1])<3.0)) then -- Format 2 + for i=4,#lines-J do + if(lines[i+J] == "$EndNodes") then + boolNodes = false + -- go to the next line + end + if(boolNodes) then -- we are in the Nodes environment + xy=split(lines[i+J]," +") + table.insert(listPoints,{x=tonumber(xy[2]),y=tonumber(xy[3])}) + end + if(lines[i+J] == "$Nodes") then + boolNodes = true + -- go to the next line + J=J+1 + end + if(lines[i+J] == "$EndElements") then + boolElements = false + -- go to the next line + end + if(boolElements) then -- we are in the Elements environment + xy=split(lines[i+J]," +") + if(tonumber(xy[2]) == 2) then -- if the element is a triangle + nbrTags = xy[3]+1 + table.insert(triangulation,{tonumber(xy[2+nbrTags+1]),tonumber(xy[2+nbrTags+2]),tonumber(xy[2+nbrTags+3])}) + end + end + if(lines[i+J] == "$Elements") then + boolElements = true + -- go to the next line + J=J+1 end end - if(lines[i+J] == "$Elements") then - boolElements = true - -- go to the next line - J=J+1 + end + + + if(tonumber(format[1]) >= 4.0) then -- format 4 + for i=4,#lines-J do + if(lines[i+J] == "$EndNodes") then + boolNodes = false + -- go to the next line + end + if(boolNodes) then -- we are in the Nodes environment + xy=split(lines[i+J]," +") -- bloc 4 number + nbrBloc = tonumber(xy[4]) + for k=1,nbrBloc do + xyz=split(lines[i+J+nbrBloc+k]," +") -- x y z + table.insert(listPoints,{x=tonumber(xyz[1]),y=tonumber(xyz[2])}) + end + J =J+ 2*tonumber(xy[4]) + end + if(lines[i+J] == "$Nodes") then + boolNodes = true + -- go to the next line + J=J+1 + end + if(lines[i+J] == "$EndElements") then + boolElements = false + -- go to the next line + end + if(boolElements) then -- we are in the Elements environment + xy=split(lines[i+J]," +") + if(tonumber(xy[1]) < 2) then -- if the elements block is not a triangle + J = J+tonumber(xy[4]) -- we jump to the new block + end + if(tonumber(xy[1]) == 2) then -- if the elements block is a triangle + nbrElements = tonumber(xy[4]) + for k=1,nbrElements do + xyz=split(lines[i+J+k]," +") -- line tag node1 node2 node3 + table.insert(triangulation,{tonumber(xyz[2]),tonumber(xyz[3]),tonumber(xyz[4])}) + end + J = J+nbrElements + end + end + if(lines[i+J] == "$Elements") then + boolElements = true + -- go to the next line + J=J+1 + end + end end return listPoints, triangulation diff --git a/Master/texmf-dist/tex/lualatex/luamesh/luamesh.sty b/Master/texmf-dist/tex/lualatex/luamesh/luamesh.sty index 86f66edf1fc..d2024a1da8c 100644 --- a/Master/texmf-dist/tex/lualatex/luamesh/luamesh.sty +++ b/Master/texmf-dist/tex/lualatex/luamesh/luamesh.sty @@ -1,7 +1,7 @@ \NeedsTeXFormat{LaTeX2e}% \def\PackageName{luamesh}% -\def\fileversion{v0.51}% -\def\filedate{2017/04/15}% +\def\fileversion{v0.6}% +\def\filedate{2020/06/06}% \ProvidesPackage{luamesh}[\filedate\space\fileversion]% % % package to load @@ -89,8 +89,8 @@ buildMeshTikZBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bmi@mode","\luameshval@bmi@print","\luameshval@bmi@bbox","\luameshval@bmi@scale","\luameshval@bmi@color","\luameshval@bmi@colorbbox")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshval@bmi@color}% - \mplibcolor{\luameshmpcolorBbox}{\luameshval@bmi@colorbbox}% + \def\luameshmpcolor{\mpcolor{\luameshval@bmi@color}}% + \def\luameshmpcolorBbox{\mpcolor{\luameshval@bmi@colorbbox}}% \directlua{% buildMeshMPBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bmi@mode","\luameshval@bmi@print","\luameshval@bmi@bbox","\luameshval@bmi@scale")% }% @@ -149,8 +149,8 @@ buildMeshTikZBW("#2","\luameshval@bm@mode","\luameshval@bm@print","\luameshval@bm@bbox","\luameshval@bm@scale","\luameshval@bm@color","\luameshval@bm@colorbbox")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshval@bm@color}% - \mplibcolor{\luameshmpcolorBbox}{\luameshval@bm@colorbbox}% + \def\luameshmpcolor{\mpcolor{\luameshval@bm@color}}% + \def\luameshmpcolorBbox{\mpcolor{\luameshval@bm@colorbbox}}% \directlua{% buildMeshMPBW("#2","\luameshval@bm@mode","\luameshval@bm@print","\luameshval@bm@bbox","\luameshval@bm@scale")% }% @@ -238,9 +238,9 @@ buildVoronoiTikZBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bvi@mode","\luameshval@bvi@print","\luameshval@bvi@bbox","\luameshval@bvi@scale","\luameshval@bvi@delaunay","\luameshval@bvi@color","\luameshval@bvi@colorbbox","\luameshval@bvi@colorvoronoi","\luameshval@bvi@styleDelaunay","\luameshval@bvi@styleVoronoi")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshval@bvi@color}% - \mplibcolor{\luameshmpcolorBbox}{\luameshval@bvi@colorbbox}% - \mplibcolor{\luameshmpcolorVoronoi}{\luameshval@bvi@colorvoronoi}% + \def\luameshmpcolor{\mpcolor{\luameshval@bvi@color}}% + \def\luameshmpcolorBbox{\mpcolor{\luameshval@bvi@colorbbox}}% + \def\luameshmpcolorVoronoi{\mpcolor{\luameshval@bvi@colorvoronoi}}% \directlua{% buildVoronoiMPBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bvi@mode","\luameshval@bvi@print","\luameshval@bvi@bbox","\luameshval@bvi@scale","\luameshval@bvi@delaunay","\luameshval@bvi@styleDelaunay","\luameshval@bvi@styleVoronoi")% }% @@ -327,9 +327,9 @@ buildVoronoiTikZBW("#2","\luameshval@bv@mode","\luameshval@bv@print","\luameshval@bv@bbox","\luameshval@bv@scale","\luameshval@bv@delaunay","\luameshval@bv@color","\luameshval@bv@colorbbox","\luameshval@bv@colorVoronoi","\luameshval@bv@styleDelaunay","\luameshval@bv@styleVoronoi")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshval@bv@color}% - \mplibcolor{\luameshmpcolorBbox}{\luameshval@bv@colorbbox}% - \mplibcolor{\luameshmpcolorVoronoi}{\luameshval@bv@colorVoronoi}% + \def\luameshmpcolor{\mpcolor{\luameshval@bv@color}}% + \def\luameshmpcolorBbox{\mpcolor{\luameshval@bv@colorbbox}}% + \def\luameshmpcolorVoronoi{\mpcolor{\luameshval@bv@colorVoronoi}}% \directlua{% buildVoronoiMPBW("#2","\luameshval@bv@mode","\luameshval@bv@print","\luameshval@bv@bbox","\luameshval@bv@scale","\luameshval@bv@delaunay","\luameshval@bv@styleDelaunay","\luameshval@bv@styleVoronoi")% }% @@ -388,8 +388,8 @@ printPointsTikZ("#2","\luameshval@tp@mode","\luameshval@tp@print","\luameshval@tp@bbox","\luameshval@tp@scale","\luameshval@tp@color","\luameshval@tp@colorbbox")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshval@tp@color}% - \mplibcolor{\luameshmpcolorBbox}{\luameshval@tp@colorbbox}% + \def\luameshmpcolor{\mpcolor{\luameshval@tp@color}}% + \def\luameshmpcolorBbox{\mpcolor{\luameshval@tp@colorbbox}}% \directlua{% printPointsMP("#2","\luameshval@tp@mode","\luameshval@tp@print","\luameshval@tp@bbox","\luameshval@tp@scale")% }% @@ -452,8 +452,8 @@ printPointsTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@tpi@mode","\luameshval@tpi@print","\luameshval@tpi@bbox","\luameshval@tpi@scale","\luameshval@tpi@color","\luameshval@tpi@colorbbox")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshval@tpi@color}% - \mplibcolor{\luameshmpcolorBbox}{\luameshval@tpi@colorbbox}% + \def\luameshmpcolor{\mpcolor{\luameshval@tpi@color}}% + \def\luameshmpcolorBbox{\mpcolor{\luameshval@tpi@colorbbox}}% \directlua{% printPointsMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@tpi@mode","\luameshval@tpi@print","\luameshval@tpi@bbox","\luameshval@tpi@scale")% }% @@ -522,11 +522,11 @@ TeXOnePointTikZBW("#2","#3","\luameshval@ap@step","\luameshval@ap@scale","\luameshval@ap@mode","\luameshval@ap@bbox","\luameshval@ap@color","\luameshval@ap@colorback","\luameshval@ap@colornew","\luameshval@ap@colorcircle","\luameshval@ap@colorbbox")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshval@ap@color} - \mplibcolor{\luameshmpcolorBack}{\luameshval@ap@colorback} - \mplibcolor{\luameshmpcolorNew}{\luameshval@ap@colornew} - \mplibcolor{\luameshmpcolorCircle}{\luameshval@ap@colorcircle} - \mplibcolor{\luameshmpcolorBbox}{\luameshval@ap@colorbbox} + \def\luameshmpcolor{\mpcolor{\luameshval@ap@color}} + \def\luameshmpcolorBack{\mpcolor{\luameshval@ap@colorback}} + \def\luameshmpcolorNew{\mpcolor{\luameshval@ap@colornew}} + \def\luameshmpcolorCircle{\mpcolor{\luameshval@ap@colorcircle}} + \def\luameshmpcolorBbox{\mpcolor{\luameshval@ap@colorbbox}} \directlua{% TeXOnePointMPBW("#2","#3","\luameshval@ap@step","\luameshval@ap@scale","\luameshval@ap@mode","\luameshval@ap@bbox")% }% @@ -596,11 +596,11 @@ TeXOnePointTikZBWinc("#2","#3","\luaescapestring{\unexpanded{#4}}","\luaescapestring{\unexpanded{#5}}","\luameshval@ap@step","\luameshval@ap@scale","\luameshval@ap@mode","\luameshval@ap@bbox","\luameshval@ap@color","\luameshval@ap@colorback","\luameshval@ap@colornew","\luameshval@ap@colorcircle","\luameshval@ap@colorbbox")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshval@api@color} - \mplibcolor{\luameshmpcolorBack}{\luameshval@api@colorback} - \mplibcolor{\luameshmpcolorNew}{\luameshval@api@colornew} - \mplibcolor{\luameshmpcolorCircle}{\luameshval@api@colorcircle} - \mplibcolor{\luameshmpcolorBbox}{\luameshval@api@colorbbox} + \def\luameshmpcolor{\mpcolor{\luameshval@api@color}} + \def\luameshmpcolorBack{\mpcolor{\luameshval@api@colorback}} + \def\luameshmpcolorNew{\mpcolor{\luameshval@api@colornew}} + \def\luameshmpcolorCircle{\mpcolor{\luameshval@api@colorcircle}} + \def\luameshmpcolorBbox{\mpcolor{\luameshval@api@colorbbox}} \directlua{% TeXOnePointMPBWinc("#2","#3","\luaescapestring{\unexpanded{#4}}","\luaescapestring{\unexpanded{#5}}","\luameshval@api@step","\luameshval@api@scale","\luameshval@api@mode","\luameshval@api@bbox")% }% @@ -641,7 +641,7 @@ drawGmshTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshvaldgi@print","\luameshvaldgi@scale","\luameshvaldgi@color")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshvaldgi@color}% + \def\luameshmpcolor{\mpcolor{\luameshvaldgi@color}}% \directlua{% drawGmshMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshvaldgi@print","\luameshvaldgi@scale")% }% @@ -679,7 +679,7 @@ drawGmshTikZ("#2","\luameshvaldg@print","\luameshvaldg@scale","\luameshvaldg@color")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshvaldg@color}% + \def\luameshmpcolor{\mpcolor{\luameshvaldg@color}}% \directlua{% drawGmshMP("#2","\luameshvaldg@print","\luameshvaldg@scale")% }% @@ -749,8 +749,8 @@ gmshVoronoiTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@gvi@print","\luameshval@gvi@scale","\luameshval@gvi@delaunay","\luameshval@gvi@color","\luameshval@gvi@colorvoronoi","\luameshval@gvi@styleDelaunay","\luameshval@gvi@styleVoronoi")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshval@gvi@color}% - \mplibcolor{\luameshmpcolorVoronoi}{\luameshval@gvi@colorvoronoi}% + \def\luameshmpcolor{\mpcolor{\luameshval@gvi@color}}% + \def\luameshmpcolorVoronoi{\mpcolor{\luameshval@gvi@colorvoronoi}}% \directlua{% gmshVoronoiMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@gvi@print","\luameshval@gvi@scale","\luameshval@gvi@delaunay","\luameshval@gvi@styleDelaunay","\luameshval@gvi@styleVoronoi")% }% @@ -817,8 +817,8 @@ gmshVoronoiTikZ("#2","\luameshval@gv@print","\luameshval@gv@scale","\luameshval@gv@delaunay","\luameshval@gv@color","\luameshval@gv@colorVoronoi","\luameshval@gv@styleDelaunay","\luameshval@gv@styleVoronoi")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshval@gv@color}% - \mplibcolor{\luameshmpcolorVoronoi}{\luameshval@gv@colorVoronoi}% + \def\luameshmpcolor{\mpcolor{\luameshval@gv@color}}% + \def\luameshmpcolorVoronoi{\mpcolor{\luameshval@gv@colorVoronoi}}% \directlua{% gmshVoronoiMP("#2","\luameshval@gv@print","\luameshval@gv@scale","\luameshval@gv@delaunay","\luameshval@gv@styleDelaunay","\luameshval@gv@styleVoronoi")% }% @@ -896,8 +896,8 @@ drawMeshPolygonTikZ("#2","\luameshval@mp@mode","\luameshval@mp@h","\luameshval@mp@step","\luameshval@mp@print","\luameshval@mp@scale","\luameshval@mp@color","\luameshval@mp@colorPolygon","\luameshval@mp@gridpoints")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshval@mp@color}% - \mplibcolor{\luameshmpcolorPoly}{\luameshval@mp@colorPolygon}% + \def\luameshmpcolor{\mpcolor{\luameshval@mp@color}}% + \def\luameshmpcolorPoly{\mpcolor{\luameshval@mp@colorPolygon}}% \directlua{% drawMeshPolygonMP("#2","\luameshval@mp@mode","\luameshval@mp@h","\luameshval@mp@step","\luameshval@mp@print","\luameshval@mp@scale","\luameshval@mp@gridpoints")% }% @@ -974,8 +974,8 @@ drawMeshPolygonTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@mpi@mode","\luameshval@mpi@h","\luameshval@mpi@step","\luameshval@mpi@print","\luameshval@mpi@scale","\luameshval@mpi@color","\luameshval@mpi@colorPolygon","\luameshval@mpi@gridpoints")% }% \else % we are using MP - \mplibcolor{\luameshmpcolor}{\luameshval@mpi@color}% - \mplibcolor{\luameshmpcolorPoly}{\luameshval@mpi@colorPolygon}% + \def\luameshmpcolor{\mpcolor{\luameshval@mpi@color}}% + \def\luameshmpcolorPoly{\mpcolor{\luameshval@mpi@colorPolygon}}% \directlua{% drawMeshPolygonMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@mpi@mode","\luameshval@mpi@h","\luameshval@mpi@step","\luameshval@mpi@print","\luameshval@mpi@scale","\luameshval@mpi@gridpoints")% }% |