Coreform-Cubit-Mesh-Export 0.9.3__tar.gz → 0.9.5__tar.gz

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.

Potentially problematic release.


This version of Coreform-Cubit-Mesh-Export might be problematic. Click here for more details.

@@ -0,0 +1,161 @@
1
+ Metadata-Version: 2.4
2
+ Name: Coreform_Cubit_Mesh_Export
3
+ Version: 0.9.5
4
+ Summary: Cubit mesh export to various formats including Gmsh, Nastran, and VTK
5
+ Author-email: Kengo Sugahara <ksugahar@gmail.com>
6
+ Maintainer-email: Kengo Sugahara <ksugahar@gmail.com>
7
+ License: BSD-3-Clause
8
+ Project-URL: Homepage, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
9
+ Project-URL: Repository, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
10
+ Project-URL: Bug Tracker, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues
11
+ Keywords: cubit,mesh,gmsh,nastran,vtk,export,coreform
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: BSD License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.7
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Scientific/Engineering
24
+ Classifier: Topic :: Scientific/Engineering :: Physics
25
+ Requires-Python: >=3.7
26
+ Description-Content-Type: text/markdown
27
+ Requires-Dist: numpy>=1.20.3
28
+ Requires-Dist: scipy>=1.6.3
29
+
30
+ # Coreform Cubit Mesh Export
31
+
32
+ Coreform Cubitから様々な形式のメッシュファイルをエクスポートするPythonライブラリ
33
+
34
+ ## インストール方法
35
+
36
+ ### PyPIから直接インストール(推奨)
37
+ ```bash
38
+ pip install --upgrade coreform-cubit-mesh-export
39
+ ```
40
+
41
+ ### Cubit内蔵Pythonの場合
42
+ ```bash
43
+ cd "C:\Program Files\Coreform Cubit 2025.3\bin\python3\"
44
+ python.exe -m pip install --upgrade coreform-cubit-mesh-export
45
+ ```
46
+
47
+ ### 開発版をGitHubからインストール
48
+ ```bash
49
+ pip install git+https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
50
+ ```
51
+
52
+ ### ローカルインストール(開発用)
53
+ ```bash
54
+ git clone https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
55
+ cd Coreform_Cubit_Mesh_Export
56
+ pip install -e .
57
+ ```
58
+
59
+ ## サポートしているファイル形式
60
+
61
+ - **Gmsh形式**
62
+ - バージョン2.2(完全サポート)
63
+ - バージョン4.1(部分サポート)
64
+ - **Nastran形式**
65
+ - 2Dメッシュ
66
+ - 3Dメッシュ
67
+ - **MEG形式**(ELF用)
68
+ - 2Dメッシュ
69
+ - 3Dメッシュ
70
+ - **VTK形式**
71
+ - メッシュのみ(Legacy VTK形式)
72
+
73
+ ## 使い方
74
+
75
+ ### Cubit内での使用例
76
+
77
+ Cubitでメッシュ生成後、以下のようにPythonスクリプトを実行します:
78
+
79
+ ```python
80
+ # Cubitコマンドライン
81
+ play "export_mesh.py"
82
+ ```
83
+
84
+ `export_mesh.py`の内容例:
85
+
86
+ ```python
87
+ import cubit_mesh_export
88
+
89
+ # Nastran形式でエクスポート
90
+ FileName = 'output/model.nas'
91
+ cubit_mesh_export.export_3D_Nastran(cubit, FileName)
92
+
93
+ # Gmsh形式でエクスポート
94
+ FileName = 'output/model.msh'
95
+ cubit_mesh_export.export_3D_gmsh_ver2(cubit, FileName)
96
+
97
+ # VTK形式でエクスポート
98
+ FileName = 'output/model.vtk'
99
+ cubit_mesh_export.export_3D_vtk(cubit, FileName)
100
+ ```
101
+
102
+ ## 関数一覧
103
+
104
+ ### Gmsh形式
105
+ - `export_3D_gmsh_ver2(cubit, filename)` - Gmsh v2.2形式で3Dメッシュをエクスポート
106
+ - `export_3D_gmsh_ver4(cubit, filename)` - Gmsh v4.1形式で3Dメッシュをエクスポート(部分サポート)
107
+
108
+ ### Nastran形式
109
+ - `export_2D_Nastran(cubit, filename)` - 2DメッシュをNastran形式でエクスポート
110
+ - `export_3D_Nastran(cubit, filename)` - 3DメッシュをNastran形式でエクスポート
111
+
112
+ ### MEG形式(ELF用)
113
+ - `export_2D_meg(cubit, filename)` - 2DメッシュをMEG形式でエクスポート
114
+ - `export_3D_meg(cubit, filename)` - 3DメッシュをMEG形式でエクスポート
115
+
116
+ ### VTK形式
117
+ - `export_3D_vtk(cubit, filename)` - 3DメッシュをVTK形式でエクスポート
118
+
119
+ ## 要件
120
+
121
+ - Python 3.7以上
122
+ - NumPy >= 1.20.3
123
+ - SciPy >= 1.6.3
124
+ - Coreform Cubit(メッシュ生成用)
125
+
126
+ ## ライセンス
127
+
128
+ BSD 3-Clause License
129
+
130
+ ## 作者
131
+
132
+ Kengo Sugahara (ksugahar@gmail.com)
133
+
134
+ ## リポジトリ
135
+
136
+ - GitHub: [https://github.com/ksugahar/Coreform_Cubit_Mesh_Export](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export)
137
+ - PyPI: [https://pypi.org/project/coreform-cubit-mesh-export/](https://pypi.org/project/coreform-cubit-mesh-export/)
138
+
139
+ ## バグ報告・機能要望
140
+
141
+ [GitHub Issues](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues)にてお願いします。
142
+
143
+ ## 変更履歴
144
+
145
+ ### v0.9.4 (2025-09-11)
146
+ - **バグ修正**
147
+ - Gmsh v4形式: Wedge要素のノード出力を4個から6個に修正
148
+ - Gmsh v4形式: 要素タグを0ではなく1から開始するよう修正
149
+ - Gmsh v4形式: 空の要素リストでmin/max関数がエラーになる問題を修正
150
+ - VTK形式: WedgeとPyramid要素のconnectivity取得処理が欠落していた問題を修正
151
+ - NASTRAN形式: f-string構文エラーを修正
152
+ - FreeFEM形式: 未定義変数`nodeset_surface_list`の問題を修正
153
+ - geo_mesh形式: 未定義変数`nodes`の初期化を追加
154
+
155
+ ### v0.9.3 (2025-01)
156
+ - パッケージ名を`Coreform_Cubit_Mesh_Export`に統一
157
+ - `pyproject.toml`ベースの最新パッケージング方式に移行
158
+ - ドキュメントの改善
159
+
160
+ ### v0.9.2
161
+ - 初回PyPIリリース
@@ -0,0 +1,161 @@
1
+ Metadata-Version: 2.4
2
+ Name: Coreform_Cubit_Mesh_Export
3
+ Version: 0.9.5
4
+ Summary: Cubit mesh export to various formats including Gmsh, Nastran, and VTK
5
+ Author-email: Kengo Sugahara <ksugahar@gmail.com>
6
+ Maintainer-email: Kengo Sugahara <ksugahar@gmail.com>
7
+ License: BSD-3-Clause
8
+ Project-URL: Homepage, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
9
+ Project-URL: Repository, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
10
+ Project-URL: Bug Tracker, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues
11
+ Keywords: cubit,mesh,gmsh,nastran,vtk,export,coreform
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: BSD License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.7
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Scientific/Engineering
24
+ Classifier: Topic :: Scientific/Engineering :: Physics
25
+ Requires-Python: >=3.7
26
+ Description-Content-Type: text/markdown
27
+ Requires-Dist: numpy>=1.20.3
28
+ Requires-Dist: scipy>=1.6.3
29
+
30
+ # Coreform Cubit Mesh Export
31
+
32
+ Coreform Cubitから様々な形式のメッシュファイルをエクスポートするPythonライブラリ
33
+
34
+ ## インストール方法
35
+
36
+ ### PyPIから直接インストール(推奨)
37
+ ```bash
38
+ pip install --upgrade coreform-cubit-mesh-export
39
+ ```
40
+
41
+ ### Cubit内蔵Pythonの場合
42
+ ```bash
43
+ cd "C:\Program Files\Coreform Cubit 2025.3\bin\python3\"
44
+ python.exe -m pip install --upgrade coreform-cubit-mesh-export
45
+ ```
46
+
47
+ ### 開発版をGitHubからインストール
48
+ ```bash
49
+ pip install git+https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
50
+ ```
51
+
52
+ ### ローカルインストール(開発用)
53
+ ```bash
54
+ git clone https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
55
+ cd Coreform_Cubit_Mesh_Export
56
+ pip install -e .
57
+ ```
58
+
59
+ ## サポートしているファイル形式
60
+
61
+ - **Gmsh形式**
62
+ - バージョン2.2(完全サポート)
63
+ - バージョン4.1(部分サポート)
64
+ - **Nastran形式**
65
+ - 2Dメッシュ
66
+ - 3Dメッシュ
67
+ - **MEG形式**(ELF用)
68
+ - 2Dメッシュ
69
+ - 3Dメッシュ
70
+ - **VTK形式**
71
+ - メッシュのみ(Legacy VTK形式)
72
+
73
+ ## 使い方
74
+
75
+ ### Cubit内での使用例
76
+
77
+ Cubitでメッシュ生成後、以下のようにPythonスクリプトを実行します:
78
+
79
+ ```python
80
+ # Cubitコマンドライン
81
+ play "export_mesh.py"
82
+ ```
83
+
84
+ `export_mesh.py`の内容例:
85
+
86
+ ```python
87
+ import cubit_mesh_export
88
+
89
+ # Nastran形式でエクスポート
90
+ FileName = 'output/model.nas'
91
+ cubit_mesh_export.export_3D_Nastran(cubit, FileName)
92
+
93
+ # Gmsh形式でエクスポート
94
+ FileName = 'output/model.msh'
95
+ cubit_mesh_export.export_3D_gmsh_ver2(cubit, FileName)
96
+
97
+ # VTK形式でエクスポート
98
+ FileName = 'output/model.vtk'
99
+ cubit_mesh_export.export_3D_vtk(cubit, FileName)
100
+ ```
101
+
102
+ ## 関数一覧
103
+
104
+ ### Gmsh形式
105
+ - `export_3D_gmsh_ver2(cubit, filename)` - Gmsh v2.2形式で3Dメッシュをエクスポート
106
+ - `export_3D_gmsh_ver4(cubit, filename)` - Gmsh v4.1形式で3Dメッシュをエクスポート(部分サポート)
107
+
108
+ ### Nastran形式
109
+ - `export_2D_Nastran(cubit, filename)` - 2DメッシュをNastran形式でエクスポート
110
+ - `export_3D_Nastran(cubit, filename)` - 3DメッシュをNastran形式でエクスポート
111
+
112
+ ### MEG形式(ELF用)
113
+ - `export_2D_meg(cubit, filename)` - 2DメッシュをMEG形式でエクスポート
114
+ - `export_3D_meg(cubit, filename)` - 3DメッシュをMEG形式でエクスポート
115
+
116
+ ### VTK形式
117
+ - `export_3D_vtk(cubit, filename)` - 3DメッシュをVTK形式でエクスポート
118
+
119
+ ## 要件
120
+
121
+ - Python 3.7以上
122
+ - NumPy >= 1.20.3
123
+ - SciPy >= 1.6.3
124
+ - Coreform Cubit(メッシュ生成用)
125
+
126
+ ## ライセンス
127
+
128
+ BSD 3-Clause License
129
+
130
+ ## 作者
131
+
132
+ Kengo Sugahara (ksugahar@gmail.com)
133
+
134
+ ## リポジトリ
135
+
136
+ - GitHub: [https://github.com/ksugahar/Coreform_Cubit_Mesh_Export](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export)
137
+ - PyPI: [https://pypi.org/project/coreform-cubit-mesh-export/](https://pypi.org/project/coreform-cubit-mesh-export/)
138
+
139
+ ## バグ報告・機能要望
140
+
141
+ [GitHub Issues](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues)にてお願いします。
142
+
143
+ ## 変更履歴
144
+
145
+ ### v0.9.4 (2025-09-11)
146
+ - **バグ修正**
147
+ - Gmsh v4形式: Wedge要素のノード出力を4個から6個に修正
148
+ - Gmsh v4形式: 要素タグを0ではなく1から開始するよう修正
149
+ - Gmsh v4形式: 空の要素リストでmin/max関数がエラーになる問題を修正
150
+ - VTK形式: WedgeとPyramid要素のconnectivity取得処理が欠落していた問題を修正
151
+ - NASTRAN形式: f-string構文エラーを修正
152
+ - FreeFEM形式: 未定義変数`nodeset_surface_list`の問題を修正
153
+ - geo_mesh形式: 未定義変数`nodes`の初期化を追加
154
+
155
+ ### v0.9.3 (2025-01)
156
+ - パッケージ名を`Coreform_Cubit_Mesh_Export`に統一
157
+ - `pyproject.toml`ベースの最新パッケージング方式に移行
158
+ - ドキュメントの改善
159
+
160
+ ### v0.9.2
161
+ - 初回PyPIリリース
@@ -0,0 +1,132 @@
1
+ # Coreform Cubit Mesh Export
2
+
3
+ Coreform Cubitから様々な形式のメッシュファイルをエクスポートするPythonライブラリ
4
+
5
+ ## インストール方法
6
+
7
+ ### PyPIから直接インストール(推奨)
8
+ ```bash
9
+ pip install --upgrade coreform-cubit-mesh-export
10
+ ```
11
+
12
+ ### Cubit内蔵Pythonの場合
13
+ ```bash
14
+ cd "C:\Program Files\Coreform Cubit 2025.3\bin\python3\"
15
+ python.exe -m pip install --upgrade coreform-cubit-mesh-export
16
+ ```
17
+
18
+ ### 開発版をGitHubからインストール
19
+ ```bash
20
+ pip install git+https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
21
+ ```
22
+
23
+ ### ローカルインストール(開発用)
24
+ ```bash
25
+ git clone https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
26
+ cd Coreform_Cubit_Mesh_Export
27
+ pip install -e .
28
+ ```
29
+
30
+ ## サポートしているファイル形式
31
+
32
+ - **Gmsh形式**
33
+ - バージョン2.2(完全サポート)
34
+ - バージョン4.1(部分サポート)
35
+ - **Nastran形式**
36
+ - 2Dメッシュ
37
+ - 3Dメッシュ
38
+ - **MEG形式**(ELF用)
39
+ - 2Dメッシュ
40
+ - 3Dメッシュ
41
+ - **VTK形式**
42
+ - メッシュのみ(Legacy VTK形式)
43
+
44
+ ## 使い方
45
+
46
+ ### Cubit内での使用例
47
+
48
+ Cubitでメッシュ生成後、以下のようにPythonスクリプトを実行します:
49
+
50
+ ```python
51
+ # Cubitコマンドライン
52
+ play "export_mesh.py"
53
+ ```
54
+
55
+ `export_mesh.py`の内容例:
56
+
57
+ ```python
58
+ import cubit_mesh_export
59
+
60
+ # Nastran形式でエクスポート
61
+ FileName = 'output/model.nas'
62
+ cubit_mesh_export.export_3D_Nastran(cubit, FileName)
63
+
64
+ # Gmsh形式でエクスポート
65
+ FileName = 'output/model.msh'
66
+ cubit_mesh_export.export_3D_gmsh_ver2(cubit, FileName)
67
+
68
+ # VTK形式でエクスポート
69
+ FileName = 'output/model.vtk'
70
+ cubit_mesh_export.export_3D_vtk(cubit, FileName)
71
+ ```
72
+
73
+ ## 関数一覧
74
+
75
+ ### Gmsh形式
76
+ - `export_3D_gmsh_ver2(cubit, filename)` - Gmsh v2.2形式で3Dメッシュをエクスポート
77
+ - `export_3D_gmsh_ver4(cubit, filename)` - Gmsh v4.1形式で3Dメッシュをエクスポート(部分サポート)
78
+
79
+ ### Nastran形式
80
+ - `export_2D_Nastran(cubit, filename)` - 2DメッシュをNastran形式でエクスポート
81
+ - `export_3D_Nastran(cubit, filename)` - 3DメッシュをNastran形式でエクスポート
82
+
83
+ ### MEG形式(ELF用)
84
+ - `export_2D_meg(cubit, filename)` - 2DメッシュをMEG形式でエクスポート
85
+ - `export_3D_meg(cubit, filename)` - 3DメッシュをMEG形式でエクスポート
86
+
87
+ ### VTK形式
88
+ - `export_3D_vtk(cubit, filename)` - 3DメッシュをVTK形式でエクスポート
89
+
90
+ ## 要件
91
+
92
+ - Python 3.7以上
93
+ - NumPy >= 1.20.3
94
+ - SciPy >= 1.6.3
95
+ - Coreform Cubit(メッシュ生成用)
96
+
97
+ ## ライセンス
98
+
99
+ BSD 3-Clause License
100
+
101
+ ## 作者
102
+
103
+ Kengo Sugahara (ksugahar@gmail.com)
104
+
105
+ ## リポジトリ
106
+
107
+ - GitHub: [https://github.com/ksugahar/Coreform_Cubit_Mesh_Export](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export)
108
+ - PyPI: [https://pypi.org/project/coreform-cubit-mesh-export/](https://pypi.org/project/coreform-cubit-mesh-export/)
109
+
110
+ ## バグ報告・機能要望
111
+
112
+ [GitHub Issues](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues)にてお願いします。
113
+
114
+ ## 変更履歴
115
+
116
+ ### v0.9.4 (2025-09-11)
117
+ - **バグ修正**
118
+ - Gmsh v4形式: Wedge要素のノード出力を4個から6個に修正
119
+ - Gmsh v4形式: 要素タグを0ではなく1から開始するよう修正
120
+ - Gmsh v4形式: 空の要素リストでmin/max関数がエラーになる問題を修正
121
+ - VTK形式: WedgeとPyramid要素のconnectivity取得処理が欠落していた問題を修正
122
+ - NASTRAN形式: f-string構文エラーを修正
123
+ - FreeFEM形式: 未定義変数`nodeset_surface_list`の問題を修正
124
+ - geo_mesh形式: 未定義変数`nodes`の初期化を追加
125
+
126
+ ### v0.9.3 (2025-01)
127
+ - パッケージ名を`Coreform_Cubit_Mesh_Export`に統一
128
+ - `pyproject.toml`ベースの最新パッケージング方式に移行
129
+ - ドキュメントの改善
130
+
131
+ ### v0.9.2
132
+ - 初回PyPIリリース
@@ -64,14 +64,12 @@ def export_3D_mesh(cubit, FileName):
64
64
  for nodeset_id in nodeset_list:
65
65
  surface_list = cubit.get_nodeset_surfaces(nodeset_id)
66
66
  for surface_id in surface_list:
67
+ nodeset_surface_list.append(surface_id)
67
68
  tri_list = cubit.get_surface_tris(surface_id)
68
69
  if len(tri_list)>0:
69
70
  for tri_id in tri_list:
70
71
  node_list = cubit.get_connectivity("tri", tri_id)
71
72
  fid.write(f'{node_list[0]} {node_list[1]} {node_list[2]} {nodeset_id}\n')
72
- for surface_id in nodeset_surface_list:
73
- quad_list += cubit.get_surface_quads(surface_id)
74
- tri_list += cubit.get_surface_tris(surface_id)
75
73
 
76
74
  fid.write("\n")
77
75
  fid.write("End\n")
@@ -482,10 +480,13 @@ def export_3D_gmsh_ver4(cubit, FileName):
482
480
  hex_all_list += cubit.get_volume_hexes(volume_id)
483
481
  wedge_all_list += cubit.get_volume_wedges(volume_id)
484
482
 
485
- elementTag = 0
483
+ elementTag = 1
486
484
 
487
485
  all_list = quad_all_list + tri_all_list + hex_all_list + tet_all_list + wedge_all_list
488
- fid.write(f'{ nodeset_surface_count + block_volume_count} {len(all_list)} {min(all_list)} {max(all_list)}\n')
486
+ if len(all_list) > 0:
487
+ fid.write(f'{ nodeset_surface_count + block_volume_count} {len(all_list)} {min(all_list)} {max(all_list)}\n')
488
+ else:
489
+ fid.write(f'{ nodeset_surface_count + block_volume_count} 0 0 0\n')
489
490
 
490
491
  for nodeset_id in cubit.get_nodeset_id_list():
491
492
  surface_list = cubit.get_nodeset_surfaces(nodeset_id)
@@ -530,7 +531,7 @@ def export_3D_gmsh_ver4(cubit, FileName):
530
531
  for wedge_id in wedge_list:
531
532
  node_list = cubit.get_connectivity("wedge", wedge_id)
532
533
  elementTag +=1
533
- fid.write(f'{elementTag} {node_list[0]} {node_list[1]} {node_list[2]} {node_list[3]}\n')
534
+ fid.write(f'{elementTag} {node_list[0]} {node_list[1]} {node_list[2]} {node_list[3]} {node_list[4]} {node_list[5]}\n')
534
535
 
535
536
  fid.write('$EndElements\n')
536
537
  fid.close()
@@ -549,7 +550,7 @@ def export_1D_Nastran(cubit, FileName):
549
550
  fid.write("$\n")
550
551
  fid.write("$ CUBIT NX Nastran Translator\n")
551
552
  fid.write("$\n")
552
- fid.write("f$ File: {FileName}\n")
553
+ fid.write(f"$ File: {FileName}\n")
553
554
  fid.write(f"$ Time Stamp: {formatted_date_time}\n")
554
555
  fid.write("$\n")
555
556
  fid.write("$\n")
@@ -645,7 +646,7 @@ def export_2D_Nastran(cubit, FileName):
645
646
  fid.write("$\n")
646
647
  fid.write("$ CUBIT NX Nastran Translator\n")
647
648
  fid.write("$\n")
648
- fid.write("f$ File: {FileName}\n")
649
+ fid.write(f"$ File: {FileName}\n")
649
650
  fid.write(f"$ Time Stamp: {formatted_date_time}\n")
650
651
  fid.write("$\n")
651
652
  fid.write("$\n")
@@ -756,7 +757,7 @@ def export_3D_Nastran(cubit, FileName, Pyram=True):
756
757
  fid.write("$\n")
757
758
  fid.write("$ CUBIT NX Nastran Translator\n")
758
759
  fid.write("$\n")
759
- fid.write("f$ File: {FileName}\n")
760
+ fid.write(f"$ File: {FileName}\n")
760
761
  fid.write(f"$ Time Stamp: {formatted_date_time}\n")
761
762
  fid.write("$\n")
762
763
  fid.write("$\n")
@@ -1197,8 +1198,10 @@ def export_3D_vtk(cubit, FileName):
1197
1198
  node_list = cubit.get_connectivity("hex", hex_id)
1198
1199
  fid.write(f'8 {node_list[0]-1} {node_list[1]-1} {node_list[2]-1} {node_list[3]-1} {node_list[4]-1} {node_list[5]-1} {node_list[6]-1} {node_list[7]-1}\n')
1199
1200
  for wedge_id in wedge_list:
1201
+ node_list = cubit.get_connectivity("wedge", wedge_id)
1200
1202
  fid.write(f'6 {node_list[0]-1} {node_list[1]-1} {node_list[2]-1} {node_list[3]-1} {node_list[4]-1} {node_list[5]-1} \n')
1201
1203
  for pyramid_id in pyramid_list:
1204
+ node_list = cubit.get_connectivity("pyramid", pyramid_id)
1202
1205
  fid.write(f'5 {node_list[0]-1} {node_list[1]-1} {node_list[2]-1} {node_list[3]-1} {node_list[4]-1} \n')
1203
1206
 
1204
1207
  fid.write(f'CELL_TYPES {len(tet_list) + len(hex_list) + len(wedge_list) + len(pyramid_list)}\n')
@@ -1227,6 +1230,7 @@ def export_2D_geo_mesh(cubit, FileName):
1227
1230
  import numpy
1228
1231
  import scipy.io
1229
1232
 
1233
+ nodes = []
1230
1234
  node_list = []
1231
1235
 
1232
1236
  N = cubit.get_node_count()
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "Coreform_Cubit_Mesh_Export"
7
- version = "0.9.3"
7
+ version = "0.9.5"
8
8
  authors = [
9
9
  {name = "Kengo Sugahara", email = "ksugahar@gmail.com"},
10
10
  ]
@@ -1,71 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: Coreform_Cubit_Mesh_Export
3
- Version: 0.9.3
4
- Summary: Cubit mesh export to various formats including Gmsh, Nastran, and VTK
5
- Author-email: Kengo Sugahara <ksugahar@gmail.com>
6
- Maintainer-email: Kengo Sugahara <ksugahar@gmail.com>
7
- License: BSD-3-Clause
8
- Project-URL: Homepage, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
9
- Project-URL: Repository, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
10
- Project-URL: Bug Tracker, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues
11
- Keywords: cubit,mesh,gmsh,nastran,vtk,export,coreform
12
- Classifier: Development Status :: 4 - Beta
13
- Classifier: Intended Audience :: Science/Research
14
- Classifier: License :: OSI Approved :: BSD License
15
- Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.7
18
- Classifier: Programming Language :: Python :: 3.8
19
- Classifier: Programming Language :: Python :: 3.9
20
- Classifier: Programming Language :: Python :: 3.10
21
- Classifier: Programming Language :: Python :: 3.11
22
- Classifier: Programming Language :: Python :: 3.12
23
- Classifier: Topic :: Scientific/Engineering
24
- Classifier: Topic :: Scientific/Engineering :: Physics
25
- Requires-Python: >=3.7
26
- Description-Content-Type: text/markdown
27
- Requires-Dist: numpy>=1.20.3
28
- Requires-Dist: scipy>=1.6.3
29
-
30
- # インストール方法
31
-
32
- ## PyPIから直接インストール(推奨)
33
- ```
34
- pip install --upgrade Coreform_Cubit_Mesh_Export
35
- ```
36
-
37
- Cubit内蔵Pythonの場合:
38
- ```
39
- cd "C:\Program Files\Coreform Cubit 2025.3\bin\python3\"
40
- python.exe -m pip install --upgrade Coreform_Cubit_Mesh_Export
41
- ```
42
- ----
43
- # サポートしているファイル
44
- - gmshファイル ver.2
45
- - gmshファイル ver.4 (不完全)
46
- - Nastranファイル (2D)
47
- - Nastranファイル (3D)
48
- - ELF用ファイル (2D)
49
- - ELF用ファイル (3D)
50
- - vtkファイル (メッシュのみ)
51
-
52
- ---
53
- # 使い方
54
- Cubitでメッシュ生成後にpythonを実行するコマンドを入力。
55
- play "Pythonスクリプト名.py"
56
- を実行する。
57
- "Pythonスクリプト名.py" の中身は例えば、
58
- ```
59
- FileName = 'O:/test.nas'
60
- import cubit_mesh_export
61
- cubit_mesh_export.export_3D_Nastran(cubit, FileName)
62
- ```
63
- ---
64
- # 関数一覧
65
- - export_3D_gmsh_ver2
66
- - export_3D_gmsh_ver4
67
- - export_2D_Nastran
68
- - export_3D_Nastran
69
- - export_2D_meg
70
- - export_3D_meg
71
- - export_3D_vtk
@@ -1,71 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: Coreform_Cubit_Mesh_Export
3
- Version: 0.9.3
4
- Summary: Cubit mesh export to various formats including Gmsh, Nastran, and VTK
5
- Author-email: Kengo Sugahara <ksugahar@gmail.com>
6
- Maintainer-email: Kengo Sugahara <ksugahar@gmail.com>
7
- License: BSD-3-Clause
8
- Project-URL: Homepage, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
9
- Project-URL: Repository, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
10
- Project-URL: Bug Tracker, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues
11
- Keywords: cubit,mesh,gmsh,nastran,vtk,export,coreform
12
- Classifier: Development Status :: 4 - Beta
13
- Classifier: Intended Audience :: Science/Research
14
- Classifier: License :: OSI Approved :: BSD License
15
- Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.7
18
- Classifier: Programming Language :: Python :: 3.8
19
- Classifier: Programming Language :: Python :: 3.9
20
- Classifier: Programming Language :: Python :: 3.10
21
- Classifier: Programming Language :: Python :: 3.11
22
- Classifier: Programming Language :: Python :: 3.12
23
- Classifier: Topic :: Scientific/Engineering
24
- Classifier: Topic :: Scientific/Engineering :: Physics
25
- Requires-Python: >=3.7
26
- Description-Content-Type: text/markdown
27
- Requires-Dist: numpy>=1.20.3
28
- Requires-Dist: scipy>=1.6.3
29
-
30
- # インストール方法
31
-
32
- ## PyPIから直接インストール(推奨)
33
- ```
34
- pip install --upgrade Coreform_Cubit_Mesh_Export
35
- ```
36
-
37
- Cubit内蔵Pythonの場合:
38
- ```
39
- cd "C:\Program Files\Coreform Cubit 2025.3\bin\python3\"
40
- python.exe -m pip install --upgrade Coreform_Cubit_Mesh_Export
41
- ```
42
- ----
43
- # サポートしているファイル
44
- - gmshファイル ver.2
45
- - gmshファイル ver.4 (不完全)
46
- - Nastranファイル (2D)
47
- - Nastranファイル (3D)
48
- - ELF用ファイル (2D)
49
- - ELF用ファイル (3D)
50
- - vtkファイル (メッシュのみ)
51
-
52
- ---
53
- # 使い方
54
- Cubitでメッシュ生成後にpythonを実行するコマンドを入力。
55
- play "Pythonスクリプト名.py"
56
- を実行する。
57
- "Pythonスクリプト名.py" の中身は例えば、
58
- ```
59
- FileName = 'O:/test.nas'
60
- import cubit_mesh_export
61
- cubit_mesh_export.export_3D_Nastran(cubit, FileName)
62
- ```
63
- ---
64
- # 関数一覧
65
- - export_3D_gmsh_ver2
66
- - export_3D_gmsh_ver4
67
- - export_2D_Nastran
68
- - export_3D_Nastran
69
- - export_2D_meg
70
- - export_3D_meg
71
- - export_3D_vtk
@@ -1,42 +0,0 @@
1
- # インストール方法
2
-
3
- ## PyPIから直接インストール(推奨)
4
- ```
5
- pip install --upgrade Coreform_Cubit_Mesh_Export
6
- ```
7
-
8
- Cubit内蔵Pythonの場合:
9
- ```
10
- cd "C:\Program Files\Coreform Cubit 2025.3\bin\python3\"
11
- python.exe -m pip install --upgrade Coreform_Cubit_Mesh_Export
12
- ```
13
- ----
14
- # サポートしているファイル
15
- - gmshファイル ver.2
16
- - gmshファイル ver.4 (不完全)
17
- - Nastranファイル (2D)
18
- - Nastranファイル (3D)
19
- - ELF用ファイル (2D)
20
- - ELF用ファイル (3D)
21
- - vtkファイル (メッシュのみ)
22
-
23
- ---
24
- # 使い方
25
- Cubitでメッシュ生成後にpythonを実行するコマンドを入力。
26
- play "Pythonスクリプト名.py"
27
- を実行する。
28
- "Pythonスクリプト名.py" の中身は例えば、
29
- ```
30
- FileName = 'O:/test.nas'
31
- import cubit_mesh_export
32
- cubit_mesh_export.export_3D_Nastran(cubit, FileName)
33
- ```
34
- ---
35
- # 関数一覧
36
- - export_3D_gmsh_ver2
37
- - export_3D_gmsh_ver4
38
- - export_2D_Nastran
39
- - export_3D_Nastran
40
- - export_2D_meg
41
- - export_3D_meg
42
- - export_3D_vtk