netgen-mesher 6.2.2504.post11.dev0__cp313-cp313-win_amd64.whl → 6.2.2506.post48.dev0__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. netgen/__init__.pyi +3 -3
  2. netgen/cmake/NetgenConfig.cmake +10 -9
  3. netgen/config/__init__.pyi +8 -8
  4. netgen/config/config.py +7 -7
  5. netgen/config/config.pyi +8 -8
  6. netgen/include/core/archive.hpp +18 -3
  7. netgen/include/core/array.hpp +20 -4
  8. netgen/include/core/autodiff.hpp +9 -11
  9. netgen/include/core/autodiffdiff.hpp +0 -2
  10. netgen/include/core/bitarray.hpp +1 -1
  11. netgen/include/core/flags.hpp +1 -1
  12. netgen/include/core/hashtable.hpp +1 -1
  13. netgen/include/core/memtracer.hpp +7 -7
  14. netgen/include/core/ngcore.hpp +5 -0
  15. netgen/include/core/ngcore_api.hpp +11 -0
  16. netgen/include/core/paje_trace.hpp +9 -8
  17. netgen/include/core/profiler.hpp +5 -5
  18. netgen/include/core/register_archive.hpp +8 -0
  19. netgen/include/core/simd.hpp +69 -1
  20. netgen/include/core/simd_arm64.hpp +205 -1
  21. netgen/include/core/simd_avx.hpp +72 -4
  22. netgen/include/core/simd_avx512.hpp +9 -0
  23. netgen/include/core/simd_generic.hpp +274 -8
  24. netgen/include/core/simd_math.hpp +178 -0
  25. netgen/include/core/simd_sse.hpp +11 -1
  26. netgen/include/core/statushandler.hpp +37 -0
  27. netgen/include/core/table.hpp +3 -2
  28. netgen/include/core/taskmanager.hpp +34 -1
  29. netgen/include/core/utils.hpp +3 -8
  30. netgen/include/include/netgen_version.hpp +4 -4
  31. netgen/include/meshing/basegeom.hpp +1 -4
  32. netgen/include/meshing/global.hpp +0 -17
  33. netgen/include/meshing/hpref_tet.hpp +41 -0
  34. netgen/include/meshing/hprefinement.hpp +2 -0
  35. netgen/include/meshing/meshtype.hpp +2 -1
  36. netgen/include/meshing/msghandler.hpp +9 -6
  37. netgen/include/meshing/topology.hpp +2 -2
  38. netgen/include/nginterface.h +3 -2
  39. netgen/include/occ/occ_utils.hpp +26 -0
  40. netgen/include/occ/occgeom.hpp +8 -0
  41. netgen/include/pybind11/attr.h +40 -8
  42. netgen/include/pybind11/buffer_info.h +14 -14
  43. netgen/include/pybind11/cast.h +553 -29
  44. netgen/include/pybind11/chrono.h +4 -1
  45. netgen/include/pybind11/conduit/README.txt +15 -0
  46. netgen/include/pybind11/conduit/pybind11_conduit_v1.h +116 -0
  47. netgen/include/pybind11/conduit/pybind11_platform_abi_id.h +87 -0
  48. netgen/include/pybind11/conduit/wrap_include_python_h.h +72 -0
  49. netgen/include/pybind11/critical_section.h +56 -0
  50. netgen/include/pybind11/detail/class.h +172 -97
  51. netgen/include/pybind11/detail/common.h +270 -189
  52. netgen/include/pybind11/detail/cpp_conduit.h +75 -0
  53. netgen/include/pybind11/detail/descr.h +55 -0
  54. netgen/include/pybind11/detail/dynamic_raw_ptr_cast_if_possible.h +39 -0
  55. netgen/include/pybind11/detail/exception_translation.h +71 -0
  56. netgen/include/pybind11/detail/function_record_pyobject.h +191 -0
  57. netgen/include/pybind11/detail/init.h +113 -9
  58. netgen/include/pybind11/detail/internals.h +479 -344
  59. netgen/include/pybind11/detail/native_enum_data.h +209 -0
  60. netgen/include/pybind11/detail/pybind11_namespace_macros.h +82 -0
  61. netgen/include/pybind11/detail/struct_smart_holder.h +378 -0
  62. netgen/include/pybind11/detail/type_caster_base.h +506 -133
  63. netgen/include/pybind11/detail/using_smart_holder.h +22 -0
  64. netgen/include/pybind11/detail/value_and_holder.h +90 -0
  65. netgen/include/pybind11/eigen/matrix.h +19 -10
  66. netgen/include/pybind11/eigen/tensor.h +15 -11
  67. netgen/include/pybind11/embed.h +50 -46
  68. netgen/include/pybind11/eval.h +11 -6
  69. netgen/include/pybind11/functional.h +58 -49
  70. netgen/include/pybind11/gil.h +34 -82
  71. netgen/include/pybind11/gil_safe_call_once.h +12 -1
  72. netgen/include/pybind11/gil_simple.h +37 -0
  73. netgen/include/pybind11/native_enum.h +67 -0
  74. netgen/include/pybind11/numpy.h +272 -93
  75. netgen/include/pybind11/pybind11.h +947 -265
  76. netgen/include/pybind11/pytypes.h +127 -21
  77. netgen/include/pybind11/stl/filesystem.h +23 -25
  78. netgen/include/pybind11/stl.h +277 -59
  79. netgen/include/pybind11/stl_bind.h +42 -7
  80. netgen/include/pybind11/subinterpreter.h +299 -0
  81. netgen/include/pybind11/trampoline_self_life_support.h +65 -0
  82. netgen/include/pybind11/typing.h +177 -4
  83. netgen/include/pybind11/warnings.h +75 -0
  84. netgen/include/visualization/mvdraw.hpp +48 -12
  85. netgen/include/visualization/vssolution.hpp +3 -1
  86. netgen/lib/libnggui.lib +0 -0
  87. netgen/lib/ngcore.lib +0 -0
  88. netgen/lib/nglib.lib +0 -0
  89. netgen/libnggui.dll +0 -0
  90. netgen/libngguipy.pyd +0 -0
  91. netgen/libngpy/_NgOCC.pyi +224 -139
  92. netgen/libngpy/_csg.pyi +26 -26
  93. netgen/libngpy/_geom2d.pyi +34 -25
  94. netgen/libngpy/_meshing.pyi +262 -111
  95. netgen/libngpy/_stl.pyi +3 -4
  96. netgen/libngpy.pyd +0 -0
  97. netgen/ngcore.dll +0 -0
  98. netgen/nglib.dll +0 -0
  99. netgen/read_gmsh.py +41 -0
  100. netgen/togl.dll +0 -0
  101. netgen/version.py +1 -1
  102. netgen/webgui.py +38 -2
  103. {netgen_mesher-6.2.2504.post11.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/METADATA +2 -1
  104. {netgen_mesher-6.2.2504.post11.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/RECORD +153 -132
  105. pyngcore/pyngcore.cp313-win_amd64.pyd +0 -0
  106. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/boundarycondition.geo +0 -0
  107. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/boxcyl.geo +0 -0
  108. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/circle_on_cube.geo +0 -0
  109. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cone.geo +0 -0
  110. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cube.geo +0 -0
  111. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cubeandring.geo +0 -0
  112. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cubeandspheres.geo +0 -0
  113. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cubemcyl.geo +0 -0
  114. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cubemsphere.geo +0 -0
  115. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cylinder.geo +0 -0
  116. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cylsphere.geo +0 -0
  117. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/doc/ng4.pdf +0 -0
  118. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/ellipsoid.geo +0 -0
  119. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/ellipticcyl.geo +0 -0
  120. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/extrusion.geo +0 -0
  121. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/fichera.geo +0 -0
  122. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/frame.step +0 -0
  123. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/hinge.stl +0 -0
  124. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/lshape3d.geo +0 -0
  125. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/manyholes.geo +0 -0
  126. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/manyholes2.geo +0 -0
  127. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/matrix.geo +0 -0
  128. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/ortho.geo +0 -0
  129. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/part1.stl +0 -0
  130. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/period.geo +0 -0
  131. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/py_tutorials/exportNeutral.py +0 -0
  132. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/py_tutorials/mesh.py +0 -0
  133. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/py_tutorials/shaft.geo +0 -0
  134. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/revolution.geo +0 -0
  135. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/screw.step +0 -0
  136. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/sculpture.geo +0 -0
  137. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/shaft.geo +0 -0
  138. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/shell.geo +0 -0
  139. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/sphere.geo +0 -0
  140. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/sphereincube.geo +0 -0
  141. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/square.in2d +0 -0
  142. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/squarecircle.in2d +0 -0
  143. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/squarehole.in2d +0 -0
  144. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/torus.geo +0 -0
  145. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/trafo.geo +0 -0
  146. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/twobricks.geo +0 -0
  147. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/twocubes.geo +0 -0
  148. {netgen_mesher-6.2.2504.post11.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/twocyl.geo +0 -0
  149. {netgen_mesher-6.2.2504.post11.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/AUTHORS +0 -0
  150. {netgen_mesher-6.2.2504.post11.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/LICENSE +0 -0
  151. {netgen_mesher-6.2.2504.post11.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/WHEEL +0 -0
  152. {netgen_mesher-6.2.2504.post11.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/entry_points.txt +0 -0
  153. {netgen_mesher-6.2.2504.post11.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/top_level.txt +0 -0
@@ -2,24 +2,20 @@
2
2
  pybind meshing module
3
3
  """
4
4
  from __future__ import annotations
5
+ import collections.abc
5
6
  import numpy
6
- import os
7
+ import numpy.typing
7
8
  import pyngcore.pyngcore
8
9
  import typing
9
10
  __all__ = ['BoundaryLayerParameters', 'ClearSolutionClass', 'Element0D', 'Element1D', 'Element2D', 'Element3D', 'ElementId1D', 'ElementId2D', 'ElementId3D', 'FaceDescriptor', 'GetTransformation', 'IdentificationType', 'ImportMesh', 'LocalH', 'Mat33', 'Mesh', 'MeshPoint', 'MeshingParameters', 'MeshingStep', 'NGDummyArgument', 'NetgenGeometry', 'NgException', 'Pnt', 'Point2d', 'Point3d', 'PointId', 'ReadMedit', 'SetMessageImportance', 'SetParallelPickling', 'SetTestoutFile', 'SetTransformation', 'SurfaceGeometry', 'Trafo', 'Vec', 'Vec2d', 'Vec3d', 'WriteMedit', 'debugparam']
10
11
  class BoundaryLayerParameters:
11
- boundary: str | int | list[int]
12
12
  disable_curving: bool
13
- domain: str | int | list[int]
14
13
  grow_edges: bool
15
14
  limit_growth_vectors: bool
16
- new_material: str | dict[str, str] | None
17
15
  outside: bool
18
- project_boundaries: str | list[int] | None
19
16
  sides_keep_surfaceindex: bool | None
20
- thickness: float | list[float]
21
17
  @typing.overload
22
- def __init__(self, boundary: str | int | list[int], thickness: float | list[float], new_material: str | dict[str, str] | None = None, domain: str | int | list[int] = '.*', outside: bool = False, project_boundaries: str | list[int] | None = None, grow_edges: bool = True, limit_growth_vectors: bool = False, sides_keep_surfaceindex: bool | None = None, disable_curving: bool = True) -> None:
18
+ def __init__(self, boundary: str | typing.SupportsInt | collections.abc.Sequence[typing.SupportsInt], thickness: typing.SupportsFloat | collections.abc.Sequence[typing.SupportsFloat], new_material: str | collections.abc.Mapping[str, str] | None = None, domain: str | typing.SupportsInt | collections.abc.Sequence[typing.SupportsInt] = '.*', outside: bool = False, project_boundaries: str | collections.abc.Sequence[typing.SupportsInt] | None = None, grow_edges: bool = True, limit_growth_vectors: bool = False, sides_keep_surfaceindex: bool | None = None, disable_curving: bool = True) -> None:
23
19
  """
24
20
  Add boundary layer to mesh.
25
21
 
@@ -52,11 +48,41 @@ class BoundaryLayerParameters:
52
48
  @typing.overload
53
49
  def __init__(self, arg0: dict) -> None:
54
50
  ...
51
+ @property
52
+ def boundary(self) -> str | int | list[int]:
53
+ ...
54
+ @boundary.setter
55
+ def boundary(self, arg0: str | typing.SupportsInt | collections.abc.Sequence[typing.SupportsInt]) -> None:
56
+ ...
57
+ @property
58
+ def domain(self) -> str | int | list[int]:
59
+ ...
60
+ @domain.setter
61
+ def domain(self, arg0: str | typing.SupportsInt | collections.abc.Sequence[typing.SupportsInt]) -> None:
62
+ ...
63
+ @property
64
+ def new_material(self) -> str | dict[str, str] | None:
65
+ ...
66
+ @new_material.setter
67
+ def new_material(self, arg0: str | collections.abc.Mapping[str, str] | None) -> None:
68
+ ...
69
+ @property
70
+ def project_boundaries(self) -> str | list[int] | None:
71
+ ...
72
+ @project_boundaries.setter
73
+ def project_boundaries(self, arg0: str | collections.abc.Sequence[typing.SupportsInt] | None) -> None:
74
+ ...
75
+ @property
76
+ def thickness(self) -> float | list[float]:
77
+ ...
78
+ @thickness.setter
79
+ def thickness(self, arg0: typing.SupportsFloat | collections.abc.Sequence[typing.SupportsFloat]) -> None:
80
+ ...
55
81
  class ClearSolutionClass:
56
82
  def __init__(self) -> None:
57
83
  ...
58
84
  class Element0D:
59
- def __init__(self, vertex: PointId, index: int = 1) -> None:
85
+ def __init__(self, vertex: PointId, index: typing.SupportsInt = 1) -> None:
60
86
  """
61
87
  create point element
62
88
  """
@@ -66,19 +92,34 @@ class Element0D:
66
92
  def vertices(self) -> list:
67
93
  ...
68
94
  class Element1D:
69
- edgenr: int
70
- index: int
71
- singular: float
72
- def __init__(self, vertices: list, surfaces: list = [], index: int = 1, edgenr: int = 1, trignums: list = []) -> None:
95
+ def __init__(self, vertices: list, surfaces: list = [], index: typing.SupportsInt = 1, edgenr: typing.SupportsInt = 1, trignums: list = []) -> None:
73
96
  """
74
97
  create segment element
75
98
  """
76
99
  def __repr__(self) -> str:
77
100
  ...
78
101
  @property
102
+ def edgenr(self) -> int:
103
+ ...
104
+ @edgenr.setter
105
+ def edgenr(self, arg1: typing.SupportsInt) -> None:
106
+ ...
107
+ @property
108
+ def index(self) -> int:
109
+ ...
110
+ @index.setter
111
+ def index(self, arg1: typing.SupportsInt) -> None:
112
+ ...
113
+ @property
79
114
  def points(self) -> list:
80
115
  ...
81
116
  @property
117
+ def singular(self) -> float:
118
+ ...
119
+ @singular.setter
120
+ def singular(self, arg1: typing.SupportsFloat) -> None:
121
+ ...
122
+ @property
82
123
  def surfaces(self) -> list:
83
124
  ...
84
125
  @property
@@ -86,9 +127,8 @@ class Element1D:
86
127
  ...
87
128
  class Element2D:
88
129
  curved: bool
89
- index: int
90
130
  refine: bool
91
- def __init__(self, index: int = 1, vertices: list[PointId]) -> None:
131
+ def __init__(self, index: typing.SupportsInt = 1, vertices: collections.abc.Sequence[PointId]) -> None:
92
132
  """
93
133
  create surface element
94
134
  """
@@ -96,6 +136,12 @@ class Element2D:
96
136
  def geominfo(self) -> list:
97
137
  ...
98
138
  @property
139
+ def index(self) -> int:
140
+ ...
141
+ @index.setter
142
+ def index(self, arg1: typing.SupportsInt) -> None:
143
+ ...
144
+ @property
99
145
  def points(self) -> list:
100
146
  ...
101
147
  @property
@@ -103,14 +149,19 @@ class Element2D:
103
149
  ...
104
150
  class Element3D:
105
151
  curved: bool
106
- index: int
107
- def __init__(self, index: int = 1, vertices: list[PointId]) -> None:
152
+ def __init__(self, index: typing.SupportsInt = 1, vertices: collections.abc.Sequence[PointId]) -> None:
108
153
  """
109
154
  create volume element
110
155
  """
111
156
  def __repr__(self) -> str:
112
157
  ...
113
158
  @property
159
+ def index(self) -> int:
160
+ ...
161
+ @index.setter
162
+ def index(self, arg1: typing.SupportsInt) -> None:
163
+ ...
164
+ @property
114
165
  def points(self) -> list:
115
166
  ...
116
167
  @property
@@ -127,7 +178,7 @@ class ElementId1D:
127
178
  ...
128
179
  def __hash__(self) -> int:
129
180
  ...
130
- def __init__(self, arg0: int) -> None:
181
+ def __init__(self, arg0: typing.SupportsInt) -> None:
131
182
  ...
132
183
  def __repr__(self) -> str:
133
184
  ...
@@ -141,7 +192,7 @@ class ElementId2D:
141
192
  ...
142
193
  def __hash__(self) -> int:
143
194
  ...
144
- def __init__(self, arg0: int) -> None:
195
+ def __init__(self, arg0: typing.SupportsInt) -> None:
145
196
  ...
146
197
  def __repr__(self) -> str:
147
198
  ...
@@ -155,7 +206,7 @@ class ElementId3D:
155
206
  ...
156
207
  def __hash__(self) -> int:
157
208
  ...
158
- def __init__(self, arg0: int) -> None:
209
+ def __init__(self, arg0: typing.SupportsInt) -> None:
159
210
  ...
160
211
  def __repr__(self) -> str:
161
212
  ...
@@ -165,20 +216,13 @@ class ElementId3D:
165
216
  def nr(self) -> int:
166
217
  ...
167
218
  class FaceDescriptor:
168
- bc: int
169
219
  bcname: str
170
220
  color: tuple
171
- domin: int
172
- domin_singular: float
173
- domout: int
174
- domout_singular: float
175
- surfnr: int
176
- transparency: float
177
221
  @typing.overload
178
222
  def __init__(self, arg0: FaceDescriptor) -> None:
179
223
  ...
180
224
  @typing.overload
181
- def __init__(self, surfnr: int = 1, domin: int = 1, domout: int = 0, bc: int = 0) -> None:
225
+ def __init__(self, surfnr: typing.SupportsInt = 1, domin: typing.SupportsInt = 1, domout: typing.SupportsInt = 0, bc: typing.SupportsInt = 0) -> None:
182
226
  """
183
227
  create facedescriptor
184
228
  """
@@ -186,6 +230,48 @@ class FaceDescriptor:
186
230
  ...
187
231
  def __str__(self) -> str:
188
232
  ...
233
+ @property
234
+ def bc(self) -> int:
235
+ ...
236
+ @bc.setter
237
+ def bc(self, arg1: typing.SupportsInt) -> None:
238
+ ...
239
+ @property
240
+ def domin(self) -> int:
241
+ ...
242
+ @domin.setter
243
+ def domin(self, arg1: typing.SupportsInt) -> None:
244
+ ...
245
+ @property
246
+ def domin_singular(self) -> float:
247
+ ...
248
+ @domin_singular.setter
249
+ def domin_singular(self, arg1: typing.SupportsFloat) -> None:
250
+ ...
251
+ @property
252
+ def domout(self) -> int:
253
+ ...
254
+ @domout.setter
255
+ def domout(self, arg1: typing.SupportsInt) -> None:
256
+ ...
257
+ @property
258
+ def domout_singular(self) -> float:
259
+ ...
260
+ @domout_singular.setter
261
+ def domout_singular(self, arg1: typing.SupportsFloat) -> None:
262
+ ...
263
+ @property
264
+ def surfnr(self) -> int:
265
+ ...
266
+ @surfnr.setter
267
+ def surfnr(self, arg1: typing.SupportsInt) -> None:
268
+ ...
269
+ @property
270
+ def transparency(self) -> float:
271
+ ...
272
+ @transparency.setter
273
+ def transparency(self, arg1: typing.SupportsFloat) -> None:
274
+ ...
189
275
  class IdentificationType:
190
276
  """
191
277
  Members:
@@ -211,7 +297,7 @@ class IdentificationType:
211
297
  ...
212
298
  def __index__(self) -> int:
213
299
  ...
214
- def __init__(self, value: int) -> None:
300
+ def __init__(self, value: typing.SupportsInt) -> None:
215
301
  ...
216
302
  def __int__(self) -> int:
217
303
  ...
@@ -219,7 +305,7 @@ class IdentificationType:
219
305
  ...
220
306
  def __repr__(self) -> str:
221
307
  ...
222
- def __setstate__(self, state: int) -> None:
308
+ def __setstate__(self, state: typing.SupportsInt) -> None:
223
309
  ...
224
310
  def __str__(self) -> str:
225
311
  ...
@@ -236,12 +322,11 @@ class Mat33:
236
322
  ...
237
323
  def __init__(self, arg0: tuple) -> None:
238
324
  ...
239
- def __setitem__(self, arg0: tuple, arg1: float) -> None:
325
+ def __setitem__(self, arg0: tuple, arg1: typing.SupportsFloat) -> None:
240
326
  ...
241
327
  def __str__(self) -> str:
242
328
  ...
243
329
  class Mesh:
244
- dim: int
245
330
  @staticmethod
246
331
  def EnableTableClass(name: str, set: bool = True) -> None:
247
332
  ...
@@ -266,29 +351,29 @@ class Mesh:
266
351
  @typing.overload
267
352
  def Add(self, arg0: FaceDescriptor) -> int:
268
353
  ...
269
- def AddElements(self, dim: int, index: int, data: typing_extensions.Buffer, base: int = 0, project_geometry: bool = False) -> None:
354
+ def AddElements(self, dim: typing.SupportsInt, index: typing.SupportsInt, data: collections.abc.Buffer, base: typing.SupportsInt = 0, project_geometry: bool = False) -> None:
270
355
  ...
271
- def AddPointIdentification(self, pid1: typing.Any, pid2: typing.Any, identnr: int, type: IdentificationType = ...) -> None:
356
+ def AddPointIdentification(self, pid1: typing.Any, pid2: typing.Any, identnr: typing.SupportsInt, type: IdentificationType = ...) -> None:
272
357
  ...
273
- def AddPoints(self, arg0: typing_extensions.Buffer) -> None:
358
+ def AddPoints(self, arg0: collections.abc.Buffer) -> None:
274
359
  ...
275
- def AddRegion(self, name: str, dim: int) -> int:
360
+ def AddRegion(self, name: str, dim: typing.SupportsInt) -> int:
276
361
  ...
277
- def AddSingularity(self, arg0: PointId, arg1: float) -> None:
362
+ def AddSingularity(self, arg0: PointId, arg1: typing.SupportsFloat) -> None:
278
363
  ...
279
- def BoundaryLayer(self, boundary: str | int | list[int], thickness: float | list[float], material: str | dict[str, str] | None = None, domains: str | int | list[int] = '.*', outside: bool = False, project_boundaries: str | list[int] | None = None, grow_edges: bool = True, limit_growth_vectors: bool = False, sides_keep_surfaceindex: bool = False, disable_curving: bool = True) -> None:
364
+ def BoundaryLayer(self, boundary: str | typing.SupportsInt | collections.abc.Sequence[typing.SupportsInt], thickness: typing.SupportsFloat | collections.abc.Sequence[typing.SupportsFloat], material: str | collections.abc.Mapping[str, str] | None = None, domains: str | typing.SupportsInt | collections.abc.Sequence[typing.SupportsInt] = '.*', outside: bool = False, project_boundaries: str | collections.abc.Sequence[typing.SupportsInt] | None = None, grow_edges: bool = True, limit_growth_vectors: bool = False, sides_keep_surfaceindex: bool = False, disable_curving: bool = True) -> None:
280
365
  """
281
366
  Add boundary layer to mesh. see help(BoundaryLayerParameters) for details.
282
367
  """
283
- def BoundaryLayer2(self, domain: int, thicknesses: pyngcore.pyngcore.Array_D_S, make_new_domain: bool = True, boundaries: pyngcore.pyngcore.Array_I_S = ...) -> int:
368
+ def BoundaryLayer2(self, domain: typing.SupportsInt, thicknesses: pyngcore.pyngcore.Array_D_S, make_new_domain: bool = True, boundaries: pyngcore.pyngcore.Array_I_S = ...) -> int:
284
369
  ...
285
- def BuildSearchTree(self, dim: int = 3) -> None:
370
+ def BuildSearchTree(self, dim: typing.SupportsInt = 3) -> None:
286
371
  ...
287
- def CalcElementMapping(self, arg0: typing_extensions.Buffer, arg1: typing_extensions.Buffer) -> None:
372
+ def CalcElementMapping(self, arg0: collections.abc.Buffer, arg1: collections.abc.Buffer) -> None:
288
373
  ...
289
- def CalcLocalH(self, arg0: float, arg1: int) -> None:
374
+ def CalcLocalH(self, arg0: typing.SupportsFloat, arg1: typing.SupportsInt) -> None:
290
375
  ...
291
- def CalcMinMaxAngle(self, badelement_limit: float = 175.0) -> dict:
376
+ def CalcMinMaxAngle(self, badelement_limit: typing.SupportsFloat = 175.0) -> dict:
292
377
  ...
293
378
  def CalcTotalBadness(self, arg0: ...) -> float:
294
379
  ...
@@ -298,7 +383,7 @@ class Mesh:
298
383
  ...
299
384
  def Copy(self) -> Mesh:
300
385
  ...
301
- def Curve(self, arg0: int) -> None:
386
+ def Curve(self, arg0: typing.SupportsInt) -> None:
302
387
  ...
303
388
  def DeleteSurfaceElement(self, arg0: ElementId2D) -> None:
304
389
  ...
@@ -342,7 +427,7 @@ class Mesh:
342
427
  VRML Format (.*)
343
428
  VRML Format Faces (.*)
344
429
  """
345
- def FaceDescriptor(self, arg0: int) -> FaceDescriptor:
430
+ def FaceDescriptor(self, arg0: typing.SupportsInt) -> FaceDescriptor:
346
431
  ...
347
432
  def FaceDescriptors(self) -> Array[FaceDescriptor]:
348
433
  ...
@@ -423,11 +508,11 @@ class Mesh:
423
508
  elsizeweight: float = 0.2
424
509
  Weight of element size w.r.t. element shape in optimization.
425
510
  """
426
- def GetBCName(self, arg0: int) -> str:
511
+ def GetBCName(self, arg0: typing.SupportsInt) -> str:
427
512
  ...
428
- def GetCD2Name(self, arg0: int) -> str:
513
+ def GetCD2Name(self, arg0: typing.SupportsInt) -> str:
429
514
  ...
430
- def GetCD3Name(self, arg0: int) -> str:
515
+ def GetCD3Name(self, arg0: typing.SupportsInt) -> str:
431
516
  ...
432
517
  def GetCurveOrder(self) -> int:
433
518
  ...
@@ -435,9 +520,9 @@ class Mesh:
435
520
  ...
436
521
  def GetIdentifications(self) -> list:
437
522
  ...
438
- def GetLocalH(self, arg0: int) -> LocalH:
523
+ def GetLocalH(self, arg0: typing.SupportsInt) -> LocalH:
439
524
  ...
440
- def GetMaterial(self, arg0: int) -> str:
525
+ def GetMaterial(self, arg0: typing.SupportsInt) -> str:
441
526
  ...
442
527
  def GetNCD2Names(self) -> int:
443
528
  ...
@@ -449,53 +534,53 @@ class Mesh:
449
534
  ...
450
535
  def GetQualityHistogram(self) -> pyngcore.pyngcore.FlatArray_I_S:
451
536
  ...
452
- def GetRegionNames(self, dim: int | None = None, codim: int | None = None) -> list[str]:
537
+ def GetRegionNames(self, dim: typing.SupportsInt | None = None, codim: typing.SupportsInt | None = None) -> list[str]:
453
538
  ...
454
539
  def GetSubMesh(self, domains: str = '', faces: str = '') -> Mesh:
455
540
  ...
456
- def GetVolumeNeighboursOfSurfaceElement(self, arg0: int) -> tuple:
541
+ def GetVolumeNeighboursOfSurfaceElement(self, arg0: typing.SupportsInt) -> tuple:
457
542
  """
458
543
  Returns element nrs of volume element connected to surface element, -1 if no volume element
459
544
  """
460
- def IdentifyPeriodicBoundaries(self, identification_name: str, face1: str, mapping: Trafo, point_tolerance: float = -1.0) -> int:
545
+ def IdentifyPeriodicBoundaries(self, identification_name: str, face1: str, mapping: Trafo, point_tolerance: typing.SupportsFloat = -1.0) -> int:
461
546
  ...
462
547
  def Load(self, arg0: str) -> None:
463
548
  ...
464
- def MacroElementNr(self, elnr: int, dim: int | None = None) -> int:
549
+ def MacroElementNr(self, elnr: typing.SupportsInt, dim: typing.SupportsInt | None = None) -> int:
465
550
  """
466
551
  number of macro element of element number elnr
467
552
  """
468
553
  def Mirror(self, arg0: Point3d, arg1: Vec3d) -> Mesh:
469
554
  ...
470
- def OptimizeMesh2d(self, mp: ... = None, faceindex: int = 0) -> None:
555
+ def OptimizeMesh2d(self, mp: ... = None, faceindex: typing.SupportsInt = 0) -> None:
471
556
  ...
472
557
  def OptimizeVolumeMesh(self, mp: ...) -> None:
473
558
  ...
474
- def Partition(self, numproc: int) -> None:
559
+ def Partition(self, numproc: typing.SupportsInt) -> None:
475
560
  ...
476
561
  def Points(self) -> ...:
477
562
  ...
478
563
  def Refine(self, adaptive: bool = False) -> None:
479
564
  ...
480
- def RestrictLocalH(self, p: Point3d, h: float, layer: int = 1) -> None:
565
+ def RestrictLocalH(self, p: Point3d, h: typing.SupportsFloat, layer: typing.SupportsInt = 1) -> None:
481
566
  ...
482
- def Save(self, arg0: os.PathLike) -> None:
567
+ def Save(self, arg0: os.PathLike | str | bytes) -> None:
483
568
  ...
484
- def Scale(self, arg0: float) -> None:
569
+ def Scale(self, arg0: typing.SupportsFloat) -> None:
485
570
  ...
486
571
  def SecondOrder(self) -> None:
487
572
  ...
488
- def SetBCName(self, arg0: int, arg1: str) -> None:
573
+ def SetBCName(self, arg0: typing.SupportsInt, arg1: str) -> None:
489
574
  ...
490
- def SetCD2Name(self, arg0: int, arg1: str) -> None:
575
+ def SetCD2Name(self, arg0: typing.SupportsInt, arg1: str) -> None:
491
576
  ...
492
- def SetCD3Name(self, arg0: int, arg1: str) -> None:
577
+ def SetCD3Name(self, arg0: typing.SupportsInt, arg1: str) -> None:
493
578
  ...
494
579
  def SetGeometry(self, arg0: NetgenGeometry) -> None:
495
580
  ...
496
- def SetLocalH(self, localh: LocalH, layer: int = 1) -> None:
581
+ def SetLocalH(self, localh: LocalH, layer: typing.SupportsInt = 1) -> None:
497
582
  ...
498
- def SetMaterial(self, arg0: int, arg1: str) -> None:
583
+ def SetMaterial(self, arg0: typing.SupportsInt, arg1: str) -> None:
499
584
  ...
500
585
  def SetMaxHDomain(self, arg0: list) -> None:
501
586
  ...
@@ -525,7 +610,7 @@ class Mesh:
525
610
  ...
526
611
  def __getstate__(self) -> tuple:
527
612
  ...
528
- def __init__(self, dim: int = 3, comm: pyngcore.pyngcore.MPI_Comm = ...) -> None:
613
+ def __init__(self, dim: typing.SupportsInt = 3, comm: pyngcore.pyngcore.MPI_Comm = ...) -> None:
529
614
  ...
530
615
  def __setitem__(self, arg0: PointId, arg1: MeshPoint) -> MeshPoint:
531
616
  ...
@@ -553,6 +638,12 @@ class Mesh:
553
638
  MPI-communicator the Mesh lives in
554
639
  """
555
640
  @property
641
+ def dim(self) -> int:
642
+ ...
643
+ @dim.setter
644
+ def dim(self, arg1: typing.SupportsInt) -> None:
645
+ ...
646
+ @property
556
647
  def macromesh(self) -> Mesh:
557
648
  """
558
649
  mesh before hp-refinement
@@ -567,28 +658,33 @@ class Mesh:
567
658
  def parentsurfaceelements(self) -> ...:
568
659
  ...
569
660
  class MeshPoint:
570
- singular: float
571
- def __getitem__(self, arg0: int) -> float:
661
+ def __getitem__(self, arg0: typing.SupportsInt) -> float:
572
662
  ...
573
663
  def __init__(self, arg0: Point3d) -> None:
574
664
  ...
575
665
  def __repr__(self) -> str:
576
666
  ...
577
- def __setitem__(self, arg0: int, arg1: float) -> None:
667
+ def __setitem__(self, arg0: typing.SupportsInt, arg1: typing.SupportsFloat) -> None:
578
668
  ...
579
669
  def __str__(self) -> str:
580
670
  ...
581
671
  @property
582
672
  def p(self) -> tuple:
583
673
  ...
674
+ @property
675
+ def singular(self) -> float:
676
+ ...
677
+ @singular.setter
678
+ def singular(self, arg1: typing.SupportsFloat) -> None:
679
+ ...
584
680
  class MeshingParameters:
585
681
  @typing.overload
586
- def RestrictH(self, x: float, y: float, z: float, h: float, layer: int = 1) -> None:
682
+ def RestrictH(self, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat, h: typing.SupportsFloat, layer: typing.SupportsInt = 1) -> None:
587
683
  ...
588
684
  @typing.overload
589
- def RestrictH(self, p: Point3d, h: float, layer: int = 1) -> None:
685
+ def RestrictH(self, p: Point3d, h: typing.SupportsFloat, layer: typing.SupportsInt = 1) -> None:
590
686
  ...
591
- def RestrictHLine(self, p1: Point3d, p2: Point3d, maxh: float, layer: int = 1) -> None:
687
+ def RestrictHLine(self, p1: Point3d, p2: Point3d, maxh: typing.SupportsFloat, layer: typing.SupportsInt = 1) -> None:
592
688
  ...
593
689
  @typing.overload
594
690
  def __init__(self) -> None:
@@ -698,7 +794,7 @@ class MeshingStep:
698
794
  ...
699
795
  def __index__(self) -> int:
700
796
  ...
701
- def __init__(self, value: int) -> None:
797
+ def __init__(self, value: typing.SupportsInt) -> None:
702
798
  ...
703
799
  def __int__(self) -> int:
704
800
  ...
@@ -706,7 +802,7 @@ class MeshingStep:
706
802
  ...
707
803
  def __repr__(self) -> str:
708
804
  ...
709
- def __setstate__(self, state: int) -> None:
805
+ def __setstate__(self, state: typing.SupportsInt) -> None:
710
806
  ...
711
807
  def __str__(self) -> str:
712
808
  ...
@@ -720,7 +816,7 @@ class NGDummyArgument:
720
816
  def __bool__(self) -> bool:
721
817
  ...
722
818
  class NetgenGeometry:
723
- def RestrictH(self, arg0: Point3d, arg1: float) -> None:
819
+ def RestrictH(self, arg0: Point3d, arg1: typing.SupportsFloat) -> None:
724
820
  ...
725
821
  class NgException(Exception):
726
822
  pass
@@ -732,13 +828,13 @@ class Point2d:
732
828
  @typing.overload
733
829
  def __sub__(*args, **kwargs) -> Point2d:
734
830
  ...
735
- def __getitem__(self, arg0: int) -> float:
831
+ def __getitem__(self, arg0: typing.SupportsInt) -> float:
736
832
  ...
737
833
  @typing.overload
738
- def __init__(self, arg0: float, arg1: float) -> None:
834
+ def __init__(self, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat) -> None:
739
835
  ...
740
836
  @typing.overload
741
- def __init__(self, arg0: tuple[float, float]) -> None:
837
+ def __init__(self, arg0: tuple[typing.SupportsFloat, typing.SupportsFloat]) -> None:
742
838
  ...
743
839
  def __len__(self) -> int:
744
840
  ...
@@ -755,10 +851,10 @@ class Point3d:
755
851
  @typing.overload
756
852
  def __sub__(*args, **kwargs) -> Point3d:
757
853
  ...
758
- def __getitem__(self, arg0: int) -> float:
854
+ def __getitem__(self, arg0: typing.SupportsInt) -> float:
759
855
  ...
760
856
  @typing.overload
761
- def __init__(self, arg0: float, arg1: float, arg2: float) -> None:
857
+ def __init__(self, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> None:
762
858
  ...
763
859
  @typing.overload
764
860
  def __init__(self, arg0: tuple) -> None:
@@ -775,7 +871,7 @@ class PointId:
775
871
  ...
776
872
  def __hash__(self) -> int:
777
873
  ...
778
- def __init__(self, arg0: int) -> None:
874
+ def __init__(self, arg0: typing.SupportsInt) -> None:
779
875
  ...
780
876
  def __repr__(self) -> str:
781
877
  ...
@@ -785,7 +881,7 @@ class PointId:
785
881
  def nr(self) -> int:
786
882
  ...
787
883
  class SurfaceGeometry(NetgenGeometry):
788
- def GenerateMesh(self, quads: bool = True, nx: int = 10, ny: int = 10, flip_triangles: bool = False, bbbpts: list = [], bbbnames: list = [], hppnts: list = [], hpbnd: dict = {}, boundarylayer: dict = {}) -> Mesh:
884
+ def GenerateMesh(self, quads: bool = True, nx: typing.SupportsInt = 10, ny: typing.SupportsInt = 10, flip_triangles: bool = False, bbbpts: list = [], bbbnames: list = [], hppnts: list = [], hpbnd: dict = {}, boundarylayer: dict = {}) -> Mesh:
789
885
  ...
790
886
  def __getstate__(self) -> tuple:
791
887
  ...
@@ -807,7 +903,7 @@ class Trafo:
807
903
  a translation
808
904
  """
809
905
  @typing.overload
810
- def __init__(self, arg0: Point3d, arg1: Vec3d, arg2: float) -> None:
906
+ def __init__(self, arg0: Point3d, arg1: Vec3d, arg2: typing.SupportsFloat) -> None:
811
907
  """
812
908
  a rotation given by point on axes, direction of axes, angle
813
909
  """
@@ -824,21 +920,21 @@ class Vec2d:
824
920
  ...
825
921
  def __eq__(self, arg0: Vec2d) -> bool:
826
922
  ...
827
- def __getitem__(self, arg0: int) -> float:
923
+ def __getitem__(self, arg0: typing.SupportsInt) -> float:
828
924
  ...
829
925
  @typing.overload
830
- def __init__(self, arg0: float, arg1: float) -> None:
926
+ def __init__(self, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat) -> None:
831
927
  ...
832
928
  @typing.overload
833
- def __init__(self, arg0: tuple[float, float]) -> None:
929
+ def __init__(self, arg0: tuple[typing.SupportsFloat, typing.SupportsFloat]) -> None:
834
930
  ...
835
931
  def __len__(self) -> int:
836
932
  ...
837
- def __mul__(self, arg0: float) -> Vec2d:
933
+ def __mul__(self, arg0: typing.SupportsFloat) -> Vec2d:
838
934
  ...
839
935
  def __neg__(self) -> Vec2d:
840
936
  ...
841
- def __rmul__(self, arg0: float) -> Vec2d:
937
+ def __rmul__(self, arg0: typing.SupportsFloat) -> Vec2d:
842
938
  ...
843
939
  def __sub__(self, arg0: Vec2d) -> Vec2d:
844
940
  ...
@@ -850,41 +946,96 @@ class Vec3d:
850
946
  ...
851
947
  def __eq__(self, arg0: Vec3d) -> bool:
852
948
  ...
853
- def __getitem__(self, arg0: int) -> float:
949
+ def __getitem__(self, arg0: typing.SupportsInt) -> float:
854
950
  ...
855
951
  @typing.overload
856
- def __init__(self, arg0: float, arg1: float, arg2: float) -> None:
952
+ def __init__(self, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> None:
857
953
  ...
858
954
  @typing.overload
859
955
  def __init__(self, arg0: tuple) -> None:
860
956
  ...
861
957
  def __len__(self) -> int:
862
958
  ...
863
- def __mul__(self, arg0: float) -> Vec3d:
959
+ def __mul__(self, arg0: typing.SupportsFloat) -> Vec3d:
864
960
  ...
865
961
  def __neg__(self) -> Vec3d:
866
962
  ...
867
- def __rmul__(self, arg0: float) -> Vec3d:
963
+ def __rmul__(self, arg0: typing.SupportsFloat) -> Vec3d:
868
964
  ...
869
965
  def __str__(self) -> str:
870
966
  ...
871
967
  def __sub__(self, arg0: Vec3d) -> Vec3d:
872
968
  ...
873
969
  class _DebugParameters:
874
- debugoutput: int
875
- haltexistingline: int
876
- haltface: int
877
- haltfacenr: int
878
- haltlargequalclass: int
879
- haltnode: int
880
- haltnosuccess: int
881
- haltoverlap: int
882
- haltsegment: int
883
970
  haltsegmentp1: PointId
884
971
  haltsegmentp2: PointId
885
- haltsuccess: int
886
- slowchecks: int
887
972
  write_mesh_on_error: bool
973
+ @property
974
+ def debugoutput(self) -> int:
975
+ ...
976
+ @debugoutput.setter
977
+ def debugoutput(self, arg0: typing.SupportsInt) -> None:
978
+ ...
979
+ @property
980
+ def haltexistingline(self) -> int:
981
+ ...
982
+ @haltexistingline.setter
983
+ def haltexistingline(self, arg0: typing.SupportsInt) -> None:
984
+ ...
985
+ @property
986
+ def haltface(self) -> int:
987
+ ...
988
+ @haltface.setter
989
+ def haltface(self, arg0: typing.SupportsInt) -> None:
990
+ ...
991
+ @property
992
+ def haltfacenr(self) -> int:
993
+ ...
994
+ @haltfacenr.setter
995
+ def haltfacenr(self, arg0: typing.SupportsInt) -> None:
996
+ ...
997
+ @property
998
+ def haltlargequalclass(self) -> int:
999
+ ...
1000
+ @haltlargequalclass.setter
1001
+ def haltlargequalclass(self, arg0: typing.SupportsInt) -> None:
1002
+ ...
1003
+ @property
1004
+ def haltnode(self) -> int:
1005
+ ...
1006
+ @haltnode.setter
1007
+ def haltnode(self, arg0: typing.SupportsInt) -> None:
1008
+ ...
1009
+ @property
1010
+ def haltnosuccess(self) -> int:
1011
+ ...
1012
+ @haltnosuccess.setter
1013
+ def haltnosuccess(self, arg0: typing.SupportsInt) -> None:
1014
+ ...
1015
+ @property
1016
+ def haltoverlap(self) -> int:
1017
+ ...
1018
+ @haltoverlap.setter
1019
+ def haltoverlap(self, arg0: typing.SupportsInt) -> None:
1020
+ ...
1021
+ @property
1022
+ def haltsegment(self) -> int:
1023
+ ...
1024
+ @haltsegment.setter
1025
+ def haltsegment(self, arg0: typing.SupportsInt) -> None:
1026
+ ...
1027
+ @property
1028
+ def haltsuccess(self) -> int:
1029
+ ...
1030
+ @haltsuccess.setter
1031
+ def haltsuccess(self, arg0: typing.SupportsInt) -> None:
1032
+ ...
1033
+ @property
1034
+ def slowchecks(self) -> int:
1035
+ ...
1036
+ @slowchecks.setter
1037
+ def slowchecks(self, arg0: typing.SupportsInt) -> None:
1038
+ ...
888
1039
  def GetTransformation() -> Trafo:
889
1040
  ...
890
1041
  def ImportMesh(filename: str, format: str = '') -> Mesh:
@@ -901,17 +1052,17 @@ def ImportMesh(filename: str, format: str = '') -> Mesh:
901
1052
  Universial Format (.unv)
902
1053
  """
903
1054
  @typing.overload
904
- def Pnt(arg0: float, arg1: float, arg2: float) -> Point3d:
1055
+ def Pnt(arg0: typing.SupportsFloat, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> Point3d:
905
1056
  ...
906
1057
  @typing.overload
907
- def Pnt(arg0: float, arg1: float) -> Point2d:
1058
+ def Pnt(arg0: typing.SupportsFloat, arg1: typing.SupportsFloat) -> Point2d:
908
1059
  ...
909
1060
  @typing.overload
910
- def Pnt(arg0: numpy.ndarray[numpy.float64]) -> typing.Any:
1061
+ def Pnt(arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> typing.Any:
911
1062
  ...
912
1063
  def ReadMedit(arg0: str) -> tuple:
913
1064
  ...
914
- def SetMessageImportance(arg0: int) -> int:
1065
+ def SetMessageImportance(arg0: typing.SupportsInt) -> int:
915
1066
  ...
916
1067
  def SetParallelPickling(arg0: bool) -> None:
917
1068
  ...
@@ -921,19 +1072,19 @@ def SetTestoutFile(arg0: str) -> None:
921
1072
  def SetTransformation(arg0: Trafo) -> None:
922
1073
  ...
923
1074
  @typing.overload
924
- def SetTransformation(dir: int = 0, angle: float = 0) -> None:
1075
+ def SetTransformation(dir: typing.SupportsInt = 0, angle: typing.SupportsFloat = 0) -> None:
925
1076
  ...
926
1077
  @typing.overload
927
1078
  def SetTransformation(p0: Point3d, ex: Vec3d, ey: Vec3d, ez: Vec3d) -> None:
928
1079
  ...
929
1080
  @typing.overload
930
- def Vec(arg0: float, arg1: float, arg2: float) -> Vec3d:
1081
+ def Vec(arg0: typing.SupportsFloat, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> Vec3d:
931
1082
  ...
932
1083
  @typing.overload
933
- def Vec(arg0: numpy.ndarray[numpy.float64]) -> typing.Any:
1084
+ def Vec(arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> typing.Any:
934
1085
  ...
935
1086
  @typing.overload
936
- def Vec(arg0: float, arg1: float) -> Vec2d:
1087
+ def Vec(arg0: typing.SupportsFloat, arg1: typing.SupportsFloat) -> Vec2d:
937
1088
  ...
938
1089
  def WriteMedit(arg0: Mesh, arg1: str) -> dict[tuple[int, int], int]:
939
1090
  ...
@@ -941,7 +1092,7 @@ def _GetStatus() -> tuple:
941
1092
  ...
942
1093
  def _PushStatus(arg0: str) -> None:
943
1094
  ...
944
- def _Redraw(blocking: bool = False, fr: float = 25) -> bool:
1095
+ def _Redraw(blocking: bool = False, fr: typing.SupportsFloat = 25) -> bool:
945
1096
  """
946
1097
  Redraw all
947
1098
 
@@ -953,7 +1104,7 @@ def _Redraw(blocking: bool = False, fr: float = 25) -> bool:
953
1104
  fr : double
954
1105
  input framerate
955
1106
  """
956
- def _SetThreadPercentage(arg0: float) -> None:
1107
+ def _SetThreadPercentage(arg0: typing.SupportsFloat) -> None:
957
1108
  ...
958
1109
  _netgen_executable_started: bool = False
959
1110
  _ngscript: str = 'catch {lappend auto_path $env(NETGENDIR) }\ncatch {lappend auto_path $env(NETGENDIR)/../lib }\nif {[catch {Ng_GetCommandLineParameter batchmode} result ]} {\nload libnggui[info sharedlibextension] gui\n}\nset batchmode [Ng_GetCommandLineParameter batchmode]\nif {$batchmode=="undefined"} {\nif {[catch {package require tkdnd } result ]} {\n}\n}\nset userlevel 3\nif { [Ng_GetCommandLineParameter expert]=="defined" } {\nset userlevel 3\n}\nset progname "NETGEN"\nset ngdir ""\nif { [lsearch [array names env] NETGENDIR] != -1 } {\nset ngdir $env(NETGENDIR)\n}\nif { [string length $ngdir] == 0 } {\nset ngdir "."\n}\nset nguserdir ""\nif { [lsearch [array names env] NETGEN_USER_DIR] != -1 } {\nset nguserdir $env(NETGEN_USER_DIR)\n}\nif { [string length $nguserdir] == 0 } {\nset nguserdir "."\n}\nset batchmode [Ng_GetCommandLineParameter batchmode]\nset solvemode 0\nif { [Ng_GetCommandLineParameter solve] != "undefined" || \\\n[Ng_GetCommandLineParameter recent] == "defined" } {\nset solvemode defined\n}\nset shellmode [Ng_GetCommandLineParameter shellmode]\nif { $shellmode == "defined" } {\nset batchmode "defined"\n}\nif { $batchmode != "defined" } {\ncatch {\nwm withdraw .\nwm title . $progname\nwm geometry . =850x600\nwm minsize . 400 300\n}\n}\nset drawmode rotate\nset selectvisual geometry\nset dirname .\nset loadgeomtypevar "All Geometry types"\nset basefilename filename\nset meshoptions.fineness 3\nset meshoptions.firststep ag\nset meshoptions.laststep ov\nset options.memory 0\nset options.localh 1\nset options.delaunay 1\nset options.checkoverlap 1\nset options.checkoverlappingboundary 0\nset options.checkchartboundary 1\nset options.startinsurface 0\nset options.blockfill 1\nset options.debugmode 0\nset options.dooptimize 1\nset options.parthread 1\nset options.elsizeweight 0.2\nset options.secondorder 0\nset options.elementorder 1\nset options.quad 0\nset options.try_hexes 0\nset options.inverttets 0\nset options.inverttrigs 0\nset options.autozrefine 0\nset options.meshsize 1000\nset options.minmeshsize 0\nset options.curvaturesafety 2\nset options.segmentsperedge 2\nset options.meshsizefilename ""\nset options.badellimit 175\nset options.optsteps2d 3\nset options.optsteps3d 5\nset options.opterrpow 2\nset options.grading 0.5\nset options.printmsg 2\nset options.parallel_meshing 1\nset options.nthreads 4\nset debug.slowchecks 0\nset debug.debugoutput 0\nset debug.haltexistingline 0\nset debug.haltoverlap 0\nset debug.haltsuccess 0\nset debug.haltnosuccess 0\nset debug.haltlargequalclass 0\nset debug.haltsegment 0\nset debug.haltnode 0\nset debug.haltface 0\nset debug.haltfacenr 0\nset debug.haltsegmentp1 0\nset debug.haltsegmentp2 0\nset geooptions.drawcsg 1\nset geooptions.detail 0.001\nset geooptions.accuracy 1e-6\nset geooptions.facets 20\nset geooptions.minx -1000\nset geooptions.miny -1000\nset geooptions.minz -1000\nset geooptions.maxx 1000\nset geooptions.maxy 1000\nset geooptions.maxz 1000\nset viewqualityplot 0\nset memuseplot 0\nset viewrotatebutton 0\nset showsensitivehelp 0\nset showhelpline 0\nset viewoptions.specpointvlen 0.3\nset viewoptions.light.amb 0.3\nset viewoptions.light.diff 0.7\nset viewoptions.light.spec 1\nset viewoptions.light.locviewer 0\nset viewoptions.mat.shininess 50\nset viewoptions.mat.transp 0.3\nset viewoptions.colormeshsize 0\nset viewoptions.whitebackground 1\nset viewoptions.drawcoordinatecross 1\nset viewoptions.drawcolorbar 1\nset viewoptions.drawnetgenlogo 1\nset viewoptions.stereo 0\nset viewoptions.shrink 1\nset viewoptions.drawfilledtrigs 1\nset viewoptions.drawedges 0\nset viewoptions.drawbadels 0\nset viewoptions.centerpoint 0\nset viewoptions.drawelement 0\nset viewoptions.drawoutline 1\nset viewoptions.drawtets 0\nset viewoptions.drawtetsdomain 0\nset viewoptions.drawprisms 0\nset viewoptions.drawpyramids 0\nset viewoptions.drawhexes 0\nset viewoptions.drawidentified 0\nset viewoptions.drawpointnumbers 0\nset viewoptions.drawedgenumbers 0\nset viewoptions.drawfacenumbers 0\nset viewoptions.drawelementnumbers 0\nset viewoptions.drawsegmentnumbers 0\nset viewoptions.drawsurfaceelementnumbers 0\nset viewoptions.drawdomainsurf 0\nset viewoptions.drawededges 1\nset viewoptions.drawedpoints 1\nset viewoptions.drawedpointnrs 0\nset viewoptions.drawedtangents 0\nset viewoptions.drawededgenrs 0\nset viewoptions.drawmetispartition 0\nset viewoptions.drawcurveproj 0\nset viewoptions.drawcurveprojedge 1\nset viewoptions.clipping.nx 0\nset viewoptions.clipping.ny 1\nset viewoptions.clipping.nz 0\nset viewoptions.clipping.dist 0\nset viewoptions.clipping.dist2 0\nset viewoptions.clipping.enable 0\nset viewoptions.clipping.onlydomain 0\nset viewoptions.clipping.notdomain 0\nset viewoptions.usecentercoords 0\nset viewoptions.centerx 0\nset viewoptions.centery 0\nset viewoptions.centerz 0\nset viewoptions.drawspecpoint 0\nset viewoptions.specpointx 0\nset viewoptions.specpointy 0\nset viewoptions.specpointz 0\nset stloptions.showtrias 0\nset stloptions.showfilledtrias 1\nset stloptions.showedges 1\nset stloptions.showmarktrias 0\nset stloptions.showactivechart 0\nset stloptions.yangle 30\nset stloptions.contyangle 20\nset stloptions.edgecornerangle 60\nset stloptions.chartangle 15\nset stloptions.outerchartangle 70\nset stloptions.usesearchtree 0\nset stloptions.chartnumber 1\nset stloptions.charttrignumber 1\nset stloptions.chartnumberoffset 0\nset stloptions.atlasminh 0.1\nset stloptions.resthsurfcurvfac 2\nset stloptions.resthsurfcurvenable 0\nset stloptions.resthatlasfac 2\nset stloptions.resthatlasenable 1\nset stloptions.resthchartdistfac 1.2\nset stloptions.resthchartdistenable 1\nset stloptions.resthlinelengthfac 0.5\nset stloptions.resthlinelengthenable 1\nset stloptions.resthcloseedgefac 1\nset stloptions.resthcloseedgeenable 1\nset stloptions.resthminedgelen 0.01\nset stloptions.resthminedgelenenable 1\nset stloptions.resthedgeanglefac 1\nset stloptions.resthedgeangleenable 0\nset stloptions.resthsurfmeshcurvfac 1\nset stloptions.resthsurfmeshcurvenable 0\nset stloptions.recalchopt 1\nset stldoctor.drawmeshededges 1\nset stldoctor.geom_tol_fact 0.000001\nset stldoctor.useexternaledges 0\nset stldoctor.showfaces 0\nset stldoctor.conecheck 1\nset stldoctor.spiralcheck 1\nset stldoctor.selecttrig 0\nset stldoctor.selectmode 1\nset stldoctor.longlinefact 0\nset stldoctor.showexcluded 1\nset stldoctor.edgeselectmode 0\nset stldoctor.nodeofseltrig 1\nset stldoctor.showtouchedtrigchart 0\nset stldoctor.showedgecornerpoints 0\nset stldoctor.showmarkedtrigs 1\nset stldoctor.dirtytrigfact 0.01\nset stldoctor.smoothangle 90\nset stldoctor.selectwithmouse 1\nset stldoctor.showvicinity 0\nset stldoctor.vicinity 50\nset stldoctor.smoothnormalsweight 0.2\nset occoptions.showvolumenr 0\nset occoptions.showsurfaces 1\nset occoptions.showedges 1\nset occoptions.showsolidnr 0\nset occoptions.showsolidnr2 0\nset occoptions.visproblemfaces 0\nset occoptions.zoomtohighlightedentity 0\nset occoptions.deflection 1\nset occoptions.tolerance 1e-3\nset occoptions.fixsmalledges 1\nset occoptions.fixspotstripfaces 1\nset occoptions.sewfaces 1\nset occoptions.makesolids 1\nset occoptions.splitpartitions 0\nset meshdoctor.active 0\nset meshdoctor.markedgedist 1\nset status_np 0\nset status_ne 0\nset status_nse 0\nset status_working " "\nset status_task " "\nset status_percent 0\nset status_filename 0\nset status_tetqualclasses "10 20 30 40 10 20 30 40 10 20 30 40 10 20 30 40 10 20 30 40"\nset exportfiletype "Neutral Format"\nset importfiletype "Neutral Format"\nset preproc.facenr 0\nset preproc.selectmode query\nset preproc.numtrig 0\nset mem_moveable 0\nset multithread_pause 0\nset multithread_testmode 0\nset multithread_redraw 0\nset multithread_drawing 0\nset multithread_terminate 0\nset multithread_running 0\nset level 0\nset tablesforoutput {}\nset optlist {\noptions.localh\noptions.delaunay\noptions.checkoverlap\noptions.startinsurface\noptions.blockfill\noptions.dooptimize\noptions.elsizeweight\noptions.meshsize\noptions.minmeshsize\noptions.curvaturesafety\noptions.optsteps2d\noptions.optsteps3d\noptions.secondorder\n}\nset visoptions.usetexture 1\nset visoptions.invcolor 0\nset visoptions.imaginary 0\nset visoptions.lineartexture 0\nset visoptions.numtexturecols 8\nset visoptions.showclipsolution 1\nset visoptions.showsurfacesolution 0\nset visoptions.drawfieldlines 0\nset visoptions.drawpointcurves 1\nset visoptions.numfieldlines 100\nset visoptions.fieldlinesrandomstart 0\nset visoptions.fieldlinesstartarea box\nset visoptions.fieldlinesstartareap1x 1\nset visoptions.fieldlinesstartareap1y 1\nset visoptions.fieldlinesstartareap1z 1\nset visoptions.fieldlinesstartareap2x 0\nset visoptions.fieldlinesstartareap2y 0\nset visoptions.fieldlinesstartareap2z 0\nset visoptions.fieldlinesstartface -1\nset visoptions.fieldlinesfilename none\nset visoptions.fieldlinestolerance 0.0005\nset visoptions.fieldlinesrktype crungekutta\nset visoptions.fieldlineslength 0.5\nset visoptions.fieldlinesmaxpoints 500\nset visoptions.fieldlinesthickness 0.0015\nset visoptions.fieldlinesvecfunction none\nset visoptions.fieldlinesphase 0\nset visoptions.fieldlinesonlyonephase 1\nset visoptions.lineplotfile empty\nset visoptions.lineplotsource file\nset visoptions.lineplotusingx 0\nset visoptions.lineplotusingy 1\nset visoptions.lineplotautoscale 1\nset visoptions.lineplotxmin 0\nset visoptions.lineplotxmax 1\nset visoptions.lineplotymin 0\nset visoptions.lineplotymax 1\nset visoptions.lineplotcurrentnum -1\nset visoptions.lineplotinfos ""\nset visoptions.lineplotselected none\nset visoptions.lineplotselector ""\nset visoptions.lineplotcolor red\nset visoptions.lineplotsizex 500\nset visoptions.lineplotsizey 400\nset visoptions.lineplotselectedeval 0\nset visoptions.lineplotdatadescr "column1 column2 column3"\nset visoptions.lineplotxcoordselector ""\nset visoptions.lineplotycoordselector ""\nset visoptions.evaluatefilenames none\nset visoptions.evaluatefiledescriptions none\nset visoptions.clipsolution none\nset visoptions.scalfunction none\nset visoptions.vecfunction none\nset visoptions.evaluate abs\nset visoptions.gridsize 20\nset visoptions.xoffset 0\nset visoptions.yoffset 0\nset visoptions.autoscale 1\nset visoptions.redrawperiodic 0\nset visoptions.logscale 0\nset visoptions.mminval 0\nset visoptions.mmaxval 1\nset visoptions.isolines 0\nset visoptions.isosurf 0\nset visoptions.subdivisions 1\nset visoptions.numiso 10\nset visoptions.autoredraw 0\nset visoptions.autoredrawtime 2\nset visoptions.simulationtime 0\nset visoptions.multidimcomponent 0\nset visoptions.deformation 0\nset visoptions.scaledeform1 1\nset visoptions.scaledeform2 1\nset parallel_netgen 0\nset optfilename [file join $nguserdir ng.opt]\nset inifilename [file join $nguserdir ng.ini]\nset meshinifilename [file join $nguserdir ngmesh.ini]\nglobal env\nif { [llength [array names env NG_OPT]] == 1 } {\nif { [string length $env(NG_OPT)] > 0 } {\nset optfilename $env(NG_OPT)\n}\n}\nif { [file exists $optfilename] == 1 } {\nset datei [open $optfilename r]\nwhile { [gets $datei line] >= 0 } {\nset [lindex $line 0] [lindex $line 1]\n}\nclose $datei\n} {\nputs "optfile $optfilename does not exist - using default values"\n}\nproc saveoptions { } {\nuplevel 1 {\nset file $optfilename\nif {$file != ""} {\nset datei [open $file w]\nputs $datei "dirname ${dirname}"\nputs $datei "loadgeomtypevar \\"${loadgeomtypevar}\\""\nputs $datei "exportfiletype \\"${exportfiletype}\\""\nputs $datei "meshoptions.fineness ${meshoptions.fineness}"\nputs $datei "meshoptions.firststep ${meshoptions.firststep}"\nputs $datei "meshoptions.laststep ${meshoptions.laststep}"\nputs $datei "options.localh ${options.localh}"\nputs $datei "options.delaunay ${options.delaunay}"\nputs $datei "options.checkoverlap ${options.checkoverlap}"\nputs $datei "options.checkchartboundary ${options.checkchartboundary}"\nputs $datei "options.startinsurface ${options.startinsurface}"\nputs $datei "options.blockfill ${options.blockfill}"\nputs $datei "options.debugmode ${options.debugmode}"\nputs $datei "options.dooptimize ${options.dooptimize}"\nputs $datei "options.parthread ${options.parthread}"\nputs $datei "options.elsizeweight ${options.elsizeweight}"\nputs $datei "options.secondorder ${options.secondorder}"\nputs $datei "options.elementorder ${options.elementorder}"\nputs $datei "options.quad ${options.quad}"\nputs $datei "options.try_hexes ${options.try_hexes}"\nputs $datei "options.inverttets ${options.inverttets}"\nputs $datei "options.inverttrigs ${options.inverttrigs}"\nputs $datei "options.autozrefine ${options.autozrefine}"\nputs $datei "options.meshsize ${options.meshsize}"\nputs $datei "options.minmeshsize ${options.minmeshsize}"\nputs $datei "options.curvaturesafety ${options.curvaturesafety}"\nputs $datei "options.segmentsperedge ${options.segmentsperedge}"\nputs $datei "options.meshsizefilename ${options.meshsizefilename}"\nputs $datei "options.badellimit ${options.badellimit}"\nputs $datei "options.optsteps2d ${options.optsteps2d}"\nputs $datei "options.optsteps3d ${options.optsteps3d}"\nputs $datei "options.opterrpow ${options.opterrpow}"\nputs $datei "options.grading ${options.grading}"\nputs $datei "options.printmsg ${options.printmsg}"\nputs $datei "options.parallel_meshing ${options.parallel_meshing}"\nputs $datei "options.nthreads ${options.nthreads}"\nputs $datei "geooptions.drawcsg ${geooptions.drawcsg}"\nputs $datei "geooptions.detail ${geooptions.detail}"\nputs $datei "geooptions.accuracy ${geooptions.accuracy}"\nputs $datei "geooptions.facets ${geooptions.facets}"\nputs $datei "geooptions.minx ${geooptions.minx}"\nputs $datei "geooptions.miny ${geooptions.miny}"\nputs $datei "geooptions.minz ${geooptions.minz}"\nputs $datei "geooptions.maxx ${geooptions.maxx}"\nputs $datei "geooptions.maxy ${geooptions.maxy}"\nputs $datei "geooptions.maxz ${geooptions.maxz}"\nputs $datei "viewoptions.specpointvlen ${viewoptions.specpointvlen}"\nputs $datei "viewoptions.light.amb ${viewoptions.light.amb}"\nputs $datei "viewoptions.light.diff ${viewoptions.light.diff}"\nputs $datei "viewoptions.light.spec ${viewoptions.light.spec}"\nputs $datei "viewoptions.light.locviewer ${viewoptions.light.locviewer}"\nputs $datei "viewoptions.mat.shininess ${viewoptions.mat.shininess}"\nputs $datei "viewoptions.mat.transp ${viewoptions.mat.transp}"\nputs $datei "viewoptions.colormeshsize ${viewoptions.colormeshsize}"\nputs $datei "viewoptions.whitebackground ${viewoptions.whitebackground}"\nputs $datei "viewoptions.drawcolorbar ${viewoptions.drawcolorbar}"\nputs $datei "viewoptions.drawcoordinatecross ${viewoptions.drawcoordinatecross}"\nputs $datei "viewoptions.drawnetgenlogo ${viewoptions.drawnetgenlogo}"\nputs $datei "viewoptions.stereo ${viewoptions.stereo}"\nputs $datei "viewoptions.drawfilledtrigs ${viewoptions.drawfilledtrigs}"\nputs $datei "viewoptions.drawedges ${viewoptions.drawedges}"\nputs $datei "viewoptions.drawbadels ${viewoptions.drawbadels}"\nputs $datei "viewoptions.centerpoint ${viewoptions.centerpoint}"\nputs $datei "viewoptions.drawelement ${viewoptions.drawelement}"\nputs $datei "viewoptions.drawoutline ${viewoptions.drawoutline}"\nputs $datei "viewoptions.drawtets ${viewoptions.drawtets}"\nputs $datei "viewoptions.drawprisms ${viewoptions.drawprisms}"\nputs $datei "viewoptions.drawpyramids ${viewoptions.drawpyramids}"\nputs $datei "viewoptions.drawhexes ${viewoptions.drawhexes}"\nputs $datei "viewoptions.drawidentified ${viewoptions.drawidentified}"\nputs $datei "viewoptions.drawpointnumbers ${viewoptions.drawpointnumbers}"\nputs $datei "viewoptions.drawededges ${viewoptions.drawededges}"\nputs $datei "viewoptions.drawedpoints ${viewoptions.drawedpoints}"\nputs $datei "viewoptions.drawedpointnrs ${viewoptions.drawedpointnrs}"\nputs $datei "viewoptions.drawedtangents ${viewoptions.drawedtangents}"\nputs $datei "viewoptions.shrink ${viewoptions.shrink}"\nputs $datei "stloptions.showtrias ${stloptions.showtrias}"\nputs $datei "stloptions.showfilledtrias ${stloptions.showfilledtrias}"\nputs $datei "stloptions.showedges ${stloptions.showedges}"\nputs $datei "stloptions.showmarktrias ${stloptions.showmarktrias}"\nputs $datei "stloptions.showactivechart ${stloptions.showactivechart}"\nputs $datei "stloptions.yangle ${stloptions.yangle}"\nputs $datei "stloptions.contyangle ${stloptions.contyangle}"\nputs $datei "stloptions.edgecornerangle ${stloptions.edgecornerangle}"\nputs $datei "stloptions.chartangle ${stloptions.chartangle}"\nputs $datei "stloptions.outerchartangle ${stloptions.outerchartangle}"\nputs $datei "stloptions.usesearchtree ${stloptions.usesearchtree}"\nputs $datei "stloptions.chartnumber ${stloptions.chartnumber}"\nputs $datei "stloptions.charttrignumber ${stloptions.charttrignumber}"\nputs $datei "stloptions.chartnumberoffset ${stloptions.chartnumberoffset}"\nputs $datei "stloptions.atlasminh ${stloptions.atlasminh}"\nputs $datei "stloptions.resthsurfcurvfac ${stloptions.resthsurfcurvfac}"\nputs $datei "stloptions.resthsurfcurvenable ${stloptions.resthsurfcurvenable}"\nputs $datei "stloptions.resthatlasfac ${stloptions.resthatlasfac}"\nputs $datei "stloptions.resthatlasenable ${stloptions.resthatlasenable}"\nputs $datei "stloptions.resthchartdistfac ${stloptions.resthchartdistfac}"\nputs $datei "stloptions.resthchartdistenable ${stloptions.resthchartdistenable}"\nputs $datei "stloptions.resthlinelengthfac ${stloptions.resthlinelengthfac}"\nputs $datei "stloptions.resthlinelengthenable ${stloptions.resthlinelengthenable}"\nputs $datei "stloptions.resthminedgelen ${stloptions.resthminedgelen}"\nputs $datei "stloptions.resthminedgelenenable ${stloptions.resthminedgelenenable}"\nputs $datei "stloptions.resthcloseedgefac ${stloptions.resthcloseedgefac}"\nputs $datei "stloptions.resthcloseedgeenable ${stloptions.resthcloseedgeenable}"\nputs $datei "stloptions.resthedgeanglefac ${stloptions.resthedgeanglefac}"\nputs $datei "stloptions.resthedgeangleenable ${stloptions.resthedgeangleenable}"\nputs $datei "stloptions.resthsurfmeshcurvfac ${stloptions.resthsurfmeshcurvfac}"\nputs $datei "stloptions.resthsurfmeshcurvenable ${stloptions.resthsurfmeshcurvenable}"\nputs $datei "stloptions.recalchopt ${stloptions.recalchopt}"\nputs $datei "visoptions.subdivisions ${visoptions.subdivisions}"\nputs $datei "visoptions.autoredraw ${visoptions.autoredraw}"\nputs $datei "visoptions.autoredrawtime ${visoptions.autoredrawtime}"\nif { [info exists trafooptions.solver] == 1 } {\nputs $datei "trafooptions.solver ${trafooptions.solver}"\nputs $datei "trafooptions.levels ${trafooptions.levels}"\nputs $datei "trafooptions.linits ${trafooptions.linits}"\nputs $datei "trafooptions.nonlinits ${trafooptions.nonlinits}"\nputs $datei "trafooptions.stabcurrent ${trafooptions.stabcurrent}"\nputs $datei "trafooptions.checkcond ${trafooptions.checkcond}"\nputs $datei "trafooptions.maxdirect ${trafooptions.maxdirect}"\nputs $datei "trafooptions.secondorder ${trafooptions.secondorder}"\nputs $datei "trafooptions.homogenizedcore ${trafooptions.homogenizedcore}"\nputs $datei "trafooptions.ordercore ${trafooptions.ordercore}"\nputs $datei "trafooptions.simplecurrents ${trafooptions.simplecurrents}"\nputs $datei "trafooptions.assemblecomplexmatrix ${trafooptions.assemblecomplexmatrix}"\nputs $datei "trafooptions.meshcasing ${trafooptions.meshcasing}"\nputs $datei "trafooptions.meshcore ${trafooptions.meshcore}"\nputs $datei "trafooptions.meshclumps ${trafooptions.meshclumps}"\nputs $datei "trafooptions.meshshields ${trafooptions.meshshields}"\nputs $datei "trafooptions.meshcoils ${trafooptions.meshcoils}"\nputs $datei "trafooptions.bcmdirectory ${trafooptions.bcmdirectory}"\nputs $datei "trafooptions.lossdensityfile ${trafooptions.lossdensityfile}"\n}\nif { [info exists smalltrafomodell.tankheight] == 1 } {\nputs $datei "smalltrafomodell.tankheight ${smalltrafomodell.tankheight}"\nputs $datei "smalltrafomodell.tankwidth ${smalltrafomodell.tankwidth}"\nputs $datei "smalltrafomodell.tanklength ${smalltrafomodell.tanklength}"\nputs $datei "smalltrafomodell.corewidth ${smalltrafomodell.corewidth}"\nputs $datei "smalltrafomodell.windowheight ${smalltrafomodell.windowheight}"\nputs $datei "smalltrafomodell.limbdistance ${smalltrafomodell.limbdistance}"\nputs $datei "smalltrafomodell.xposcore ${smalltrafomodell.xposcore}"\nputs $datei "smalltrafomodell.yposcore ${smalltrafomodell.yposcore}"\nputs $datei "smalltrafomodell.zposcore ${smalltrafomodell.zposcore}"\nputs $datei "smalltrafomodell.leakagefluxguidethickness ${smalltrafomodell.leakagefluxguidethickness}"\nputs $datei "smalltrafomodell.leakagefluxguidewidth ${smalltrafomodell.leakagefluxguidewidth}"\nputs $datei "smalltrafomodell.leakagefluxguidezposition ${smalltrafomodell.leakagefluxguidezposition}"\nputs $datei "smalltrafomodell.limbcoil.1 ${smalltrafomodell.limbcoil.1}"\nputs $datei "smalltrafomodell.ricoil.1 ${smalltrafomodell.ricoil.1}"\nputs $datei "smalltrafomodell.rocoil.1 ${smalltrafomodell.rocoil.1}"\nputs $datei "smalltrafomodell.zposcoil.1 ${smalltrafomodell.zposcoil.1}"\nputs $datei "smalltrafomodell.heightcoil.1 ${smalltrafomodell.heightcoil.1}"\nputs $datei "smalltrafomodell.currentcoil.1 ${smalltrafomodell.currentcoil.1}"\nputs $datei "smalltrafomodell.nturnscoil.1 ${smalltrafomodell.nturnscoil.1}"\nputs $datei "smalltrafomodell.limbcoil.2 ${smalltrafomodell.limbcoil.2}"\nputs $datei "smalltrafomodell.ricoil.2 ${smalltrafomodell.ricoil.2}"\nputs $datei "smalltrafomodell.rocoil.2 ${smalltrafomodell.rocoil.2}"\nputs $datei "smalltrafomodell.zposcoil.2 ${smalltrafomodell.zposcoil.2}"\nputs $datei "smalltrafomodell.heightcoil.2 ${smalltrafomodell.heightcoil.2}"\nputs $datei "smalltrafomodell.currentcoil.2 ${smalltrafomodell.currentcoil.2}"\nputs $datei "smalltrafomodell.nturnscoil.2 ${smalltrafomodell.nturnscoil.2}"\nputs $datei "smalltrafomodell.limbcoil.3 ${smalltrafomodell.limbcoil.3}"\nputs $datei "smalltrafomodell.ricoil.3 ${smalltrafomodell.ricoil.3}"\nputs $datei "smalltrafomodell.rocoil.3 ${smalltrafomodell.rocoil.3}"\nputs $datei "smalltrafomodell.zposcoil.3 ${smalltrafomodell.zposcoil.3}"\nputs $datei "smalltrafomodell.heightcoil.3 ${smalltrafomodell.heightcoil.3}"\nputs $datei "smalltrafomodell.currentcoil.3 ${smalltrafomodell.currentcoil.3}"\nputs $datei "smalltrafomodell.nturnscoil.3 ${smalltrafomodell.nturnscoil.3}"\nputs $datei "smalltrafomodell.limbcoil.4 ${smalltrafomodell.limbcoil.4}"\nputs $datei "smalltrafomodell.ricoil.4 ${smalltrafomodell.ricoil.4}"\nputs $datei "smalltrafomodell.rocoil.4 ${smalltrafomodell.rocoil.4}"\nputs $datei "smalltrafomodell.zposcoil.4 ${smalltrafomodell.zposcoil.4}"\nputs $datei "smalltrafomodell.heightcoil.4 ${smalltrafomodell.heightcoil.4}"\nputs $datei "smalltrafomodell.currentcoil.4 ${smalltrafomodell.currentcoil.4}"\nputs $datei "smalltrafomodell.nturnscoil.4 ${smalltrafomodell.nturnscoil.4}"\nputs $datei "smalltrafomodell.limbcoil.5 ${smalltrafomodell.limbcoil.5}"\nputs $datei "smalltrafomodell.ricoil.5 ${smalltrafomodell.ricoil.5}"\nputs $datei "smalltrafomodell.rocoil.5 ${smalltrafomodell.rocoil.5}"\nputs $datei "smalltrafomodell.zposcoil.5 ${smalltrafomodell.zposcoil.5}"\nputs $datei "smalltrafomodell.heightcoil.5 ${smalltrafomodell.heightcoil.5}"\nputs $datei "smalltrafomodell.currentcoil.5 ${smalltrafomodell.currentcoil.5}"\nputs $datei "smalltrafomodell.nturnscoil.5 ${smalltrafomodell.nturnscoil.5}"\nputs $datei "smalltrafomodell.limbcoil.6 ${smalltrafomodell.limbcoil.6}"\nputs $datei "smalltrafomodell.ricoil.6 ${smalltrafomodell.ricoil.6}"\nputs $datei "smalltrafomodell.rocoil.6 ${smalltrafomodell.rocoil.6}"\nputs $datei "smalltrafomodell.zposcoil.6 ${smalltrafomodell.zposcoil.6}"\nputs $datei "smalltrafomodell.heightcoil.6 ${smalltrafomodell.heightcoil.6}"\nputs $datei "smalltrafomodell.currentcoil.6 ${smalltrafomodell.currentcoil.6}"\nputs $datei "smalltrafomodell.nturnscoil.6 ${smalltrafomodell.nturnscoil.6}"\nputs $datei "smalltrafomodell.limbtest.1 ${smalltrafomodell.limbtest.1}"\nputs $datei "smalltrafomodell.heighttest.1 ${smalltrafomodell.heighttest.1}"\nputs $datei "smalltrafomodell.widthtest.1 ${smalltrafomodell.widthtest.1}"\nputs $datei "smalltrafomodell.rtest.1 ${smalltrafomodell.rtest.1}"\nputs $datei "smalltrafomodell.zpostest.1 ${smalltrafomodell.zpostest.1}"\nputs $datei "smalltrafomodell.edgeradiustest.1 ${smalltrafomodell.edgeradiustest.1}"\nputs $datei "smalltrafomodell.finetest.1 ${smalltrafomodell.finetest.1}"\nputs $datei "smalltrafomodell.conductivetest.1 ${smalltrafomodell.conductivetest.1}"\nputs $datei "smalltrafomodell.limbtest.2 ${smalltrafomodell.limbtest.2}"\nputs $datei "smalltrafomodell.heighttest.2 ${smalltrafomodell.heighttest.2}"\nputs $datei "smalltrafomodell.widthtest.2 ${smalltrafomodell.widthtest.2}"\nputs $datei "smalltrafomodell.rtest.2 ${smalltrafomodell.rtest.2}"\nputs $datei "smalltrafomodell.zpostest.2 ${smalltrafomodell.zpostest.2}"\nputs $datei "smalltrafomodell.edgeradiustest.2 ${smalltrafomodell.edgeradiustest.2}"\nputs $datei "smalltrafomodell.finetest.2 ${smalltrafomodell.finetest.2}"\nputs $datei "smalltrafomodell.conductivetest.2 ${smalltrafomodell.conductivetest.2}"\nputs $datei "smalltrafomodell.limbtest.3 ${smalltrafomodell.limbtest.3}"\nputs $datei "smalltrafomodell.heighttest.3 ${smalltrafomodell.heighttest.3}"\nputs $datei "smalltrafomodell.widthtest.3 ${smalltrafomodell.widthtest.3}"\nputs $datei "smalltrafomodell.rtest.3 ${smalltrafomodell.rtest.3}"\nputs $datei "smalltrafomodell.zpostest.3 ${smalltrafomodell.zpostest.3}"\nputs $datei "smalltrafomodell.edgeradiustest.3 ${smalltrafomodell.edgeradiustest.3}"\nputs $datei "smalltrafomodell.finetest.3 ${smalltrafomodell.finetest.3}"\nputs $datei "smalltrafomodell.conductivetest.3 ${smalltrafomodell.conductivetest.3}"\nputs $datei "smalltrafomodell.limbtest.4 ${smalltrafomodell.limbtest.4}"\nputs $datei "smalltrafomodell.heighttest.4 ${smalltrafomodell.heighttest.4}"\nputs $datei "smalltrafomodell.widthtest.4 ${smalltrafomodell.widthtest.4}"\nputs $datei "smalltrafomodell.rtest.4 ${smalltrafomodell.rtest.4}"\nputs $datei "smalltrafomodell.zpostest.4 ${smalltrafomodell.zpostest.4}"\nputs $datei "smalltrafomodell.edgeradiustest.4 ${smalltrafomodell.edgeradiustest.4}"\nputs $datei "smalltrafomodell.finetest.4 ${smalltrafomodell.finetest.4}"\nputs $datei "smalltrafomodell.conductivetest.4 ${smalltrafomodell.conductivetest.4}"\nputs $datei "smalltrafomodell.nperitest ${smalltrafomodell.nperitest}"\nputs $datei "smalltrafomodell.filename ${smalltrafomodell.filename}"\nputs $datei "smalltrafomodell.murlfguide ${smalltrafomodell.murlfguide}"\nputs $datei "smalltrafomodell.murtestwire ${smalltrafomodell.murtestwire}"\nputs $datei "smalltrafomodell.murcore ${smalltrafomodell.murcore}"\nputs $datei "smalltrafomodell.kappalfguide ${smalltrafomodell.kappalfguide}"\nputs $datei "smalltrafomodell.kappatestwire ${smalltrafomodell.kappatestwire}"\nputs $datei "smalltrafomodell.kappacore ${smalltrafomodell.kappacore}"\n}\nclose $datei\n}\n}\n}\nproc saveinifile { } {\nglobal inifilename\nif {[catch { set datei [open $inifilename w] } result ]} {\nputs "cannot write file $inifilename"\n} {\nfor { set i [.ngmenu.file.recent index last] } { $i >= 0 } { incr i -1 } {\nputs $datei "recentfile \\"[.ngmenu.file.recent entrycget $i -label]\\""\n}\nclose $datei\n}\n}\nproc savemeshinifile { } {\nglobal meshinifilename\nif {[catch { set datei [open $meshinifilename w] } result ]} {\nputs "cannot write file $meshinifilename"\n} {\nfor { set i [.ngmenu.file.recentmesh index last] } { $i >= 1 } { incr i -1 } {\nputs $datei "recentfile \\"[.ngmenu.file.recentmesh entrycget $i -label]\\""\n}\nclose $datei\n}\n}\nproc loadinifile { } {\nglobal inifilename\nif { [file exists $inifilename] == 1 } {\nset datei [open $inifilename r]\nwhile { [gets $datei line] >= 0 } {\nif {[lindex $line 0] == "recentfile"} {\nset filename [lindex $line 1]\nif { [file exists $filename] == 1 } {\nAddRecentFile $filename\n}\n}\n}\nclose $datei\n}\n}\nproc loadmeshinifile { } {\nglobal meshinifilename\nif { [file exists $meshinifilename] == 1 } {\nset datei [open $meshinifilename r]\nwhile { [gets $datei line] >= 0 } {\nif {[lindex $line 0] == "recentfile"} {\nset filename [lindex $line 1]\nif { [file exists $filename] == 1 } {\nAddRecentMeshFile $filename\n}\n}\n}\nclose $datei\n}\n}\nset cmdindex {}\nset hlpindex {}\nset secindex {}\nproc setgranularity { gran } {\nif {$gran == 6} { return }\nset gran [expr $gran - 1]\nglobal options.curvaturesafety\nset surfcurvlist { 1 1.5 2 3 5 }\nset options.curvaturesafety [lindex $surfcurvlist $gran]\nglobal options.segmentsperedge\nset spelist { 0.3 0.5 1 2 3 }\nset options.segmentsperedge [lindex $spelist $gran]\nglobal stloptions.resthsurfcurvfac\nset surfcurvfaclist { 0.25 0.5 1 1.5 3 }\nset stloptions.resthsurfcurvfac [lindex $surfcurvfaclist $gran]\nglobal stloptions.resthchartdistfac\nset chartdistfaclist { 0.8 1 1.5 2 5 }\nset stloptions.resthchartdistfac [lindex $chartdistfaclist $gran]\nglobal stloptions.resthlinelengthfac\nset linelengthfaclist { 0.2 0.35 0.5 1.5 3 }\nset stloptions.resthlinelengthfac [lindex $linelengthfaclist $gran]\nglobal stloptions.resthcloseedgefac\nset closeedgefaclist { 0.5 1 2 3.5 5 }\nset stloptions.resthcloseedgefac [lindex $closeedgefaclist $gran]\nglobal stloptions.resthminedgelen\nset minedgelenlist { 0.002 0.02 0.2 1.0 2.0 5.0 10.0 }\nset stloptions.resthminedgelen [lindex $minedgelenlist $gran]\nglobal stloptions.resthedgeanglefac\nset edgeanglefaclist { 0.25 0.5 1 1.5 3 }\nset stloptions.resthedgeanglefac [lindex $edgeanglefaclist $gran]\nglobal stloptions.resthsurfmeshcurvfac\nset surfmeshcurvlist { 1 1.5 2 3 5 }\nset stloptions.resthsurfmeshcurvfac [lindex $surfmeshcurvlist $gran]\nglobal options.grading\nset gradinglist { 0.7 0.5 0.3 0.2 0.1 }\nset options.grading [lindex $gradinglist $gran]\n}\nif { $batchmode != "defined" } {\ncatch {\nif { $tcl_platform(os) eq "Linux" && [tk scaling] > 1.5 } {\nfont create ngFont -family Helvetica\noption add *font ngFont\nttk::style configure "." -font ngFont\n}\nmenu .ngmenu -tearoff 0 -relief raised -bd 2\n. configure -menu .ngmenu\n.ngmenu add cascade -label "File" -menu .ngmenu.file -underline 0\n.ngmenu add cascade -label "Geometry" -menu .ngmenu.geometry -underline 0\n.ngmenu add cascade -label "Mesh" -menu .ngmenu.mesh -underline 0\n.ngmenu add cascade -label "View" -menu .ngmenu.view -underline 0\n.ngmenu add cascade -label "Refinement" -menu .ngmenu.meshsize -underline 5\nif { $userlevel == 3} {\n.ngmenu add cascade -label "Special" -menu .ngmenu.special -underline 3\n}\n.ngmenu add cascade -label "Help" -menu .ngmenu.help -underline 0\nmenu .ngmenu.file\n.ngmenu.file add command -label "Load Geometry..." -accelerator "<l><g>" \\\n-command {\nset types {\n{"All Geometry types" { .stl .stlb .step .stp .geo .in2d .igs .iges .brep .sat} }\n{"IGES Geometry"\t{.igs .iges} }\n{"BREP OpenCascade Geometry" {.brep} }\n{"STL Geometry" {.stl} }\n{"Binary STL Geometry" {.stlb} }\n{"STEP Geometry" {.step .stp} }\n{"Geometry file" {.geo} }\n{"2D Geometry" {.in2d } }\n}\nset ACISavailable [Ng_ACISCommand isACISavailable]\nif {$ACISavailable == "yes" } {\nlappend types {"ACIS Geometry" {.sat} }\n}\nif {[catch {\nset file [tk_getOpenFile -filetypes $types -initialdir $dirname -typevariable loadgeomtypevar]\n}]} {\nset file [tk_getOpenFile -filetypes $types -initialdir $dirname]\n}\nif {$file != ""} {\nAddRecentFile $file\nNg_LoadGeometry $file\nNg_ParseGeometry\nset selectvisual geometry\nNg_SetVisParameters\nredraw\nwm title . [concat "$progname - " $file]\nset dirname [file dirname $file]\nset basefilename [file tail [file rootname $file]]\nif { $hasocc == "yes" } {\nrebuildoccdialog\n}\n}\n}\n.ngmenu.file add command -label "Save Geometry..." \\\n-command {\nset occgeometryloaded [Ng_OCCCommand isoccgeometryloaded]\nputs $occgeometryloaded\nif {$occgeometryloaded == 1 } {\nset types {\n{"IGES Geometry file" {.igs} }\n{"STEP Geometry file" {.stp} }\n{"STL Geometry file" {.stl} }\n{"STL BIN Geometry file" {.stlb} }\n}\n} {\nset types {\n{"STL Geometry file" {.stl} }\n{"STL BIN Geometry file" {.stlb} }\n}\n}\nset ACISavailable [Ng_ACISCommand isACISavailable]\nputs $ACISavailable\nif {$ACISavailable == "yes" } {\nlappend types {"ACIS Geometry" {.sat} }\n}\nset file [tk_getSaveFile -filetypes $types -initialdir $dirname -initialfile $basefilename ]\nif {$file != ""} {\nNg_SaveGeometry $file\n}\n}\n.ngmenu.file add cascade -label "Recent Files" -menu .ngmenu.file.recent\nmenu .ngmenu.file.recent -tearoff 0\nproc AddRecentFile { filename } {\nglobal progname\nglobal dirname\ncatch { [.ngmenu.file.recent delete $filename] }\n.ngmenu.file.recent insert 0 command -label $filename \\\n-command "AddRecentFile {$filename};\nNg_LoadGeometry {$filename};\nNg_ParseGeometry;\nset selectvisual geometry;\nNg_SetVisParameters;\nredraw;\nwm title . [concat \\" $progname - $filename \\"];\nset dirname {[file dirname $filename]};\nset basefilename {[file tail [file rootname $filename]]};\nrebuildoccdialog;"\nif { [.ngmenu.file.recent index last] >= 6 } {\n.ngmenu.file.recent delete last }\nsaveinifile;\n}\nloadinifile;\n.ngmenu.file add separator\n.ngmenu.file add command -label "Load Mesh..." -accelerator "<l><m>" \\\n-command {\nset types {\n{"Mesh file" {.vol .vol.gz}\t} }\nset file [tk_getOpenFile -filetypes $types -defaultextension ".vol"]\nif {$file != ""} {\nAddRecentMeshFile $file;\nNg_LoadMesh $file;\nset selectvisual mesh\nNg_SetVisParameters\nredraw\nNg_ReadStatus;\nwm title . [concat "$progname - " $file]\nset dirname [file dirname $file]\nset basefilename [file tail [file rootname $file]]\n}\n}\n.ngmenu.file add cascade -label "Recent Meshes" -menu .ngmenu.file.recentmesh\nmenu .ngmenu.file.recentmesh\nproc AddRecentMeshFile { filename } {\nglobal progname\nglobal dirname\ncatch { [.ngmenu.file.recentmesh delete $filename] }\n.ngmenu.file.recentmesh insert 0 command -label $filename \\\n-command "AddRecentMeshFile {$filename};\nNg_LoadMesh {$filename};\nset selectvisual mesh;\nNg_SetVisParameters;\nredraw;\nwm title . [concat \\" $progname - $filename \\"];\nset dirname {[file dirname $filename]};\nset basefilename {[file tail [file rootname $filename]]};\nrebuildoccdialog;"\nif { [.ngmenu.file.recentmesh index last] >= 6 } {\n.ngmenu.file.recentmesh delete last }\nsavemeshinifile;\n}\nloadmeshinifile;\n.ngmenu.file add command -label "Save Mesh..." -accelerator "<s><m>" \\\n-command {\nset types {\n{"Mesh file" {.vol .vol.gz}\t} }\nset file [tk_getSaveFile -filetypes $types -defaultextension ".vol.gz" -initialfile $basefilename -initialdir $dirname ]\nif {$file != ""} {\nNg_SaveMesh $file }\nAddRecentMeshFile $file;\n}\n.ngmenu.file add command -label "Merge Mesh..." \\\n-command {\nset types {\n{"Mesh file" {.vol}\t} }\nset file [tk_getOpenFile -filetypes $types -defaultextension ".vol"]\nif {$file != ""} {\nNg_MergeMesh $file;\nset selectvisual mesh\nNg_SetVisParameters\nredraw\nNg_ReadStatus;\n}\n}\nset meshimportformats [Ng_GetImportFormats]\n.ngmenu.file add command -label "Import Mesh..." \\\n-command {\nforeach importformat $meshimportformats {\nif { [lindex $importformat 0] == $importfiletype } {\nset extension [lindex $importformat 1]\n}\n}\nset types {\n{"Neutral format" {.mesh .emt} }\n{"Surface mesh format" {.surf} }\n{"Universal format" {.unv} }\n{"Olaf format" {.emt} }\n{"TET format" {.tet} }\n{"STL format" {.stl .stlb} }\n{"Pro/ENGINEER neutral format" {.fnf} }\n{"CFD General Notation System" {.cgns} }\n}\nset file [tk_getOpenFile -filetypes $meshimportformats -typevariable importfiletype]\nif {$file != ""} {\nNg_ImportMesh $file $importfiletype\nset selectvisual mesh\nNg_SetVisParameters\nredraw\nNg_ReadStatus;\n}\n}\nset meshexportformats [Ng_GetExportFormats]\n.ngmenu.file add command -label "Export Mesh..." \\\n-command {\nforeach exportformat $meshexportformats {\nif { [lindex $exportformat 0] == $exportfiletype } {\nset extension [lindex $exportformat 1]\n}\n}\nif { $exportfiletype == "Elmer Format"} {\nset file [file nativename [tk_chooseDirectory -title "Elmer Mesh Export - Select Directory"]]\n} elseif { $exportfiletype == "OpenFOAM 1.5+ Format"} {\nset file [file nativename [tk_chooseDirectory -title "OpenFOAM 1.5+ Mesh Export - Select Case Directory"]]\n} elseif { $exportfiletype == "OpenFOAM 1.5+ Compressed"} {\nset file [file nativename [tk_chooseDirectory -title "OpenFOAM 1.5+ Mesh Export - Select Case Directory"]]\n} else {\nset file [tk_getSaveFile -filetypes $meshexportformats -typevariable exportfiletype]\nputs "type = $exportfiletype"\nputs "filename = $file"\n}\nif {$file != ""} {\nNg_ExportMesh $file $exportfiletype\n}\n}\n.ngmenu.file add cascade -label "Export Filetype" -menu .ngmenu.file.filetype\nmenu .ngmenu.file.filetype\nforeach exportformat $meshexportformats {\n.ngmenu.file.filetype add radio -label [lindex $exportformat 0] -variable exportfiletype -command { .ngmenu.file invoke "Export Mesh..." }\n}\n.ngmenu.file add separator\n.ngmenu.file add command -label "Save Solution..." \\\n-command {\nset types {\n{"Solution File" {.sol} }\n{"VTK File" {.vtk} }\n}\nset file [tk_getSaveFile -filetypes $types ]\nif {$file != ""} {\nNg_SaveSolution $file\n}\n}\n.ngmenu.file add command -label "Import Solution..." \\\n-command {\nset types { {"Solution File" {.sol} } }\nset file [tk_getOpenFile -filetypes $types -defaultextension ".sol" ]\nif {$file != ""} {\nNg_ImportSolution $file\nset selectvisual solution\nNg_SetVisParameters\nredraw\n}\n}\nset demostarttime [clock clicks -millisecond]\nset stopdemo 0\nproc demoredraw { } {\nglobal demostarttime\nglobal stopdemo\nset curtime [clock clicks -millisecond]\nset result [ Ng_DemoSetTime [expr $curtime - $demostarttime] ]\nredraw\nglobal videoactive\nif { $videoactive == 1 } {\nputs "addframe"\nNg_VideoClip .ndraw addframe\n}\nif { $result == 0 && $stopdemo == 0 } {\nafter 1 { demoredraw }\n}\n}\n.ngmenu.file add command -label "Show Demo..." \\\n-command {\nset types { {"Demo File" {.dem} } }\nset file [tk_getOpenFile -filetypes $types -defaultextension ".dem" ]\nif {$file != ""} {\nNg_ShowDemo $file\nset demostarttime [clock clicks -millisecond]\nset stopdemo 0\ndemoredraw\n}\n}\n.ngmenu.file add separator\n.ngmenu.file add command -label "Snapshot..." \\\n-command {\nset types {\n{"JPG file" {.jpg} }\n{"GIF file" {.gif} }\n{"PPM file" {.ppm} }\n}\nset file [tk_getSaveFile -filetypes $types]\nif {$file != ""} {\nNg_SnapShot .ndraw $file }\n}\n.ngmenu.file add cascade -label "Video clip" -menu .ngmenu.file.video\nmenu .ngmenu.file.video\nset videoactive 0\n.ngmenu.file.video add command -label "start..." \\\n-command {\nset types {\n{"MPG file" {.mpg} }\n}\nset file [tk_getSaveFile -filetypes $types]\nif {$file != ""} {\nNg_VideoClip .ndraw init $file\nglobal videoactive\nset videoactive 1\n}\n}\n.ngmenu.file.video add command -label "add frame..." \\\n-command {Ng_VideoClip .ndraw addframe }\n.ngmenu.file.video add command -label "one cycle" \\\n-command {\nset visoptions.redrawperiodic 1\nfor { set j 0 } { $j < 100 } { incr j } {\nputs "j = $j"\nNg_Vis_Set time [expr (1000 * $j / 100)]\nredraw\nNg_VideoClip .ndraw addframe\nafter 200\n}\n}\n.ngmenu.file.video add command -label "finalize..." \\\n-command {\nNg_VideoClip .ndraw finalize\nglobal videoactive\nset videoactive 0\n}\n.ngmenu.file add command -label "Save Options" \\\n-command { saveoptions }\n.ngmenu.file add separator\n.ngmenu.file add command -label "Quit" -accelerator "<q>" \\\n-command {\nputs "Thank you for using $progname";\nif { [catch { unload libngsolve[info sharedlibextension] ngsolve } result ] } {\n}\nafter cancel { timer2 }\nNg_Exit;\ndestroy .\n}\nmenu .ngmenu.mesh\n.ngmenu.mesh add command -label "Generate Mesh" -accelerator "<g><m>" \\\n-command {\nset selectvisual mesh\nNg_SetVisParameters\nNg_GenerateMesh ${meshoptions.firststep} ${meshoptions.laststep}\nNg_ReadStatus\nredraw\n}\n.ngmenu.mesh add command -label "Stop Meshing" \\\n-command { Ng_StopMeshing }\n.ngmenu.mesh add command -label "Meshing Options..." \\\n-command meshingoptionsdialog\n.ngmenu.mesh add separator\n.ngmenu.mesh add command -label "Delete Mesh" \\\n-command { Ng_New mesh; Ng_ReadStatus; redraw }\n.ngmenu.mesh add command -label "Delete Vol Mesh" \\\n-command { Ng_DeleteVolMesh; Ng_ReadStatus; redraw }\n.ngmenu.mesh add command -label "Mesh Info" \\\n-command {\nset dim [Ng_MeshInfo dim]\nset np [Ng_MeshInfo np]\nset ne [Ng_MeshInfo ne]\nset nse [Ng_MeshInfo nse]\nset nseg [Ng_MeshInfo nseg]\nset bbox [Ng_MeshInfo bbox]\ntk_messageBox -message "Dimension: $dim\\nPoints: $np\\nElements: $ne\\nSurface Els: $nse\\nSegments: $nseg\\nxmin [lindex $bbox 0] xmax [lindex $bbox 1]\\nymin [lindex $bbox 2] ymax [lindex $bbox 3]\\nzmin [lindex $bbox 4] zmax [lindex $bbox 5]"\n}\n.ngmenu.mesh add command -label "Mesh Quality" \\\n-command {\nset inplanemin 0\nset inplanemax 0\nset betplanemin 0\nset betplanemax 0\nNg_MeshQuality inplanemin inplanemax betplanemin betplanemax\nputs "Triangle angles : $inplanemin - $inplanemax"\nputs "Tet angles : $betplanemin - $betplanemax"\ntk_messageBox -message "Triangle angles : $inplanemin - $inplanemax \\n Tet angles : $betplanemin - $betplanemax"\n}\n.ngmenu.mesh add command -label "Check Surface Mesh" \\\n-command { Ng_CheckSurfaceMesh }\n.ngmenu.mesh add command -label "Check Volume Mesh" \\\n-command { Ng_CheckVolumeMesh }\n.ngmenu.mesh add command -label "Edit Boundary Conditions..." \\\n-command { bcpropdialog }\nif { $userlevel == 3 } {\n.ngmenu.mesh add command -label "Mesh Doctor..." \\\n-command { meshdoctordialog }\n}\n.ngmenu.mesh add command -label "METIS Mesh Partitioning..." \\\n-command { METISdialog }\n.ngmenu.mesh add separator\n.ngmenu.mesh add command -label "Analyze Geometry" \\\n-command { Ng_GenerateMesh ag ag; Ng_ReadStatus; redraw }\n.ngmenu.mesh add command -label "Mesh Edges" \\\n-command { Ng_GenerateMesh me me; Ng_ReadStatus; redraw }\n.ngmenu.mesh add command -label "Mesh Surface" \\\n-command { set selectvisual mesh; Ng_SetVisParameters; \\\nNg_GenerateMesh ms ms; Ng_ReadStatus; redraw }\n.ngmenu.mesh add command -label "Optimize Surface" \\\n-command { Ng_GenerateMesh os os cmsmSm; redraw }\n.ngmenu.mesh add cascade -label "Surface Optim. Step" -menu .ngmenu.mesh.surfoptstep\nmenu .ngmenu.mesh.surfoptstep\n.ngmenu.mesh.surfoptstep add command -label "Mesh Smoothing" \\\n-command { Ng_GenerateMesh os os m; redraw}\n.ngmenu.mesh.surfoptstep add command -label "Edge swapping (topologic)" \\\n-command { Ng_GenerateMesh os os s; redraw}\n.ngmenu.mesh.surfoptstep add command -label "Edge swapping (metric)" \\\n-command { Ng_GenerateMesh os os S; redraw}\n.ngmenu.mesh.surfoptstep add command -label "Combine points" \\\n-command { Ng_GenerateMesh os os c; redraw}\n.ngmenu.mesh add separator\n.ngmenu.mesh add command -label "Mesh Volume" \\\n-command { Ng_GenerateMesh mv mv; Ng_ReadStatus }\n.ngmenu.mesh add command -label "Optimize Volume" \\\n-command { Ng_GenerateMesh ov ov; Ng_ReadStatus }\n.ngmenu.mesh add command -label "Smooth Opt Volume" \\\n-command { Ng_GenerateMesh ov ov m; Ng_ReadStatus }\n.ngmenu.mesh add command -label "Smooth Opt Volume Jacobian" \\\n-command { Ng_GenerateMesh ov ov j; Ng_ReadStatus }\nmenu .ngmenu.geometry\nmenu .ngmenu.view\n.ngmenu.view add command -label "Zoom all" \\\n-command { Ng_ZoomAll; redraw }\n.ngmenu.view add command -label "Center" \\\n-command { Ng_Center; redraw }\n.ngmenu.view add command -label "x-y plane" \\\n-command { Ng_StandardRotation xy; redraw }\n.ngmenu.view add command -label "y-x plane" \\\n-command { Ng_StandardRotation yx; redraw }\n.ngmenu.view add command -label "x-z plane" \\\n-command { Ng_StandardRotation xz; redraw }\n.ngmenu.view add command -label "z-x plane" \\\n-command { Ng_StandardRotation zx; redraw }\n.ngmenu.view add command -label "y-z plane" \\\n-command { Ng_StandardRotation yz; redraw }\n.ngmenu.view add command -label "z-y plane" \\\n-command { Ng_StandardRotation zy; redraw }\n.ngmenu.view add command -label "Viewing Options..." \\\n-command { viewingoptionsdialog; redraw }\n.ngmenu.view add command -label "Clipping Plane..." \\\n-command { clippingdialog; redraw }\n.ngmenu.view add command -label "Solution Data..." \\\n-command { visual_dialog; redraw }\n.ngmenu.view add checkbutton -variable viewqualityplot \\\n-label "Quality Plot" \\\n-command { qualityviewdialog $viewqualityplot }\n.ngmenu.view add checkbutton -variable memuseplot \\\n-label "Memory Usage" \\\n-command { memusedialog $memuseplot }\nmenu .ngmenu.meshsize\n.ngmenu.meshsize add command -label "Refine uniform" \\\n-command { Ng_Refine; Ng_HighOrder ${options.elementorder}; Ng_ReadStatus; redraw }\n.ngmenu.meshsize add command -label "Second Order" \\\n-command { Ng_SecondOrder; Ng_ReadStatus; redraw }\n.ngmenu.meshsize add command -label "Validate Second Order" \\\n-command { Ng_ValidateSecondOrder; Ng_ReadStatus; redraw }\n.ngmenu.meshsize add command -label "High Order" \\\n-command { Ng_HighOrder ${options.elementorder}; Ng_ReadStatus; redraw }\n.ngmenu.meshsize add separator\n.ngmenu.meshsize add command -label "Refinement Dialog..." \\\n-command { refinementdialog }\n.ngmenu.meshsize add command -label "Load Meshsize..." \\\n-command {\nset types {\n{"Meshsize file" {.msz}\t} }\nset file [tk_getOpenFile -filetypes $types]\nif {$file != ""} {\nNg_LoadMeshSize $file;\n}\n}\n.ngmenu.meshsize add command -label "MS from Surf Mesh" \\\n-command { Ng_MeshSizeFromSurfaceMesh }\nif { $userlevel == 3 } {\n.ngmenu.meshsize add command -label "Singular point ms" \\\n-command { Ng_SingularPointMS; }\n.ngmenu.meshsize add command -label "Singular edge ms" \\\n-command { Ng_SingularEdgeMS; }\n.ngmenu.meshsize add separator\nset bisectfilename "";\n.ngmenu.meshsize add command -label "Bisection" \\\n-command { Ng_ReadStatus; set oldnp 0; set newnp $status_np;\nNg_ReadStatus;\nwhile { $oldnp < $newnp } {\nset level [expr $level+1]\nif { $bisectfilename == ""} {\nNg_Bisect;\n} else {\nNg_Bisect $bisectfilename;\n}\nNg_ReadStatus;\nredraw;\nif { $bisectfilename == ""} {\nset oldnp $newnp;\nset newnp $status_np;\nputs "oldnp $oldnp newnp $newnp";\n} else {\nset oldnp $newnp;\n}\n}\n}\n}\n.ngmenu.meshsize add command -label "Load Refinement Info..." \\\n-command {\nset types {\n{"Refinement info" {.refine} }}\nset bisectfilename [tk_getOpenFile -filetypes $types]\n}\n.ngmenu.meshsize add command -label "Z-Refinement" \\\n-command { Ng_ZRefinement 2; Ng_ReadStatus; redraw }\n.ngmenu.meshsize add cascade -label "hp-Refinement" -menu .ngmenu.meshsize.hpref\nmenu .ngmenu.meshsize.hpref\n.ngmenu.meshsize.hpref add command -label "1 Level" \\\n-command { Ng_HPRefinement 1; Ng_ReadStatus; redraw }\n.ngmenu.meshsize.hpref add command -label "2 Levels" \\\n-command { Ng_HPRefinement 2; Ng_ReadStatus; redraw }\n.ngmenu.meshsize.hpref add command -label "3 Levels" \\\n-command { Ng_HPRefinement 3; Ng_ReadStatus; redraw }\n.ngmenu.meshsize.hpref add command -label "4 Levels" \\\n-command { Ng_HPRefinement 4; Ng_ReadStatus; redraw }\n.ngmenu.meshsize.hpref add command -label "5 Levels" \\\n-command { Ng_HPRefinement 5; Ng_ReadStatus; redraw }\n.ngmenu.meshsize.hpref add command -label "6 Levels" \\\n-command { Ng_HPRefinement 6; Ng_ReadStatus; redraw }\n.ngmenu.meshsize.hpref add command -label "7 Levels" \\\n-command { Ng_HPRefinement 7; Ng_ReadStatus; redraw }\n.ngmenu.meshsize.hpref add command -label "8 Levels" \\\n-command { Ng_HPRefinement 8; Ng_ReadStatus; redraw }\n.ngmenu.meshsize.hpref add command -label "9 Levels" \\\n-command { Ng_HPRefinement 9; Ng_ReadStatus; redraw }\n.ngmenu.meshsize.hpref add command -label "10 Levels" \\\n-command { Ng_HPRefinement 10; Ng_ReadStatus; redraw }\n.ngmenu.meshsize add command -label "Split to Tets" \\\n-command { Ng_Split2Tets; Ng_ReadStatus; redraw }\nmenu .ngmenu.special\n.ngmenu.special add command -label "Prismatic Boundary Layer" \\\n-command { Ng_GenerateBoundaryLayer; redraw }\n.ngmenu.special add command -label "Insert virtual boundary layer" \\\n-command { Ng_InsertVirtualBL; redraw }\n.ngmenu.special add command -label "Cut off and combine with other" \\\n-command {\nset types { {"Mesh file" {.vol}\t} }\nset file [tk_getOpenFile -filetypes $types]\nif {$file != ""} {\nNg_CutOffAndCombine $file; }\nredraw\n}\n.ngmenu.special add command -label "Helmholtz Mesh grading" \\\n-command { Ng_HelmholtzMesh; }\n.ngmenu.special add cascade -label "Colour-based boundary conditions" -menu .ngmenu.special.colbndcond\nmenu .ngmenu.special.colbndcond\n.ngmenu.special.colbndcond add command -label "Inspect Colours in mesh" \\\n-command { currmeshcoloursdialog }\n.ngmenu.special.colbndcond add separator\n.ngmenu.special.colbndcond add command -label "Automatic Assignment" \\\n-command { Ng_AutoColourBcProps auto; redraw }\n.ngmenu.special.colbndcond add separator\nset ocffile [file join ${ngdir} netgen.ocf];\n.ngmenu.special.colbndcond add command -label "Select Colour Profile file" \\\n-command {\nset types { {"Colour Profile file" {.ocf} } }\nset ocffile [tk_getOpenFile -filetypes $types]\nif {$ocffile == ""} {\nset ocffile [file join ${ngdir} netgen.ocf]; }\n}\n.ngmenu.special.colbndcond add command -label "Profile based Assignment" \\\n-command { Ng_AutoColourBcProps profile ${ocffile}; redraw }\nmenu .ngmenu.help\n.ngmenu.view add checkbutton -label "Help Line" -variable showhelpline \\\n-command {\nif { $showhelpline == 1} {\npack .helpline -before .statbar -side bottom -fill x -padx 3p\n} {\npack forget .helpline\n}\n}\n.ngmenu.help add command -label "About..." \\\n-command {\ntk_messageBox -message "This is NETGEN \\nmainly written by \\nJoachim Schoeberl \\nthanks to \\nRobert Gaisbauer, Johannes Gerstmayr, Philippose Rajan"\n}\nttk::frame .bubar\npack .bubar -side top -fill x\nttk::button .bubar.testb -text "Test" -command { Ng_SaveGeometry }\nttk::button .bubar.surfm -text "Generate Mesh" -command \\\n{\n.ngmenu.mesh invoke "Generate Mesh";\n}\nttk::button .bubar.stopm -text "Stop" -command \\\n{\nset multithread_terminate 1;\nset stopdemo 1;\n}\nttk::button .bubar.exitb -text "Quit" \\\n-command {\nset ans [tk_messageBox -title "Quit Netgen?" -message "Do you really want to quit Netgen?" -type yesno -default "no" -icon question]\nif { $ans == "yes" } {\n.ngmenu.file invoke "Quit";\n}\n}\npack .bubar.exitb .bubar.surfm .bubar.stopm -side left\nttk::button .bubar.zoomall -text "Zoom All" \\\n-command { Ng_ZoomAll; redraw }\nttk::button .bubar.center -text "Center" \\\n-command { Ng_Center; redraw }\nttk::menubutton .bubar.modesel -menu .bubar.modesel.menu -text "" -width 6\nmenu .bubar.modesel.menu -tearoff 0\n.bubar.modesel.menu add command -label "Rotate" -command "set drawmode \\"rotate\\" ;.bubar.modesel configure -text \\"Rotate\\""\n.bubar.modesel.menu add command -label "Move" -command "set drawmode \\"move\\" ;.bubar.modesel configure -text \\"Move\\""\n.bubar.modesel.menu add command -label "Zoom" -command "set drawmode \\"zoom\\" ;.bubar.modesel configure -text \\"Zoom\\""\n.bubar.modesel.menu invoke "Rotate"\nset viewvals { geometry specpoints mesh solution}\nif { $userlevel == 3} {\nset viewvals { geometry mesh specpoints surfmeshing modelview solution}\n}\nset viewvallabs(cross) "Cross"\nset viewvallabs(geometry) "Geometry"\nset viewvallabs(mesh) "Mesh"\nset viewvallabs(specpoints) "Edges"\nset viewvallabs(surfmeshing) "Mesh Gen"\nset viewvallabs(modelview) "Modeller"\nset viewvallabs(solution) "Solution"\npack .bubar.center .bubar.zoomall -side right\n.ngmenu.view add checkbutton -variable viewrotatebutton \\\n-label "Enable LeftButton Selection" \\\n-command {\nif { $viewrotatebutton } {\npack .bubar.modesel -side right\n} {\npack forget .bubar.modesel\n}\n}\nmenu .bubar.selviewmenu\nttk::menubutton .bubar.selview1 -menu .bubar.selviewmenu -text "Geometry"\nforeach viewv $viewvals {\n.bubar.selviewmenu add command -label $viewvallabs($viewv) -command \\\n".bubar.selview1 configure -text \\"$viewvallabs($viewv)\\" ; set selectvisual $viewv ; Ng_SetVisParameters; redraw"\n}\npack .bubar.selview1 -side right\ntrace add variable selectvisual write selvis_monitor\nproc selvis_monitor { name args } {\nglobal selectvisual viewvallabs\n.bubar.selviewmenu invoke $viewvallabs($selectvisual)\n}\nttk::label .helpline -text "None"\npack forget .helpline -side bottom -fill x\nttk::frame .statbar -relief flat\npack .statbar -side bottom -fill x\nttk::label .statbar.ptslabel -text " Points: "\nttk::label .statbar.ptsval -textvariable status_np\nttk::label .statbar.elslabel -text " Elements: "\nttk::label .statbar.elsval -textvariable status_ne\nttk::label .statbar.selslabel -text " Surf Elements: "\nttk::label .statbar.selsval -textvariable status_nse\nttk::label .statbar.task -textvariable status_task\npack .statbar.ptslabel .statbar.ptsval -side left -ipady 3p\npack .statbar.elslabel .statbar.elsval -side left -ipady 3p\npack .statbar.selslabel .statbar.selsval -side left -ipady 3p\nttk::progressbar .statbar.per -value 0 -maximum 1\npack .statbar.per -side right\npack .statbar.task -side right -ipady 4\nset qualbaraxis(0) 0\nset qualbar(0) 0\nset qualbarnull(0) 0\nproc timer2 { } {\nglobal status_np\nglobal status_ne\nglobal status_nse\nglobal multithread_running\nglobal multithread_redraw\nglobal status_working\nglobal status_task\nglobal status_percent\nglobal status_tetqualclasses\nNg_ReadStatus\nif { $multithread_redraw == 1 } {\nset multithread_redraw 0;\nredraw;\nglobal videoactive\nif { $videoactive == 1 } {\nputs "addframe"\nNg_VideoClip .ndraw addframe\n}\n}\nif { $multithread_redraw == 2 } {\nredraw;\nset multithread_redraw 0;\nglobal videoactive\nif { $videoactive == 1 } {\nputs "addframe"\nNg_VideoClip .ndraw addframe\n}\nafter 1 { timer2 }\nreturn\n}\n.statbar.per configure -value [expr $status_percent/100]\nif { $multithread_running } {\npack .statbar.per -side right -before .statbar.task -padx 6\n} {\npack forget .statbar.per\n}\nif {[winfo exists .qualityview_dlg] == 1} {\nglobal qualbar\nglobal qualbarnull\nglobal qualbaraxis\nset maxval 0\nfor {set i 0} {$i < 20} {incr i} {\nif {[lindex $status_tetqualclasses $i] > $maxval} {\nset maxval [lindex $status_tetqualclasses $i]\n}\n}\nset ubound 1\nwhile { $ubound < $maxval } {\nset ubound [expr {10 * $ubound}]\n}\nif { $ubound/5 > $maxval } {\nset ubound [expr $ubound/5]\n}\nif { $ubound/2 > $maxval } {\nset ubound [expr $ubound/2]\n}\nfor {set i 1} {$i <= 5} {incr i} {\nset value [expr { $i * $ubound / 5 }]\n.qualityview_dlg.c dchars $qualbaraxis($i) 0 end\n.qualityview_dlg.c insert $qualbaraxis($i) end $value\n}\nfor {set i 0} {$i < 20} {incr i} {\nset x1 [expr {100 + ($i*15) + 2}]\nset x2 [expr {$x1+10}]\nset nbrs [lindex $status_tetqualclasses $i]\nset y [expr (249 - (200 * $nbrs / $ubound ) )]\n.qualityview_dlg.c coords $qualbar($i) $x1 250 $x2 $y\nif { $nbrs == 0 } {\n.qualityview_dlg.c itemconfigure $qualbarnull($i) -text 0\n} {\n.qualityview_dlg.c itemconfigure $qualbarnull($i) -text ""\n}\n}\n}\nif {[winfo exists .memuse_dlg] == 1} {\nglobal memmark\nset usemb [Ng_MemInfo usedmb]\nfor {set i 0} {$i < [string length $usemb] } {incr i} {\nif { [string index $usemb $i] == 0 } {\n.memuse_dlg.c coords $memmark($i) [expr 50+$i] 68 [expr 50+$i] 70\n} {\n.memuse_dlg.c coords $memmark($i) [expr 50+$i] 50 [expr 50+$i] 70\n}\n}\n}\nafter 40 { timer2 }\n}\ntimer2\nproc bgerror { error } {\nglobal errorInfo userlevel\nif { $userlevel == 3} {\nputs "ERROR: $error"\nputs "errinfo: $errorInfo"\n}\ntk_messageBox -title "Error Message" -message $error -type ok\n}\nproc smh2 { menuitem } {\nif {[catch {$menuitem entrycget active -label} name]} {\nset name " "\n}\nshow_menu_help $name\nupdate idletasks\n}\nbind .ngmenu <<MenuSelect>> { smh2 %W }\nbind .ngmenu.file <<MenuSelect>> { smh2 %W }\nbind .ngmenu.geometry <<MenuSelect>> { smh2 %W }\nbind .ngmenu.mesh <<MenuSelect>> { smh2 %W }\nbind .ngmenu.view <<MenuSelect>> { smh2 %W }\nbind .ngmenu.meshsize <<MenuSelect>> { smh2 %W }\nbind .ngmenu.special <<MenuSelect>> { smh2 %W }\nbind .ngmenu.help <<MenuSelect>> { smh2 %W }\nbind . <q> { .ngmenu.file invoke "Quit" }\nbind . <l><g> { .ngmenu.file invoke "Load Geometry..." } ;\nbind . <l><m> { .ngmenu.file invoke "Load Mesh..." } ;\nbind . <s><m> { .ngmenu.file invoke "Save Mesh..." } ;\nbind . <r><f> { .ngmenu.file activate "Recent Files" } ;\nbind . <n><p> { newprimitivedialog } ; \nbind . <e><p> { editprimitivedialog }\nbind . <e><s> { newsoliddialog }\nbind . <g><m> { .ngmenu.mesh invoke "Generate Mesh" } ;\n}\n}\ncatch {\nproc meshingoptionsdialog { } {\nset w .options_dlg\nif {[winfo exists .options_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\npack [ttk::notebook $w.nb] -fill both -side top\n$w.nb add [ttk::frame $w.nb.general] -text "General" -underline 0\n$w.nb add [ttk::frame $w.nb.meshsize] -text "Mesh Size" -underline 0\n$w.nb add [ttk::frame $w.nb.chartopt] -text "STL Charts" -underline 0\n$w.nb add [ttk::frame $w.nb.optimizer] -text "Optimizer" -underline 0\n$w.nb add [ttk::frame $w.nb.debug] -text "Debug" -underline 0\nset f $w.nb.general\nttk::frame $f.background\npack $f.background -fill both\nset f $f.background\nttk::labelframe $f.f2 -relief groove -borderwidth 3 -text "General meshing options"\npack $f.f2 -pady 15 -fill x\nset f $f.f2\nset finevals { 1 2 3 4 5 6 }\nset finelabs(1) "very coarse"\nset finelabs(2) "coarse"\nset finelabs(3) "moderate"\nset finelabs(4) "fine"\nset finelabs(5) "very fine"\nset finelabs(6) "user defined"\nglobal meshoptions.fineness\nttk::label $f.fine2l -text "Mesh granularity: "\nttk::menubutton $f.fine2c -menu $f.fine2m -text "coarse" -width 16\nmenu $f.fine2m -tearoff 0\nforeach finev { 1 2 3 4 5 6 } {\n$f.fine2m add command -label $finelabs($finev) \\\n-command "set meshoptions.fineness $finev ; setgranularity $finev; $f.fine2c configure -text \\"$finelabs($finev)\\""\n}\n$f.fine2m invoke $finelabs(${meshoptions.fineness})\ngrid $f.fine2l $f.fine2c -sticky nw\nset mgsteps { ag me ms os mv ov }\nset mgsteplabel(ag) "Analyze Geometry"\nset mgsteplabel(me) "Mesh Edges"\nset mgsteplabel(ms) "Mesh Surface"\nset mgsteplabel(os) "Optimize Surface"\nset mgsteplabel(mv) "Mesh Volume"\nset mgsteplabel(ov) "Optimize Volume"\nglobal meshoptions.firststep\nttk::label $f.first2l -text "First Step: "\nttk::menubutton $f.first2c -menu $f.first2m -width 16\nmenu $f.first2m -tearoff 0\nforeach i $mgsteps {\n$f.first2m add command -label $mgsteplabel($i) -command "set meshoptions.firststep $i ; $f.first2c configure -text \\"$mgsteplabel($i)\\""\n}\n$f.first2m invoke $mgsteplabel(${meshoptions.firststep})\ngrid $f.first2l $f.first2c -sticky nw\nglobal meshoptions.laststep\nttk::label $f.last2l -text "Last Step: "\nttk::menubutton $f.last2c -menu $f.last2m -width 16\nmenu $f.last2m -tearoff 0\nforeach i $mgsteps {\n$f.last2m add command -label $mgsteplabel($i) -command "set meshoptions.laststep $i ; $f.last2c configure -text \\"$mgsteplabel($i)\\""\n}\n$f.last2m invoke $mgsteplabel(${meshoptions.laststep})\ngrid $f.last2l $f.last2c -sticky nw\ngrid anchor $f center\nset msg(0) "None"\nset msg(1) "Least"\nset msg(2) "Little"\nset msg(3) "Moderate"\nset msg(4) "Much"\nset msg(5) "Most"\nglobal options.printmsg\nttk::label $f.msg2l -text "Print Messages: "\nmenu $f.msg2m -tearoff 0\nttk::menubutton $f.msg2c -menu $f.msg2m -width 16\nforeach step {0 1 2 3 4 5 } {\n$f.msg2m add command -label $msg($step) -command "set options.printmsg $step ; $f.msg2c configure -text $msg($step)"\n}\n$f.msg2m invoke ${options.printmsg}\ngrid $f.msg2l $f.msg2c -sticky nw\nset f $w.nb.general\nttk::labelframe $f.bts -borderwidth 3 -relief groove -text "Additional meshing options"\npack $f.bts -fill x -pady 15\nttk::frame $f.bts.btnframe\nttk::checkbutton $f.bts.btnframe.parthread -text "Separate meshing thread" \\\n-variable options.parthread\nttk::checkbutton $f.bts.btnframe.second -text "Second order elements" \\\n-variable options.secondorder\nttk::checkbutton $f.bts.btnframe.quad -text "Quad dominated" \\\n-variable options.quad -command {\nif { ${options.quad} } {\nset meshoptions.laststep os\n}\n}\nttk::checkbutton $f.bts.btnframe.invtets -text "Invert volume elements" \\\n-variable options.inverttets\nttk::checkbutton $f.bts.btnframe.invtrigs -text "Invert surface elements" \\\n-variable options.inverttrigs\nttk::checkbutton $f.bts.btnframe.azref -text "Automatic Z-refinement" \\\n-variable options.autozrefine\npack $f.bts.btnframe -anchor center\npack $f.bts.btnframe.parthread $f.bts.btnframe.second $f.bts.btnframe.quad $f.bts.btnframe.invtets $f.bts.btnframe.invtrigs $f.bts.btnframe.azref -anchor w\nttk::frame $f.bts.btnframe.elorder\nttk::label $f.bts.btnframe.elorder.l -text "Element order"\nttk::spinbox $f.bts.btnframe.elorder.elementorder2 -from 1 -to 20 -textvariable options.elementorder -width 2\npack $f.bts.btnframe.elorder -fill x\npack $f.bts.btnframe.elorder.elementorder2 $f.bts.btnframe.elorder.l -anchor w -side left\nttk::frame $f.bts.btnframe.pm\nttk::checkbutton $f.bts.btnframe.pm.parallel_meshing -text "Parallel meshing" \\\n-variable options.parallel_meshing\npack $f.bts.btnframe.pm -fill x -pady 5\npack $f.bts.btnframe.pm.parallel_meshing -anchor w\nttk::label $f.bts.btnframe.pm.lnthreads -text "Number of meshing threads"\nttk::spinbox $f.bts.btnframe.pm.nthreads -from 1 -to 128 -textvariable options.nthreads -width 2\npack $f.bts.btnframe.pm.nthreads $f.bts.btnframe.pm.lnthreads -anchor w -side left\nset f $w.nb.meshsize\nttk::frame $f.f2\npack $f.f2 -pady 10\nset f $f.f2\nttk::frame $f.meshsize\nttk::label $f.meshsize.l -text "max mesh-size"\nttk::spinbox $f.meshsize.s -from 1e-9 -to 1e9 -textvariable options.meshsize -width 5 -validate focus -validatecommand "my_validatespinbox %W %P 10" \\\n-invalidcommand "my_invalidspinbox %W"\npack $f.meshsize -fill x\npack $f.meshsize.s $f.meshsize.l -side right\nttk::frame $f.minmeshsize\nttk::label $f.minmeshsize.l -text "min mesh-size"\nttk::spinbox $f.minmeshsize.s -from 0 -to 1e9 -textvariable options.minmeshsize -width 5 -validate focus -validatecommand "my_validatespinbox %W %P 10" \\\n-invalidcommand "my_invalidspinbox %W"\npack $f.minmeshsize -fill x\npack $f.minmeshsize.s $f.minmeshsize.l -side right\nttk::frame $f.grading\nttk::label $f.grading.l -text "mesh-size grading"\nttk::spinbox $f.grading.s -from 0.1 -to 1.0 -textvariable options.grading -width 5 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \\\n-invalidcommand "my_invalidspinbox %W"\npack $f.grading -fill x\npack $f.grading.s $f.grading.l -side right\nset f $w.nb.meshsize\nttk::labelframe $f.msf -text "mesh-size file:" -relief groove -borderwidth 3\npack $f.msf\nttk::entry $f.msf.ent -textvariable options.meshsizefilename -width 30\nttk::button $f.msf.btn -text "Browse" -command {\nglobal options.meshsizefilename\nset types {\n{"Meshsize file" {.msz}\t} }\nset options.meshsizefilename [tk_getOpenFile -filetypes $types -initialfile ${options.meshsizefilename}]\n}\npack $f.msf.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4\npack $f.msf.btn -side left -anchor s -padx 4 -pady 4\nttk::label $f.lab -text "Additional mesh size restrictions:"\nttk::labelframe $f.csg -relief groove -borderwidth 3 -text "CSG mesh-size"\npack $f.csg -fill x\nproc test {a} {puts $a}\nttk::scale $f.csg.curvsc -orient horizontal -length 150 -from 0.2 -to 5 \\\n-variable options.curvaturesafety -takefocus 0 -command "roundscale $f.csg.curvsc 1"\nttk::entry $f.csg.curve -textvariable options.curvaturesafety -width 3 \\\n-validatecommand "my_validate %W [$f.csg.curvsc cget -from] [$f.csg.curvsc cget -to] %P 1" \\\n-invalidcommand "my_invalid %W" -validate focus\nttk::label $f.csg.curvla -text "Elements per curvature radius"\ngrid $f.csg.curvsc $f.csg.curve $f.csg.curvla -sticky nw -padx 4\nttk::scale $f.csg.elensc -orient horizontal -length 150 -from 0.2 -to 5 \\\n-variable options.segmentsperedge -takefocus 0 -command "roundscale $f.csg.elensc 1"\nttk::entry $f.csg.elene -textvariable options.segmentsperedge -width 3 \\\n-validatecommand "my_validate %W [$f.csg.elensc cget -from] [$f.csg.elensc cget -to] %P 1" \\\n-invalidcommand "my_invalid %W" -validate focus\nttk::label $f.csg.elenla -text "Elements per edge"\ngrid $f.csg.elensc $f.csg.elene $f.csg.elenla -sticky nw -padx 4\ngrid anchor $f.csg center\nttk::labelframe $f.stl -relief groove -borderwidth 3 -text "STL mesh-size"\npack $f.stl -fill x\nttk::scale $f.stl.r2sc -orient horizontal -length 150 -from 0.2 -to 5 \\\n-variable stloptions.resthchartdistfac -takefocus 0 -command "roundscale $f.stl.r2sc 1"\nttk::entry $f.stl.r2e -textvariable stloptions.resthchartdistfac -width 3 \\\n-validatecommand "my_validate %W [$f.stl.r2sc cget -from] [$f.stl.r2sc cget -to] %P 1" \\\n-invalidcommand "my_invalid %W" -validate focus\nttk::checkbutton $f.stl.r2bu -text "STL - chart distance" \\\n-variable stloptions.resthchartdistenable\ngrid $f.stl.r2sc $f.stl.r2e $f.stl.r2bu -sticky nw -padx 4\nttk::scale $f.stl.r6sc -orient horizontal -length 150 -from 0.2 -to 5 \\\n-variable stloptions.resthlinelengthfac -takefocus 0 -command "roundscale $f.stl.r6sc 1"\nttk::entry $f.stl.r6e -textvariable stloptions.resthlinelengthfac -width 3 \\\n-validatecommand "my_validate %W [$f.stl.r6sc cget -from] [$f.stl.r6sc cget -to] %P 1" \\\n-invalidcommand "my_invalid %W" -validate focus\nttk::checkbutton $f.stl.r6bu -text "STL - line length" \\\n-variable stloptions.resthlinelengthenable\ngrid $f.stl.r6sc $f.stl.r6e $f.stl.r6bu -sticky nw -padx 4\nttk::scale $f.stl.r3sc -orient horizontal -length 150 -from 0.2 -to 8 \\\n-variable stloptions.resthcloseedgefac -takefocus 0 -command "roundscale $f.stl.r3sc 1"\nttk::entry $f.stl.r3e -textvariable stloptions.resthcloseedgefac -width 3 \\\n-validatecommand "my_validate %W [$f.stl.r3sc cget -from] [$f.stl.r3sc cget -to] %P 1" \\\n-invalidcommand "my_invalid %W" -validate focus\nttk::checkbutton $f.stl.r3bu -text "STL/IGES/STEP - close edges" \\\n-variable stloptions.resthcloseedgeenable\ngrid $f.stl.r3sc $f.stl.r3e $f.stl.r3bu -sticky nw -padx 4\nttk::scale $f.stl.r1sc -orient horizontal -length 150 -from 0.2 -to 5 \\\n-variable stloptions.resthsurfcurvfac -takefocus 0 -command "roundscale $f.stl.r1sc 1"\nttk::entry $f.stl.r1e -textvariable stloptions.resthsurfcurvfac -width 3 \\\n-validatecommand "my_validate %W [$f.stl.r1sc cget -from] [$f.stl.r1sc cget -to] %P 1" \\\n-invalidcommand "my_invalid %W" -validate focus\nttk::checkbutton $f.stl.r1bu -text "STL - surface curvature" \\\n-variable stloptions.resthsurfcurvenable\ngrid $f.stl.r1sc $f.stl.r1e $f.stl.r1bu -sticky nw -padx 4\nttk::scale $f.stl.r3bsc -orient horizontal -length 150 -from 0.2 -to 5 \\\n-variable stloptions.resthedgeanglefac -takefocus 0 -command "roundscale $f.stl.r3bsc 1"\nttk::entry $f.stl.r3be -textvariable stloptions.resthedgeanglefac -width 3 \\\n-validatecommand "my_validate %W [$f.stl.r3bsc cget -from] [$f.stl.r3bsc cget -to] %P 1" \\\n-invalidcommand "my_invalid %W" -validate focus\nttk::checkbutton $f.stl.r3bbu -text "STL - edge angle" \\\n-variable stloptions.resthedgeangleenable\ngrid $f.stl.r3bsc $f.stl.r3be $f.stl.r3bbu -sticky nw -padx 4\nttk::scale $f.stl.r5sc -orient horizontal -length 150 -from 0.2 -to 5 \\\n-variable stloptions.resthsurfmeshcurvfac -takefocus 0 -command "roundscale $f.stl.r5sc 1"\nttk::entry $f.stl.r5e -textvariable stloptions.resthsurfmeshcurvfac -width 3 \\\n-validatecommand "my_validate %W [$f.stl.r5sc cget -from] [$f.stl.r5sc cget -to] %P 1" \\\n-invalidcommand "my_invalid %W" -validate focus\nttk::checkbutton $f.stl.r5bu -text "STL - surface mesh curv" \\\n-variable stloptions.resthsurfmeshcurvenable\ngrid $f.stl.r5sc $f.stl.r5e $f.stl.r5bu -sticky nw -padx 4\nttk::checkbutton $f.stl.recalch -text "STL - Recalc mesh size for surface optimization" \\\n-variable stloptions.recalchopt\ngrid $f.stl.recalch -sticky n -columnspan 3 -column 0\nttk::button $f.stl.calch -text "Calc New H" -command { redraw; Ng_STLCalcLocalH }\ngrid $f.stl.calch -columnspan 3 -column 0\ngrid anchor $f.stl center\nproc roundscale {w n_digits args} {\nset val [$w get]\nglobal [$w cget -variable]\nif {$n_digits == 0 } {\nset [$w cget -variable] [tcl::mathfunc::round $val]\n} else {\nset [$w cget -variable] [format "%.[append n_digits "f"]" $val]\n}\n}\nglobal last_accepted_sc\nproc my_validate {w mini maxi val n_digits} {\nglobal last_accepted_sc [$w cget -textvariable]\nif {[string length $val] == 0} {return 0}\nif {[string is double $val] == 1} {\nif { $n_digits == 0 } {\nset val [tcl::mathfunc::max $mini [tcl::mathfunc::min $maxi [tcl::mathfunc::round $val]]]\n} else {\nif { $n_digits < 9 } {\nset val [tcl::mathfunc::max $mini [tcl::mathfunc::min $maxi [format "%.[append n_digits "f"]" $val]]]\n}\n}\nset last_accepted_sc $val\nset [$w cget -textvariable] $val\nreturn 1\n} else {\nreturn 0\n}\n}\nproc my_invalid {w} {\nglobal last_accepted_sc [$w cget -textvariable]\nset [$w cget -textvariable] $last_accepted_sc\n}\nset f $w.nb.chartopt\nttk::labelframe $f.mainframe -text "STL angles" -relief groove -borderwidth 3\npack $f.mainframe -fill x -pady 15\nset f $f.mainframe\nttk::label $f.labYangles -text "Yellow Edges Angle ()"\nttk::scale $f.scale1 -orient horizontal -length 150 -from 0 -to 90 -variable stloptions.yangle -takefocus 0 -command "roundscale $f.scale1 1"\nttk::entry $f.entry1 -textvariable stloptions.yangle -width 5 -validate focus -takefocus 0 -validatecommand "my_validate %W [$f.scale1 cget -from] [$f.scale1 cget -to] %P 1" \\\n-invalidcommand "my_invalid %W"\ngrid $f.scale1 $f.entry1 $f.labYangles -sticky nw -padx 4 -pady 6\nttk::label $f.labEangles -text "Edge Corner Angle ()"\nttk::scale $f.scale2 -orient horizontal -length 150 -from 0 -to 180 -variable stloptions.edgecornerangle -takefocus 0 -command "roundscale $f.scale2 1"\nttk::entry $f.entry2 -textvariable stloptions.edgecornerangle -width 5 -validate focus -takefocus 0 -validatecommand "my_validate %W [$f.scale2 cget -from] [$f.scale2 cget -to] %P 1" \\\n-invalidcommand "my_invalid %W"\ngrid $f.scale2 $f.entry2 $f.labEangles -sticky nw -padx 4 -pady 6\nttk::label $f.lab31 -text "Chart Angle ()"\nttk::scale $f.scale3 -orient horizontal -length 150 -from 0 -to 180 -variable stloptions.chartangle -takefocus 0 -command "roundscale $f.scale3 1"\nttk::entry $f.entry3 -textvariable stloptions.chartangle -width 5 -validate focus -takefocus 0 -validatecommand "my_validate %W [$f.scale3 cget -from] [$f.scale3 cget -to] %P 1" \\\n-invalidcommand "my_invalid %W"\ngrid $f.scale3 $f.entry3 $f.lab31 -sticky nw -padx 4 -pady 6\nttk::label $f.lab41 -text "Outer Chart Angle ()"\nttk::scale $f.scale4 -orient horizontal -length 150 -from 0 -to 180 -variable stloptions.outerchartangle -takefocus 0 -command "roundscale $f.scale4 1"\nttk::entry $f.entry4 -textvariable stloptions.outerchartangle -width 5 -validate focus -takefocus 0 -validatecommand "my_validate %W [$f.scale4 cget -from] [$f.scale4 cget -to] %P 1" \\\n-invalidcommand "my_invalid %W"\ngrid $f.scale4 $f.entry4 $f.lab41 -sticky nw -padx 4 -pady 6\ngrid anchor $f center\nglobal last_accepted_sp\nproc my_validatespinbox {w val n_digits} {\nglobal last_accepted_sp\nif {[string length $val] == 0} {return 0}\nif {[string is double $val] == 1} {\nif { $n_digits == 0 } {\nif { $n_digits < 9 } {\nset val [tcl::mathfunc::round $val] } else { set val [format "%.[append n_digits "f"]" $val]\n}\n}\n$w set [tcl::mathfunc::max [$w cget -from] [tcl::mathfunc::min [$w cget -to] $val]]\nset last_accepted_sp $val\nreturn 1\n} else {\nreturn 0\n}\n}\nproc my_invalidspinbox {w} {\nglobal last_accepted_sp\n$w set $last_accepted_sp\n}\nset f $w.nb.optimizer\nttk::labelframe $f.optframe -text "Optimization settings" -relief groove -borderwidth 3\npack $f.optframe -fill x -pady 15\nttk::label $f.optframe.sosl -text "Surface opt steps"\nttk::spinbox $f.optframe.soss -from 0 -to 99 -textvariable options.optsteps2d -width 5 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W"\ngrid $f.optframe.sosl $f.optframe.soss -sticky nw;\nttk::label $f.optframe.vosl -text "Volume opt steps"\nttk::spinbox $f.optframe.voss -from 0 -to 99 -textvariable options.optsteps3d -width 5 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W"\ngrid $f.optframe.vosl $f.optframe.voss -sticky nw;\nttk::label $f.optframe.eswl -text "Element size weight"\nttk::spinbox $f.optframe.esws -from 0 -to 1 -textvariable options.elsizeweight -width 5 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 1" \\\n-invalidcommand "my_invalidspinbox %W"\ngrid $f.optframe.eswl $f.optframe.esws -sticky nw;\nttk::label $f.optframe.weml -text "Worst element measure"\nttk::spinbox $f.optframe.wems -from 1 -to 10 -textvariable options.opterrpow -width 5 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W"\ngrid $f.optframe.weml $f.optframe.wems -sticky nw;\ngrid anchor $f.optframe center\nproc roundscale_helper_osx {w val} {\nglobal [$w cget -variable] options.badellimit\nset [$w cget -variable] [tcl::mathfunc::round $val]\nset options.badellimit [expr [tcl::mathfunc::round $val]+160]\n}\nproc my_validate_helper_osx {w val} {\nif {[string length $val] == 0} {return 0}\nif {[string is double $val] == 1} {\nset scale_loc [lindex [winfo children [winfo parent $w]] [lsearch [winfo children [winfo parent $w]] *scale]]\nglobal [$scale_loc cget -variable] options.badellimit\nset [$scale_loc cget -variable] [tcl::mathfunc::max [$scale_loc cget -from] [tcl::mathfunc::min [$scale_loc cget -to] [expr [tcl::mathfunc::round $val]-160]]]\nset options.badellimit [tcl::mathfunc::max [expr [$scale_loc cget -from]+160] [tcl::mathfunc::min [expr [$scale_loc cget -to]+160] [tcl::mathfunc::round $val]]]\nreturn 1\n} else {\nreturn 0\n}\n}\nproc my_invalid_helper_osx {w} {\nglobal options.badellimit\nset scale_loc [lindex [winfo children [winfo parent $w]] [lsearch [winfo children [winfo parent $w]] *scale]]\nglobal [$scale_loc cget -variable]\nset [$scale_loc cget -variable] [tcl::mathfunc::round [$scale_loc get]]\nset options.badellimit [expr [tcl::mathfunc::round [$scale_loc get]]+160]\n}\nglobal dummy_badellimit\nset dummy_badellimit 15\nttk::labelframe $f.optframe2 -text "Bad elements" -relief groove -borderwidth 3\npack $f.optframe2 -fill x -pady 15 -ipady 5\nttk::frame $f.optframe2.badellimit\nttk::label $f.optframe2.lab -text "bad element criterion";\nttk::scale $f.optframe2.scale -orient horizontal -length 100 -from 00 -to 20 -variable dummy_badellimit -takefocus 0 -command "roundscale_helper_osx $f.optframe2.scale"\nttk::entry $f.optframe2.entry -textvariable options.badellimit -width 3 -validate focusout -takefocus 0 -validatecommand "my_validate_helper_osx %W %P" \\\n-invalidcommand "my_invalid_helper_osx %W"\ngrid $f.optframe2.scale $f.optframe2.entry $f.optframe2.lab -padx 4 -sticky nw\ngrid anchor $f.optframe2 center\nset f $w.nb.debug\nttk::labelframe $f.f2 -text "Advanced options" -borderwidth 3 -relief groove\npack $f.f2 -fill x -pady 15\nset f $f.f2\nttk::checkbutton $f.localh -text "Use Local Meshsize" \\\n-variable options.localh\nttk::checkbutton $f.delauney -text "Use Delaunay" \\\n-variable options.delaunay\nttk::checkbutton $f.checkoverlap -text "Check Overlapping" \\\n-variable options.checkoverlap\nttk::checkbutton $f.checkcb -text "Check Chart Boundary" \\\n-variable options.checkchartboundary\nttk::checkbutton $f.blockfill -text "Do Blockfilling" \\\n-variable options.blockfill\ngrid $f.localh $f.delauney -sticky nw\ngrid $f.checkoverlap $f.blockfill -sticky nw\ngrid $f.checkcb -sticky nw\ngrid anchor $f center\nset f $w.nb.debug\nproc enable_cb {w1 w2 w3} {\nNg_SetDebugParameters\nif {[string match *selected* [$w1 state]] == 1 } {\n$w2 configure -state normal\n$w3 configure -state normal\n} else {\n$w2 configure -state disabled\n$w3 configure -state disabled\n}\n}\nttk::labelframe $f.cb1 -text "Debugging options" -borderwidth 3 -relief groove\npack $f.cb1 -fill x -pady 15\nttk::checkbutton $f.cb1.slowchecks -text "Slow checks" \\\n-variable debug.slowchecks -command { Ng_SetDebugParameters }\nttk::checkbutton $f.cb1.debugoutput -text "Debugging output" \\\n-variable debug.debugoutput -command { Ng_SetDebugParameters }\nttk::checkbutton $f.cb1.haltexline -text "Halt on existing line" \\\n-variable debug.haltexistingline -command { Ng_SetDebugParameters }\nttk::checkbutton $f.cb1.haltoverlap -text "Halt on Overlap" \\\n-variable debug.haltoverlap -command { Ng_SetDebugParameters }\nttk::checkbutton $f.cb1.haltsuc -text "Halt on success" \\\n-variable debug.haltsuccess -command { Ng_SetDebugParameters }\nttk::checkbutton $f.cb1.haltnosuc -text "Halt on no success" \\\n-variable debug.haltnosuccess -command { Ng_SetDebugParameters }\nttk::checkbutton $f.cb1.haltlargequal -text "Halt on large quality class" \\\n-variable debug.haltlargequalclass -command { Ng_SetDebugParameters }\nttk::checkbutton $f.cb1.haltseg -text "Halt on Segment:" \\\n-variable debug.haltsegment -command { Ng_SetDebugParameters }\nttk::checkbutton $f.cb1.haltnode -text "Halt on Node:" \\\n-variable debug.haltnode -command { Ng_SetDebugParameters }\nttk::frame $f.cb1.fr\nttk::checkbutton $f.cb1.fr.cb -text "Halt on Face:" \\\n-variable debug.haltface -command { Ng_SetDebugParameters }\nttk::entry $f.cb1.fr.ent -textvariable debug.haltfacenr -width 3\npack $f.cb1.fr.cb $f.cb1.fr.ent -side left\nttk::frame $f.cb1.segs\nttk::label $f.cb1.segs.lab1 -text "P1:"\nttk::entry $f.cb1.segs.ent1 -width 6 \\\n-textvariable debug.haltsegmentp1\nttk::label $f.cb1.segs.lab2 -text "P2:"\nttk::entry $f.cb1.segs.ent2 -width 6 \\\n-textvariable debug.haltsegmentp2\npack $f.cb1.segs.lab1 $f.cb1.segs.ent1 $f.cb1.segs.lab2 $f.cb1.segs.ent2 -side left\ngrid $f.cb1.slowchecks $f.cb1.debugoutput -sticky nw\ngrid $f.cb1.haltexline $f.cb1.haltoverlap -sticky nw\ngrid $f.cb1.haltsuc $f.cb1.haltnosuc -sticky nw\ngrid $f.cb1.haltlargequal $f.cb1.fr -sticky nw\ngrid $f.cb1.haltnode -sticky nw\ngrid $f.cb1.haltseg -stick nw\ngrid $f.cb1.segs -stick w -row 4 -rowspan 2 -column 1\ngrid rowconfigure $f.cb1 3 -pad 8\ngrid anchor $f.cb1 center\nttk::checkbutton $f.cb1.showactivechart -text "Show Active Meshing-Chart" -variable stloptions.showactivechart -command { Ng_SetVisParameters; redraw }\ngrid $f.cb1.showactivechart\ngrid rowconfigure $f.cb1 3 -pad 8\ngrid rowconfigure $f.cb1 5 -pad 8\nset f $w.nb.debug\nttk::labelframe $f.cont -relief groove -borderwidth 3 -text "Debugging visualization"\npack $f.cont -fill x -pady 15\nttk::checkbutton $f.cont.multidrawing -text "Draw Meshing" -variable multithread_drawing\nttk::checkbutton $f.cont.multitestmode -text "Meshing Testmode" -variable multithread_testmode\nttk::button $f.cont.goon -text "Go On" -command { set multithread_pause 0 }\ngrid $f.cont.multidrawing -sticky nw\ngrid $f.cont.multitestmode -sticky nw\ngrid $f.cont.goon -row 0 -rowspan 2 -column 1 -sticky w\ngrid columnconfigure $f.cont 0 -pad 30\ngrid columnconfigure $f.cont 1 -pad 20\ngrid anchor $f.cont center\nglobal userlevel\nif { $userlevel < 3} {\n$w.nb delete insider\n$w.nb delete debug\n}\nttk::frame $w.bu\npack $w.bu -fill x -ipady 3\nttk::button $w.bu.apl -text "Apply" -command {\nNg_SetMeshingParameters\nNg_SetDebugParameters\n}\nttk::button $w.bu.ok -text "Done" -command {\nNg_SetMeshingParameters\nNg_SetDebugParameters\nwm withdraw .options_dlg\n}\npack $w.bu.apl $w.bu.ok -side left -expand yes\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Meshing Options"\nfocus .options_dlg\n}\n}\nmeshingoptionsdialog\nwm withdraw .options_dlg\nproc viewingoptionsdialog { } {\nglobal userlevel\nset w .viewopts_dlg\nif {[winfo exists .viewopts_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\npack [ttk::notebook $w.nb] -fill both -fill both -side top\n$w.nb add [ttk::frame $w.nb.general] -text "General" -underline 0\n$w.nb add [ttk::frame $w.nb.stl] -text "STL" -underline 0\n$w.nb add [ttk::frame $w.nb.occ] -text "IGES/STEP" -underline 0\n$w.nb add [ttk::frame $w.nb.mesh] -text "Mesh" -underline 0\n$w.nb add [ttk::frame $w.nb.light] -text "Light" -underline 0\n$w.nb add [ttk::frame $w.nb.edges] -text "Edges" -underline 0\n$w.nb add [ttk::frame $w.nb.misc] -text "Misc." -underline 3\nset f $w.nb.general\nttk::labelframe $f.gvop -text "General viewing options" -relief groove -borderwidth 3\npack $f.gvop -fill x -pady 15\nset f $f.gvop\nttk::checkbutton $f.backcol -text "White Background" \\\n-variable viewoptions.whitebackground \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.cross -text "Draw Coordinate Cross" \\\n-variable viewoptions.drawcoordinatecross \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.color -text "Draw Color-bar" \\\n-variable viewoptions.drawcolorbar \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.netgen -text "Draw Netgen-logo" \\\n-variable viewoptions.drawnetgenlogo \\\n-command { Ng_SetVisParameters; redraw }\ngrid $f.backcol -sticky nw\ngrid $f.cross -stick nw\ngrid $f.color -sticky nw\ngrid $f.netgen -sticky nw\nmenu $f.stylemenu\nttk::menubutton $f.style -menu $f.stylemenu -width 10 -text [ttk::style theme use]\ngrid $f.style -sticky nw\ngrid anchor $f center\nforeach theme [ttk::themes] {\n$f.stylemenu add command -label $theme \\\n-command " $f.style configure -text $theme; puts $theme ; ttk::setTheme $theme"\n}\nset f $w.nb.stl\nttk::labelframe $f.show -relief groove -borderwidth 3 -text "STL viewing options"\npack $f.show -fill x -pady 15\nttk::checkbutton $f.show.showtrias -text "Show STL-Triangles" \\\n-variable stloptions.showtrias -command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.show.showfilledtrias -text "Show Filled Triangles" \\\n-variable stloptions.showfilledtrias -command { Ng_SetVisParameters; redraw }\ngrid $f.show.showtrias $f.show.showfilledtrias -sticky nw\nttk::checkbutton $f.show.showactivechart -text "Show Active Meshing-Chart" \\\n-variable stloptions.showactivechart -command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.show.showedges -text "Show Edges" \\\n-variable stloptions.showedges -command { Ng_SetVisParameters; redraw }\ngrid $f.show.showactivechart $f.show.showedges -sticky nw\ngrid anchor $f.show center\nttk::checkbutton $f.show.showmarktrias -text "Show Chart Triangles" \\\n-variable stloptions.showmarktrias \\\n-command {set stldoctor.showfaces 0; Ng_STLDoctor; Ng_SetVisParameters; redraw }\nttk::checkbutton $f.show.showfaces -text "Show Faces" \\\n-variable stldoctor.showfaces \\\n-command {set stloptions.showmarktrias 0; Ng_STLDoctor; Ng_SetVisParameters; redraw}\ngrid $f.show.showmarktrias $f.show.showfaces -sticky nw\nttk::labelframe $f.fn -relief groove -borderwidth 3 -text "Chart/Face number"\npack $f.fn -fill x\nttk::label $f.fn.lab3 -text "Chart/Face number"\nttk::scale $f.fn.scale3 -orient horizontal -length 150 -from 0 -to 200 \\\n-variable stloptions.chartnumber -command "Ng_SetVisParameters; redraw;roundscale $f.fn.scale3 0"\nttk::entry $f.fn.ent3 -textvariable stloptions.chartnumber -width 3 -validate focus -takefocus 0 \\\n-validatecommand "Ng_SetVisParameters; redraw;my_validate %W [$f.fn.scale3 cget -from] [$f.fn.scale3 cget -to] %P 0" \\\n-invalidcommand "my_invalid %W;Ng_SetVisParameters; redraw;"\ngrid $f.fn.scale3 $f.fn.ent3 $f.fn.lab3 -sticky nw -padx 4\ntk::label $f.fn.lab -text "Chart/Face Offset:";\nttk::entry $f.fn.ent -width 3 \\\n-textvariable stloptions.chartnumberoffset -validate focus -takefocus 0 \\\n-validatecommand "my_validate %W 0 1e9 %P 0" \\\n-invalidcommand "my_invalid %W"\nttk::button $f.fn.btn_write_chart -text "Write selected chart to chart.stlb" -command {\nNg_STLDoctor writechart\n}\ngrid $f.fn.lab -sticky ne -padx 4\ngrid $f.fn.ent -sticky nw -padx 4 -row 1 -column 1\ngrid $f.fn.btn_write_chart -padx 4 -row 2 -column 1\ngrid anchor $f.fn center\nttk::labelframe $f.advstl -text "Advanced STL options" -relief groove -borderwidth 3\npack $f.advstl -fill x -pady 15\nttk::checkbutton $f.advstl.bu1 -text "Show Marked (Dirty) Triangles" \\\n-variable stldoctor.showmarkedtrigs \\\n-command {Ng_STLDoctor; redraw}\nttk::checkbutton $f.advstl.bu2 -text "show edge corner points" \\\n-variable stldoctor.showedgecornerpoints \\\n-command {Ng_STLDoctor; redraw}\nttk::checkbutton $f.advstl.bu3 -text "show touched triangle chart" \\\n-variable stldoctor.showtouchedtrigchart \\\n-command {set stldoctor.showfaces 0; set stloptions.showmarktrias 1; \\\nNg_STLDoctor; Ng_SetVisParameters; redraw}\nttk::checkbutton $f.advstl.bu4 -text "draw meshed edges" \\\n-variable stldoctor.drawmeshededges \\\n-command {Ng_STLDoctor;}\nttk::checkbutton $f.advstl.bu5 -text "select with mouse" \\\n-variable stldoctor.selectwithmouse\ngrid $f.advstl.bu1 -stick nw\ngrid $f.advstl.bu2 -sticky nw\ngrid $f.advstl.bu3 -stick nw\ngrid $f.advstl.bu4 -stick nw\ngrid $f.advstl.bu5 -stick nw\ngrid anchor $f.advstl center\nttk::frame $f.advstl.tbn\nttk::label $f.advstl.tbn.lab -text "Select triangle by number";\nttk::entry $f.advstl.tbn.ent -width 5 \\\n-textvariable stldoctor.selecttrig\npack $f.advstl.tbn.lab $f.advstl.tbn.ent -padx 4 -side left\ngrid $f.advstl.tbn -sticky nw\ngrid anchor $f.advstl center\ngrid rowconfigure $f.advstl 4 -pad 8\nttk::labelframe $f.vc -relief groove -borderwidth 3 -text "Vicinity options"\npack $f.vc -fill x -pady 15\nttk::checkbutton $f.vc.bu -text "show vicinity" \\\n-variable stldoctor.showvicinity \\\n-command {Ng_STLDoctor vicinity; redraw}\nttk::label $f.vc.lab -text "vicinity size";\nttk::scale $f.vc.scale -orient horizontal -length 150 -from 0 -to 200 \\\n-variable stldoctor.vicinity \\\n-takefocus 0 \\\n-command "roundscale $f.vc.scale 0; Ng_STLDoctor vicinity; redraw"\nttk::entry $f.vc.ent -width 4 -textvariable stldoctor.vicinity -validate focus \\\n-takefocus 0 -validatecommand "Ng_STLDoctor vicinity; redraw;my_validate %W [$f.vc.scale cget -from] [$f.vc.scale cget -to] %P 0" \\\n-invalidcommand "my_invalid %W;Ng_STLDoctor vicinity; redraw"\ngrid $f.vc.bu -stick nw -columnspan 3 -column 0\ngrid $f.vc.scale $f.vc.ent $f.vc.lab -sticky nw -padx 4\ngrid anchor $f.vc center\nset f $w.nb.occ\nttk::labelframe $f.occframe -text "IGES/STEP options" -relief groove -borderwidth 3\npack $f.occframe -fill x -pady 15 -ipady 8\nttk::checkbutton $f.occframe.occshowsurfaces -text "Show surfaces " \\\n-variable occoptions.showsurfaces \\\n-command { Ng_SetOCCVisParameters; redraw }\nttk::checkbutton $f.occframe.occshowedges -text "Show edges " \\\n-variable occoptions.showedges \\\n-command { Ng_SetOCCVisParameters; redraw }\ngrid $f.occframe.occshowsurfaces $f.occframe.occshowedges -sticky nw -padx 4\ngrid anchor $f.occframe center\nttk::button $f.occframe.btn -text "Rebuild visualization data" \\\n-command {\nNg_SetOCCVisParameters\nNg_OCCCommand buildvisualizationmesh\nredraw\n}\nttk::frame $f.occframe.vssm\nttk::label $f.occframe.vssm.lab -text "Visulization smoothness"\nttk::spinbox $f.occframe.vssm.sp -textvariable occoptions.deflection \\\n-from 0.1 -to 3 -increment 0.1 -width 4 -command { catch Ng_SetOCCVisParameters } \\\n-validate focus -validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W"\npack $f.occframe.vssm.lab $f.occframe.vssm.sp -side left -padx 4\ngrid $f.occframe.vssm -sticky nw -columnspan 2 -column 0 -pady 8\ngrid $f.occframe.btn -columnspan 2 -column 0 -sticky n\nttk::labelframe $f.occframe1 -relief groove -borderwidth 3 -text "ACIS visulization / construction"\npack $f.occframe1 -fill x -pady 15 -ipady 8\nttk::label $f.occframe1.lab1 -text "Show solid (0 for all)"\nttk::spinbox $f.occframe1.sp1 -textvariable occoptions.showsolidnr \\\n-from 0 -to 999 -increment 1 -width 4 -command { catch Ng_SetOCCVisParameters;redraw } \\\n-validate focus -validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W"\nttk::label $f.occframe1.lab2 -text "Show solid 2"\nttk::spinbox $f.occframe1.sp2 -textvariable occoptions.showsolidnr2 \\\n-from 0 -to 999 -increment 1 -width 4 -command { catch Ng_SetOCCVisParameters;redraw } \\\n-validate focus -validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W"\nttk::button $f.occframe1.subtract -text "Subtract (2 minus 1)" \\\n-command {\nNg_ACISCommand subtract ${occoptions.showsolidnr} ${occoptions.showsolidnr2}\nredraw\n}\nttk::button $f.occframe1.combine -text "Combine all" \\\n-command {\nNg_ACISCommand combineall\nredraw\n}\ngrid $f.occframe1.lab1 -row 0 -column 0 -sticky ne\ngrid $f.occframe1.sp1 -row 0 -column 1 -sticky nw\ngrid $f.occframe1.lab2 -row 1 -column 0 -sticky ne\ngrid $f.occframe1.sp2 -row 1 -column 1 -sticky nw\ngrid $f.occframe1.combine -columnspan 2 -column 0 -sticky n\ngrid anchor $f.occframe1 center\nset f $w.nb.mesh\nttk::labelframe $f.center -relief groove -borderwidth 3 -text "how shall i name you?"\npack $f.center -fill x -pady 15\nttk::button $f.center.lab1 -text "Set Center Point" \\\n-command { Ng_SetVisParameters; Ng_Center; redraw }\nttk::entry $f.center.ent1 -width 5 \\\n-textvariable viewoptions.centerpoint -validate focus \\\n-validatecommand "my_validate %W 0 1e9 %P 0" \\\n-invalidcommand "my_invalid %W"\ngrid $f.center.ent1 $f.center.lab1 -padx 4 -pady 4 -sticky nw\nttk::button $f.center.lab2 -text "Draw Element" \\\n-command { Ng_SetVisParameters; Ng_ZoomAll; redraw }\nttk::entry $f.center.ent2 -width 5 \\\n-textvariable viewoptions.drawelement -validate focus \\\n-validatecommand "my_validate %W 0 1e9 %P 0" \\\n-invalidcommand "my_invalid %W"\ngrid $f.center.ent2 $f.center.lab2 -padx 4 -pady 4 -sticky nw\ngrid anchor $f.center center\nttk::labelframe $f.meshframe -text "Mesh visualization options" -relief groove -borderwidth 3\npack $f.meshframe -fill x -pady 15\nset f $f.meshframe\nttk::checkbutton $f.showcolor -text "Meshsize Visualization" \\\n-variable viewoptions.colormeshsize \\\n-command { Ng_SetVisParameters;redraw; }\nttk::checkbutton $f.showfilledtrigs -text "Show filled triangles" \\\n-variable viewoptions.drawfilledtrigs \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showedges -text "Show edges" \\\n-variable viewoptions.drawedges \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showoutline -text "Show Triangle Outline" \\\n-variable viewoptions.drawoutline \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showbadels -text "Show bad elements" \\\n-variable viewoptions.drawbadels \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showprisms -text "Show prisms" \\\n-variable viewoptions.drawprisms \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showpyramids -text "Show pyramids" \\\n-variable viewoptions.drawpyramids \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showhexes -text "Show hexes" \\\n-variable viewoptions.drawhexes \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showidentified -text "Show identified points" \\\n-variable viewoptions.drawidentified \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showmetispartition -text "Show METIS Partition" \\\n-variable viewoptions.drawmetispartition \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showpointnumbers -text "Show Point-numbers" \\\n-variable viewoptions.drawpointnumbers \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showedgenumbers -text "Show Edge-numbers" \\\n-variable viewoptions.drawedgenumbers \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showfacenumbers -text "Show Face-numbers" \\\n-variable viewoptions.drawfacenumbers \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showelementnumbers -text "Show Element-numbers" \\\n-variable viewoptions.drawelementnumbers \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showsegmentnumbers -text "Show Segment-numbers" \\\n-variable viewoptions.drawsegmentnumbers \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showsurfaceelementnumbers -text "Show Surfaceelement-numbers" \\\n-variable viewoptions.drawsurfaceelementnumbers \\\n-command { Ng_SetVisParameters; redraw }\nttk::frame $f.frametets\nttk::checkbutton $f.frametets.showtets -text "" \\\n-variable viewoptions.drawtets \\\n-command { Ng_SetVisParameters; redraw }\nttk::label $f.frametets.label -text "\\Show Tets\\rin domain"\nttk::spinbox $f.frametets.showtetsdomain -from 0 -to 500 -increment 1 -width 3 \\\n-textvariable viewoptions.drawtetsdomain -validate focus \\\n-command "Ng_SetVisParameters; redraw;" \\\n-validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W"\nttk::label $f.frametets.label1 -text "Subdivision"\nttk::spinbox $f.frametets.subdiv -from 0 -to 8 -increment 1 -width 3 \\\n-textvariable visoptions.subdivisions -validate focus \\\n-command { Ng_SetVisParameters; Ng_Vis_Set parameters; Ng_SetNextTimeStamp; redraw } \\\n-validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W"\nttk::label $f.frametets.label2 -text "Show surface\\rof domain"\nttk::spinbox $f.frametets.showdomain -from 0 -to 50 -increment 1 -width 3 \\\n-textvariable viewoptions.drawdomainsurf -validate focus \\\n-command { Ng_SetVisParameters; Ng_Vis_Set parameters; redraw } \\\n-validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W"\ngrid $f.frametets.showtets $f.frametets.label $f.frametets.showtetsdomain -sticky w\ngrid x $f.frametets.label2 $f.frametets.showdomain -stick w\ngrid x $f.frametets.label1 $f.frametets.subdiv -sticky w\ngrid $f.showfilledtrigs $f.showoutline -sticky nw\ngrid $f.showedges $f.showbadels -sticky nw\ngrid $f.showpointnumbers $f.showedgenumbers -sticky nw\ngrid $f.showfacenumbers $f.showelementnumbers -sticky nw\ngrid $f.showsurfaceelementnumbers $f.showsegmentnumbers -sticky nw\ngrid $f.showmetispartition $f.showidentified -sticky nw\ngrid $f.showcolor $f.showpyramids -sticky nw\ngrid $f.showprisms $f.showhexes -sticky nw\ngrid $f.frametets -sticky n -columnspan 2 -column 0 -pady 8\ngrid anchor $f center\nset f $w.nb.mesh\nttk::labelframe $f.fshrink -text "Element visualization" -relief groove -borderwidth 3\nttk::label $f.fshrink.lab -text "Shrink elements"\nttk::scale $f.fshrink.scale -orient horizontal -length 200 -from 0 -to 1.0001 \\\n-command "roundscale $f.fshrink.scale 2;Ng_SetVisParameters; after idle redraw" \\\n-variable viewoptions.shrink\nttk::entry $f.fshrink.entry -textvariable viewoptions.shrink -width 4 -validate focus \\\n-takefocus 0 -validatecommand "Ng_SetVisParameters; after idle redraw;my_validate %W [$f.fshrink.scale cget -from] [$f.fshrink.scale cget -to] %P 2" \\\n-invalidcommand "my_invalid %W;Ng_SetVisParameters; after idle redraw;"\npack $f.fshrink -fill x -ipady 8\ngrid $f.fshrink.scale $f.fshrink.entry $f.fshrink.lab -padx 4\ngrid anchor $f.fshrink center\nset f $w.nb.light\nttk::labelframe $f.main -text "Lighting options" -relief groove -borderwidth 3\npack $f.main -fill x -pady 15\nset f $f.main\nttk::label $f.lab1 -text "Ambient Light"\nttk::scale $f.scale1 -orient horizontal -length 200 -from 0 -to 1 \\\n-command "roundscale $f.scale1 2; Ng_SetVisParameters; redraw" \\\n-variable viewoptions.light.amb\nttk::entry $f.ent1 -textvariable viewoptions.light.amb -validate focus -width 4 \\\n-validatecommand " Ng_SetVisParameters; redraw;my_validate %W [$f.scale1 cget -from] [$f.scale1 cget -to] %P 2" \\\n-invalidcommand "my_invalid %W;Ng_SetVisParameters; redraw;"\nttk::label $f.lab2 -text "Diffuse Light"\nttk::scale $f.scale2 -orient horizontal -length 200 -from 0 -to 1 \\\n-command "roundscale $f.scale2 2; Ng_SetVisParameters; redraw " \\\n-variable viewoptions.light.diff\nttk::entry $f.ent2 -textvariable viewoptions.light.diff -validate focus -width 4 \\\n-validatecommand " Ng_SetVisParameters; redraw;my_validate %W [$f.scale2 cget -from] [$f.scale2 cget -to] %P 2" \\\n-invalidcommand "my_invalid %W;Ng_SetVisParameters; redraw;"\nttk::label $f.lab3 -text "Specular Light"\nttk::scale $f.scale3 -orient horizontal -length 200 -from 0 -to 1 \\\n-command "roundscale $f.scale3 2; Ng_SetVisParameters; redraw " \\\n-variable viewoptions.light.spec\nttk::entry $f.ent3 -textvariable viewoptions.light.spec -validate focus -width 4 \\\n-validatecommand " Ng_SetVisParameters; redraw;my_validate %W [$f.scale3 cget -from] [$f.scale3 cget -to] %P 2" \\\n-invalidcommand "my_invalid %W;Ng_SetVisParameters; redraw;"\ngrid $f.scale1 $f.ent1 $f.lab1 -sticky nw -padx 4 -pady 8\ngrid $f.scale2 $f.ent2 $f.lab2 -sticky nw -padx 4 -pady 8\ngrid $f.scale3 $f.ent3 $f.lab3 -sticky nw -padx 4 -pady 8\ngrid anchor $f center\nset f $w.nb.light\nttk::labelframe $f.main1 -text "Material options" -relief groove -borderwidth 3\npack $f.main1 -fill x -pady 15\nset f $f.main1\nttk::label $f.lab4 -text "Material Shininess"\nttk::scale $f.scale4 -orient horizontal -length 200 -from 0 -to 128 \\\n-command "roundscale $f.scale4 0; Ng_SetVisParameters; redraw " \\\n-variable viewoptions.mat.shininess\nttk::entry $f.ent4 -textvariable viewoptions.mat.shininess -validate focus -width 4 \\\n-validatecommand " Ng_SetVisParameters; redraw;my_validate %W [$f.scale4 cget -from] [$f.scale4 cget -to] %P 0" \\\n-invalidcommand "my_invalid %W;Ng_SetVisParameters; redraw;"\nttk::label $f.lab5 -text "Material Transparency"\nttk::scale $f.scale5 -orient horizontal -length 200 -from 0 -to 1 \\\n-command "roundscale $f.scale5 2; Ng_SetVisParameters; redraw " \\\n-variable viewoptions.mat.transp\nttk::entry $f.ent5 -textvariable viewoptions.mat.transp -validate focus -width 4 \\\n-validatecommand " Ng_SetVisParameters; redraw;my_validate %W [$f.scale5 cget -from] [$f.scale5 cget -to] %P 2" \\\n-invalidcommand "my_invalid %W;Ng_SetVisParameters; redraw;"\ngrid $f.scale4 $f.ent4 $f.lab4 -sticky nw -padx 4 -pady 8\ngrid $f.scale5 $f.ent5 $f.lab5 -sticky nw -padx 4 -pady 8\ngrid anchor $f center\nset f $w.nb.edges\nttk::labelframe $f.main -text "Edge viewing options" -relief groove -borderwidth 3\npack $f.main -fill x -pady 15\nset f $f.main\nttk::frame $f.helper\npack $f.helper -anchor center\nset f $f.helper\nttk::checkbutton $f.showedges -text "Show Edges" \\\n-variable viewoptions.drawededges \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showpoints -text "Show Points" \\\n-variable viewoptions.drawedpoints \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showpointnrs -text "Show Points Nrs" \\\n-variable viewoptions.drawedpointnrs \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.showtang -text "Show CP Tangents" \\\n-variable viewoptions.drawedtangents \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.drawedgenrs -text "Show Edge Nrs" \\\n-variable viewoptions.drawededgenrs \\\n-command { Ng_SetVisParameters; redraw }\npack $f.showedges $f.showpoints $f.showpointnrs $f.showtang $f.drawedgenrs -anchor w\nset f $w.nb.edges\nttk::labelframe $f.main1 -text "Center point" -relief groove -borderwidth 3\npack $f.main1 -fill x -pady 15\nset f $f.main1\nttk::frame $f.center\npack $f.center -anchor center\nttk::button $f.center.btn -text "Set Center Point" \\\n-command { Ng_SetVisParameters; Ng_Center; redraw }\nttk::entry $f.center.ent -width 5 -textvariable viewoptions.centerpoint -validate focus \\\n-validatecommand "my_validate %W 0 1e9 %P 0" \\\n-invalidcommand "my_invalid %W"\ngrid $f.center.ent $f.center.btn -sticky nw -padx 4\nttk::label $f.center.lab1 -text "SpecPoint Veclen"\nttk::entry $f.center.ent1 -width 5 -textvariable viewoptions.specpointvlen -validate focus \\\n-validatecommand "my_validate %W 0 1e9 %P 4" \\\n-invalidcommand "my_invalid %W"\ngrid $f.center.ent1 $f.center.lab1 -sticky nw -padx 4\nset f $w.nb.misc\nttk::labelframe $f.point -relief groove -borderwidth 3 -text "Special point"\nttk::frame $f.point.dp\nttk::checkbutton $f.point.dp.drawpoint -text "Draw Point" \\\n-variable viewoptions.drawspecpoint \\\n-command { Ng_SetVisParameters; redraw }\nttk::entry $f.point.dp.px -width 8 -textvariable viewoptions.specpointx -validate focus \\\n-validatecommand "my_validate %W -1e9 1e9 %P 10" \\\n-invalidcommand "my_invalid %W"\nttk::entry $f.point.dp.py -width 8 -textvariable viewoptions.specpointy -validate focus \\\n-validatecommand "my_validate %W -1e9 1e9 %P 10" \\\n-invalidcommand "my_invalid %W"\nttk::entry $f.point.dp.pz -width 8 -textvariable viewoptions.specpointz -validate focus \\\n-validatecommand "my_validate %W -1e9 1e9 %P 10" \\\n-invalidcommand "my_invalid %W"\ngrid $f.point.dp.drawpoint $f.point.dp.px $f.point.dp.py $f.point.dp.pz -sticky nw -padx 4;\nttk::checkbutton $f.point.dp.center -text "Use as Center" \\\n-variable viewoptions.usecentercoords \\\n-command {\nif { ${viewoptions.usecentercoords} } {\nset viewoptions.centerx ${viewoptions.specpointx}\nset viewoptions.centery ${viewoptions.specpointy}\nset viewoptions.centerz ${viewoptions.specpointz}\nNg_SetVisParameters; Ng_Center\nredraw\n} {\nNg_SetVisParameters\n}\n}\ngrid $f.point.dp.center -sticky nw -padx 4\npack $f.point.dp\npack $f.point -fill x -ipady 3 -pady 15\nttk::frame $w.bu\npack $w.bu -fill x -ipady 3\nttk::button $w.bu.done -text "Done" -command {\nNg_SetVisParameters;\nredraw\ndestroy .viewopts_dlg\n}\nttk::button $w.bu.apply -text "Apply" -command {\nNg_SetVisParameters;\nredraw\n}\npack $w.bu.apply $w.bu.done -expand yes -side left\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Viewing options"\nfocus $w\n}\n}\nproc clipplanecommand { { optionalvar 0 } } {\nNg_SetVisParameters\nafter idle redraw\n}\nset clippingdialog_pop1 0\nset clippingdialog_pop2 0\nset clippingdialog_pop3 0\nset clippingdialog_pop4 0\nproc clippingdialog { } {\nglobal clippingdialog_pop1\nglobal clippingdialog_pop2\nglobal clippingdialog_pop3\nglobal clippingdialog_pop4\nset clippingdialog_pop1 1\nset clippingdialog_pop2 1\nset clippingdialog_pop3 1\nset clippingdialog_pop4 1\nset w .clipping_dlg\nif {[winfo exists .clipping_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\nttk::frame $w.background\npack $w.background -fill x -fill y\nset w $w.background\nttk::labelframe $w.main -text "Visual clipping" -relief groove -borderwidth 3\npack $w.main -fill x -pady 15\nset w $w.main\nttk::label $w.lab1 -text "Normal x"\nttk::scale $w.scale1 -orient horizontal -length 300 -from -1 -to 1 \\\n-variable viewoptions.clipping.nx \\\n-command "roundscale $w.scale1 2; clipplanecommand "\nttk::entry $w.entry1 -width 5 -textvariable viewoptions.clipping.nx \\\n-validate focus -validatecommand " clipplanecommand;my_validate %W [$w.scale1 cget -from] [$w.scale1 cget -to] %P 2" \\\n-invalidcommand "my_invalid %W; clipplanecommand"\nttk::label $w.lab2 -text "Normal y"\nttk::scale $w.scale2 -orient horizontal -length 300 -from -1 -to 1 \\\n-variable viewoptions.clipping.ny \\\n-command "roundscale $w.scale2 2; clipplanecommand "\nttk::entry $w.entry2 -width 5 -textvariable viewoptions.clipping.ny \\\n-validate focus -validatecommand " clipplanecommand;my_validate %W [$w.scale2 cget -from] [$w.scale2 cget -to] %P 2" \\\n-invalidcommand "my_invalid $w.entry2;clipplanecommand"\nttk::label $w.lab3 -text "Normal z"\nttk::scale $w.scale3 -orient horizontal -length 300 -from -1 -to 1 \\\n-variable viewoptions.clipping.nz \\\n-command "roundscale $w.scale3 2; clipplanecommand "\nttk::entry $w.entry3 -width 5 -textvariable viewoptions.clipping.nz \\\n-validate focus -validatecommand " clipplanecommand;my_validate %W [$w.scale3 cget -from] [$w.scale3 cget -to] %P 2" \\\n-invalidcommand "my_invalid %W;clipplanecommand"\nttk::label $w.lab4 -text "Distance"\nttk::scale $w.scale4 -orient horizontal -length 300 -from -1 -to 1.001 \\\n-variable viewoptions.clipping.dist \\\n-command "roundscale $w.scale4 3; clipplanecommand "\nttk::entry $w.entry4 -width 5 -textvariable viewoptions.clipping.dist \\\n-validate focus -validatecommand " clipplanecommand;my_validate %W [$w.scale4 cget -from] [$w.scale4 cget -to] %P 3" \\\n-invalidcommand "my_invalid %W;clipplanecommand"\nproc my_Press {w x y} {\nset inc [expr {([$w get $x $y] <= [$w get]) ? -1 : 1}]\nttk::Repeatedly ttk::scale::Increment $w [expr 0.001*$inc]\n}\nbind $w.scale4 <ButtonPress-1> { if { [string match *slider [%W identify %x %y]] == 0 } { my_Press %W %x %y;break } }\nbind $w.scale4 <ButtonRelease-1> {ttk::scale::Release %W %x %y}\nttk::label $w.lab5 -text "Additional\\rDistance"\nttk::scale $w.scale5 -orient horizontal -length 300 -from -1 -to 1.001 \\\n-variable viewoptions.clipping.dist2 \\\n-command "roundscale $w.scale5 3; clipplanecommand "\nttk::entry $w.entry5 -width 5 -textvariable viewoptions.clipping.dist2 \\\n-validate focus -validatecommand " clipplanecommand;my_validate %W [$w.scale5 cget -from] [$w.scale5 cget -to] %P 3" \\\n-invalidcommand "my_invalid %W;clipplanecommand"\nbind $w.scale5 <ButtonPress-1> { if { [string match *slider [%W identify %x %y]] == 0 } { my_Press %W %x %y;break } }\nbind $w.scale5 <ButtonRelease-1> {ttk::scale::Release %W %x %y}\nttk::label $w.clipdomainlabel -text "Clip only domain"\nttk::spinbox $w.clipdomainspinb -from 0 -to 500 -increment 1 -width 3 \\\n-textvariable viewoptions.clipping.onlydomain -validate focus \\\n-command {clipplanecommand;} \\\n-validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W"\nttk::label $w.donotclipdomainlabel -text "Do not clip domain"\nttk::spinbox $w.donotclipdomainspinb -from 0 -to 500 -increment 1 -width 3 \\\n-textvariable viewoptions.clipping.notdomain -validate focus \\\n-command "clipplanecommand" \\\n-validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W"\ngrid $w.scale1 $w.entry1 $w.lab1 -sticky nw -padx 4 -pady 14\ngrid $w.scale2 $w.entry2 $w.lab2 -sticky nw -padx 4 -pady 14\ngrid $w.scale3 $w.entry3 $w.lab3 -sticky nw -padx 4 -pady 14\ngrid $w.scale4 $w.entry4 $w.lab4 -sticky nw -padx 4 -pady 14\ngrid $w.scale5 $w.entry5 $w.lab5 -sticky w -padx 4 -pady 14\ngrid $w.clipdomainlabel -sticky ne -padx 4 -pady 14\ngrid $w.clipdomainspinb -sticky nw -padx 4 -pady 14 -column 1 -row 5\ngrid $w.donotclipdomainlabel -sticky ne -padx 4 -pady 14\ngrid $w.donotclipdomainspinb -sticky nw -padx 4 -pady 14 -column 1 -row 6\ngrid anchor $w center\nset w .clipping_dlg.background.main\nttk::checkbutton $w.cb1 -text "Enable clipping" \\\n-variable viewoptions.clipping.enable \\\n-command { Ng_SetVisParameters; redraw }\ngrid $w.cb1 -columnspan 2 -sticky ne\nttk::frame $w.bu\ngrid $w.bu;\nttk::button $w.cancle -text "Done" -command "destroy .clipping_dlg"\ngrid $w.cancle -columnspan 3 -pady 16\nset w .clipping_dlg\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Clipping Plane"\nfocus $w\nclipplanecommand\n}\n}\nproc refinementdialog { } {\nset w .refinement_dlg\nif {[winfo exists .refinement_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\nglobal localh\nset localh 1\nttk::frame $w.meshsize\nttk::label $w.meshsize.l1 -text "max mesh-size: "\nttk::spinbox $w.meshsize.sp1 -from 1e-6 -to 1e6 -textvariable options.meshsize -validate focus -validatecommand "my_validatespinbox %W %P 4" \\\n-invalidcommand "my_invalidspinbox %W" -width 6 -increment 0.1\nttk::frame $w.meshsizeloc\nttk::label $w.meshsizeloc.l1 -text "local mesh-size: "\nttk::spinbox $w.meshsizeloc.sp1 -from 1e-6 -to 1e6 -textvariable localh -validate focus -validatecommand "my_validatespinbox %W %P 4" \\\n-invalidcommand "my_invalidspinbox %W" -width 6 -increment 0.1\npack $w.meshsize\npack $w.meshsizeloc\ngrid $w.meshsize.l1 $w.meshsize.sp1\ngrid $w.meshsizeloc.l1 $w.meshsizeloc.sp1\nttk::button $w.restface -text "Restrict H at face" \\\n-command {\n.refinement_dlg.meshsize invoke\n.refinement_dlg.loch invoke\nNg_RestrictH face $localh\n}\nttk::button $w.restedge -text "Restrict H at edge" \\\n-command {\n.refinement_dlg.meshsize invoke\n.refinement_dlg.loch invoke\nNg_RestrictH edge $localh\n}\nttk::button $w.restelement -text "Restrict H at element" \\\n-command {\n.refinement_dlg.meshsize invoke\n.refinement_dlg.loch invoke\nNg_RestrictH element $localh\n}\nttk::button $w.restpoint -text "Restrict H at point" \\\n-command {\n.refinement_dlg.meshsize invoke\n.refinement_dlg.loch invoke\nNg_RestrictH point $localh\n}\npack $w.restface $w.restedge $w.restelement $w.restpoint\nttk::button $w.anisoedge -text "Declare Anisotropic edge" \\\n-command {\nNg_Anisotropy edge\n}\npack $w.anisoedge\nframe $w.bu\npack $w.bu -fill x -ipady 3\nttk::button $w.bu.cancle -text "Done" -command "destroy .refinement_dlg"\nttk::button $w.bu.refine -text "Refine" \\\n-command {\nset oldnp 0; set newnp $status_np;\nwhile { $oldnp < $newnp } {\nset level [expr $level+1]\nNg_Bisect;\nNg_HighOrder ${options.elementorder}\nNg_ReadStatus;\nredraw;\nset oldnp $newnp\nset newnp $status_np\nputs "oldnp $oldnp newnp $newnp"\n}\n}\nttk::button $w.bu.zrefine -text "Z-Refine" \\\n-command { Ng_ZRefinement; Ng_ReadStatus; redraw; }\npack $w.bu.zrefine $w.bu.refine $w.bu.cancle -expand yes -side left\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Select Refinement"\nfocus $w\n}\n}\nproc bcpropdialog { } {\nset w .bcprop_dlg\nif {[winfo exists .bcprop_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\n} {\ntoplevel $w\nttk::frame $w.face -borderwidth 3\npack $w.face -fill x\nttk::label $w.face.lab -text "face index:"\nttk::label $w.face.ent -text 1\nttk::button $w.face.next -text "next" -command {\nset w .bcprop_dlg;\nset facenr [$w.face.ent cget -text]\nif {$facenr == [Ng_BCProp getnfd]} {\nset facenr 1\n} {\nset facenr [expr $facenr + 1]\n}\n$w.face.ent configure -text $facenr\nNg_BCProp setactive $facenr\nset bcnr [Ng_BCProp getbc $facenr]\n$w.bc.ent delete 0 end\n$w.bc.ent insert 0 $bcnr\nredraw\n}\nttk::button $w.face.prev -text "prev" -command {\nset w .bcprop_dlg;\nset facenr [$w.face.ent cget -text]\nif {$facenr == 1} {\nset facenr [Ng_BCProp getnfd]\n} {\nset facenr [expr $facenr - 1]\n}\n$w.face.ent configure -text $facenr\nNg_BCProp setactive $facenr\nset bcnr [Ng_BCProp getbc $facenr]\n$w.bc.ent delete 0 end\n$w.bc.ent insert 0 $bcnr\nredraw\n}\npack $w.face.lab $w.face.ent $w.face.prev $w.face.next -side left\nttk::frame $w.bc -borderwidth 3\npack $w.bc -fill x\nttk::label $w.bc.lab -text "bc property:"\nentry $w.bc.ent -width 5 -relief sunken\nttk::button $w.bc.but -text "change" -command {\nset w .bcprop_dlg;\nNg_BCProp setbc [$w.face.ent cget -text] [$w.bc.ent get];\n}\nttk::button $w.bc.but2 -text "all" -command {\nset w .bcprop_dlg;\nNg_BCProp setall [$w.bc.ent get];\n}\npack $w.bc.lab $w.bc.ent $w.bc.but $w.bc.but2 -side left -expand yes\nttk::frame $w.bcname -borderwidth 3\npack $w.bcname -fill x\nttk::label $w.bcname.lab -text "bc name:"\nttk::label $w.bcname.ent -text "-"\npack $w.bcname.lab $w.bcname.ent -side left -expand yes\nttk::frame $w.bu\npack $w.bu -fill x -ipady 3\nttk::button $w.bu.close -text "Close" -command { destroy .bcprop_dlg }\npack $w.bu.close -expand yes -side left\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Boundary Conditions"\n}\nfocus $w\nset facenr [Ng_BCProp getactive]\n$w.face.ent configure -text $facenr\nset bcnr [Ng_BCProp getbc $facenr]\n$w.bc.ent delete 0 end\n$w.bc.ent insert 0 $bcnr\nset bcname [Ng_BCProp getbcname $facenr]\n$w.bcname.ent configure -text $bcname\n}\nproc currmeshcoloursdialog { } {\nset w .currmeshcolours_dlg\nif {[winfo exists .currmeshcolours_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\nglobal facecolslist\nframe $w.facecols -borderwidth 3\nlistbox $w.facecols.list -yscroll "$w.facecols.scroll set" -selectmode single -setgrid 1 -width 32 -height 12\nscrollbar $w.facecols.scroll -command "$w.facecols.list yview"\npack $w.facecols.scroll -side right -fill y\npack $w.facecols.list -side left -expand yes -fill both\nNg_CurrentFaceColours getcolours facecolslist\nset i 1\nforeach el $facecolslist {\nset hel [format "%d: (%.4f %.4f %.4f)" $i [ lindex $el 0 ] [ lindex $el 1 ] [ lindex $el 2 ]]\nincr i\n$w.facecols.list insert end $hel }\nframe $w.bu1 -borderwidth 3\nttk::button $w.bu1.showonly -text "show only" -command {\nNg_CurrentFaceColours showonly [.currmeshcolours_dlg.facecols.list curselection]\nredraw\n}\nttk::button $w.bu1.hideonly -text "hide only" -command {\nNg_CurrentFaceColours hideonly [.currmeshcolours_dlg.facecols.list curselection]\nredraw\n}\nttk::button $w.bu1.showalso -text "show" -command {\nNg_CurrentFaceColours showalso [.currmeshcolours_dlg.facecols.list curselection]\nredraw\n}\nttk::button $w.bu1.hidealso -text "hide" -command {\nNg_CurrentFaceColours hidealso [.currmeshcolours_dlg.facecols.list curselection]\nredraw\n}\npack $w.bu1.showonly $w.bu1.hideonly $w.bu1.showalso $w.bu1.hidealso -expand yes -fill x -padx 2 -pady 2 -side left\nframe $w.bu2\nttk::button $w.bu2.showall -text "show all" -command {\nNg_CurrentFaceColours showall\nredraw\n}\nttk::button $w.bu2.hideall -text "hide all" -command {\nNg_CurrentFaceColours hideall\nredraw\n}\npack $w.bu2.showall $w.bu2.hideall -expand yes -fill x -padx 2 -pady 2 -side left\nframe $w.bu3\nttk::button $w.bu3.close -text "close" -command {\ndestroy .currmeshcolours_dlg\n}\npack $w.bu3.close -expand yes -fill x -pady 3 -side right\npack $w.facecols -side top -expand yes -fill x -fill y\npack $w.bu3 -side bottom\npack $w.bu2 -side bottom\npack $w.bu1 -expand yes -fill x -side left\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Inspect Mesh Colours"\nfocus $w\n}\n}\nproc surfacemeshsizedialog { } {\nset w .surfacemeshsize_dlg\nif {[winfo exists .surfacemeshsize_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\n} {\ntoplevel $w\nframe $w.face -borderwidth 3\npack $w.face -fill x -padx 5\nttk::label $w.face.lab -text "face index:"\nttk::label $w.face.ent -text 1\nttk::button $w.face.next -text "next" -command {\nset w .surfacemeshsize_dlg;\nset facenr [$w.face.ent cget -text]\nif {$facenr == [Ng_SurfaceMeshSize getnfd]} {\nset facenr 1\n} {\nset facenr [expr $facenr + 1]\n}\n$w.face.ent configure -text $facenr\nNg_SurfaceMeshSize setactive $facenr\nset surfms [Ng_SurfaceMeshSize getsurfms $facenr]\n$w.sms.ent delete 0 end\n$w.sms.ent insert 0 $surfms\nredraw\n}\nttk::button $w.face.prev -text "prev" -command {\nset w .surfacemeshsize_dlg;\nset facenr [$w.face.ent cget -text]\nif {$facenr == 1} {\nset facenr [Ng_SurfaceMeshSize getnfd]\n} {\nset facenr [expr $facenr - 1]\n}\n$w.face.ent configure -text $facenr\nNg_SurfaceMeshSize setactive $facenr\nset surfms [Ng_SurfaceMeshSize getsurfms $facenr]\n$w.sms.ent delete 0 end\n$w.sms.ent insert 0 $surfms\nredraw\n}\npack $w.face.lab $w.face.ent $w.face.prev $w.face.next -side left\nframe $w.sms -borderwidth 3\npack $w.sms -fill x\nttk::label $w.sms.lab -text "max mesh size:"\nentry $w.sms.ent -width 8 -relief sunken\nttk::button $w.sms.but -text "change" -command {\nset w .surfacemeshsize_dlg;\nNg_SurfaceMeshSize setsurfms [$w.face.ent cget -text] [$w.sms.ent get];\n}\nttk::button $w.sms.but2 -text "all" -command {\nset w .surfacemeshsize_dlg;\nNg_SurfaceMeshSize setall [$w.sms.ent get];\n}\npack $w.sms.lab $w.sms.ent $w.sms.but $w.sms.but2 -side left -padx 5 -expand yes\nframe $w.bu\npack $w.bu -fill x -ipady 3\nttk::button $w.bu.close -text "Close" -command { destroy .surfacemeshsize_dlg }\npack $w.bu.close -expand yes -side left\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Edit Surface Mesh Size"\n}\nfocus $w\nset facenr [Ng_SurfaceMeshSize getactive]\n$w.face.ent configure -text $facenr\nset surfms [Ng_SurfaceMeshSize getsurfms $facenr]\n$w.sms.ent delete 0 end\n$w.sms.ent insert 0 $surfms\n}\nproc METISdialog { } {\nset w .metis_dlg\nset w.parts 64\nif {[winfo exists .metis_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\n} {\ntoplevel $w\nframe $w.a -borderwidth 0\nframe $w.b -borderwidth 0\npack $w.a $w.b\nttk::label $w.a.lab -text "Number of partitions:"\nentry $w.a.ent -textvariable w.parts -width 4 -relief sunken\nttk::button $w.b.start -text "Start METIS" -command {\nNg_Metis ${w.parts}\nredraw\n}\nttk::button $w.b.cancel -text "Cancel" -command { destroy .metis_dlg }\npack $w.a.lab $w.a.ent -side left -expand yes\npack $w.b.start $w.b.cancel -side left\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "METIS Partitioning"\nfocus $w\n}\n}\nproc stloptionsdialog { } {\nset w .stlopts_dlg\nif {[winfo exists .stlopts_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\npack [ttk::notebook $w.nb] -fill both -fill both -side top\nframe $w.bu\npack $w.bu -fill x -ipady 3\nttk::button $w.bu.apply -text "Apply" -command { redraw; Ng_GenerateMesh 1 2}\nttk::button $w.bu.cancle -text "Done" -command { destroy .stlopts_dlg }\npack $w.bu.cancle $w.bu.apply -side left -expand yes\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "STL Options"\nfocus $w\n}\n}\nproc stldoctordialog { } {\nNg_STLDoctor\nset wd .stldoctor_dlg\nif {[winfo exists .stldoctor_dlg] == 1} {\nwm withdraw $wd\nwm deiconify $wd\nfocus $wd\n} {\ntoplevel $wd\npack [ttk::notebook $wd.nb] -fill both -fill both -side top\n$wd.nb add [ttk::frame $wd.nb.general] -text "General" -underline 0\n$wd.nb add [ttk::frame $wd.nb.topology] -text "Edit Topology" -underline 5\n$wd.nb add [ttk::frame $wd.nb.edges] -text "Edit Edges" -underline 5\n$wd.nb add [ttk::frame $wd.nb.normals] -text "Edit Normals" -underline 5\n$wd.nb add [ttk::frame $wd.nb.advanced] -text "Advanced" -underline 0\nset f $wd.nb.general\nttk::frame $f.selectframe -borderwidth 0\nttk::checkbutton $f.selectframe.showtrias -text "Show STL-Triangles" \\\n-variable stloptions.showtrias -command { Ng_SetVisParameters; redraw }\nttk::checkbutton $f.selectframe.showfilledtrias -text "Show Filled Triangles" \\\n-variable stloptions.showfilledtrias -command { Ng_SetVisParameters; redraw }\nset selmodevals { 0 1 2 3 4 }\nset selmodelabs(0) "triangle"\nset selmodelabs(1) "edge"\nset selmodelabs(2) "point"\nset selmodelabs(3) "line"\nset selmodelabs(4) "line cluster"\nglobal stldoctor.selectmode\nttk::label $f.selectframe.dblcsellab -text "Double Click selects : "\nttk::menubutton $f.selectframe.dblcselbut -menu $f.selectframe.dblcselmen -text "triangle" -width 16\nmenu $f.selectframe.dblcselmen -tearoff 0\nforeach selmode { 0 1 2 3 4 } {\n$f.selectframe.dblcselmen add command -label $selmodelabs($selmode) \\\n-command "set stldoctor.selectmode $selmode ; Ng_STLDoctor ; $f.selectframe.dblcselbut configure -text \\"$selmodelabs($selmode)\\""\n}\n$f.selectframe.dblcselmen invoke $selmodelabs(${stldoctor.selectmode})\npack $f.selectframe\ngrid $f.selectframe.showtrias -sticky nw\ngrid $f.selectframe.showfilledtrias -sticky nw\ngrid $f.selectframe.dblcsellab $f.selectframe.dblcselbut -sticky nw\nttk::frame $f.sm\npack $f.sm -fill x\nttk::checkbutton $f.sm.bu -text "select with mouse" \\\n-variable stldoctor.selectwithmouse\npack $f.sm.bu\nttk::frame $f.st -relief groove -borderwidth 3\npack $f.st -fill x\nttk::label $f.st.lab -text "Select triangle by number";\nttk::entry $f.st.ent -width 5 \\\n-textvariable stldoctor.selecttrig\npack $f.st.ent $f.st.lab -side left -expand yes\nttk::frame $f.vc -relief groove -borderwidth 3\npack $f.vc -fill x\nttk::checkbutton $f.vc.bu -text "show vicinity" \\\n-variable stldoctor.showvicinity \\\n-command {Ng_STLDoctor vicinity; redraw}\nttk::label $f.vc.lab -text "vicinity size";\nttk::frame $f.vc.sc\nttk::scale $f.vc.sc.scale -orient horizontal -length 200 -from 0 -to 200 \\\n-variable stldoctor.vicinity -takefocus 0 -command "Ng_STLDoctor vicinity; redraw; roundscale $f.vc.sc.scale 0"\nttk::entry $f.vc.sc.entry -textvariable stldoctor.vicinity -width 3 \\\n-validatecommand "Ng_STLDoctor vicinity; redraw; my_validate %W [$f.vc.sc.scale cget -from] [$f.vc.sc.scale cget -to] %P 0" \\\n-invalidcommand "my_invalid %W;Ng_STLDoctor vicinity; redraw;" -validate focus\nttk::label $f.vc.sc.lab -text "vicinity size"\ngrid $f.vc.sc.scale $f.vc.sc.entry $f.vc.sc.lab -sticky nw -padx 4\npack $f.vc.bu $f.vc.lab $f.vc.sc -expand yes\nttk::frame $f.ge -relief groove -borderwidth 0\npack $f.ge -expand yes\nttk::button $f.ge.neighbourangles -text "calc neighbourangles" -command {Ng_STLDoctor neighbourangles}\nttk::button $f.ge.showcoords -text "show coords of touched triangle" -command {Ng_STLDoctor showcoords}\nttk::button $f.ge.moveptm -text "move point to middle of trianglepoints" -command {Ng_STLDoctor movepointtomiddle; redraw}\nttk::button $f.ge.destroy0trigs -text "destroy 0-volume triangles" -command {Ng_STLDoctor destroy0trigs}\ngrid $f.ge.neighbourangles -sticky nw -padx 4 -pady 4\ngrid $f.ge.showcoords -sticky nw -padx 4 -pady 4\ngrid $f.ge.moveptm -sticky nw -padx 4 -pady 4\ngrid $f.ge.destroy0trigs -sticky nw -padx 4 -pady 4\nttk::button $f.ge.cancle -text "Done" -command {destroy .stldoctor_dlg }\ngrid $f.ge.cancle -sticky nw\nset f $wd.nb.topology\nttk::frame $f.oc -relief groove -borderwidth 3\npack $f.oc -pady 3 -ipady 3 -fill y -fill x\nttk::frame $f.oc.oc1 -borderwidth 0\npack $f.oc.oc1\nttk::button $f.oc.oc1.bu -text "invert orientation \\n of selected trig" -command {Ng_STLDoctor invertselectedtrig; redraw }\nttk::button $f.oc.oc1.bu2 -text "orient after \\n selected trig" -command {Ng_STLDoctor orientafterselectedtrig; redraw }\nttk::button $f.oc.oc1.toperr -text "mark inconsistent triangles" -command {Ng_STLDoctor marktoperrortrigs; redraw }\nttk::button $f.oc.oc1.deltrig -text "delete selected triangle" -command {Ng_STLDoctor deleteselectedtrig; redraw }\nttk::button $f.oc.oc1.geosmooth -text "geometric smoothing" -command {Ng_STLDoctor smoothgeometry; redraw }\ngrid $f.oc.oc1.bu x $f.oc.oc1.bu2 -sticky nw -padx 4 -pady 4\ngrid $f.oc.oc1.toperr - x -sticky nw -padx 4 -pady 4\ngrid $f.oc.oc1.deltrig - x -sticky nw -padx 4 -pady 4\ngrid $f.oc.oc1.geosmooth - x -sticky nw -padx 4 -pady 4\nset f $wd.nb.edges\nttk::frame $f.be -relief groove -borderwidth 3\npack $f.be -fill x\nttk::frame $f.be.frame\npack $f.be.frame -ipady 4 -pady 4\nttk::label $f.be.frame.lab -text "build edges with yellow angle:";\nttk::scale $f.be.frame.scale -orient horizontal -length 200 -from 0 -to 200 \\\n-variable stloptions.yangle -takefocus 0 -command "roundscale $f.be.frame.scale 1; Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw"\nttk::entry $f.be.frame.entry -textvariable stloptions.yangle -width 5 \\\n-validatecommand "Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw;my_validate %W [$f.be.frame.scale cget -from] [$f.be.frame.scale cget -to] %P 1" \\\n-invalidcommand "my_invalid %W;Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw" -validate focus\ngrid $f.be.frame.lab - -sticky nw -padx 4\ngrid $f.be.frame.scale $f.be.frame.entry -sticky nw -padx 4\nttk::label $f.be.frame.lab2 -text "continue edges with yellow angle:";\nttk::scale $f.be.frame.scale2 -orient horizontal -length 200 -from 0 -to 100 \\\n-variable stloptions.contyangle -takefocus 0 -command "roundscale $f.be.frame.scale2 1; Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw"\nttk::entry $f.be.frame.entry2 -textvariable stloptions.contyangle -width 5 \\\n-validatecommand "Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw;my_validate %W [$f.be.frame.scale2 cget -from] [$f.be.frame.scale2 cget -to] %P 1" \\\n-invalidcommand "my_invalid %W;Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw" -validate focus\ngrid $f.be.frame.lab2 - -sticky nw -padx 4\ngrid $f.be.frame.scale2 $f.be.frame.entry2 -sticky nw -padx 4\nttk::button $f.be.frame.buildedges -text "Build Edges" -command {Ng_STLDoctor buildedges; redraw}\ngrid $f.be.frame.buildedges - -sticky n -padx 4 -pady 4\nttk::frame $f.se -relief groove -borderwidth 3\npack $f.se -fill x\nttk::checkbutton $f.se.bu -text "show excluded" \\\n-variable stldoctor.showexcluded \\\n-command {Ng_STLDoctor; redraw}\npack $f.se.bu\nset edgeselmodevals { 0 1 2 3 4 }\nset edgeselmodelabs(0) "no change"\nset edgeselmodelabs(1) "undefined"\nset edgeselmodelabs(2) "confirmed"\nset edgeselmodelabs(3) "candidate"\nset edgeselmodelabs(4) "excluded"\nglobal stldoctor.edgeselectmode\nttk::frame $f.scaleframe -relief groove -borderwidth 0\npack $f.scaleframe -ipadx 4 -pady 4 -expand yes\nttk::label $f.scaleframe.dblcedgelab -text "Double Click sets edge :"\nttk::menubutton $f.scaleframe.dblcledgebut -menu $f.scaleframe.dblcledgem -text "coarse" -width 16\nmenu $f.scaleframe.dblcledgem -tearoff 0\nforeach selectmode { 0 1 2 3 4 } {\n$f.scaleframe.dblcledgem add command -label $edgeselmodelabs($selectmode) \\\n-command "set stldoctor.edgeselectmode $selectmode ; $f.scaleframe.dblcledgebut configure -text \\"$edgeselmodelabs($selectmode)\\""\n}\n$f.scaleframe.dblcledgem invoke $edgeselmodelabs(${stldoctor.edgeselectmode})\ngrid $f.scaleframe.dblcedgelab $f.scaleframe.dblcledgebut -sticky n -ipadx 4\nttk::frame $f.edg -relief groove -borderwidth 3\npack $f.edg -fill x -ipadx 4 -ipady 4\nttk::frame $f.edg.f0\npack $f.edg.f0\nttk::button $f.edg.f0.confirmedge -text "confirm" -command {Ng_STLDoctor confirmedge; redraw}\nttk::button $f.edg.f0.candidateedge -text "candidate" -command {Ng_STLDoctor candidateedge; redraw}\nttk::button $f.edg.f0.excludeedge -text "exclude" -command {Ng_STLDoctor excludeedge; redraw}\nttk::button $f.edg.f0.undefinededge -text "undefined" -command {Ng_STLDoctor undefinededge; redraw}\npack $f.edg.f0.confirmedge $f.edg.f0.candidateedge $f.edg.f0.excludeedge $f.edg.f0.undefinededge -side left\nttk::frame $f.edg.fa\npack $f.edg.fa\nttk::button $f.edg.fa.setallundefined -text "all undefined" -command {Ng_STLDoctor setallundefinededges; redraw}\nttk::button $f.edg.fa.erasecandidates -text "candidates to undefined" -command {Ng_STLDoctor erasecandidateedges; redraw}\npack $f.edg.fa.setallundefined $f.edg.fa.erasecandidates -side left\nttk::frame $f.edg.fb\npack $f.edg.fb\nttk::button $f.edg.fb.confirmcandidates -text "candidates to confirmed" -command {Ng_STLDoctor confirmcandidateedges; redraw}\nttk::button $f.edg.fb.confirmedtocandidates -text "confirmed to candidates" -command {Ng_STLDoctor confirmedtocandidateedges; redraw}\npack $f.edg.fb.confirmcandidates $f.edg.fb.confirmedtocandidates -side left\nttk::frame $f.edg.f1\nttk::frame $f.edg.f2\nttk::frame $f.edg.f3\nttk::frame $f.edg.f4\npack $f.edg.f1 $f.edg.f2 $f.edg.f3 $f.edg.f4\nttk::button $f.edg.f1.exportedges -text "export edges" -command {Ng_STLDoctor exportedges}\nttk::button $f.edg.f1.importedges -text "import edges" -command {Ng_STLDoctor importedges; redraw}\nttk::button $f.edg.f1.saveedgedata -text "save edgedata" \\\n-command {\nset types {\n{"Netgen Edgedata" {.ned} }\n}\nset file [tk_getSaveFile -filetypes $types -defaultextension ".ned"]\nif {$file != ""} {\nNg_STLDoctor saveedgedata $file\n}\n}\nttk::button $f.edg.f1.loadedgedata -text "load edgedata" \\\n-command {\nset types {\n{"Netgen Edgedata" {.ned} }\n}\nset file [tk_getOpenFile -filetypes $types -defaultextension ".ned"]\nif {$file != ""} {\nNg_STLDoctor loadedgedata $file\nputs "loading done"\nredraw\n}\n}\nttk::button $f.edg.f1.importAVLedges -text "import AVL edges" \\\n-command {\nset types {{"Edge file" {.edg }}}\nset file [tk_getOpenFile -filetypes $types -defaultextension ".edg"]\nif {$file != ""} {\nNg_STLDoctor importexternaledges $file;\n}\n}\npack $f.edg.f1.importAVLedges $f.edg.f1.loadedgedata $f.edg.f1.saveedgedata -side left\nttk::frame $f.edg2 -relief groove -borderwidth 3\npack $f.edg2 -fill x\nttk::label $f.edg2.lab -text "length (%):"\nscale $f.edg2.sc -orient horizontal -length 200 -from 0 -to 100 \\\n-resolution 0.5 \\\n-variable stldoctor.longlinefact\nttk::button $f.edg2.undoedge -text "undo last edge change" -command {Ng_STLDoctor undoedgechange; redraw}\npack $f.edg2.undoedge -expand yes\nset f $wd.nb.normals\nttk::frame $f.dt -relief groove -borderwidth 3\npack $f.dt -fill x\nttk::label $f.dt.lab -text "dirty triangle factor";\nttk::entry $f.dt.ent -width 5 \\\n-textvariable stldoctor.dirtytrigfact -validatecommand "Ng_SetSTLParameters;my_validate %W -1e9 1e9 %P 3" \\\n-invalidcommand "my_invalid %W;Ng_SetSTLParameters" -validate focus\npack $f.dt.ent $f.dt.lab -side left -expand yes -pady 8\nttk::frame $f.srt -relief groove -borderwidth 3\npack $f.srt -fill x\nttk::button $f.srt.bu -text "smooth reverted triangles geometric" -command {Ng_STLDoctor smoothrevertedtrigs; redraw }\nttk::entry $f.srt.ent -width 5 \\\n-textvariable stldoctor.smoothangle -validatecommand "Ng_SetSTLParameters;my_validate %W -1e9 1e9 %P 2" \\\n-invalidcommand "my_invalid %W;Ng_SetSTLParameters" -validate focus\npack $f.srt.ent $f.srt.bu -side left -expand yes -pady 8\nttk::frame $f.bdt -relief groove -borderwidth 3\npack $f.bdt -fill x\nttk::button $f.bdt.bu -text "mark dirty triangles" -command {Ng_STLDoctor markdirtytrigs; redraw }\nttk::button $f.bdt.bu2 -text "smooth dirty triangles normal" -command {Ng_STLDoctor smoothdirtytrigs; redraw }\npack $f.bdt.bu $f.bdt.bu2 -side left -expand yes -pady 8\nttk::frame $f.sno -relief groove -borderwidth 3\npack $f.sno -fill x\nttk::frame $f.sno.snoframe -borderwidth 0\nttk::button $f.sno.smoothnormals -text "smooth normals" -command { Ng_STLDoctor smoothnormals; redraw}\nttk::scale $f.sno.snoframe.scale -orient horizontal -length 100 -from 0.0 -to 0.8 \\\n-variable stldoctor.smoothnormalsweight -takefocus 0 -command "roundscale $f.sno.snoframe.scale 2;Ng_SetSTLParameters"\nttk::entry $f.sno.snoframe.entry -textvariable stldoctor.smoothnormalsweight -width 4 \\\n-validatecommand "Ng_SetSTLParameters;my_validate %W [$f.sno.snoframe.scale cget -from] [$f.sno.snoframe.scale cget -to] %P 2" \\\n-invalidcommand "my_invalid %W;Ng_SetSTLParameters" -validate focus\nttk::label $f.sno.snoframe.labrough -text "rough"\nttk::label $f.sno.snoframe.labsmooth -text "smooth"\ngrid $f.sno.snoframe.labrough $f.sno.snoframe.scale $f.sno.snoframe.labsmooth $f.sno.snoframe.entry -sticky nw -padx 4\npack $f.sno.snoframe $f.sno.smoothnormals -side left -padx 5 -pady 8\nttk::frame $f.no -relief groove -borderwidth 3\npack $f.no -fill x\nttk::button $f.no.marknonsmoothnormals -text "mark non-smooth triangles" -command {Ng_STLDoctor marknonsmoothnormals; redraw}\nttk::button $f.no.calcnormals -text "calculate normals from geometry" -command {Ng_STLDoctor calcnormals; redraw}\npack $f.no.marknonsmoothnormals $f.no.calcnormals -expand yes -pady 8\nset f $wd.nb.advanced\nttk::frame $f.sc\npack $f.sc -fill x\nttk::checkbutton $f.sc.bu -text "spiral check" \\\n-variable stldoctor.spiralcheck \\\n-command {Ng_STLDoctor;}\nttk::checkbutton $f.sc.bu2 -text "cone check" \\\n-variable stldoctor.conecheck \\\n-command {Ng_STLDoctor;}\npack $f.sc.bu $f.sc.bu2\nttk::label $f.gtol_lbl -text "LoadSTL tolerance factor"\nttk::spinbox $f.gtol -from 1e-15 -to 0.001 -textvariable stldoctor.geom_tol_fact -width 8\npack $f.gtol_lbl $f.gtol\nttk::button $f.adap -text "Apply" -command {\nNg_STLDoctor;\n}\npack $f.adap -expand yes\nwm withdraw $wd\nwm geom $wd +100+100\nwm deiconify $wd\nwm title $wd "STL Doctor"\nfocus $wd\n}\n}\nproc meshdoctordialog { } {\nset w .meshdoc_dlg\nglobal meshdoctor.active\nif {[winfo exists .meshdoc_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\nset meshdoctor.active 1\nNg_MeshDoctor;\nttk::frame $w.vis -relief groove -borderwidth 3\npack $w.vis\nttk::checkbutton $w.vis.showfilledtrigs -text "Show filled triangles" \\\n-variable viewoptions.drawfilledtrigs \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $w.vis.showedges -text "Show edges" \\\n-variable viewoptions.drawedges \\\n-command { Ng_SetVisParameters; redraw }\nttk::checkbutton $w.vis.showoutline -text "Show Triangle Outline" \\\n-variable viewoptions.drawoutline \\\n-command { Ng_SetVisParameters; redraw }\npack $w.vis.showfilledtrigs $w.vis.showoutline $w.vis.showedges\nttk::frame $w.markedgedist\nttk::label $w.markedgedist.l -text "Mark edge dist: "\nttk::spinbox $w.markedgedist.s -from 0 -to 999 -width 5 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W" -command {Ng_MeshDoctor markedgedist ${meshdoc.markedgedist};redraw} -textvariable meshdoc.markedgedist\npack $w.markedgedist.l $w.markedgedist.s -side left\npack $w.markedgedist\nttk::button $w.deledge -text "Delete marked segments" -command {\nNg_MeshDoctor deletemarkedsegments\nredraw\n}\npack $w.deledge\nttk::button $w.close -text "Close" -command {\nset meshdoctor.active 0;\nNg_MeshDoctor;\ndestroy .meshdoc_dlg\n}\npack $w.close -expand yes\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Mesh Doctor"\n}\n}\nproc qualityviewdialog { show } {\nset w .qualityview_dlg\nif {[winfo exists .qualityview_dlg] == 1} {\nif { $show == 1 } {\nwm withdraw .qualityview_dlg\nwm deiconify $w\nfocus $w\n} {\nwm withdraw $w\n}\n} {\ntoplevel $w\nset c $w.c\ncanvas $c -relief raised -width 450 -height 300\npack $w.c -side top -fill x\nset plotFont {Helvetica 12}\nset smallFont {Helvetica 12}\n$c create line 100 250 400 250 -width 2\n$c create line 100 250 100 50 -width 2\nfor {set i 0} {$i <= 10} {incr i} {\nset x [expr {100 + ($i*30)}]\n$c create line $x 250 $x 245 -width 2\nif { [expr {$i % 2}] == 0 } {\n$c create text $x 254 -text [format %1.1f [expr 0.1*$i]] -anchor n -font $plotFont\n}\n}\nglobal qualbar\nglobal qualbarnull\nglobal qualbaraxis\nfor {set i 0} {$i <= 5} {incr i} {\nset y [expr {250 - ($i*40)}]\n$c create line 100 $y 105 $y -width 2\nset qualbaraxis($i) \\\n[$c create text 96 $y -text [expr $i*50].0 -anchor e -font $plotFont]\n}\nfor {set i 0} {$i < 20} {incr i} {\nset x1 [expr {100 + ($i*15) + 2}]\nset x2 [expr {$x1+10}]\nset y [expr {250 - 10 * $i}]\nset qualbar($i) [$c create rectangle $x1 250 $x2 245 -fill blue]\nset qualbarnull($i) [$c create text [expr {($x1+$x2)/2}] 245 -text 0 -anchor s -font $smallFont -fill blue]\n}\nframe $w.bu\npack $w.bu\nttk::button $w.close -text "Close" \\\n-command {\nwm withdraw .qualityview_dlg\nset viewqualityplot 0\n}\npack $w.close\nif { $show == 1 } {\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Mesh Quality"\nfocus $w\n}\n}\n}\nproc memusedialog { show } {\nset w .memuse_dlg\nif {[winfo exists .memuse_dlg] == 1} {\nif { $show == 1 } {\nwm withdraw .memuse_dlg\nwm deiconify $w\nfocus $w\n} {\nwm withdraw $w\n}\n} {\ntoplevel $w\nset c $w.c\ncanvas $c -relief raised -width 600 -height 300\npack $w.c -side top -fill x\nset plotFont {Helvetica 18}\nset smallFont {Helvetica 12}\nglobal memmark\nfor {set i 0} {$i < 512} { incr i } {\nset memmark($i) [$c create line [expr 50+$i] 50 [expr 50+$i] 70 -fill blue]\n}\nset plotFont {Helvetica 18}\nset smallFont {Helvetica 12}\n$c create text 50 90 -text "0 GB" -anchor n -font $plotFont\n$c create text 178 90 -text "1 GB" -anchor n -font $plotFont\n$c create text 306 90 -text "2 GB" -anchor n -font $plotFont\n$c create text 434 90 -text "3 GB" -anchor n -font $plotFont\n$c create text 562 90 -text "4 GB" -anchor n -font $plotFont\nttk::frame $w.bu\npack $w.bu\nttk::button $w.close -text "Close" \\\n-command {\nwm withdraw .memuse_dlg\nset memuseplot 0\n}\npack $w.close\nif { $show == 1 } {\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Memory Usage"\nfocus $w\n}\n}\n}\nproc STLinfodialog { show } {\nset w .STLinfo_dlg\nif {[winfo exists .STLinfo_dlg] == 1} {\nif { $show == 1 } {\nwm withdraw .STLinfo_dlg\nwm deiconify $w\nfocus $w\n} {\nwm withdraw $w\n}\n} {\ntoplevel $w\nset c $w.c\ncanvas $c -relief raised -width 450 -height 300\npack $w.c -side top -fill x\nset plotFont {Helvetica 18}\nset smallFont {Helvetica 12}\n$c create line 100 250 400 250 -width 2\n$c create line 100 250 100 50 -width 2\nttk::frame $w.bu\npack $w.bu\nttk::button $w.close -text "Close" \\\n-command {\nwm withdraw .STLinfo_dlg\n}\npack $w.close\nif { $show == 1 } {\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "STL Geometry Info"\nfocus $w\n}\n}\n}\nproc logwindow { } {\nset w .logwindow\nif {[winfo exists .logwindow] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\ntext $w.edit -yscroll "$w.scrolly set" -setgrid 1 -height 12\nscrollbar $w.scrolly -command "$w.edit yview"\npack $w.edit -side left -fill both -expand 1\npack $w.scrolly -side left -fill both -expand 0\n.logwindow.edit insert end "Netgen Log Window\\n"\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Netgen Log"\nfocus $w\n}\n}\nproc printtable { tablevar } {\nset w newtcltable\nwhile {[winfo exists .$w] == 1} {set w 1$w}\nset w .$w\ntoplevel $w\nfor {set i 0} {$i < [lindex $tablevar 2]} { incr i } {\nframe $w.col$i\nfor {set j 0} {$j < [lindex $tablevar 1]} { incr j } {\nframe $w.col$i.row$j\nmessage $w.col$i.row$j.txt -aspect 10000000 -text [lindex $tablevar [expr 3+[lindex $tablevar 2]*$j+$i]]\npack $w.col$i.row$j.txt\npack $w.col$i.row$j -side top\n}\npack $w.col$i -side left\n}\nwm withdraw $w\nwm geom $w +200+100; wm deiconify $w\nwm title $w [lindex $tablevar 0]\nfocus $w\n}\nset latestwarning 0\nproc printwarning { textvar } {\nglobal latestwarning\nset latestwarning $textvar\nset w warning\nwhile {[winfo exists .$w] == 1} {set w 1$w}\nset w .$w\ntoplevel $w\nmessage $w.mes -aspect 2000 -text "WARNING:\\n$textvar"\nttk::button $w.done -text "Done" -command "destroy $w"\npack $w.mes\npack $w.done\nwm withdraw $w\nwm deiconify $w\nwm title $w "Warning"\nfocus $w\n}\nproc printlatestwarning { } {\nglobal latestwarning\nif {$latestwarning != 0} {printwarning $latestwarning}\n}\n}\ncatch {\nset oldmousex 0\nset oldmousey 0\nset toglversion [Ng_GetToglVersion]\nputs "togl-version : $toglversion"\nset toglok 0\nif { [Ng_GetToglVersion] == 2 } {\nif {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect false -create init -display draw -reshape reshape }] } {\nputs "no OpenGL"\n} {\nset toglok 1\n}\n} {\nif {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect false }] } {\nputs "no OpenGL"\n} {\nset toglok 1\n}\n}\nif { $toglok == 1} {\npack .ndraw -expand true -fill both -padx 0 -pady 0\ncatch { tkdnd::drop_target register .ndraw DND_Files }\nbind .ndraw <Button-1> {\nset oldmousex %x; set oldmousey %y;\n}\nbind .ndraw <Button-2> {\nset oldmousex %x; set oldmousey %y;\n}\nbind .ndraw <Button-3> {\nset oldmousex %x; set oldmousey %y;\n}\nbind .ndraw <B1-Motion> {\nNg_MouseMove $oldmousex $oldmousey %x %y $drawmode\n.ndraw render\nset oldmousex %x; set oldmousey %y;\n}\nbind .ndraw <Double-1> {\nNg_MouseDblClick %x %y\n.ndraw render\nif { [winfo exists .bcprop_dlg] } { bcpropdialog }\nif { [winfo exists .surfacemeshsize_dlg] } { surfacemeshsizedialog }\nif { [winfo exists .fieldlines_dlg] } { fieldlinesdialog }\n}\nbind .ndraw <B2-Motion> {\nNg_MouseMove $oldmousex $oldmousey %x %y move\n.ndraw render\nset oldmousex %x; set oldmousey %y;\n}\nbind .ndraw <B3-Motion> {\nif { $tcl_platform(os) == "Darwin" } {\nNg_MouseMove $oldmousex $oldmousey %x %y move\n} {\nNg_MouseMove $oldmousex $oldmousey %x %y zoom\n}\n.ndraw render\nset oldmousex %x; set oldmousey %y;\n}\nbind .ndraw <Alt-B2-Motion> {\nNg_MouseMove $oldmousex $oldmousey %x %y Move2d\n.ndraw render\nset oldmousex %x; set oldmousey %y;\n}\nbind .ndraw <Alt-B3-Motion> {\nNg_MouseMove $oldmousex $oldmousey %x %y Zoom2d\n.ndraw render\nset oldmousex %x; set oldmousey %y;\n}\n}\nproc popupcheckredraw { vari { x 0 } } {\nupvar $vari varname\nif { $varname == 1 } {\nset varname 0\n} {\nNg_Vis_Set parameters\nredraw\n}\n}\nproc popupcheckredraw2 { vari boolvar { x 0 } } {\nupvar $vari varname\nif { $varname == 1 } {\nset varname 0\n} {\nNg_SetVisParameters\nNg_Vis_Set parameters\nif { $boolvar == 1 } { redraw }\nNg_SetVisParameters\n}\n}\nproc popupcheckredraw3 { vari { x 0 } } {\nupvar $vari varname\nif { $varname == 1 } {\nset varname 0\n} {\nNg_Vis_Set parameters\n}\n}\nproc redraw { {x 0} } {\nif {[winfo exists .ndraw]} { .ndraw render }\n}\nbind . <Left> { Ng_MouseMove 0 0 -10 0 rotate; redraw }\nbind . <Right> { Ng_MouseMove 0 0 10 0 rotate; redraw }\nbind . <Up> { Ng_MouseMove 0 0 0 -10 rotate; redraw }\nbind . <Down> { Ng_MouseMove 0 0 0 10 rotate; redraw }\nbind . <Shift-Left> { Ng_MouseMove 0 0 -10 0 move; redraw }\nbind . <Shift-Right> { Ng_MouseMove 0 0 10 0 move; redraw }\nbind . <Shift-Up> { Ng_MouseMove 0 0 0 -10 move; redraw }\nbind . <Shift-Down> { Ng_MouseMove 0 0 0 10 move; redraw }\nbind . <Control-Up> { Ng_MouseMove 0 0 0 -10 zoom; redraw }\nbind . <Control-Down> { Ng_MouseMove 0 0 0 10 zoom; redraw }\nbind . <Button-4> \\\n{event generate [focus -displayof %W] <MouseWheel> -delta 120}\nbind . <Button-5> \\\n{event generate [focus -displayof %W] <MouseWheel> -delta -120}\nbind . <MouseWheel> { Ng_MouseMove 0 0 0 [expr {%D/-5}] zoom; redraw }\nbind .ndraw <<Drop:DND_Files>> {\nset filename [join %D " "]\nset index [string last . $filename]\nset type [string range $filename $index+1 end]\nset ispde [string match -nocase $type "pde"]\nset isgeo [expr max([string match -nocase $type "geo"],[string match -nocase $type "in2d"])]\nset ismesh [expr max([string match -nocase $type "vol"],[string match -nocase $type "vol.gz"])]\nset ispy [string match -nocase $type "py"]\nif {$ispde == 1} {\nAddRecentNGSFile $filename;\nNGS_LoadPDE $filename;\nSetNumProcHelpMenu\nset selectvisual mesh;\nNg_SetVisParameters\n}\nif {$ispy == 1} {\nAddRecentPYNGSFile $filename;\nNGS_LoadPy $filename;\n}\nif {$isgeo == 1} {\nAddRecentFile $filename;\nNg_LoadGeometry $filename;\nNg_ParseGeometry\nset selectvisual geometry\nNg_SetVisParameters\nredraw\nwm title . [concat "$progname - " $filename]\nset dirname [file dirname $filename]\nset basefilename [file tail [file rootname $filename]]\n}\nif {$ismesh == 1} {\nAddRecentMeshFile $filename;\nNg_LoadMesh $filename;\nset selectvisual mesh\nNg_SetVisParameters\nredraw\nNg_ReadStatus;\nwm title . [concat "$progname - " %D]\nset dirname [file dirname %D]\nset basefilename [file tail [file rootname %D]]\n}\nreturn %A\n}\n}\ncatch { .ngmenu.geometry add command -label "Scan CSG Geometry" -command { Ng_ParseGeometry }\n.ngmenu.geometry add command -label "CSG Options..." -command geometryoptionsdialog\n.ngmenu.geometry add command -label "CSG Properties..." \\\n-command topleveldialog2\nproc geometryoptionsdialog { } {\nset w .geometry_dlg\nif {[winfo exists .geometry_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\nglobal geooptions\nNg_GeometryOptions get\ncheckbutton $w.drawcsg -text "Draw Geometry" \\\n-variable geooptions.drawcsg\npack $w.drawcsg\nframe $w.fac\npack $w.fac -pady 5\nttk::label $w.fac.lab -text "Facets:";\nentry $w.fac.ent -width 8 -relief sunken \\\n-textvariable geooptions.facets\npack $w.fac.lab $w.fac.ent -side left\nframe $w.det\npack $w.det -pady 5\nttk::label $w.det.lab -text "Detail:";\nentry $w.det.ent -width 8 -relief sunken \\\n-textvariable geooptions.detail\npack $w.det.lab $w.det.ent -side left\nframe $w.cox\npack $w.cox -pady 5\nttk::label $w.cox.lab -text "min/max x:";\nentry $w.cox.ent1 -width 8 -relief sunken \\\n-textvariable geooptions.minx\nentry $w.cox.ent2 -width 8 -relief sunken \\\n-textvariable geooptions.maxx\npack $w.cox.lab $w.cox.ent1 \\\n$w.cox.ent2 -side left\nframe $w.coy\npack $w.coy -pady 5\nttk::label $w.coy.lab -text "min/max y:";\nentry $w.coy.ent1 -width 8 -relief sunken \\\n-textvariable geooptions.miny\nentry $w.coy.ent2 -width 8 -relief sunken \\\n-textvariable geooptions.maxy\npack $w.coy.lab $w.coy.ent1 \\\n$w.coy.ent2 -side left\nframe $w.coz\npack $w.coz -pady 5\nttk::label $w.coz.lab -text "min/max z:";\nentry $w.coz.ent1 -width 8 -relief sunken \\\n-textvariable geooptions.minz\nentry $w.coz.ent2 -width 8 -relief sunken \\\n-textvariable geooptions.maxz\npack $w.coz.lab $w.coz.ent1 \\\n$w.coz.ent2 -side left\nframe $w.bu\npack $w.bu -fill x -ipady 3\nttk::button $w.bu.app -text "Apply" -command {\nNg_GeometryOptions set\n}\nttk::button $w.bu.ok -text "Done" -command {\nNg_GeometryOptions set\ndestroy .geometry_dlg\n}\npack $w.bu.app $w.bu.ok -side left -expand yes\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Geometry options"\nfocus $w\n}\n}\nproc editprimitivedialog2 { name } {\nglobal w classname\nset w .ep_dlg\ntoplevel .$w\nNg_GetPrimitiveData $name classname valuelist\nttk::label $w.lab1 -text "Primitive Name: $name";\nttk::label $w.lab2 -text "Primitive Class: $classname";\npack $w.lab1 $w.lab2 -fill x -pady 1m -padx 5m\nframe $w.specific -relief groove\nglobal spec\nset spec(sphere) { cx cy cz rad }\nset spec(cylinder) { ax ay az bx by bz rad }\nset spec(plane) { px py pz nx ny nz }\nset spec(cone) { ax ay az bx by bz ra rb }\nset spec(brick) { p1x p1y p1z p2x p2y p2z p3x p3y p3z p4x p4y p4z }\nset cnt 0\nforeach field $spec($classname) {\nframe $w.specific.f$cnt\npack $w.specific.f$cnt -side top -anchor ne\nttk::label $w.specific.f$cnt.lab -text "$field"\nentry $w.specific.f$cnt.ent -textvariable dataval($cnt) \\\n-width 6 -relief sunken\npack $w.specific.f$cnt.ent $w.specific.f$cnt.lab -side right\n$w.specific.f$cnt.ent delete 0 end\n$w.specific.f$cnt.ent insert 0 [lindex $valuelist $cnt]\nset cnt [expr $cnt + 1]\n}\npack $w.specific\nttk::button $w.cancel -text "cancel" -command {\ndestroy $w\n}\nttk::button $w.ok -text "ok" -command {\nset valuelist ""\nset cnt 0\nforeach field $spec($classname) {\nlappend valuelist $dataval($cnt)\nset cnt [expr $cnt + 1]\n}\nNg_SetPrimitiveData $name $valuelist\ndestroy $w\n}\npack $w.cancel $w.ok -side left -expand yes\nbind $w <Return> { $w.ok invoke}\nbind $w <Escape> { $w.cancel invoke}\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nfocus $w.specific.f0.ent\n}\nproc editprimitivedialog { } {\nglobal w\nset w .ep_dlg\ntoplevel $w\nframe $w.frame -borderwidth 5m\npack $w.frame -side top -expand yes -fill y\nlistbox $w.frame.list -yscroll "$w.frame.scroll set" -setgrid 1 -height 12\nscrollbar $w.frame.scroll -command "$w.frame.list yview"\npack $w.frame.scroll -side right -fill y\npack $w.frame.list -side left -expand 1 -fill both\nNg_GetPrimitiveList primlist\nforeach el $primlist {\n$w.frame.list insert end $el }\nttk::button $w.cancel -text "cancel" -command { destroy $w }\nttk::button $w.ok -text "ok" -command {\nset name [.ep_dlg.frame.list get active]\nputs "name=($name)"\ndestroy $w\nif { $name != "" } { editprimitivedialog2 $name }\n}\nbind $w <Escape> { $w.cancel invoke }\nbind $w <Return> { $w.ok invoke }\npack $w.cancel $w.ok -side left -expand yes\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nfocus $w.frame.list\n}\nproc newprimitivedialog { } {\nglobal w name\nset w .ap_dlg\ntoplevel $w\nset name ""\nframe $w.f1\npack $w.f1 -pady 2m\nttk::label $w.f1.lab -text "Primitive Name: ";\nentry $w.f1.ent -width 5 -relief sunken \\\n-textvariable name\npack $w.f1.lab $w.f1.ent -side left\nframe $w.frame -borderwidth .5c\npack $w.frame -side top -expand yes -fill y\nlistbox $w.frame.list -yscroll "$w.frame.scroll set" -setgrid 1 -height 8\nscrollbar $w.frame.scroll -command "$w.frame.list yview"\npack $w.frame.scroll -side right -fill y\npack $w.frame.list -side left -expand 1 -fill both\n$w.frame.list insert 0 sphere cylinder plane cone brick\n$w.frame.list activate 0\nttk::button $w.ok -text "ok" -command {\nNg_CreatePrimitive [$w.frame.list get active] $name\ndestroy $w\neditprimitivedialog2 $name\n}\nttk::button $w.cancel -text "cancel" -command {\ndestroy $w\n}\npack $w.cancel $w.ok -side left -expand yes -pady 2m\nbind $w <Escape> { $w.cancel invoke }\nbind $w <Return> { $w.ok invoke }\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nfocus $w.f1.ent\n}\nproc newsoliddialog { } {\nglobal w name val sollist\nset w .ns_dlg\ntoplevel $w\nset name ""\nframe $w.f1\nttk::label $w.f1.lab -text "Solid Name: ";\nentry $w.f1.ent -width 5 -relief sunken \\\n-textvariable name\n$w.f1.ent delete 0 end\nttk::button $w.f1.getsel -text "Get Selected" -command {\n$w.f1.ent delete 0 end\n$w.f1.ent insert 0 [$w.f3.list get active]\n$w.bu.get invoke\n}\npack $w.f1.getsel -side bottom\npack $w.f1.ent $w.f1.lab -side right\nframe $w.f3 -borderwidth .5c\nlistbox $w.f3.list -yscroll "$w.f3.scroll set" -setgrid 1 -height 12\nscrollbar $w.f3.scroll -command "$w.f3.list yview"\npack $w.f3.scroll -side right -fill y\npack $w.f3.list -side left -expand 1 -fill both\nNg_GetSolidList sollist\nforeach el $sollist {\n$w.f3.list insert end $el }\nframe $w.f2\nttk::label $w.f2.lab -text "Solid Description: ";\npack $w.f2.lab\nentry $w.f2.ent -width 100 -relief sunken \\\n-textvariable val -xscrollcommand "$w.f2.scr set"\nscrollbar $w.f2.scr -relief sunken -orient horiz -command \\\n"$w.f2.ent xview"\n$w.f2.ent delete 0 end\npack $w.f2.ent $w.f2.scr -fill x\nframe $w.bu\nttk::button $w.bu.close -text "close" -command {\ndestroy $w\n}\nttk::button $w.bu.get -text "get data" -command {\nNg_GetSolidData $name val\n}\nttk::button $w.bu.set -text "set data" -command {\nNg_SetSolidData $name $val\n}\npack $w.bu.get $w.bu.set $w.bu.close -side left\npack $w.bu -pady 5 -side bottom ;\npack $w.f2 -pady 5 -side bottom ;\npack $w.f1 -pady 5 -side left ;\npack $w.f3 -side left -expand yes -fill y ;\nbind $w <Escape> { $w.bu.close invoke }\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nfocus $w\n}\nproc toplevelproperties { w solname surfname } {\nglobal properties\nNg_TopLevel getprop $solname $surfname properties\nset w .tlprop_dlg\nif {[winfo exists $w] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\nttk::label $w.lab1 -text "Red"\nscale $w.scale1 -orient horizontal -length 300 -from 0 -to 1 \\\n-resolution 0.01 -tickinterval 0.2 \\\n-command { Ng_TopLevel setprop $solname $surfname properties; redraw } -variable properties(red)\nttk::label $w.lab2 -text "Green"\nscale $w.scale2 -orient horizontal -length 300 -from 0 -to 1 \\\n-resolution 0.01 -tickinterval 0.2 \\\n-command { Ng_TopLevel setprop $solname $surfname properties; redraw } -variable properties(green)\nttk::label $w.lab3 -text "Blue"\nscale $w.scale3 -orient horizontal -length 300 -from 0 -to 1 \\\n-resolution 0.01 -tickinterval 0.2 \\\n-command { Ng_TopLevel setprop $solname $surfname properties; redraw } -variable properties(blue)\npack $w.lab1 $w.scale1 $w.lab2 $w.scale2 $w.lab3 $w.scale3\ncheckbutton $w.cb4 -text "Visible" \\\n-command { Ng_TopLevel setprop $solname $surfname properties; redraw } \\\n-variable properties(visible)\ncheckbutton $w.cb5 -text "Transparent" \\\n-command { Ng_TopLevel setprop $solname $surfname properties; redraw } \\\n-variable properties(transp)\npack $w.cb4 $w.cb5\nframe $w.bu\npack $w.bu -fill x\nttk::button $w.bu.ok -text "Ok" -command "destroy .tlprop_dlg"\npack $w.bu.ok -expand yes\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nfocus $w\n}\nwm title $w "Properties $solname $surfname"\n}\nproc topleveldialog { } {\nglobal w name val sollist\nset w .tl_dlg\ntoplevel $w\nframe $w.sol -borderwidth .5c\nlistbox $w.sol.list -yscroll "$w.sol.scroll set" -setgrid 1 -height 12\nscrollbar $w.sol.scroll -command "$w.sol.list yview"\npack $w.sol.scroll -side right -fill y\npack $w.sol.list -side left -expand 1 -fill both\nNg_GetSolidList sollist\nforeach el $sollist {\n$w.sol.list insert end $el }\nNg_GetPrimitiveList sollist\nforeach el $sollist {\n$w.sol.list insert end $el }\nframe $w.sul -borderwidth .5c\nlistbox $w.sul.list -yscroll "$w.sul.scroll set" -setgrid 1 -height 12\nscrollbar $w.sul.scroll -command "$w.sul.list yview"\npack $w.sul.scroll -side right -fill y\npack $w.sul.list -side left -expand 1 -fill both\nNg_GetSurfaceList sollist\nforeach el $sollist {\n$w.sul.list insert end $el }\nframe $w.topl -borderwidth .5c\nlistbox $w.topl.list -yscroll "$w.topl.scroll set" -setgrid 1 -height 12 \\\n-command { puts hi }\nscrollbar $w.topl.scroll -command "$w.topl.list yview"\npack $w.topl.scroll -side right -fill y\npack $w.topl.list -side left -expand 1 -fill both\nNg_TopLevel getlist sollist\nputs $sollist\nforeach el $sollist {\nset hel "[ lindex $el 0 ]"\nif { [ llength $el ] == 2 } {\nset hel "[ lindex $el 1 ] on [ lindex $el 0 ]"\n}\n$w.topl.list insert end $hel\n}\nframe $w.bu\nttk::button $w.bu.close -text "close" -command {\ndestroy $w\n}\nttk::button $w.bu.addsol -text "Add Solid" -command {\nset solname [$w.sol.list get active]\nNg_TopLevel set $solname ""\nNg_ParseGeometry\n$w.topl.list insert end $solname\n}\nttk::button $w.bu.addsurf -text "Add Surface" -command {\nset solname [$w.sol.list get active]\nset surfname [$w.sul.list get active]\nNg_TopLevel set $solname $surfname\nNg_ParseGeometry\nputs "$solname on $surfname"\n$w.topl.list insert end "$surfname on $solname"\n}\nttk::button $w.bu.remsol -text "Remove" -command {\nset solname [$w.topl.list get active]\nset surfname ""\nif { [llength $solname] == 3 } {\nset surfname [lindex $solname 0]\nset solname [lindex $solname 2]\n}\nNg_TopLevel remove $solname $surfname\nNg_ParseGeometry\n$w.topl.list delete active\n}\nttk::button $w.bu.prop -text "Properties" -command {\nset solname [$w.topl.list get active]\nset surfname ""\nif { [llength $solname] == 3 } {\nset surfname [lindex $solname 0]\nset solname [lindex $solname 2]\n}\ntoplevelproperties tlp $solname $surfname\n}\npack $w.bu.close $w.bu.addsol $w.bu.addsurf $w.bu.remsol $w.bu.prop -side left\npack $w.bu -side bottom\npack $w.sol -side left -expand yes -fill y ;\npack $w.sul -side left -expand yes -fill y ;\npack $w.topl -side left -expand yes -fill y ;\nbind $w <Escape> { $w.bu.close invoke }\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nfocus $w\n}\nproc topleveldialog2 { } {\nset w .tl2_dlg\nif {[winfo exists .tl2_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\nglobal name val sollist\nframe $w.topl -borderwidth .5c\nlistbox $w.topl.list -yscroll "$w.topl.scroll set" -setgrid 1 -height 12\nscrollbar $w.topl.scroll -command "$w.topl.list yview"\npack $w.topl.scroll -side right -fill y\npack $w.topl.list -side left -expand 1 -fill both\nNg_TopLevel getlist sollist\nputs $sollist\nset i 1\nforeach el $sollist {\nset hel "$i: [ lindex $el 0 ]"\nif { [ llength $el ] == 2 } {\nset hel "$i: [ lindex $el 1 ] on [ lindex $el 0 ]"\n}\nincr i\n$w.topl.list insert end $hel }\nframe $w.bu\nttk::button $w.bu.close -text "close" -command {\ndestroy .tl2_dlg\n}\nttk::button $w.bu.prop -text "Properties" -command {\nset solname [.tl2_dlg.topl.list get active]\nset surfname ""\nif { [llength $solname] == 2 } {\nset solname [lindex $solname 1]\n}\nif { [llength $solname] == 4 } {\nset surfname [lindex $solname 1]\nset solname [lindex $solname 3]\n}\ntoplevelproperties tlp $solname $surfname\n}\npack $w.bu.close $w.bu.prop -side left\npack $w.bu -side bottom\npack $w.topl -side left -expand yes -fill y ;\nbind .tl2_dlg.topl.list <Double-1> {\nset solname [.tl2_dlg.topl.list get @%x,%y]\nset surfname ""\nif { [llength $solname] == 2 } {\nset solname [lindex $solname 1]\n}\nif { [llength $solname] == 4 } {\nset surfname [lindex $solname 1]\nset solname [lindex $solname 3]\n}\ntoplevelproperties tlp $solname $surfname\n}\nbind .tl2_dlg <Escape> { .tl2_dlg.bu.close invoke }\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Top-Level Options"\nfocus $w\n}\n}\n}\ncatch { \n.ngmenu.geometry add separator\n.ngmenu.geometry add command -label "STL Doctor..." \\\n-command { stldoctordialog; }\n.ngmenu.geometry add command -label "STL Info" \\\n-command {\nset notriangles 0\nset minx 0\nset maxx 0\nset miny 0\nset maxy 0\nset minz 0\nset maxz 0\nset trigscons 0\nNg_STLInfo notriangles minx maxx miny maxy minz maxz trigscons\nset msgtext "NO STL-Triangles : $notriangles\\nGeometry:\\nX = $minx - $maxx\\nY = $miny - $maxy\\nZ = $minz - $maxz\\nConsistency Check = $trigscons\\n"\nset msgtext "$msgtext Status: [Ng_STLInfo status]"\ntk_messageBox -title "STL Info" -message $msgtext -type ok\n}\n}\nset hasocc no\ncatch { if { [catch { load liboccvis[info sharedlibextension] Ng_OCC } result ] } {\n}\nif { [catch { Ng_OCCCommand isoccgeometryloaded }] } {\nproc rebuildoccdialog { } { }\n} {\nputs "OCC module loaded"\nset hasocc yes\n.ngmenu.geometry add separator\n.ngmenu.geometry add command -label "IGES/STEP Topology Explorer/Doctor..." \\\n-command { occdialog; }\n.ngmenu.geometry add command -label "Edit Face Mesh Size..." \\\n-command { surfacemeshsizedialog }\nset entities [ ]\nproc occdialogbuildtree {} {\nglobal entities\nset w .occ_dlg\nset entities [Ng_GetOCCData getentities]\nset nrentities [expr [llength $entities]]\nif {$nrentities != 0} {\n$w.tree insert {Topology} end -id "CompSolids" -text "Composite Solids"\n$w.tree insert {Topology} end -id "FreeSolids" -text "Free Solids"\n$w.tree insert {Topology} end -id "FreeShells" -text "Free Shells"\n$w.tree insert {Topology} end -id "FreeFaces" -text "Free Faces"\n$w.tree insert {Topology} end -id "FreeWires" -text "Free Wires"\n$w.tree insert {Topology} end -id "FreeEdges" -text "Free Edges"\n$w.tree insert {Topology} end -id "FreeVertices" -text "Free Vertices"\n$w.tree item "Topology" -open true\nset i [expr 0]\nwhile {$i < $nrentities} {\nset entity [lindex $entities [expr $i]]\nincr i 1\nset entityname [lindex $entities [expr $i]]\nset myroot [string range $entity 0 [string last / $entity]-1]\n$w.tree insert $myroot end -id $entity -text $entityname -value 1\nincr i 1\n}\nset i [expr 0]\nwhile {$i < $nrentities} {\nset entity [lindex $entities [expr $i]]\n$w.tree item $entity -open false\nincr i 2\n}\nset faces [Ng_OCCCommand getunmeshedfaceinfo]\nset nrfaces [expr [llength $faces]]\nif {$nrfaces >= 2} {\n$w.tree insert {} end -id "ErrorFaces" -text "Faces with surface meshing error"\n$w.tree item ErrorFaces -open true\nset i [expr 0]\nwhile {$i < $nrfaces} {\nset entity [lindex $faces [expr $i]]\nset myroot [string range $entity 0 [string last / $entity]-1]\nif { [string length $myroot] == 0 } {\nset myroot "ErrorFaces"\n}\nincr i 1\nset entityname [lindex $faces [expr $i]]\n$w.tree insert $myroot end -id $entity -text $entityname -value 0\nincr i 1\n}\n}\nset faces [Ng_OCCCommand getnotdrawablefaces]\nset nrfaces [expr [llength $faces]]\nif {$nrfaces >= 2} {\n$w.tree insert {} -id NotDrawableFaces -text "Faces impossible to visualize"\n$w.tree item NotDrawableFaces -open true\nset i [expr 0]\nwhile {$i < $nrfaces} {\nset entity [lindex $faces [expr $i]]\nset myroot [string range $entity 0 [string last / $entity]-1]\nif { [string length $myroot ] == 0 } {\nset myroot NotDrawableFaces\n}\nincr i 1\nset entityname [lindex $faces [expr $i]]\n$w.tree insert $myroot end -id $entity -text $entityname -value 0\nincr i 1\n}\n}\nputs "done"\n}\n}\nproc rebuildoccdialog {} {\nif {[winfo exists .occ_dlg] == 1} {\n.occ_dlg.tree delete [.occ_dlg.tree children Topology]\noccdialogbuildtree\n}\n}\nproc checkoccloaded { } {\nset isoccgeometryloaded [Ng_OCCCommand isoccgeometryloaded]\nif {$isoccgeometryloaded == 0} {\nputs "no IGES/STEP geometry loaded"\ndestroy .occ_dlg\n}\n}\nproc selectentity { entityname } {\nglobal entities\nset nrentities [expr [llength $entities]]\nset i [expr 0]\nwhile {$i < $nrentities} {\nset entitylength []\nset entity2 [lindex $entities [expr $i]]\nincr i 1\nset entityname2 [lindex $entities [expr $i]]\nincr i 1\nset entityname2 [string range $entityname2 0 [expr [string length $entityname]-1]]\nif {$entityname == $entityname2} {\n.occ_dlg.tree see $entity2\n.occ_dlg.tree selection set $entity2\n}\n}\n}\nproc occdialog { } {\nuplevel 1 {\nglobal entities\nset selectvisual geometry\nNg_SetVisParameters\nredraw\nset w .occ_dlg\nif {[winfo exists .occ_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\nttk::treeview $w.tree\n$w.tree insert {} end -id "Topology" -text "Topology"\npack $w.tree -fill both -expand yes\noccdialogbuildtree\nbind $w.tree <Double-1> {\nset entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]\nset rootname ""\nif {[.occ_dlg.tree item [.occ_dlg.tree selection] -value] == 1 } {\nset rootname "Topology"\n}\nset spacepos [string first " " $entityname]\nset entitytype [string range $entityname 0 [expr $spacepos-1]]\nset helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]\nset spacepos2 [string first " " $helpstring]\nset entitynumber [string range $helpstring 0 [expr $spacepos2-1]]\nif {$rootname == "Topology"} {\nNg_OCCCommand highlightentity $entitytype $entitynumber\nset selectvisual geometry\nredraw\n} {\nset brackpos [string first " (" $entityname]\nif {$brackpos != -1} {\nset entityname [string range $entityname 0 $brackpos]\n}\nselectentity $entityname\n}\n}\nttk::button $w.cl -text "Close" -command {\ndestroy .occ_dlg\n}\nttk::button $w.show -text "Show" -command {\nset entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]\nset spacepos [string first " " $entityname]\nset entitytype [string range $entityname 0 [expr $spacepos-1]]\nset helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]\nset spacepos2 [string first " " $helpstring]\nset entitynumber [string range $helpstring 0 [expr $spacepos2-1]]\nNg_OCCCommand show $entitytype $entitynumber\nset selectvisual geometry\nredraw\n}\nttk::button $w.hide -text "Hide" -command {\nset entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]\nset spacepos [string first " " $entityname]\nset entitytype [string range $entityname 0 [expr $spacepos-1]]\nset helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]\nset spacepos2 [string first " " $helpstring]\nset entitynumber [string range $helpstring 0 [expr $spacepos2-1]]\nNg_OCCCommand hide $entitytype $entitynumber\nset selectvisual geometry\nredraw\n}\nttk::button $w.swaporientation -text "Swap orientation" -command {\nset entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]\nset spacepos [string first " " $entityname]\nset entitytype [string range $entityname 0 [expr $spacepos-1]]\nset helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]\nset spacepos2 [string first " " $helpstring]\nset entitynumber [string range $helpstring 0 [expr $spacepos2-1]]\nNg_OCCCommand swaporientation $entitytype $entitynumber\nset selectvisual geometry\nredraw\n.occ_dlg.tree delete [.occ_dlg.tree children Topology]\noccdialogbuildtree\n}\nttk::button $w.marksingular -text "Mark/Unmark as singular" -command {\nset entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]\nset spacepos [string first " " $entityname]\nif { $spacepos != 0 } {\nset entitytype [string range $entityname 0 [expr $spacepos-1]]\nset helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]\nset spacepos2 [string first " " $helpstring]\nif { $spacepos2 != 0 } {\nset entitynumber [string range $helpstring 0 [expr $spacepos2-1]]\nputs $entitytype\nputs $entitynumber\nglobal ismarkedsingular\nNg_OCCCommand marksingular $entitytype $entitynumber\nif { $ismarkedsingular == 0 } {\n.occ_dlg.tree tag remove "Color" [.occ_dlg.tree selection]\n} {\n.occ_dlg.tree tag add "Color" [.occ_dlg.tree selection]\n.occ_dlg.tree tag configure "Color" -foreground "red"\n.occ_dlg.tree tag configure "Color" -background "blue"\n}\n}\n}\n}\nttk::checkbutton $w.zoomtohighlightedentity -text "Zoom to highlighted entity" \\\n-variable occoptions.zoomtohighlightedentity \\\n-command {\nNg_SetOCCVisParameters\nif { ${occoptions.zoomtohighlightedentity} == 1} {\nset selectvisual geometry\nNg_OCCCommand redrawstatus 1\nredraw\n} {\nNg_OCCCommand redrawstatus 0\n}\n}\nttk::frame $w.healing -relief groove -borderwidth 3\nttk::button $w.healing.checkentities -text "Analyze geometry" -command {\nset irregent [Ng_OCCCommand findsmallentities]\nset w .occ_dlg\nset nritems [expr [llength $irregent]]\nset i [expr 0]\nif {$nritems > 0 } {\nif { [.occ_dlg.tree exists ProblematicEntities] == 1 } {\n$w.tree delete ProblematicEntities\n}\n$w.tree insert {} end -id ProblematicEntities -text "Problematic Entities"\n}\nwhile {$i < $nritems} {\nset entity [lindex $irregent [expr $i]]\nincr i 1\nset entityname [lindex $irregent [expr $i]]\nset myroot [string range $entity 0 [string last / $entity]-1]\nif { [string length $myroot] == 0 } {\nset myroot ProblematicEntities\n}\n$w.tree insert $myroot end -id $entity -text $entityname\nincr i 1\n}\n$w.tree item ProblematicEntities -open true\n}\nttk::frame $w.healing.tolerance\nttk::label $w.healing.tolerance.label -text "Healing tolerance: "\nttk::spinbox $w.healing.tolerance.sp -textvariable occoptions.tolerance -width 6 -increment 0.01 -validate focus -validatecommand "my_validatespinbox %W %P 12" \\\n-invalidcommand "my_invalidspinbox %W" -from -1e-9 -to 1e6\ngrid $w.healing.tolerance.label $w.healing.tolerance.sp\nttk::checkbutton $w.healing.fixsmalledges -text "Fix small edges" \\\n-variable occoptions.fixsmalledges\nttk::checkbutton $w.healing.fixspotstripfaces -text "Fix spot/strip faces" \\\n-variable occoptions.fixspotstripfaces\nttk::checkbutton $w.healing.sewfaces -text "Sew faces" \\\n-variable occoptions.sewfaces\nttk::checkbutton $w.healing.makesolids -text "Make solids" \\\n-variable occoptions.makesolids\nttk::checkbutton $w.healing.splitpartitions -text "Split partitions" \\\n-variable occoptions.splitpartitions\nttk::button $w.healing.heal -text "Heal geometry" -command {\nNg_OCCCommand shapehealing\nredraw\n.occ_dlg.tree delete [.occ_dlg.tree children Topology]\noccdialogbuildtree\n}\npack $w.healing.checkentities\npack $w.healing.tolerance $w.healing.fixsmalledges \\\n$w.healing.fixspotstripfaces $w.healing.sewfaces \\\n$w.healing.makesolids $w.healing.splitpartitions -anchor w\npack $w.healing.heal\npack $w.show $w.hide\npack $w.zoomtohighlightedentity -anchor w\npack $w.swaporientation\npack $w.marksingular\npack $w.healing -fill x\npack $w.cl\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "IGES/STEP Topology Explorer/Doctor"\nfocus .occ_dlg\n}\n}\n}\n} }\nif { [Ng_ACISCommand isACISavailable] == "yes" } {\n.ngmenu.geometry add command -label "ACIS Topology Explorer..." \\\n-command { acisdialog; }\n.ngmenu.geometry add command -label "ACIS combine all" \\\n-command { Ng_ACISCommand combineall }\n.ngmenu.geometry add command -label "ACIS Create CT" \\\n-command { Ng_ACISCommand createct }\n}\ncatch { proc print_commandline_help { } {\nputs "Usage: ng { options }"\nputs "-geofile=filename Input geometry file (alternative: ng filename)"\nputs "-meshfile=filename Output mesh file"\nputs "-verycoarse, -coarse, -moderate, -fine, -veryfine"\nputs " Automatic mesh-size selection"\nputs "-meshsizefile=filename Load mesh-size file with local mesh sizes"\nputs "-meshfiletype={\\"Neutral Format\\", ...}"\nputs " Filetype of output file, default is netgen file"\nputs "-batchmode Run Netgen in batchmode"\nputs "-inputmeshfile=filename"\nputs " Input mesh file (batchmode only)"\nputs "-mergefile=filename Merge with mesh file (batchmode only)"\nputs "-refinementfile=filename"\nputs " Use refinementinfo from file (batchmode only)"\nputs "-serversocket=\\\nputs "-V Print additional information"\nputs "-testout=filename file for test output"\nif { [catch { NGS_GetData } ] == 0 } {\nputs "\\nNGSolve parameters:"\nputs "-pdefile=filename Load pde input file"\nputs "-solve Solve pde once"\nputs "-solve=n Solve pde by n adaptive refinement steps"\nputs "-recent Load and solve most recently loaded pde"\n}\n}\nproc set_menu_help { entry helpmsg } {\nglobal menuhelps\nset menuhelps($entry) $helpmsg\n}\nproc show_menu_help { entry } {\nglobal menuhelps\nif {[catch {set helptext $menuhelps($entry)}]} {\nset helptext "no help available "\n}\n.helpline configure -text $helptext\nif {[winfo exists .senshelp_dlg]==1} {\n.senshelp_dlg.text delete 1.0 end\n.senshelp_dlg.text insert end "Menu item: $entry\\n\\n"\n.senshelp_dlg.text insert end $helptext\n}\n}\nproc set_control_help { control helpmsg } {\nbind $control <Enter> "show_control_help {$helpmsg}"\nbind $control <Leave> "show_control_help {None}"\n.balloon bind $control -balloonmsg $helpmsg -statusmsg $helpmsg\n}\nproc show_control_help { helpmsg } {\n.helpline configure -text $helpmsg\nif {[winfo exists .senshelp_dlg]==1} {\n.senshelp_dlg.text delete 1.0 end\n.senshelp_dlg.text insert end $helpmsg\n}\n}\nproc sensitivehelpdialog { show } {\nset w .senshelp_dlg\nif {[winfo exists .senshelp_dlg] == 1} {\nif { $show == 1 } {\nwm withdraw .senshelp_dlg\nwm deiconify $w\nfocus $w\n} {\nwm withdraw $w\n}\n} {\ntoplevel $w\nglobal senshelptext\ntext $w.text -yscrollcommand "$w.scroll set" -setgrid true \\\n-width 40 -height 10 -wrap word\nscrollbar $w.scroll -command "$w.text yview"\npack $w.scroll -side right -fill y\npack $w.text -expand yes -fill both\nttk::frame $w.bu\npack $w.bu\nttk::button $w.close -text "Close" \\\n-command {\nwm withdraw .senshelp_dlg\nset showsensitivehelp 0\n}\npack $w.close\nif { $show == 1 } {\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Help"\nfocus $w\n}\n}\n}\nset_menu_help "File" "In File menu you can load and store geometries, meshes etc."\nset_menu_help "New Geometry" "Deletes current geometry"\nset_menu_help "Load Geometry" "Loads Geometry file in one of the formats STL (ASCII or binary), Constructive Solid Geometry (.geo) or 2D geometry. Please have a look into Netgen User\'s manuel for more details."\nset_menu_help "Save Geometry" "Saves STL Geometry in in either ASCII or binary STL format."\nset_menu_help "Load Mesh" "Loads surface and volume mesh in Netgen internal format."\nset_menu_help "Save Mesh" "Saves surface and volume mesh in Netgen internal format."\nset_menu_help "Write EPS File" "Dumps OpenGL rendering to EPS File."\nset_menu_help "Save Options" "Saves current options in file \\"ng.opt\\". These options will be loaded again when starting ng in the same directory."\nset_menu_help "Export Mesh" "Exports mesh in format defined by Export Filetype."\nset_menu_help "Export Filetype" "Selects file format for exporting mesh. Please have a look into the Netgen User\'s manual for more information."\nset_menu_help "Import Mesh" "Imports surface or volume mesh in exchange format."\nset_menu_help "Quit" "Quits Netgen"\nset_menu_help "Geometry" "Preparing geometries, visualiztion of geometries."\nset_menu_help "Scan CSG Geometry" "Generates surface triangulation for rendering"\nset_menu_help "CSG Options" "Sets Options for CSG visualization (bounding box, detail size, number of facets)."\nset_menu_help "CSG Properties" "Defines appearance of current CSG geometry (color, visibility, transparency)"\nset_menu_help "STL Doctor" "Calls STL Doctor for preprocessing STL geometry files."\nset_menu_help "STL Info" "Retrieves information about current STL geometry."\nset_menu_help "Mesh" "Menu for mesh generation"\nset_menu_help "Generate Mesh" "Generates mesh from geometry, same as Button \\"Generate Mesh\\""\nset_menu_help "Stop Meshing" "Terminates meshgeneration. It may take a while until meshing terminates, please be patient."\nset_menu_help "Meshing Options" "Set options for mesh generation."\nset_menu_help "Delete Mesh" "Deletes mesh. Not necessary before generation of new mesh."\nset_menu_help "Delete Vol Mesh" "Deletes only volume mesh."\nset_menu_help "Mesh Quality" "Computs element shape measures. Triangle angles are inner angles of all triangles (faces of tetrahedra). Tet angles are angles between faces of tetrahedra."\nset_menu_help "Check Surface Mesh" "Checks consistency and overlap of surface mesh. Marks overlapping elements as bad elements, please enable visualization of bad elements in View->Mesh."\nset_menu_help "Check Volume Mesh" "Checks conformity of volume mesh."\nset_menu_help "Edit Boundary Conditions" "Open dialog for setting boundary condition numbers for individual faces."\nset_menu_help "Analyze Geometry" "Perform only first step in mesh generation. Action depends on geometry type, e.g. generates charts for STL mesh, find vertices in CSG geometries."\nset_menu_help "Mesh Edges" "Meshes edges"\nset_menu_help "Mesh Surface" "Generates surface mesh. Includes already surface optimization for some geometry types."\nset_menu_help "Optimize Surface" "Optimizes surface mesh."\nset_menu_help "Surface Optim. Step" "Performs a specific surface optimiztion step. Mesh smoothing moves nodes. edge swapping swaps the diagonal of a quadrilateral built by two triangles, criterion either by number of nodes, or anlges. Combine points eliminates triangles by combining points (in the center of gravity)."\nset_menu_help "Mesh Volume" "Performs volume meshing. Algorithm is a combination of Delaunay and Rule-based Advancing Front"\nset_menu_help "Optimize Volume" "Performs additional volume optimization steps"\nset_menu_help "Smooth Opt Volume" "Performs optimization steps by smoothing iterations"\nset_menu_help "Smooth Opt Volume Jacobian" "Volume optimization by smoothing iterations. Criterion is optimization of Jacobi determinants. This optimization step is also available for 10-node tetrahedra."\nset_menu_help "View" "Sets viewing options"\nset_menu_help "Zoom all" "Zooms scene to show whole object"\nset_menu_help "Center" "Defines center of rotation"\nset_menu_help "Viewing Options" "Sets viewing options for geometry, mesh, lighting"\nset_menu_help "Clipping Plane" "Introduces clipping plane. The clipping plane is defined by the normal vector, and a scaled offset. Clipping of performed by OpenGl rendering"\nset_menu_help "Quality Plot" "Shows the element quality distribution histogram. Measure is volume scaled by edge-length to the third. Optimal elements have measure 1."\nset_menu_help "Sensitive Help" "Shows this help window"\nset_menu_help "Mesh-size" "Manipulations of existing mesh"\nset_menu_help "Refine uniform" "Refines mesh by splitting elements into eight childs (algorithm of J. Bey)"\nset_menu_help "Second Order" "Converts 4 node elements to 10 node elements. Edge-midpoitns are projected to the geometry."\nset_menu_help "Refinement Dialog" "Controls local mesh refinement"\nset_menu_help "Load Meshsize" "Loads mesh-size file for local mesh refinement."\nset_menu_help "MS from Surf Mesh" "Defines mesh-size by the surface mesh."\nset f .options_dlg.nb.nbframe.general\nset_control_help $f.fine "Controls relative mesh size.\\nThis control affects other mesh-size controls in common"\nset_control_help $f.first "First step in mesh generation. Usually, meshing starts from \\"analyze geometry\\". If the surface mesh is already available \\"First step\\" should be set to \\"mesh volume\\""\nset_control_help $f.last "Last step in mesh generation. If only the surface mesh is required, please set \\"Last Step\\" to \\"Optimize Surface\\""\nset_control_help .bubar.surfm "Start mesh generation"\nset_control_help .bubar.stopm "Stop mesh generation"\nproc help_item { helptext } {p\nputs $helptext\n}\nproc show_help { } {\nset w .help\nif {[winfo exists .help] == 1} {\nwm withdraw $w\nwm deiconif $w\nfocus $w\n} {\ntoplevel $w\nframe $w.buttons\npack $w.buttons -side bottom -fill x -pady 2m\nbutton $w.buttons.done -text Done -command "destroy $w"\npack $w.buttons.done -side left -expand 1\ntext $w.text -yscrollcommand "$w.scroll set" -setgrid true \\\n-width 60 -height 24 -wrap word\nscrollbar $w.scroll -command "$w.text yview"\npack $w.scroll -side right -fill y\npack $w.text -expand yes -fill both\n}\n$w.text configure -state normal\n$w.text delete 1.0 end\n}\nset bold "-background \nset normal "-background {} -relief flat"\nproc help_main { } {\nshow_help;\nset w .help\nglobal bold\nglobal normal\n$w.text insert 0.0 \\\n{NETGEN Help}\n$w.text insert end \\n\\n\n$w.text insert end \\\n{1. General} d1\n$w.text insert end \\n\\n\n$w.text insert end \\\n{2. Menu items } d2\n$w.text insert end \\n\\n\nforeach tag {d1 d2} {\n$w.text tag bind $tag <Any-Enter> "$w.text tag configure $tag $bold"\n$w.text tag bind $tag <Any-Leave> "$w.text tag configure $tag $normal"\n}\n$w.text tag bind d1 <1> { puts "general"; help_general }\n$w.text tag bind d2 <1> { help_menus }\n$w.text configure -state disabled\n}\nproc help_general { } {\nshow_help;\nset w .help\nglobal bold\nglobal normal\nputs "general called"\n$w.text insert 0.0 \\\n{NETGEN is an automatic three dimensional tetrahedral mesh generation system. It accepts input from constructive solid geometry (CSG) or boundary representation (BRep) from STEP or STL file format. NETGEN contains modules for mesh optimization and hierarchical mesh refinement.}\n$w.text configure -state disabled\n}\nproc help_menus { } {\nshow_help;\nset w .help\nglobal bold\nglobal normal\n$w.text insert 0.0 \\\n{The NETGEN Menu items are}\n$w.text insert end \\n\\n\n$w.text insert end \\\n{1. File} d1\n$w.text insert end \\n\\n\n$w.text insert end \\\n{2. Geometry } d2\n$w.text insert end \\n\\n\n$w.text insert end \\\n{3. Mesh } d3\n$w.text insert end \\n\\n\n$w.text insert end \\\n{4. View } d4\n$w.text insert end \\n\\n\n$w.text insert end \\\n{5. Mesh-size } d5\n$w.text insert end \\n\\n\n$w.text insert end \\\n{6. STL } d6\nforeach tag {d1 d2 d3 d4 d5 d6} {\n$w.text tag bind $tag <Any-Enter> "$w.text tag configure $tag $bold"\n$w.text tag bind $tag <Any-Leave> "$w.text tag configure $tag $normal"\n}\n$w.text tag bind d1 <1> {puts "File menu"}\n$w.text tag bind d2 <1> {puts "Geometry menu"}\n$w.text tag bind d3 <1> {puts "Mesh menu"}\n$w.text tag bind d4 <1> {puts "View menu"}\n$w.text tag bind d5 <1> {puts "Mesh-size menu"}\n$w.text tag bind d6 <1> {puts "STL menu"}\n$w.text configure -state disabled\n}\n}\ncatch { Ng_Vis_Set parameters\nset viscnt 0\nproc snapshottimer { } {\nafter 2000 { snapshottimer }\nglobal viscnt\nset viscnt [expr $viscnt+1]\nset s1 0000$viscnt\nset cnt [string range $s1 [expr [string length $s1]-4] end]\nset filename "p$cnt.jpg"\n}\nsnapshottimer\nproc redrawtimer { } {\nglobal visoptions.autoredraw\nglobal visoptions.autoredrawtime\nset delay [expr int(${visoptions.autoredrawtime}*1000)]\nif { ${visoptions.autoredraw} == 1 } { redraw; }\nafter $delay { redrawtimer }\n}\nredrawtimer\nset perstarttime [clock clicks -millisecond]\nproc redrawperiodic { } {\nglobal visoptions.redrawperiodic\nglobal perstarttime\nset curtime [clock clicks -millisecond]\nNg_Vis_Set time [expr ($curtime - $perstarttime) / 5]\nredraw\nif { ${visoptions.redrawperiodic} == 1 } { after 30 { redrawperiodic } };\n}\nproc addplotline { identifier datax datay plotinfo {color black}} {\nset c $identifier.c\nset xstart [lindex $plotinfo 0]\nset ystart [lindex $plotinfo 1]\nset xmin [lindex $plotinfo 2]\nset ymin [lindex $plotinfo 3]\nset unitx [lindex $plotinfo 4]\nset unity [lindex $plotinfo 5]\nset latestx [expr ([lindex $datax 0]-$xmin)*$unitx + $xstart]\nset latesty [expr ([lindex $datay 0]-$ymin)*$unity + $ystart]\nfor {set i 1} {$i < [llength $datax]} {incr i} {\nset xpos [expr ([lindex $datax $i]-$xmin)*$unitx + $xstart]\nset ypos [expr ([lindex $datay $i]-$ymin)*$unity + $ystart]\n$c create line $latestx $latesty $xpos $ypos -width 1 -fill $color\nset latestx $xpos\nset latesty $ypos\n}\n}\nproc createlineplot { width height identifier title xmin xmax ymin ymax plotinfo} {\nset thiswidth $width\nset thisheight $height\nif { $thiswidth < 275 } { set thiswidth 275 }\nif { $thisheight < 225 } { seth thisheight 225 }\nset w $identifier\nif {[winfo exists $w] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\nset c $w.c\ncanvas $c -relief raised -width $thiswidth -height $thisheight\npack $w.c -side top -fill x\nset titleFont {Helvetica 18}\nset smallFont {Helvetica 12}\nset xstart 100\nset xend [expr $thiswidth-75]\nset ystart [expr $thisheight-75]\nset yend 75\n$c create line $xstart $ystart $xstart $yend -width 2\n$c create line $xstart $ystart $xend $ystart -width 2\nset unitx [expr double($xend-$xstart)/($xmax-$xmin)]\nset unity [expr double($yend-$ystart)/($ymax-$ymin)]\nfor {set i 0} {$i <= 1} {set i [expr $i+0.2]} {\n$c create line [expr $xstart+$i*($xend-$xstart)] [expr $ystart] [expr $xstart+$i*($xend-$xstart)] [expr $ystart+5] -width 2\n$c create text [expr $xstart+$i*($xend-$xstart)] [expr $ystart+7] -anchor n -font $smallFont \\\n-text [format "%.3g" [expr $xmin+$i*($xmax-$xmin)]]\n$c create line [expr $xstart] [expr $ystart+$i*($yend-$ystart)] [expr $xstart-7] [expr $ystart+$i*($yend-$ystart)] -width 2\n$c create text [expr $xstart-9] [expr $ystart+$i*($yend-$ystart)] -anchor e -font $smallFont \\\n-text [format "%.3g" [expr $ymin+$i*($ymax-$ymin)]]\n}\nupvar $plotinfo ploti\nset ploti "$xstart $ystart $xmin $ymin $unitx $unity"\nbutton $w.close -text "Close" -command "destroy $w"\npack $w.close\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w $title\nfocus $w\n}\n}\nproc getlineplotdata { datax datay xmini xmaxi ymini ymaxi} {\nupvar $datax datx\nupvar $datay daty\nupvar $xmini xmin\nupvar $xmaxi xmax\nupvar $ymini ymin\nupvar $ymaxi ymax\nglobal visoptions.lineplotusingx\nglobal visoptions.lineplotusingy\nglobal visoptions.lineplotsource\nglobal visoptions.lineplotfile\nset datx ""\nset daty ""\nset xmin 1e20\nset xmax -1e20\nset ymin 1e20\nset ymax -1e20\nif {${visoptions.lineplotsource} == "file"} {\nset fileId [open ${visoptions.lineplotfile} r]\nset line ""\nwhile {[gets $fileId line] >= 0} {\nif { [string index [lindex $line 0] 0] != "\\\nif { ${visoptions.lineplotusingx} < [llength $line] } {\nlappend datx [lindex $line ${visoptions.lineplotusingx}]\nif { [lindex $datx end] < $xmin } {set xmin [lindex $datx end]}\nif { [lindex $datx end] > $xmax } {set xmax [lindex $datx end]}\n} {\nlappend datx 0\n}\nif { ${visoptions.lineplotusingy} < [llength $line] } {\nlappend daty [lindex $line ${visoptions.lineplotusingy}]\nif { [lindex $daty end] < $ymin } {set ymin [lindex $daty end]}\nif { [lindex $daty end] > $ymax } {set ymax [lindex $daty end]}\n} {\nlappend daty 0\n}\n}\n}\nclose $fileId\n}\n}\nproc lineplotdialog { } {\nset w .lineplot_dlg\nif {[winfo exists .lineplot_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\nttk::frame $w.filesettings -relief groove -borderwidth 3\nttk::frame $w.filesettings.title\nttk::radiobutton $w.filesettings.title.choose -variable visoptions.lineplotsource \\\n-value file -text "Data from File"\npack $w.filesettings.title.choose -side left\npack $w.filesettings.title\nglobal visoptions.lineplotselectedeval\nglobal visoptions.lineplotfile\nglobal visoptions.evaluatefilenames\nglobal visoptions.evaluatefiledescriptions\nset evdata [NGS_GetData evaluatefiles]\nset visoptions.evaluatefilenames none\nset visoptions.evaluatefiledescriptions none\nfor {set i 0} {[expr $i+1] < [llength $evdata]} {incr i 2} {\nlappend visoptions.evaluatefilenames [lindex $evdata $i]\nlappend visoptions.evaluatefiledescriptions [lindex $evdata [expr $i+1]]\n}\nttk::frame $w.filesettings.latestevals\nttk::label $w.filesettings.latestevals.lab -text "Use Evaluate Results: "\nttk::menubutton $w.filesettings.latestevals.but -menu $w.filesettings.latestevals.menu -text "coarse" -width 40\nmenu $w.filesettings.latestevals.menu -tearoff 0\nfor {set i 0} {$i < [llength ${visoptions.evaluatefilenames}]} {incr i} {\n$w.filesettings.latestevals.menu add command -label $i\\\n-command "set visoptions.lineplotselectedeval $i ; $w.filesettings.latestevals.but configure -text \\"[lindex ${visoptions.evaluatefiledescriptions} $i] ([lindex ${visoptions.evaluatefilenames} $i])\\""\n}\n$w.filesettings.latestevals.menu invoke ${visoptions.lineplotselectedeval}\ngrid $w.filesettings.latestevals.lab $w.filesettings.latestevals.but -sticky nw\npack $w.filesettings.latestevals\nttk::frame $w.filesettings.sfn\nttk::button $w.filesettings.sfn.bb -text "Browse" \\\n-command { set visoptions.lineplotfile [tk_getOpenFile] }\nttk::entry $w.filesettings.sfn.fn -width 50 \\\n-textvariable visoptions.lineplotfile\npack $w.filesettings.sfn.bb $w.filesettings.sfn.fn -side left\npack $w.filesettings.sfn\nttk::button $w.filesettings.refresh -text "Refresh" -command {\nif { ${visoptions.lineplotselectedeval} != 0} {\nset visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}]\n}\nset saveusingx ${visoptions.lineplotusingx}\nset saveusingy ${visoptions.lineplotusingy}\nfor { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } {\n${visoptions.lineplotxcoordselector} delete $i\n}\nfor { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } {\n${visoptions.lineplotycoordselector} delete $i\n}\nset fileId [open ${visoptions.lineplotfile} r]\nset line ""\ngets $fileId line\nclose $fileId\nif { [lindex $line 0] == "\\\nset visoptions.lineplotdatadescr [lrange $line 1 end]\n} {\nset visoptions.lineplotdatadescr ""\nfor { set i 0 } { $i < [llength $line] } { incr i } {\nlappend visoptions.lineplotdatadescr "data[expr $i+1]"\n}\n}\nfor { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } {\n${visoptions.lineplotxcoordselector} add command $i -label [lindex ${visoptions.lineplotdatadescr} $i]\n}\nfor { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } {\n${visoptions.lineplotycoordselector} add command $i -label [lindex ${visoptions.lineplotdatadescr} $i]\n}\nif { $saveusingx < [llength ${visoptions.lineplotdatadescr}] } {\nset visoptions.lineplotusingx $saveusingx\n} {\nset visoptions.lineplotusingx 0\n}\nif { $saveusingy < [llength ${visoptions.lineplotdatadescr}] } {\nset visoptions.lineplotusingy $saveusingy\n} {\nset visoptions.lineplotusingy 1\n}\n}\npack $w.filesettings.refresh\nttk::frame $w.filesettings.using\nglobal visoptions.lineplotdatadescr\nttk::frame $w.filesettings.using.xco\nttk::label $w.filesettings.using.xco.lab -text "X-Coord:"\nttk::menubutton $w.filesettings.using.xco.but -menu $w.filesettings.using.xco.menu -text "" -width 15\nmenu $w.filesettings.using.xco.menu -tearoff 0\nfor {set i 0} {$i < [llength ${visoptions.lineplotdatadescr}]} {incr i} {\n$w.filesettings.using.xco.menu add command -label [lindex ${visoptions.lineplotdatadescr} $i]\\\n-command "set visoptions.lineplotusingx $i ; $w.filesettings.using.xco.but configure -text \\"[lindex ${visoptions.lineplotdatadescr} $i]\\""\n}\n$w.filesettings.using.xco.menu invoke [lindex ${visoptions.lineplotdatadescr} 0]\ngrid $w.filesettings.using.xco.lab $w.filesettings.using.xco.but -sticky nw\nttk::frame $w.filesettings.using.yco\nttk::label $w.filesettings.using.yco.lab -text "Y-Coord:"\nttk::menubutton $w.filesettings.using.yco.but -menu $w.filesettings.using.yco.menu -text "" -width 15\nmenu $w.filesettings.using.yco.menu -tearoff 0\nfor {set i 0} {$i < [llength ${visoptions.lineplotdatadescr}]} {incr i} {\n$w.filesettings.using.yco.menu add command -label [lindex ${visoptions.lineplotdatadescr} $i]\\\n-command "set visoptions.lineplotusingy $i ; $w.filesettings.using.yco.but configure -text \\"[lindex ${visoptions.lineplotdatadescr} $i]\\""\n}\n$w.filesettings.using.yco.menu invoke [lindex ${visoptions.lineplotdatadescr} 0]\ngrid $w.filesettings.using.yco.lab $w.filesettings.using.yco.but -sticky nw\nglobal visoptions.lineplotxcoordselector\nglobal visoptions.lineplotycoordselector\nset visoptions.lineplotxcoordselector $w.filesettings.using.xco\nset visoptions.lineplotycoordselector $w.filesettings.using.yco\npack $w.filesettings.using.xco $w.filesettings.using.yco -side left\npack $w.filesettings.using\npack $w.filesettings -fill x -ipady 3\nttk::frame $w.settings -relief groove -borderwidth 3\nttk::label $w.settings.title -text "\\nSettings\\n"\npack $w.settings.title\nttk::frame $w.settings.minmax\nttk::checkbutton $w.settings.minmax.autoscale -text "Autoscale" -variable visoptions.lineplotautoscale\nttk::frame $w.settings.minmax.xmin\nttk::label $w.settings.minmax.xmin.label -text "Min. x: "\nttk::spinbox $w.settings.minmax.xmin.sp -textvariable visoptions.lineplotxmin -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \\\n-invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9\nttk::frame $w.settings.minmax.xmax\nttk::label $w.settings.minmax.xmax.label -text "Max. x: "\nttk::spinbox $w.settings.minmax.xmax.sp -textvariable visoptions.lineplotxmax -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \\\n-invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9\nttk::frame $w.settings.minmax.ymin\nttk::label $w.settings.minmax.ymin.label -text "Min. y: "\nttk::spinbox $w.settings.minmax.ymin.sp -textvariable visoptions.lineplotymin -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \\\n-invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9\nttk::frame $w.settings.minmax.ymax\nttk::label $w.settings.minmax.ymax.label -text "Max. y: "\nttk::spinbox $w.settings.minmax.ymax.sp -textvariable visoptions.lineplotymax -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \\\n-invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9\npack $w.settings.minmax.xmin.label $w.settings.minmax.xmin.sp\npack $w.settings.minmax.xmax.label $w.settings.minmax.xmax.sp\npack $w.settings.minmax.ymin.label $w.settings.minmax.ymin.sp\npack $w.settings.minmax.ymax.label $w.settings.minmax.ymax.sp\npack $w.settings.minmax.autoscale $w.settings.minmax.xmin $w.settings.minmax.xmax \\\n$w.settings.minmax.ymin $w.settings.minmax.ymax -side left\npack $w.settings.minmax\nttk::label $w.settings.empty1 -text ""\npack $w.settings.empty1\nttk::frame $w.settings.plotsize\nttk::frame $w.settings.plotsize.xsize\nttk::label $w.settings.plotsize.xsize.label -text "Plotsize x: "\nttk::spinbox $w.settings.plotsize.xsize.sp -textvariable visoptions.lineplotsizex -width 6 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9\npack $w.settings.plotsize.xsize.label $w.settings.plotsize.xsize.sp\nttk::frame $w.settings.plotsize.ysize\nttk::label $w.settings.plotsize.ysize.label -text "Plotsize y: "\nttk::spinbox $w.settings.plotsize.ysize.sp -textvariable visoptions.lineplotsizey -width 6 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9\npack $w.settings.plotsize.ysize.label $w.settings.plotsize.ysize.sp\npack $w.settings.plotsize.xsize $w.settings.plotsize.ysize -side left\npack $w.settings.plotsize\nttk::label $w.settings.empty2 -text ""\npack $w.settings.empty2\nttk::frame $w.settings.color\nttk::label $w.settings.color.lab -text "Linecolor: "\nttk::menubutton $w.settings.color.but -menu $w.settings.color.menu -text "" -width 15\nmenu $w.settings.color.menu -tearoff 0\nforeach step { red black blue green yellow } {\n$w.settings.color.menu add command -label $step -command "set visoptions.lineplotcolor $step; $w.settings.color.but configure -text \\"$step\\""\n}\n$w.settings.color.menu invoke "red"\ngrid $w.settings.color.lab $w.settings.color.but -sticky nw\npack $w.settings.color\npack $w.settings -fill x\nset datax ""\nset datay ""\nset xmin 0\nset xmax 0\nset ymin 0\nset ymax 0\nttk::frame $w.plots -relief groove -borderwidth 3\nttk::frame $w.plots.selplot\nttk::label $w.plots.selplot.lab -text "Linecolor: "\nttk::menubutton $w.plots.selplot.but -menu $w.plots.selplot.menu -text "" -width 15\nmenu $w.plots.selplot.menu -tearoff 0\n$w.plots.selplot.menu add command -label "None" -command "set visoptions.lineplotselected \\"None\\"; $w.plots.selplot.but configure -text \\"None\\""\ngrid $w.plots.selplot.lab $w.plots.selplot.but -sticky nw\n$w.plots.selplot.menu invoke "None"\nglobal visoptions.lineplotselector\nset visoptions.lineplotselector $w.plots.selplot.menu\nttk::button $w.plots.new -text "Generate New Plot" -command {\nif { ${visoptions.lineplotselectedeval} != 0} {\nset visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}]\n}\ngetlineplotdata datax datay xmin xmax ymin ymax\nputs stdout "xmin $xmin xmax $xmax ymin $ymin ymax $ymax"\nglobal visoptions.lineplotautoscale\nif {! ${visoptions.lineplotautoscale}} {\nputs "using set min/max values"\nset xmin ${visoptions.lineplotxmin}\nset xmax ${visoptions.lineplotxmax}\nset ymin ${visoptions.lineplotymin}\nset ymax ${visoptions.lineplotymax}\n}\nincr visoptions.lineplotcurrentnum\nset ident .newplot${visoptions.lineplotcurrentnum}\nset plotinfo ""\ncreatelineplot ${visoptions.lineplotsizex} ${visoptions.lineplotsizey} \\\n$ident "Lineplot ${visoptions.lineplotcurrentnum}" \\\n$xmin $xmax $ymin $ymax plotinfo\nlappend visoptions.lineplotinfos $plotinfo\n${visoptions.lineplotselector} add command ${visoptions.lineplotcurrentnum} -label "Lineplot ${visoptions.lineplotcurrentnum}"\naddplotline $ident $datax $datay $plotinfo ${visoptions.lineplotcolor}\n}\nttk::button $w.plots.addto -text "Add to Selected Plot" -command {\nif { ${visoptions.lineplotselectedeval} != 0} {\nset visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}]\n}\nif { ${visoptions.lineplotselected} != "none" } {\ngetlineplotdata datax datay xmin xmax ymin ymax\nset ident .newplot${visoptions.lineplotselected}\nset plotinfo [lindex ${visoptions.lineplotinfos} ${visoptions.lineplotselected}]\naddplotline $ident $datax $datay $plotinfo ${visoptions.lineplotcolor}\n}\n}\npack $w.plots.new $w.plots.addto $w.plots.selplot\npack $w.plots -fill x -ipady 3\nttk::button $w.close -text "Close" -command "destroy $w"\npack $w.close\nwm withdraw $w\nwm geom $w +200+100\nwm deiconify $w\nwm title $w "2D Lineplots"\nfocus $w\n}\n}\nset fieldlinesdialog_pop1 0\nproc fieldlinesdialog { } {\nset w .fieldlines_dlg\nglobal fieldlinesdialog_pop1\nset fieldlinesdialog_pop1 1\nif {[winfo exists .fieldlines_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\npack [ttk::notebook $w.nb] -fill both -side top -ipadx 6 -ipady 6\n$w.nb add [ttk::frame $w.nb.draw] -text "Draw" -underline 0\n$w.nb add [ttk::frame $w.nb.settings] -text "Settings" -underline 0\nset f $w.nb.draw\nttk::labelframe $f.general -text "General settings" -relief groove -borderwidth 3\nttk::checkbutton $f.general.enable -text "Enable Fieldlines" \\\n-variable visoptions.drawfieldlines \\\n-command {\nNg_Vis_Set parameters;\nredraw\n}\nttk::label $f.general.numl -text "num:"\nttk::spinbox $f.general.num -from 0 -to 100 -increment 1 \\\n-textvariable visoptions.numfieldlines -width 4\ngrid $f.general.enable -sticky nw -padx 4 -pady 2\ngrid x $f.general.numl $f.general.num -rowspan 3 -sticky w -padx 4 -row 0 -pady 2\ngrid anchor $f.general center\npack $f.general -pady 15 -fill x -ipady 3\nttk::label $f.labe0 -text " "\npack $f.labe0\nttk::checkbutton $f.general.randomstart -text "Field dependent density " \\\n-variable visoptions.fieldlinesrandomstart \\\n-command { Ng_Vis_Set parameters; redraw}\nttk::checkbutton $f.general.redrawperiodic -text "Animate periodic" \\\n-variable visoptions.redrawperiodic \\\n-command {\nredrawperiodic\nNg_Vis_Set parameters;\nredraw\n}\ngrid $f.general.randomstart -sticky nw -padx 4 -row 1\ngrid $f.general.redrawperiodic -sticky nw -padx 4 -row 2\nttk::label $f.lab0 -text " "\npack $f.lab0\nttk::frame $f.vecfun\nttk::label $f.vecfun.lab -text "Vector Function: "\nttk::menubutton $f.vecfun.but -menu $f.vecfun.menu -text "" -width 12\nmenu $f.vecfun.menu -tearoff 0\nfor { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {\nset fname [Ng_Vis_Field getfieldname $i]\nset fcomp [Ng_Vis_Field getfieldcomponents $i]\nset iscomplex [Ng_Vis_Field iscomplex $i]\nset sdim [Ng_Vis_Field getdimension]\nif { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] }\nif { ($fcomp == $sdim) || ($fcomp == 3) } {\n$f.vecfun.menu add command -label $fname -command "set visoptions.fieldlinesvecfunction $fname;Ng_Vis_Set parameters; redraw;$f.vecfun.but configure -text \\"$fname\\" " \t }\n}\ngrid $f.vecfun.lab $f.vecfun.but -sticky nw\npack $f.vecfun\nttk::label $f.lab00 -text " "\npack $f.lab00\nttk::frame $f.phasesettings\nttk::checkbutton $f.phasesettings.onephase -text "Fix Phase" -variable visoptions.fieldlinesonlyonephase\nttk::frame $f.phasesettings.phase\nttk::label $f.phasesettings.phase.lab -text "phi"\nttk::scale $f.phasesettings.phase.sc -orient horizontal -length 100 -from 0 -to 360 -variable visoptions.fieldlinesphase \\\n-command "roundscale $f.phasesettings.phase.sc 0; popupcheckredraw3 fieldlinesdialog_pop1"\nttk::entry $f.phasesettings.phase.ent -width 4 -textvariable visoptions.fieldlinesphase -validate focus -takefocus 0 \\\n-validatecommand "popupcheckredraw3 fieldlinesdialog_pop1;my_validate %W 0 1 %P 0" \\\n-invalidcommand "my_invalid %W;popupcheckredraw3 fieldlinesdialog_pop1"\ngrid $f.phasesettings.phase.lab $f.phasesettings.phase.sc $f.phasesettings.phase.ent -sticky nw -ipadx 4\npack $f.phasesettings.onephase $f.phasesettings.phase -side left\npack $f.phasesettings\nttk::label $f.lab1 -text " "\npack $f.lab1\nttk::frame $f.boxsettings -relief groove -borderwidth 3\nttk::frame $f.boxsettings.title\nttk::radiobutton $f.boxsettings.title.choose -variable visoptions.fieldlinesstartarea \\\n-value box -text "Startpoints in Box"\npack $f.boxsettings.title.choose -side left\npack $f.boxsettings.title\nttk::frame $f.boxsettings.points\nttk::label $f.boxsettings.points.lab2 -text "Pmin";\nttk::entry $f.boxsettings.points.ent1x -width 8 \\\n-textvariable visoptions.fieldlinesstartareap1x\nttk::entry $f.boxsettings.points.ent1y -width 8 \\\n-textvariable visoptions.fieldlinesstartareap1y\nttk::entry $f.boxsettings.points.ent1z -width 8 \\\n-textvariable visoptions.fieldlinesstartareap1z\nttk::label $f.boxsettings.points.lab3 -text " Pmax";\nttk::entry $f.boxsettings.points.ent2x -width 8 \\\n-textvariable visoptions.fieldlinesstartareap2x\nttk::entry $f.boxsettings.points.ent2y -width 8 \\\n-textvariable visoptions.fieldlinesstartareap2y\nttk::entry $f.boxsettings.points.ent2z -width 8 \\\n-textvariable visoptions.fieldlinesstartareap2z\npack $f.boxsettings.points\npack $f.boxsettings.points.lab2 $f.boxsettings.points.ent1x $f.boxsettings.points.ent1y $f.boxsettings.points.ent1z -side left\npack $f.boxsettings.points.lab3 $f.boxsettings.points.ent2x $f.boxsettings.points.ent2y $f.boxsettings.points.ent2z -side left\nttk::button $f.boxsettings.settobb -text "Bounding Box" -command {\nset bbox [Ng_MeshInfo bbox]\nset visoptions.fieldlinesstartareap1x [lindex $bbox 0]\nset visoptions.fieldlinesstartareap2x [lindex $bbox 1]\nset visoptions.fieldlinesstartareap1y [lindex $bbox 2]\nset visoptions.fieldlinesstartareap2y [lindex $bbox 3]\nset visoptions.fieldlinesstartareap1z [lindex $bbox 4]\nset visoptions.fieldlinesstartareap2z [lindex $bbox 5]\n}\npack $f.boxsettings.settobb\npack $f.boxsettings -fill x -ipady 3\nttk::frame $f.facesettings -relief groove -borderwidth 3\nttk::frame $f.facesettings.title\nttk::radiobutton $f.facesettings.title.choose -variable visoptions.fieldlinesstartarea \\\n-value face -text "Startpoints on Face"\npack $f.facesettings.title.choose -side left\npack $f.facesettings.title\nttk::frame $f.facesettings.index\nttk::label $f.facesettings.index.lab -text "face index:"\nttk::label $f.facesettings.index.ent -text 1;\npack $f.facesettings.index.lab $f.facesettings.index.ent -side left\npack $f.facesettings.index\npack $f.facesettings -fill x -ipady 3\nglobal visoptions.fieldlinesfilename\nttk::frame $f.filesettings -relief groove -borderwidth 3\nttk::frame $f.filesettings.title\nttk::radiobutton $f.filesettings.title.choose -variable visoptions.fieldlinesstartarea \\\n-value file -text "Startpoints from File"\npack $f.filesettings.title.choose -side left\npack $f.filesettings.title\nttk::frame $f.filesettings.sfn\nttk::button $f.filesettings.sfn.bb -text "Browse" \\\n-command {\nset types {\n{ "Netgen Fieldlines" {.nef} }\n}\nset visoptions.fieldlinesfilename [tk_getOpenFile -filetypes $types -defaultextension ".nef"]\n}\nttk::entry $f.filesettings.sfn.fn -width 50 \\\n-textvariable visoptions.fieldlinesfilename\npack $f.filesettings.sfn.bb $f.filesettings.sfn.fn -side left\npack $f.filesettings.sfn\npack $f.filesettings -fill x -ipady 3\nset g $w.nb.settings\nttk::frame $g.linesettings -relief groove -borderwidth 3\nttk::label $g.linesettings.title -text "\\nLine Settings\\n"\nttk::frame $g.linesettings.length\nttk::label $g.linesettings.length.lab -text "rel. Length: "\nttk::spinbox $g.linesettings.length.sp -textvariable visoptions.fieldlineslength -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 5" \\\n-invalidcommand "my_invalidspinbox %W" -from 0.00001 -to 10000\ngrid $g.linesettings.length.lab $g.linesettings.length.sp -sticky nw\nttk::frame $g.linesettings.maxpoints\nttk::label $g.linesettings.maxpoints.lab -text "max. Points: "\nttk::spinbox $g.linesettings.maxpoints.sp -textvariable visoptions.fieldlinesmaxpoints -width 6 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \\\n-invalidcommand "my_invalidspinbox %W" -from 0 -to 10000\ngrid $g.linesettings.maxpoints.lab $g.linesettings.maxpoints.sp -sticky nw\nttk::frame $g.linesettings.thick\nttk::label $g.linesettings.thick.lab -text "rel. Thickness: "\nttk::spinbox $g.linesettings.thick.sp -textvariable visoptions.fieldlinesthickness -width 6 -increment 0.001 -validate focus -validatecommand "my_validatespinbox %W %P 6" \\\n-invalidcommand "my_invalidspinbox %W" -from 1e-10 -to 0.5\ngrid $g.linesettings.thick.lab $g.linesettings.thick.sp -stick nw\npack $g.linesettings.title $g.linesettings.length $g.linesettings.maxpoints $g.linesettings.thick\npack $g.linesettings -fill x -ipady 3\nglobal visoptions.fieldlinestolerance\nttk::frame $g.odesettings -relief groove -borderwidth 3\nttk::label $g.odesettings.title -text "\\nODE Settings\\n"\nttk::frame $g.odesettings.tol\nttk::label $g.odesettings.tol.lab -text "rel. Thickness: "\nttk::spinbox $g.odesettings.tol.sp -textvariable visoptions.fieldlinestolerance -width 6 -increment 0.01 -validate focus -validatecommand "my_validatespinbox %W %P 5" \\\n-invalidcommand "my_invalidspinbox %W" -from 0.00001 -to 1\ngrid $g.odesettings.tol.lab $g.odesettings.tol.sp -stick nw\nttk::frame $g.odesettings.rktype\nttk::label $g.odesettings.rktype.lab -text "RK-Type "\nttk::menubutton $g.odesettings.rktype.but -menu $g.odesettings.rktype.menu -text "" -width 25\nmenu $g.odesettings.rktype.menu -tearoff 0\n$g.odesettings.rktype.menu add command -label "Euler, order 1" -command "set visoptions.fieldlinesrktype \\"euler\\" ;Ng_Vis_Set parameters; redraw;$g.odesettings.rktype.but configure -text \\"Euler,order 1\\" "\n$g.odesettings.rktype.menu add command -label "Euler-Cauchy, order 2" -command "set visoptions.fieldlinesrktype \\"eulercauchy\\" ;Ng_Vis_Set parameters; redraw;$g.odesettings.rktype.but configure -text \\"Euler-Cauchy,order 2\\" "\n$g.odesettings.rktype.menu add command -label "Simpson, order 3" -command "set visoptions.fieldlinesrktype \\"simpson\\" ;Ng_Vis_Set parameters; redraw;$g.odesettings.rktype.but configure -text \\"Simpson,order 3\\""\n$g.odesettings.rktype.menu add command -label "classical Runge-Kutta, order 4" -command "set visoptions.fieldlinesrktype \\"crungekutta\\" ;Ng_Vis_Set parameters; redraw; $g.odesettings.rktype.but configure -text \\"classical Runge-Kutta,order 4\\""\n$g.odesettings.rktype.menu invoke "classical Runge-Kutta, order 4"\ngrid $g.odesettings.rktype.lab $g.odesettings.rktype.but -sticky nw\npack $g.odesettings.title $g.odesettings.tol $g.odesettings.rktype\npack $g.odesettings -fill x -ipady 3\nttk::frame $w.bu\npack $w.bu -fill x -ipady 3\nttk::button $w.bu.calc -text "Build Fieldlines" -command {\nif { ${visoptions.fieldlinesvecfunction} == "none" } {\nbgerror "Please select the vector function first!"\n} {\nset visoptions.drawfieldlines 1\nNg_Vis_Set parameters\nNg_BuildFieldLines\nredraw\n}\n}\nttk::button $w.bu.help -text "Help" -command {\nif {[winfo exists .fieldlines_help] == 1} {\nwm withdraw .fieldlines_help\nwm deiconify .fieldlines_help\nfocus .fieldlines_help\n} {\ntoplevel .fieldlines_help\nset f [frame .fieldlines_help.ht]\nttk::scrollbar $f.vsb -orient vertical -command [list $f.t yview]\ntext $f.t -yscrollcommand [list $f.vsb set]\ngrid $f.t -row 0 -column 0 -sticky nsew\ngrid $f.vsb -row 0 -column 1 -sticky nsew\ngrid columnconfigure $f 0 -weight 1\ngrid rowconfigure $f 0 -weight 1\nset text $f.t\n$text configure -setgrid true -wrap word\n$text tag configure bold -font *-*-bold-*-*-*-*\n$text insert end \\\n"Draw menu\\n \\n" bold\n$text insert end \\\n"Enable Fieldlines\\n To turn on and off the calculated fieldlines. (Has to be turned on to start the calculation)\\n"\n$text insert end \\\n"Num\\n Number of fieldlines to calculate. (May not be used exactly.)"\n$text insert end \\\n"Field dependent density\\n There will be more fieldline startpoints where the field is stronger\\n\\n"\n$text insert end \\\n"Animate periodic\\n (for quasistationary fields) The fieldlines of the different phase angles are animated.\\n ATTENTION: \\"Fix Phase\\" has to be turned off\\n\\n"\n$text insert end \\\n"Vector Function\\n The function fixing the direction of the lines\\n\\n"\n$text insert end \\\n"Fix Phase\\n (for quasistationary fields) Only calculate and draw fieldlines for one special phase angle.\\n\\n"\n$text insert end \\\n"Startpoints in Box\\n Set the startpoints inside the box \\[Pmin1,Pmax1\\] x \\[Pmin2,Pmax2\\] x \\[Pmin3,Pmax3\\]\\n"\n$text insert end \\\n" With the button \\"Bounding Box\\" the whole bounding box of the geometry is selected.\\n\\n"\n$text insert end \\\n"Startpoints on Face\\n All startpoints will be set on one face. This face is selected by double-clicking with the mouse.\\n\\n"\n$text insert end \\\n"Startpoints from File\\n The startpoint information will be read from the selected file.\\n The entries in the file can be as follows:\\n"\n$text insert end \\\n" point <x> <y> <z>\\n set a (potential) startpoint\\n"\n$text insert end \\\n" line <x1> <y1> <z1> <x2> <y2> <z2> <n>\\n set n (potential) startpoints on the line from (x1,y1,z1) to (x2,y2,z2)\\n"\n$text insert end \\\n" box <x1> <y1> <z1> <x2> <y2> <z2> <n>\\n set n (potential) startpoints inside the box \\[x1,x2\\] x \\[y1,y2\\] x \\[z1,z2\\]\\n"\n$text insert end \\\n" ATTENTION: These are potential startpoints.\\n The total number of startpoints will be bounded by the \\"Num\\"-parameter.\\n \\n \\n \\n"\n$text insert end \\\n"Settings Menu\\n \\n" bold\n$text insert end \\\n"rel. Length\\n The maximal length of a fieldline relative to the diameter of the geometry.\\n\\n"\n$text insert end \\\n"max. Points\\n The maximum number of Runge-Kutta steps.\\n\\n"\n$text insert end \\\n"rel. Thickness\\n The thickness of the fieldlines relative to the diameter of the geometry.\\n\\n"\n$text insert end \\\n"rel. Tolerance\\n The tolerance for the step-length control of the Runge-Kutta method.\\n\\n"\n$text insert end \\\n"RK-Type\\n Which Runge-Kutta scheme to use\\n \\n \\n \\n"\n$text insert end \\\n"Button \\"Build Fieldlines\\"\\n" bold\n$text insert end \\\n" Build the fieldlines."\n$text configure -state disabled\npack .fieldlines_help.ht -expand yes -fill both\nwm withdraw .fieldlines_help\nwm geom .fieldlines_help +300+200\nwm deiconify .fieldlines_help\nwm title .fieldlines_help "Fieldlines Help"\nfocus .fieldlines_help\n}\n}\nttk::button $w.bu.cancel -text "Done" -command "destroy $w"\ngrid $w.bu.calc $w.bu.help $w.bu.cancel -sticky nw -padx 4\ngrid anchor $w.bu center\nwm withdraw $w\nwm geom $w +200+100\nwm deiconify $w\nwm title $w "Fieldlines"\nfocus $w\n}\nglobal visoptions.fieldlinesstartface\nset f $w.nb.draw\nset visoptions.fieldlinesstartface [Ng_BCProp getactive]\n$f.facesettings.index.ent configure -text ${visoptions.fieldlinesstartface}\n}\nset visual_dialog_pop1 0\nset visual_dialog_pop2 0\nset visual_dialog_pop3 0\nset visual_dialog_pop4 0\nset visual_dialog_pop5 0\nset visual_dialog_pop6 0\nset visual_dialog_pop7 0\nproc visual_dialog { } {\nset w .visoptions_dlg\nglobal visual_dialog_pop1\nglobal visual_dialog_pop2\nglobal visual_dialog_pop3\nglobal visual_dialog_pop4\nglobal visual_dialog_pop5\nglobal visual_dialog_pop6\nglobal visual_dialog_pop7\nset visual_dialog_pop1 1\nset visual_dialog_pop2 1\nset visual_dialog_pop3 1\nset visual_dialog_pop4 1\nset visual_dialog_pop5 1\nset visual_dialog_pop6 1\nset visual_dialog_pop7 1\nif {[winfo exists .visoptions_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\nttk::frame $w.main\npack $w.main -fill x\nset w $w.main\nttk::frame $w.upperfr ;\npack $w.upperfr -fill x;\nttk::labelframe $w.upperfr.size -text "Grid" -relief groove -borderwidth 3\nttk::entry $w.upperfr.size.ent -width 3 -textvariable visoptions.gridsize -validate focus -takefocus 0 -validatecommand "popupcheckredraw visual_dialog_pop2;my_validate %W 0 200 %P 0" \\\n-invalidcommand "my_invalid %W;popupcheckredraw visual_dialog_pop2"\nttk::scale $w.upperfr.size.sc -orient horizontal -length 100 -from 1 -to 200 -variable visoptions.gridsize\\\n-command "roundscale $w.upperfr.size.sc 0;popupcheckredraw visual_dialog_pop2"\nttk::labelframe $w.upperfr.offsets -text "x / y offsets" -relief groove -borderwidth 3\nttk::label $w.upperfr.offsets.xlab -text "x"\nttk::label $w.upperfr.offsets.ylab -text "y"\nttk::scale $w.upperfr.offsets.xoffset -orient horizontal -length 100 -from 0 -to 1 -variable visoptions.xoffset \\\n-command "roundscale $w.upperfr.offsets.xoffset 2; popupcheckredraw visual_dialog_pop3"\nttk::scale $w.upperfr.offsets.yoffset -orient horizontal -length 100 -from 0 -to 1 -variable visoptions.yoffset \\\n-command "roundscale $w.upperfr.offsets.yoffset 2; popupcheckredraw visual_dialog_pop4"\nttk::entry $w.upperfr.offsets.entx -width 4 -textvariable visoptions.xoffset -validate focus -takefocus 0 \\\n-validatecommand "popupcheckredraw visual_dialog_pop3;my_validate %W 0 1 %P 2" \\\n-invalidcommand "my_invalid %W;popupcheckredraw visual_dialog_pop3"\nttk::entry $w.upperfr.offsets.enty -width 4 -textvariable visoptions.yoffset -validate focus -takefocus 0 \\\n-validatecommand "popupcheckredraw visual_dialog_pop4;my_validate %W 0 1 %P 2" \\\n-invalidcommand "my_invalid %W;popupcheckredraw visual_dialog_pop4"\npack $w.upperfr.size.sc $w.upperfr.size.ent -padx 4 -pady 12 -side left\ngrid $w.upperfr.offsets.xoffset $w.upperfr.offsets.entx $w.upperfr.offsets.xlab -sticky nw -padx 4\ngrid $w.upperfr.offsets.yoffset $w.upperfr.offsets.enty $w.upperfr.offsets.ylab -sticky nw -padx 4\ngrid $w.upperfr.size $w.upperfr.offsets -sticky nw -pady 7 -padx 10\ngrid anchor $w.upperfr center\nttk::labelframe $w.deform -relief groove -borderwidth 3 -text "Deformation settings"\nttk::checkbutton $w.deform.cb -text "Deformation" \\\n-variable visoptions.deformation \\\n-command { Ng_Vis_Set parameters; redraw }\nttk::label $w.deform.l -text "Scale: "\nttk::spinbox $w.deform.sc1 -from 0 -to 1e99 -textvariable visoptions.scaledeform1 -width 5 \\\n-command { Ng_Vis_Set parameters; redraw } \\\n-validate focusout -validatecommand { Ng_Vis_Set parameters; redraw; string is double %P } \\\n-invalidcommand { puts "invalid value, %P %s"; set visoptions.scaledeform1 1; }\nttk::scale $w.deform.sc2 -orient horizontal -length 100 -from 0 -to 1 \\\n-variable visoptions.scaledeform2 \\\n-command { popupcheckredraw visual_dialog_pop5 }\npack $w.deform -fill x -ipady 2 -pady 4 -ipady 3\ngrid $w.deform.cb $w.deform.l $w.deform.sc1 $w.deform.sc2 -sticky nw -padx 4;\ngrid anchor $w.deform center\ngrid columnconfigure $w.deform 0 -pad 20\ngrid columnconfigure $w.deform 2 -pad 20\nttk::labelframe $w.as -relief groove -borderwidth 3 -text "Scaling options"\nttk::checkbutton $w.as.autoscale -text "Autoscale" \\\n-variable visoptions.autoscale \\\n-command { Ng_Vis_Set parameters; redraw }\nttk::label $w.as.lmin -text "Min-value"\nttk::spinbox $w.as.smin -textvariable visoptions.mminval -width 5 -validate focus \\\n-validatecommand "my_validatespinbox %W %P 10" \\\n-command "Ng_Vis_Set parameters; redraw;" \\\n-invalidcommand "my_invalidspinbox %W" -from -1e10 -to 1e10 -increment 0.001\nttk::label $w.as.lmax -text "Max-value"\nttk::spinbox $w.as.smax -textvariable visoptions.mmaxval -width 5 -validate focus \\\n-validatecommand "Ng_Vis_Set parameters; redraw;my_validatespinbox %W %P 10" \\\n-command "Ng_Vis_Set parameters; redraw;" \\\n-invalidcommand "my_invalidspinbox %W;Ng_Vis_Set parameters; redraw" -from -1e10 -to 1e10 -increment 0.001\nttk::label $w.as.lncols -text "N Colors"\nttk::spinbox $w.as.snumcols -textvariable visoptions.numtexturecols -width 5 -validate focus \\\n-command "Ng_Vis_Set parameters; redraw;" \\\n-from 2 -to 31 -increment 1\npack $w.as -fill x -pady 5 -ipady 3\ngrid $w.as.autoscale $w.as.lmin $w.as.smin $w.as.lmax $w.as.smax $w.as.lncols $w.as.snumcols -sticky nw -padx 4\ngrid columnconfigure $w.as 0 -pad 20\ngrid columnconfigure $w.as 2 -pad 20\ngrid anchor $w.as center\nttk::frame $w.iso; \npack $w.iso -anchor center;\nttk::labelframe $w.iso.cb -relief groove -borderwidth 3 -text "Iso lines / surfaces"\npack $w.iso.cb -side left -pady 7 -fill y\nttk::checkbutton $w.iso.cb.isolines -text "Iso-lines" \\\n-variable visoptions.isolines \\\n-command { Ng_Vis_Set parameters; redraw }\nttk::checkbutton $w.iso.cb.isosurf -text "Iso-Surface" \\\n-variable visoptions.isosurf \\\n-command { Ng_Vis_Set parameters; redraw }\nttk::label $w.iso.cb.numisol -text "amount"\nttk::scale $w.iso.cb.numiso -orient horizontal -length 100 -from 2 -to 50 \\\n-variable visoptions.numiso \\\n-command "roundscale $w.iso.cb.numiso 0;popupcheckredraw visual_dialog_pop6"\nttk::entry $w.iso.cb.entry -textvariable visoptions.numiso -width 3 \\\n-validate focus -validatecommand "popupcheckredraw visual_dialog_pop6;\\\nmy_validate %W [$w.iso.cb.numiso cget -from] [$w.iso.cb.numiso cget -to] %P 0" \\\n-invalidcommand "my_invalid %W;popupcheckredraw visual_dialog_pop6"\ngrid $w.iso.cb.isolines $w.iso.cb.numisol $w.iso.cb.entry -sticky nw -padx 4\ngrid $w.iso.cb.isosurf -sticky nw -padx 4\ngrid $w.iso.cb.numiso -sticky nw -padx 4 -columnspan 2 -column 1 -row 1\nttk::labelframe $w.iso.subdiv -text "Subdivision" -relief groove -borderwidth 3\nttk::radiobutton $w.iso.subdiv.zero -text "0" -variable visoptions.subdivisions -value 0 \\\n-command {\nNg_Vis_Set parameters; redraw;\n}\nttk::radiobutton $w.iso.subdiv.one -text "1" -variable visoptions.subdivisions -value 1 \\\n-command {\nNg_Vis_Set parameters; redraw;\n}\nttk::radiobutton $w.iso.subdiv.two -text "2" -variable visoptions.subdivisions -value 2 \\\n-command {\nNg_Vis_Set parameters; redraw;\n}\nttk::radiobutton $w.iso.subdiv.three -text "3" -variable visoptions.subdivisions -value 3 \\\n-command {\nNg_Vis_Set parameters; redraw;\n}\nttk::radiobutton $w.iso.subdiv.four -text "4" -variable visoptions.subdivisions -value 4 \\\n-command {\nNg_Vis_Set parameters; redraw;\n}\nttk::radiobutton $w.iso.subdiv.five -text "5" -variable visoptions.subdivisions -value 5 \\\n-command {\nNg_Vis_Set parameters; redraw;\n}\nttk::label $w.iso.subdiv.text -text "subdivision"\npack $w.iso.subdiv -side right -fill y -padx 4 -pady 7\ngrid $w.iso.subdiv.zero $w.iso.subdiv.one $w.iso.subdiv.two $w.iso.subdiv.three $w.iso.subdiv.four $w.iso.subdiv.five\ngrid anchor $w.iso.subdiv center\nttk::labelframe $w.redraw -relief groove -borderwidth 3 -text "Auto-redraw"\nttk::checkbutton $w.redraw.auto -text "Auto-redraw after (sec)" \\\n-variable visoptions.autoredraw\nttk::spinbox $w.redraw.val -textvariable visoptions.autoredrawtime -from 0 -to 100 -width 3\npack $w.redraw -fill x -ipady 3 -pady 7\ngrid $w.redraw.auto $w.redraw.val -sticky nw\ngrid anchor $w.redraw center\nttk::labelframe $w.lowerframe -text "Additional viewing options" -relief groove -borderwidth 3\npack $w.lowerframe -fill x\nset w $w.lowerframe\nttk::frame $w.f1\nset f [ttk::frame $w.f1.clipsol]\npack $f -anchor e\nmenu $f.m\nttk::menubutton $f.b -menu $f.m -width 12\nttk::label $f.l -text "Clipping Plane Sol: "\nglobal visoptions.clipsolution\nset clipsollabs(none) "None"\nset clipsollabs(scal) "Scalar Function"\nset clipsollabs(vec) "Vector Function"\nforeach i { none scal vec } {\nset textval $clipsollabs($i)\n$f.m add command -label "$textval" -command \\\n"$f.b configure -text \\"$textval\\" ; set visoptions.clipsolution $i ; Ng_Vis_Set parameters ; redraw "\n}\npack $f.b $f.l -side right\n$f.m invoke $clipsollabs(${visoptions.clipsolution})\nset f [ttk::frame $w.f1.scalfun]\npack $f -anchor e\nmenu $f.m\nttk::menubutton $f.b -menu $f.m -width 12\nttk::label $f.l -text "Scalar Function: "\nset scalentries [list none None]\nfor { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {\nset fname [Ng_Vis_Field getfieldname $i]\nset fcomp [Ng_Vis_Field getfieldcomponents $i]\nif { $fcomp == 1 } {\nlappend scalentries $fname:1 $fname\n} {\nfor { set j 1 } { $j <= $fcomp } { incr j } {\nlappend scalentries $fname:$j "$fname ($j)"\n}\nlappend scalentries $fname:0 "func ($fname)"\n}\n}\nglobal visoptions.scalfunction\nforeach { name textval } $scalentries {\n$f.m add command -label "$textval" -command \\\n"$f.b configure -text \\"$textval\\" ; set visoptions.scalfunction \\"$name\\" ; Ng_Vis_Set parameters ; redraw ; "\n}\npack $f.b $f.l -side right\nforeach { name textval } $scalentries {\nif { ${visoptions.scalfunction} == $name } {\n$f.m invoke $textval\n}\n}\nset f [ttk::frame $w.f1.vecfun]\npack $f -anchor e\nmenu $f.m\nttk::menubutton $f.b -menu $f.m -width 12\nttk::label $f.l -text "Vector Function: "\nset vecentries [list none None]\nfor { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {\nset fname [Ng_Vis_Field getfieldname $i]\nset fcomp [Ng_Vis_Field getfieldcomponents $i]\nset iscomplex [Ng_Vis_Field iscomplex $i]\nset sdim [Ng_Vis_Field getdimension]\nif { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] }\nif { ($fcomp == $sdim) || ($fcomp == 3) } {\nlappend vecentries $fname $fname\n}\n}\nglobal visoptions.vecfunction\nforeach { name textval } $vecentries {\n$f.m add command -label "$textval" -command \\\n"$f.b configure -text \\"$textval\\" ; set visoptions.vecfunction $name ; Ng_Vis_Set parameters ; redraw ; "\n}\npack $f.b $f.l -side right\nforeach { name textval } $vecentries {\nif { ${visoptions.vecfunction} == $name } {\n$f.m invoke $textval\n}\n}\nset f [ttk::frame $w.f1.evaluate]\npack $f -anchor e\nmenu $f.m\nttk::menubutton $f.b -menu $f.m -width 12\nttk::label $f.l -text "Evaluate: "\nglobal visoptions.evaluate\nset evallabs(abs) "| |"\nset evallabs(abstens) "|tensor|"\nset evallabs(mises) "Mises"\nset evallabs(main) "Main"\nforeach i { abs abstens mises main } {\nset textval $evallabs($i)\n$f.m add command -label "$textval" -command \\\n"$f.b configure -text \\"$textval\\" ; set visoptions.evaluate $i ; "\n}\npack $f.b $f.l -side right\n$f.m invoke $evallabs(${visoptions.evaluate})\npack [ttk::frame $w.f1.multidim] -fill x\nset f [ttk::frame $w.f1.multidim.f]\npack $f -anchor e\nttk::label $f.l1 -text "multidim-component: "\nttk::spinbox $f.sb1 -from 0 -to 1e99 -textvariable visoptions.multidimcomponent -width 3 \\\n-command { Ng_Vis_Set parameters; redraw }\npack $f.l1 $f.sb1 -side left\nttk::frame $w.fcb\ngrid $w.f1 $w.fcb -sticky nw -padx 7 -ipady 3\ngrid anchor $w center\nttk::frame $w.fcb.cb\npack $w.fcb.cb\nttk::checkbutton $w.fcb.cb.showsurfsolution -text "Draw Surface Vectors" \\\n-variable visoptions.showsurfacesolution \\\n-command { Ng_Vis_Set parameters; redraw }\nttk::checkbutton $w.fcb.cb.showcurves -text "Show Curves" \\\n-variable visoptions.drawpointcurves \\\n-command { Ng_Vis_Set parameters; redraw }\nttk::checkbutton $w.fcb.cb.imaginary -text "Imaginary Part" \\\n-variable visoptions.imaginary \\\n-command { Ng_Vis_Set parameters; redraw }\nttk::checkbutton $w.fcb.cb.logscale -text "Log Scale" \\\n-variable visoptions.logscale \\\n-command { Ng_Vis_Set parameters; redraw }\nttk::checkbutton $w.fcb.cb.invcolor -text "Inverse Color" \\\n-variable visoptions.invcolor \\\n-command { Ng_Vis_Set parametersrange; redraw }\nttk::frame $w.fcb.cb.texframe\nttk::checkbutton $w.fcb.cb.texframe.usetexture -text "Use Textures (" \\\n-variable visoptions.usetexture \\\n-command { Ng_Vis_Set parameters; redraw }\nttk::checkbutton $w.fcb.cb.texframe.lintexture -text "Linear )" \\\n-variable visoptions.lineartexture \\\n-command { Ng_Vis_Set parametersrange; redraw }\nttk::checkbutton $w.fcb.cb.lineartexture -text "Use Linear Texture" \\\n-variable visoptions.lineartexture \\\n-command { Ng_Vis_Set parameters; redraw }\nttk::checkbutton $w.fcb.cb.showclipsolution -text "Draw Clipping Plane Solution" \\\n-variable visoptions.showclipsolution \\\n-command { Ng_Vis_Set parameters; redraw }\nttk::checkbutton $w.fcb.cb.redrawperiodic -text "Animate periodic" \\\n-variable visoptions.redrawperiodic \\\n-command {\nredrawperiodic\nNg_Vis_Set parameters;\nredraw\n}\ngrid $w.fcb.cb.showsurfsolution -sticky nw\ngrid $w.fcb.cb.showcurves -sticky nw\ngrid $w.fcb.cb.imaginary -sticky nw\ngrid $w.fcb.cb.logscale -sticky nw\ngrid $w.fcb.cb.texframe -sticky nw\ngrid $w.fcb.cb.invcolor -sticky nw\ngrid $w.fcb.cb.redrawperiodic -sticky nw\npack $w.fcb.cb.texframe.usetexture $w.fcb.cb.texframe.lintexture -side left -expand yes\nset w .visoptions_dlg.main\nttk::frame $w.bu;\npack $w.bu -pady 5 -padx 4\nttk::button $w.bu.showsol -text "Show Solution" -command {\nset selectvisual solution\nNg_SetVisParameters\nredraw\n}\nttk::button $w.bu.clipping -text "Clipping" -command {\nclippingdialog;\n}\nttk::button $w.bu.fieldlines -text "Fieldlines" -command {\nfieldlinesdialog;\n}\nttk::button $w.bu.lineplot -text "2D Lineplot" -command {\nlineplotdialog;\n}\nttk::button $w.bu.done -text "Close" -command {\ndestroy .visoptions_dlg\n}\npack $w.bu.showsol $w.bu.clipping $w.bu.fieldlines $w.bu.lineplot $w.bu.done -side left -expand yes\nset w .visoptions_dlg\nwm withdraw $w\nwm geom $w +100+100\nwm deiconify $w\nwm title $w "Visualization"\n}\n}\n}\ncatch { set sockets.serverport 0\nset sockets.serverhost "localhost"\nset sockets.serverlistbox 0\nset sockets.queuelistbox 0\nset sockets.currentjoblistbox 0\nset sockets.answerlistbox 0\nset sockets.myidlabel -1\nproc updateserverlist { } {\nglobal sockets.serverlistbox\nset retval [Ng_Socket getserverlist]\n${sockets.serverlistbox} delete 0 end\nfor {set i 0} {$i < [llength $retval]} {incr i 3} {\n${sockets.serverlistbox} insert end \\\n[format "%-16s %6i %6i" [lindex $retval $i] [lindex $retval [expr $i+1]] [lindex $retval [expr $i+2]]]\n}\n}\nproc clientsocketdialog { } {\nset w .clientsock_dlg\nif {[winfo exists .clientsock_dlg] == 1} {\nwm withdraw $w\nwm deiconify $w\nfocus $w\n} {\ntoplevel $w\nglobal sockets.serverhost\nglobal sockets.serverport\nttk::frame $w.general\nttk::frame $w.host\nttk::label $w.host.lab -text "Serverhost: "\nttk::entry $w.host.name -width 30 -textvariable sockets.serverhost\npack $w.host.lab $w.host.name -side left\npack $w.host\nttk::frame $w.ports\nttk::label $w.ports.lab1 -text "Serverport: "\nttk::entry $w.ports.statport -width 6 -textvariable sockets.serverport\npack $w.ports.lab1 $w.ports.statport -side left\npack $w.ports\nttk::frame $w.listboxes\nttk::frame $w.listboxes.choosesocketframe\ntixScrolledListBox $w.listboxes.choosesocketframe.choosesocket -scrollbar auto\nglobal sockets.serverlistbox\nset sockets.serverlistbox [$w.listboxes.choosesocketframe.choosesocket subwidget listbox]\n${sockets.serverlistbox} configure -width 35\n${sockets.serverlistbox} configure -selectmode browse\n${sockets.serverlistbox} configure -exportselection false\nttk::button $w.addserver -text "Add ServerSocket" -command {\nNg_Socket addserver ${sockets.serverport} ${sockets.serverhost}\nupdateserverlist\n}\npack $w.addserver\nttk::label $w.linefeed -text "\\n"\npack $w.linefeed\nttk::frame $w.clientidframe\nttk::label $w.clientidframe.lab -text "Client ID: ";\nglobal sockets.myidlabel\nttk::entry $w.clientidframe.val -width 5 -textvariable sockets.myidlabel\nttk::button $w.clientidframe.but -text "Set" -command {\nset opsel [${sockets.serverlistbox} curselection]\nif {[llength $opsel] > 0} {\nset opserver [lindex $opsel 0]\nNg_Socket setid $opserver ${sockets.myidlabel}\nupdateserverlist\n}\n}\npack $w.clientidframe.lab $w.clientidframe.val $w.clientidframe.but -side left\npack $w.clientidframe\nttk::label $w.listboxes.choosesocketframe.chooselab -text [format "\\n\\n%-16s %6s %6s " Host Socket MyID ]\npack $w.listboxes.choosesocketframe.chooselab\npack $w.listboxes.choosesocketframe.choosesocket\nttk::frame $w.listboxes.choosesocketframe.serverbuttons\nttk::button $w.listboxes.choosesocketframe.serverbuttons.save -text "Save" -command {\nNg_Socket saveserverlist\n}\nglobal sockets.serverlist\nNg_Socket loadserverlist\nupdateserverlist\nttk::button $w.listboxes.choosesocketframe.serverbuttons.delete -text "Delete" -command {\nset opsel [${sockets.serverlistbox} curselection]\nif {[llength $opsel] > 0} {\nNg_Socket deletesocket [lindex $opsel 0]\nupdateserverlist\n}\n}\npack $w.listboxes.choosesocketframe.serverbuttons.save $w.listboxes.choosesocketframe.serverbuttons.delete -side left\npack $w.listboxes.choosesocketframe.serverbuttons\nttk::frame $w.listboxes.statusframe\nttk::label $w.listboxes.statusframe.statuslabel1 -text "\\n\\njobqueue"\ntixScrolledListBox $w.listboxes.statusframe.queuestatus -scrollbar auto\nttk::label $w.listboxes.statusframe.statuslabel2 -text "\\ncurrent job"\ntixScrolledListBox $w.listboxes.statusframe.currentjobstatus -scrollbar auto\nttk::label $w.listboxes.statusframe.statuslabel3 -text "\\nanswers"\ntixScrolledListBox $w.listboxes.statusframe.answers -scrollbar auto\nglobal sockets.queuelistbox\nglobal sockets.currentjoblistbox\nglobal sockets.answerlistbox\nset sockets.queuelistbox [$w.listboxes.statusframe.queuestatus subwidget listbox]\nset sockets.currentjoblistbox [$w.listboxes.statusframe.currentjobstatus subwidget listbox]\nset sockets.answerlistbox [$w.listboxes.statusframe.answers subwidget listbox]\n${sockets.queuelistbox} configure -width 50\n${sockets.queuelistbox} configure -height 5\n${sockets.queuelistbox} configure -selectmode browse\n${sockets.queuelistbox} configure -exportselection false\n${sockets.currentjoblistbox} configure -width 50\n${sockets.currentjoblistbox} configure -height 1\n${sockets.currentjoblistbox} configure -selectmode browse\n${sockets.currentjoblistbox} configure -exportselection false\n${sockets.answerlistbox} configure -width 50\n${sockets.answerlistbox} configure -height 5\n${sockets.answerlistbox} configure -selectmode browse\n${sockets.answerlistbox} configure -exportselection false\nttk::button $w.listboxes.statusframe.updatebutton -text "Update" -command {\nset opsel [${sockets.serverlistbox} curselection]\nif {[llength $opsel] > 0} {\nset opserver [lindex $opsel 0]\nset retval [Ng_Socket sendqueuestatus $opserver]\n${sockets.queuelistbox} delete 0 end\nif {[lindex $retval 0] > 0} {\n${sockets.queuelistbox} insert end [format "Blocked for user %i" [lindex $retval 0]]\n} {\n${sockets.queuelistbox} insert end "Not blocked"\n}\nfor {set i 2} {$i < [expr 2*[lindex $retval 1]+2]} {incr i 2} {\n${sockets.queuelistbox} insert end [format "client %i, command %s" [lindex $retval $i] [lindex $retval [expr $i+1]]]\n}\n${sockets.answerlistbox} delete 0 end\nfor {set i [expr 2*[lindex $retval 1]+3]} {$i < [llength $retval]} {incr i 2} {\n${sockets.answerlistbox} insert end [format "client %i, command %s" [lindex $retval $i] [lindex $retval [expr $i+1]]]\n}\n${sockets.currentjoblistbox} delete 0 end\nset retval [Ng_Socket sendjobstatus $opserver]\nif {[lindex $retval 0] != 0} {\n${sockets.currentjoblistbox} insert end [format "client %i, command %s: %s" [lindex $retval 0] [lindex $retval 1] [lrange $retval 2 end]]\n}\n}\n}\npack $w.listboxes.statusframe.statuslabel1 $w.listboxes.statusframe.queuestatus \\\n$w.listboxes.statusframe.statuslabel2 $w.listboxes.statusframe.currentjobstatus \\\n$w.listboxes.statusframe.statuslabel3 $w.listboxes.statusframe.answers \\\n$w.listboxes.statusframe.updatebutton\npack $w.listboxes.choosesocketframe $w.listboxes.statusframe -side left\npack $w.listboxes\nttk::label $w.lab1 -text "\\n"\npack $w.lab1\nttk::frame $w.buttons1\nttk::frame $w.buttons2\nttk::button $w.buttons1.getid -text "Get ID" -command {\nset opsel [${sockets.serverlistbox} curselection]\nif {[llength $opsel] > 0} {\nset opserver [lindex $opsel 0]\nset retval [Ng_Socket getid $opserver]\nupdateserverlist\nset sockets.myidlabel $retval\n}\n}\nttk::button $w.buttons1.killjob -text "Kill Cur. Job" -command {\nset opsel [${sockets.serverlistbox} curselection]\nif {[llength $opsel] > 0} {\nset opserver [lindex $opsel 0]\nNg_Socket killcurrentjob $opserver\n}\n}\nttk::button $w.buttons2.sendmesh -text "Send Mesh" -command {\nset opsel [${sockets.serverlistbox} curselection]\nif {[llength $opsel] > 0} {\nset opserver [lindex $opsel 0]\nset retval [Ng_Socket sendmesh $opserver]\nset sockets.meshsent 1\n}\n}\nttk::button $w.buttons2.sendpde -text "Send PDE" -command {\nset opsel [${sockets.serverlistbox} curselection]\nif {[llength $opsel] > 0} {\nset opserver [lindex $opsel 0]\nset retval [NGS_Socket sendpdefile $opserver]\n}\n}\nttk::button $w.buttons2.solvepde -text "Solve PDE" -command {\nset opsel [${sockets.serverlistbox} curselection]\nif {[llength $opsel] > 0} {\nset opserver [lindex $opsel 0]\nset retval [NGS_Socket solvepde $opserver]\n}\n}\nttk::button $w.buttons2.writesol -text "Write Solution" -command {\nset opsel [${sockets.serverlistbox} curselection]\nif {[llength $opsel] > 0} {\nset opserver [lindex $opsel 0]\nset retval [NGS_Socket writesolution $opserver]\n}\n}\nttk::button $w.buttons2.sendsol -text "Receive Solution" -command {\nset opsel [${sockets.serverlistbox} curselection]\nif {[llength $opsel] > 0} {\nset opserver [lindex $opsel 0]\nset retval [NGS_Socket sendsolution $opserver]\n}\n}\nttk::button $w.buttons1.blockserver -text "Block Server" -command {\nset opsel [${sockets.serverlistbox} curselection]\nif {[llength $opsel] > 0} {\nset opserver [lindex $opsel 0]\nset retval [Ng_Socket blockserver $opserver]\n}\n}\nttk::button $w.buttons1.unblockserver -text "UnBlock Server" -command {\nset opsel [${sockets.serverlistbox} curselection]\nif {[llength $opsel] > 0} {\nset opserver [lindex $opsel 0]\nset retval [Ng_Socket unblockserver $opserver]\n}\n}\npack $w.buttons1.getid $w.buttons1.blockserver $w.buttons1.unblockserver $w.buttons1.killjob -side left\npack $w.buttons2.sendmesh $w.buttons2.sendpde $w.buttons2.solvepde $w.buttons2.writesol $w.buttons2.sendsol -side left\npack $w.buttons1 $w.buttons2\nwm withdraw $w\nwm geom $w +200+200\nwm deiconify $w\nwm title $w "Client Socket"\nfocus .options_dlg\n}\n}\n}\ncatch { source ${ngdir}/acis.tcl }\nset zugstange 0\ncatch { source ${ngdir}/trafo/menu.tcl }\nsetgranularity ${meshoptions.fineness}\nNg_SetMeshingParameters\nNg_SetVisParameters\nNg_SetDebugParameters\nNg_STLDoctor\nNg_GeometryOptions set\nif { $hasocc == "yes" } {\nNg_SetOCCVisParameters\n}\nif { $batchmode != "defined" } {\ncatch {\nwm protocol . WM_DELETE_WINDOW { .ngmenu.file invoke "Quit" }\nwm deiconify .\n}\n}\nset trafoapp 0\ncatch { source ${ngdir}/trafoapp/trafoapp.tcl }\nset geofilename [Ng_GetCommandLineParameter geofile]\nif { $geofilename != "undefined" &&\n[info exists trafo] == 0 && $zugstange == 0} {\nif { [ catch { Ng_LoadGeometry $geofilename } errstring] == 0 } {\nif { $batchmode != "defined" } {\nAddRecentFile $geofilename\n}\nNg_ParseGeometry\nif { $batchmode != "defined" } {\nset selectvisual geometry\nNg_SetVisParameters\nredraw\nwm title . [concat "$progname - " $geofilename]\n}\nset dirname [file dirname $geofilename]\nset basefilename [file tail [file rootname $geofilename]]\n} {\nputs "Problem with input file:"\nputs "$errstring"\n}\n}\nset cnt 0\nforeach { gran } { verycoarse coarse moderate fine veryfine } {\nset cnt [expr $cnt + 1]\nif { [Ng_GetCommandLineParameter $gran] == "defined" } {\nset meshoptions.fineness $cnt\nsetgranularity ${meshoptions.fineness}\n}\n}\nset meshfilename [Ng_GetCommandLineParameter meshfile]\nif { $meshfilename == "undefined" } {\nset meshfilename out.mesh\n}\nset meshfiletype [Ng_GetCommandLineParameter meshfiletype]\nif { $meshfiletype == "undefined" } {\nset meshfiletype netgen\n}\nset inputmeshfilename [Ng_GetCommandLineParameter inputmeshfile]\nset mergemeshfilename [Ng_GetCommandLineParameter mergefile]\nset meshsizefilename [Ng_GetCommandLineParameter meshsizefile]\nif { $meshsizefilename != "undefined" } {\nset options.meshsizefilename $meshsizefilename\n}\nset refinementfilename [Ng_GetCommandLineParameter refinementfile]\nif { $batchmode == "defined" && $solvemode != "defined"} {\nset options.parthread 0\nif { $shellmode == "undefined" } {\nset selectvisual mesh\nNg_SetVisParameters\nset meshsize [Ng_GetCommandLineParameter meshsize]\nif {$meshsize != "undefined"} { set options.meshsize $meshsize }\nif { $inputmeshfilename == "undefined" } {\nNg_GenerateMesh ${meshoptions.firststep} ${meshoptions.laststep}\n} else {\nNg_LoadMesh $inputmeshfilename\nif { $mergemeshfilename != "undefined" } {\nNg_MergeMesh $mergemeshfilename\n}\n}\nif { $refinementfilename != "undefined" } {\nNg_Bisect $refinementfilename\n}\nif { $meshfiletype == "netgen" } {\nNg_SaveMesh $meshfilename\n} else {\nif { [catch { Ng_ExportMesh $meshfilename $meshfiletype } ] == 1 } {\nputs "Unknown file format $meshfiletype"\n}\n}\nNg_Exit;\nexit\n} else {\nset code [catch { \nproc dotest {} {\nsource ngtest.tcl\n}\nproc Ng_RunShell {} {\nputs "Wellcome to NG Shell mode"\nset line 1\nwhile { 1 } {\nputs -nonewline "$line: "\nflush stdout\nset cmdline [gets stdin]\nif { [catch $cmdline errcode] } {\nputs "$errcode"\n}\nincr line 1\n}\n}\nproc Ng_PrintCmdIndex { } {\nglobal cmdindex\nforeach { lst } $cmdindex {\nputs $lst\n}\n}\nproc Ng_PrintHlpIndex { } {\nglobal hlpindex\nglobal secindex\nforeach {sec} $secindex {\nputs "\\n * $sec:"\nforeach {lst} $hlpindex {\nif {$sec == [lindex $lst 1]} {\nputs " * [lindex $lst 2]: [lindex $lst 3]"\n}\n}\n}\n}\nproc Ng_RegisterCmd { cmd section syntax {help ""} } {\nglobal hlpindex\nglobal cmdindex\nglobal secindex\nputs "register command $cmd"\nif { [lsearch $cmdindex cmd] != -1 } {\nputs "command \'$cmd\' already defined"\n} else {\nlappend cmdindex $cmd\nlappend hlpindex [list $cmd $section $syntax $help]\nif {[lsearch $secindex $section]==-1} {\nlappend secindex $section\n}\n}\n}\nNg_RegisterCmd "exit" "general" "exit" "exit Netgen shell mode"\nproc nghelp { {sec ""} } {\nglobal secindex\nglobal hlpindex\nglobal cmdindex\nif { $sec == "" } {\nNg_PrintHlpIndex\nputs "\\n type help \'section\'\\n"\nreturn\n}\nif { [lsearch $secindex $sec] != -1} {\nforeach {lst} $hlpindex {\nif {[lindex $lst 1] == $sec } {\nputs " * [lindex $lst 2]: [lindex $lst 3]"\n}\n}\nreturn\n}\nset ind [lsearch $cmdindex $sec]\nif {$ind != -1} {\nset lst [lindex $hlpindex $ind]\nputs " * [lindex $lst 2]: [lindex $lst 3]"\nreturn\n}\nputs " unknown section or command $sec"\n}\nset ngtimer 0\nproc nggettimer {} {\nreturn [clock clicks -milliseconds]\n}\nproc ngtic {} {\nset ::ngtimer [nggettimer]\n}\nproc ngtoc { {logfile stdout} } {\nset end [nggettimer]\nset tim [expr ($end - $::ngtimer)/1000.0]\nputs $logfile "$tim s"\n}\nproc ngloadgeometry { fname } {\nif { ![file exists $fname] } {\nputs "error: file $fname does not exist"\n} else {\nset err [catch {Ng_LoadGeometry $fname}]\nif {$err != 0} {\nputs "error: loading geometry failed"\n}\n}\n}\nNg_RegisterCmd "ngloadgeometry" "netgen" "ngloadgeometry <file>" "load geometry file"\nproc ngparsegeometry {} {\nset err [catch {Ng_ParseGeometry}]\nif {$err} {\nputs "error: parsing geometry failed"\n}\n}\nNg_RegisterCmd "ngparsegeometry" "netgen" "ngparsegeometry" "parse geometry"\nproc nggeneratemesh {} {\nset err [catch {Ng_GenerateMesh}]\nif {$err} {\nputs "error: mesh generation failed"\n}\n}\nNg_RegisterCmd "nggeneratemesh" "netgen" "nggeneratemesh" "generate mesh"\nproc ngsavemesh { fname } {\nif { [file exists $fname]} {\nputs "warning: existing file $fname overwritten"\n} else {\nset err [catch {Ng_SaveMesh $fname}]\nif {$err != 0} {\nputs "error: saving mesh failed"\n}\n}\n}\nNg_RegisterCmd "ngsavemesh" "netgen" "ngsavemesh <file>" "save mesh to file"\nproc ngset { opt {val 0} } {\nif {$opt == "meshsize"} {\nset ::options.meshsize $val\nNg_SetMeshingParameters\n} elseif {$opt == "printmsg"} {\nset ::options.printmsg $val\nNg_SetMeshingParameters\n} else {\nputs "error: unknown option $opt";\n}\n}\nNg_RegisterCmd "ngset" "netgen" "ngset <option> <val>" "set option to val"\nproc nganalyzegeometry {} {\nNg_GenerateMesh ag ag\nNg_ReadStatus\n}\nproc ngmeshedges {} {\nNg_GenerateMesh me me\nNg_ReadStatus\n}\nproc ngmeshsurface { } {\nNg_GenerateMesh ms ms\nNg_ReadStatus\n}\nproc ngoptimizesurface { {step all} } {\nif {$step == "all"} {\nNg_GenerateMesh os os cmsmSm\n} elseif {$step == "meshsmoothing"} {\nNg_GenerateMesh os os m\n} elseif {$step == "topologicedgeswapping" } {\nNg_GenerateMesh os os s\n} elseif {$step == "metricedgeswapping"} {\nNg_GenerateMesh os os S\n} elseif {$step == "combinepoints"} {\nNg_GenerateMesh os os c\n} else {\nputs "error: unknown option in ngoptimizesurface"\nreturn\n}\nNg_ReadStatus\n}\nproc ngmeshvolume { } {\nNg_GenerateMesh mv mv\nNg_ReadStatus\n}\nproc ngoptimizevolume {{step ""} } {\nif {$step == ""} {\nNg_GenerateMesh ov ov\n} elseif {$step == "smooth"} {\nNg_GenerateMesh ov ov m\n} elseif {$step == "smoothjacobian"} {\nNg_GenerateMesh ov ov j\n} else {\nputs "error: unknown step $step in ngoptimizevolume"\nreturn\n}\nNg_ReadStatus\n}\nproc ngsloadpde {fname} {\nif { ![file exists $fname] } {\nputs "warning: pdefile $fname does not exist"\n} else {\nputs "load pde $fname"\nNGS_LoadPDE $fname\n}\n}\nproc ngssolvepde {} {\nNGS_SolvePDE\n}\ncatch {source "${::ngdir}/ngtesting.tcl"} errcode\n} errcode]\nif {$code} {\nputs "error: $errcode"\n}\nset code [ catch {Ng_RunShell} errcode]\nif {$code} {\nputs "error: $errcode"\n}\nNg_Exit;\nexit\n}\n}\nset stereo [Ng_GetCommandLineParameter stereo]\nif { $stereo == "defined" } {\nset viewoptions.stereo 1\nputs "use stereo mode"\nNg_SetVisParameters;\nredraw\n}\nset ngsolve_loaded 0\ncatch {\nsource ${ngdir}/ngsolve.tcl;\nset ngsolve_loaded 1\n}\nset pathlist [split $::env(PATH) \\ [expr {$::tcl_platform(platform) == "windows" ? ";" : ":"}]]\nforeach dir $pathlist {\nif { $ngsolve_loaded != 1 } {\ncatch {\nsource ${dir}/ngsolve.tcl\nset ngsolve_loaded 1\n}\n}\n}\nset scriptfilename [Ng_GetCommandLineParameter script]\nif { $scriptfilename != "undefined" } {\nif { [catch { source $scriptfilename } errstring] == 1 } {\nputs "Error in input: $errstring"\n}\n}\nif { [Ng_GetCommandLineParameter help]=="defined" } {\nif { $zugstange == 1 } {\nprint_zug_commandline_help\nexit;\n} {\nif { $trafoapp == 1 } {\nprint_trafo_commandline_help;\n} {\nprint_commandline_help;\nNg_Exit;\nexit\n}\n}\n}\nif { [file exists startup.tcl] } {\nsource startup.tcl }\ncatch { source ${ngdir}/demoapp.tcl }\ncatch { source ${ngdir}/dropsexp.tcl }\n'