上記PLYファイルをCloudCompareで開いてcloudを選択し,bottom view(図29)。点群対象のcompute 2.5D volume分析のために,上下に点群を分割したい。外周の一番の出っ張りをトレースしてsegmentationを実施したいと考えた。segmentationはsegment in or outを実行をしないとオブジェクトの移動などができないので,1回で分割しなければならない,と呆けで決めつけてしまった。それで,図30のように,set bottomにしてその縁辺で切り取るしか,方法はない,と考えたのである。 図31には,ポリゴンの選択を完了した様子(緑色細線の閉曲線)が見える。
図29 PLYファイルを開いてcloudを選択
図30 set bottomでsegmentationのトライ
図31 ポリゴンツールによる選択完了
図32はsegment outを実行したところで,図31のポリゴンツールで閉曲線を作成した筈であるが,囲んだ範囲の外側が図32のcloudとなったのである。図33ではconfirmした結果で,DB Treeのremainingとsegmentedの両方が選択されている。図34はこのオブジェクトのleft side viewで,切り口は見えない。まだ事態が掴めない。
toolでの点群体積計算で,Ceilがsegmentedで,groundがremainingに対応することになるだろう。図60では両cloudを選んで,Tools > Volume > 2.5Dvolumeを実行することになる。図61を見ると,groundに対応するcloudはremainingで,ceilに対応するcloudはsegmentedになっているので,いい感じだ。ただ,At least one of the cloud is sparse! You should fill the empty cells… という警告が出ている。 step: 0.03(3 cm)。図62との違いはEmpty Cellsをleave emptyにしているかinterpolateにしているかの違いで体積値が変わる。
図60 両cloudを選んで
図61 UpdateでVolume 25.879
図62 UpdateでVolume 21.376
Calculated volume in 2.5 d changes with grid step size bug? を参照のこと。それで,図63では,両点群のEmpty cells: interpolate,Grid step 0.10(10cm)にした。かなり粗いグリッドだが,Volume 32.205,Surface 18.750,Matching cells: 81.9%,となった。警告が出なくなった。図64のように,Export grid as a cloudのボタンをクリックすると,シーンにカラーによる高度頻度分布図がHeight deiffernce raster(0.1)として出力されている。図64のパネルの最下部でOKを押すと,図65のように,パネルが消えてシーンには高度頻度分布図が配置されている。
7 フィールド科学のためのアップルLiDAR測量 Part 2 Ⅴ.4 Meshmixerで大饗石の底抜けを解消して体積を求める
文学論集Vol. 73, No. 3(発行は2023年末ぐらいか)
Meshmixer 3.5 is now available ![i] からこのアプリをダウンロードできる。筆者が用意していた大饗石オブジェクトだけのMeshLabファイルからobjファイルを抽出してMeshmixerにインポートした。メッシュの綻びをチェックすべく,解析 > 検証,を選んだ。かなりの綻びがシーンに表示される。「すべて自動修復」ボタンを押した。実行にかなりの時間を要した。MeshLabでこの種の作業を実施してきたファイルであったるが,Meshmixerからすると今だ綻びがあるようだ。Meshmixerは,ビジュアルに簡便に,この種の作業が実施できる。これは驚きであった。
なお,上述のように点群の点数を増やさない場合,step: 0.1より小さくすると,赤字でAt least one of the cloud is sparse! You should fill the empty cells..という警告が現れる。Ⅴ.4.aのメッシュの体積は前述のように37.6635㎥であった。点群の体積は31.825㎥である。メッシュの体積は,図34(a)のメッシュ拡大図に見えるようにメッシュエンティティーは三角面triangle facesからなり,適当な原点から三角面それぞれの頂点に側稜が伸びて,オブジェクトは三角錐で埋められる。それぞれの三角錐の体積の総和がメッシュファイルの体積となる。前述のように2.5D volume法はこのメッシュ法に比べると粗雑になっているので,メッシュ法の体積V = 37.6635㎥を採用することになる。土木工事などで工事の前後の土量の移動などの場合は,適用が2.5D volume法に限定されるので,もちろん,使用価値はある。
質問:Is Japanese edition of ChatGPT original or translation of English ChatGPT?
As of my last knowledge update in September 2021, OpenAI had not released an official Japanese edition of ChatGPT. However, it’s important to note that advancements and updates may have occurred since then.
If a Japanese edition of ChatGPT exists or has been released since my last update, it could be an adaptation or translation of the original English ChatGPT. The translation process involves translating the underlying model, fine-tuning it using Japanese text, and potentially making cultural or linguistic adjustments to ensure the responses are appropriate and natural in a Japanese context.
For the most current and accurate information about a Japanese edition of ChatGPT, I recommend visiting the OpenAI website or referring to official updates and announcements from OpenAI or other relevant sources.
文学論集Vol. 73, No. 3の『フィールド科学のためのアップルLiDAR測量 Part 2』の「Ⅴ.4 四面体に分割して体積を求める」(Sep. 19, 2023投稿)のコピーをここに示す。ChatGPTを初めて使った報告の一部である。 ———————————————— ChatGPTを本日初めて使い,” Do you calculate the volume of a 3D mesh obj file?”って質問すると,多少長いが示唆に富む回答があった。
Load the OBJ file → Triangulate the Faces → Calculate Tetrahedral Volume → Sum Up the Tetrahedral Volumes.
このモデルを手作業で実行した。このモデルではどんな形態でも適応が可能ではあるが大饗石はほぼ一つの六面体と一つの五面体で構成されている。 図33のα)は南壁面,β)は北壁面,γ)は東と西の壁面を示している。西壁面は,いわば新幹線先頭車両の鼻のように,大饗石本体の六面体に四角錐が突出しているようで,こういったイメージの元で,1〜9の9点の座標値を採取した。つまり,CloudCompareの上段メニューアイコン群の左から4番目のアイコン Point list picking(9点)を実行した。図33にその地点を示している。六面体内の四面体構成を図33δ)左手に示す。5個の四面体は,a〜eと命名しそれらの頂点に対応する頂点にa〜eを記している。西壁面の五面体は図33δ)右手に示すがf,g二つの四面体で構成される。1〜9の9点の座標値は,(x, y, z)の配列で,次の表5に示している。
2.1 質問: 3D scanned objects inevitablly have a big hole at the bottom. Please show me how to close up it?
ChatGPT回答:
When you 3D scan an object, it’s common to have holes or gaps in the mesh, especially at the bottom or other areas where the scanning process might not capture data accurately. Closing these holes and creating a watertight mesh is important for 3D printing or further digital modeling. Here’s a step-by-step guide to closing up holes in a 3D scanned mesh:
Use 3D Modeling Software:
Open the 3D scanning file in a 3D modeling software that allows mesh editing, such as Blender, Autodesk Meshmixer, or MeshLab.(全部オープンソース,Meshmixerは数日前にインストールした。3Dプリンター用の簡易版で使い易そうな印象だ)
Identify the Hole:
Identify the hole or gaps in the mesh that need to be closed. You can usually visualize these areas by rotating and inspecting the model in the software.
Select the Hole:
Use the selection tools in the software to select the area around the hole. In most programs, you can click and drag to select vertices, edges, or faces.(MeshLabにこういう機能が欲しいと思っていたがこの手法などにアクセスできていない)
Fill the Hole:
Once you’ve selected the hole, use the software’s mesh editing tools to fill the hole. This may be called “Fill Hole” or “Bridge Edge Loops” in different software. The tool will automatically generate new geometry to close the gap.
Adjust and Smooth:
After filling the hole, you may need to adjust the new geometry to match the surrounding surface. Use tools like sculpting, smoothing, or vertex manipulation to refine the area and make it seamless.
Check for Watertightness:
Ensure the mesh is watertight by using the software’s tools to check for holes, leaks, or non-manifold geometry. This ensures there are no remaining gaps in the mesh.
Save the Edited Mesh:
Save the edited mesh as a new file to preserve the changes without altering the original scanned data.
Export for Further Use:
If you intend to use the mesh for 3D printing or other purposes, export the edited and closed mesh in a suitable file format such as STL or OBJ.
Validate with 3D Printing Software:
If you plan to 3D print the model, import the closed mesh into 3D printing software to confirm that it’s now watertight and ready for printing.
Remember, the exact steps and tools you use may vary based on the 3D modeling software you’re using, but the general process remains similar. Additionally, practice and experimentation will help you become proficient in closing holes and editing 3D scanned meshes effectively.
2.2 User 質問: As you know that 3D scanned objects have big holes in the meshes. Please show me how to mend them using Autodesk Meshmixer.
ChatGPT回答:
Certainly! Autodesk Meshmixer is a powerful tool for working with 3D meshes, including repairing holes. Follow these steps to mend holes in 3D scanned objects using Autodesk Meshmixer:
ってなことで続くのであるが,木枯らしが吹いていた。前述のように,ChatGPTを本日初めて使いー” Do you calculate the volume of a 3D mesh obj file?”ーって質問すると,多少長いが示唆に富む回答があった,と書いていたがすでにぼくの頭の中にその世界があったから,ぼくが反応できたのであって,ChatGPTを使うことで,新たな世界が展開する訳ではない。ChatGPTに具体的な質問をすると,一応返ってくるのであるが,どうでもいい内容で,実際のプロセスを示してくれない。これは,アプリのユーザーマニュアルが役に立たない現象と似ているかも知れない。ChatGPTはこういった分野では使えない。自らの論文の英語チェックには,役立つのではと,今だ期待をしはしている。
以上,Sep. 22, 2023記。
Blenderでusdzファイルをobjファイルに変換して体積を求める converting usdz into obj by Blender and calculating volume
7-Zip for Windows からダウンロードできる。Downloadsフォルダを開くと,7z2301-64x.exeがある。これをダブルクリックすると,Destination folder: C:\Program Files\7-Zip\と出るので,Install。7-Zipフォルダーには,exeファイルが幾つかあるが,7z.exeが基本的なものであろう。この段階で右クリックで使えるようになっている。
Blender の File -> Import -> Universal Scene Description (.usd, .usdc, .usda) から USDC ファイルだけでなく,テキスチャーを共にインポートすることになる。 Blender File View ウィンドウで目的の USDC ファイルを選択し、またテクスチャも一緒に読み込むため画面の右ペーンの,Import All materials(これにはディフォルトでは✓が入っていない), Import USD Preview(これにはディフォルトで✓が入っている), Set Material Blend (これにもディフォルトで✓が入っている)を有効にして、Import USD ボタンを押す。ボタンを押す前が,図4である。
図4 Blender File View ウィンドウでの入力
読み込んだ直後の画面が図5である。この時点では, 3D モデルにはテクスチャはいまだ表示されていない。
その結果が図4である。テキスチャーはまだだ。右上のView Port Shadingを選択する必要がある。右端のViewport Shading Method to display / shade object in the 3D View: Rendered Display render previewを選ぶと,次の図6のように表示される。
File -> Export -> Wavefront (.obj) を選択して OBJ 形式でエクスポートする。なお、デフォルトではエクスポート時の座標系が Z Forward, Y Up になっている。BlenderのZ軸は奥行き方向に対して,CloudCompareやMeshLabではZ軸は高度軸なので,変更する必要がある。図8の右ペーンのTransformで,UpをZ軸,ForwardをY Forwardに変更した。クラウドコンペアでのXYZ軸関係を見ると(図13),右手座標系になっているので,この設定は正解だ。なお,Exportする際に画面上のオブジェクトを選択していた(メッシュがオレンジ色で縁取られている)が,この所作は重要かも知れない?。
usdzから変換したobjファイルのtextureの肌理は細やかな気がしている。実際,segmentationの際のmeshの断面はfbxよりもかなりスムーズな印象であった。図16のように,比較的大きな穴が残っている。 図17では,Remeshing, Simplification and Reconstuction > Close Holes size 100,✓Prevent,設定。図18はその結果。手前の穴は塞がった。奥の一つは塞がらない。
図16 比較的大きな穴が
図17 Close holes size=100, ✓Prevent
図18 手前の穴は塞がった
引き続き,Close Holesを実行しようとすると,Filter Failure not 2-manifold egesエラー。それで, Filters > Cleaning and Repairing > Repair non Manifold Edges, Remove Faces を実行後に,もう一つの選択肢Split Verticesも実行した結果が図19で,図20のように,いまだ懸案の穴は残っている。 size=1,000も実行した。Closed 789 holes and 44 new facesという結果。さらに,図21のように,10,000実行。Closed 32 holes and 1 new faces。とはいえ,図21のように,未だパネルそばの穴は塞がっていない。
Blender PreferencesのAdd-onsのリストの中に,Mesh: 3D-Print Toolboxがあり,Blenderアイコンが出ている(図41)ので,インストール済みということ。□に✓を入れること。なお,インストールされていないのは人影が見えるので,□に✓を入れて,リスト最上段の「↓インストール」ボタンを押せば良い。 add-onがあるpathは次のようだ。C:\Program Files\Blender Foundation\Blender 3.6\3.6\Script\addons。 Mesh: 3D-Print Toolboxの使用法は, How To Use The 3D Print Toolbox Add On? 【注意点アリ!】Blenderで3Dプリンター用のデータを作る方法 にある。要するに,3Dプリンター用のファイルを作るためのadd-onのようだ。Mesh: 3D-Print Toolboxを画面に表示するには,図43のViewメニューのSidebarの□に✓を入れること。
LiDARスキャンオブジェクトの底を塞ぐ closing the bottom hole of a LiDAR scanned object
はじめに
iPhone 12 ProのLiDARで3DスキャンしてPLY, OBJ, FBXファイルで出力して, メッシュファイルを使って体積を求めるべく,CloudCompareで開いて,Edit > Mesh > Measure Volumeを実行すると,計算値が出るが,必ず,”The above volume might be invalid (mesh has holes)”のメッセージが現れる。
これをぼくは作成した3Dスキャン像に隙間や穴ができているためだと考えて,実際埋める作業をしてきた。実際埋まるのであるが,相変わらずこのinvalidメッセージが出る。MeshLabでの作業を学んでいて,昨晩,やっと気付いたのである。オブジェクトの下が抜けているのである。オブジェクトが載る床や地面に「接する」底はスキャンできない。これまでの3Dスキャン像は全部,底抜けである。この底抜けのために,”The above volume might be invalid (mesh has holes)”のメッセージが現れていたのである。
This tool is accessible via the ‘Edit > Mesh > Delaunay 2.5D (XY plane)’ menu.
Description
Computes a Delaunay 2D1/2 triangulation on a point cloud.
The point cloud is simply projected in 2D on the (XY) plane. Then the corresponding 2D points are triangulated and the mesh structure is applied to the 3D points.
By default the 2D Delaunay triangulation is done on the cloud convex hull. Therefore CloudCompare will ask the user to specify a maximum length for the triangle edges. This allows to remove the biggest triangles (generally on the boundary) that are not necessarily meaningful. If this value is left to zero, then all the triangles output by the Delaunay triangulation will be kept.
This works very well with rather flat clouds and properly oriented (i.e. with the Z dimension as the vertical one). If the point cloud is not properly oriented but is still rather flat in a direction, you should consider using the other version of this method Delaunay 2D (best LS plane).
Note: for 3D triangulation, refer to the qPoissonRecon plugin.
ここに記述されている内容であれば,Delaunay 2.5D (XY plane) を実行することに問題はない。”specify a maximum length for the triangle edges” が理解できないので,デフォルトで実行した。これ自体,問題はないはずではある。
Merge all visible layers:デフォルトでは✓なしで,ママ。 Reconstruction Depth: デフォルト 8のママ。 Minimum Number of Samples: できるだけスムーズにするには高い値の方がいいようだ。デフォルトは1.5であるが,不確かだが10としよう。体積を求めるにはよりスムーズにした方がいいと思うからである。 Interpolation Weight: この値をゼロにすると,original (unscreened) Poisson Reconstructionになってしまう。このパネルを実行する意味が無くなると言って良いと思う。デフォルトは4で,4のママ。 Confidence Flag: デフォルトは✓なし。この場合,すべてのnormals法線はこの操作の前のunit-length(単位長)に揃えられる。デフォルトのママ。 Pre-Clean: デフォルトは✓なし。この場合,vertices (vertex) 関係の整理が実行されない。実行した方がいいと思うので,✓。 Number Thread: このreconstruction algorism 再建アルゴリズムの最大実行回数の意味であるがどういう役目を果たすのか,わからない。デフォルト 8のママ。
図3 Poisson meshの結果
図3のように,実行した結果はスカートを穿いたようになった。底は抜けたままだ。残念っ。新しいレイヤーができただけなので,右クリックで “delete current mesh” を実行すれば削除できそうなので,一応,キープ。全くデフォルトで実行したのだが,その結果の違いがわからなかった。二つとも削除した。底抜けを埋めるのは全く無理。
5 Filters / Remeshing, Simplification and Reconstruction/ Close Holes
図4 Current mesh does not have any faces
さて,現状は,前日の出口無しに戻ってしまった。先ほどMeshLabに取り込んだPLYファイルを操作する。Filters / Remeshing, Simplification and Reconstruction/ Close Holes を実行すると,PreConditions’ Failureとして,Current mesh does not have any faces. とのメッセージだ。
新たなファイルだから当然だなあ。
この点群PLYファイルに,Filters / Normals, Curvatures and Orientation / Compute normals for point sets, で点群の法線を生成する。Neighbour numをデフォルトの10で。Helpを見ると,Smooth Iteration欄がある。これを実行するかどうかで,像がスムーズになるかどうがわかるかも。
図5 Filters / Normals, Curvatures and Orientation / Compute normals for point sets
穴埋めには,次の三つのステップ Cleaning掃除, Fixing修理, Remeshing再メッシュ化がある。このツールとして最も簡便で多用されているのは, Remeshing, simplification and reconstruction->Close Holes パラメータには次の4点がある。(MeshLab でメッシュの穴埋めを行なう) Max size to be closed: ふさぐ穴の境界を構成するエッジの最大数。このエッジ数より小さい穴が処理対象。 Close holes with selected faces: 処理対象を選択されている面に限定するかどうか。 Select the newly created faces: 新たに追加された面を選択状態にするかどうか。処理前の選択面の選択は解除される。 Prevent creation of selfIntersecting faces: なるべく既存面と交差しないように面を追加するかどうか。
Open the point cloud file in Meshlab.
Clean the point cloud by removing any outliers and irrelevant data.It also reudces the number of points to be processed.
Compute Vertex Normals. Go to Filters->Normals,Curvatures and Orientation->Compute Normals for point sets.We have used default meshlab parameters for computing the normals.
Apply Poisson Reconstruction. Go to Filters->Remeshing,Simplification and Reconstruction->Surface Reconstruction:Poisson. To obtain good results, you may have to experiment with giving different octree depth value.Normal direction may need to be flipped for orienting them outwards.(Filters->Normals,Curvatures and Orientation->Flip Faces)
To add color, Go to Filters->Sampling->Attribute Transfer.Select color transfer check box and source and destination files appropriately for mapping.
Filters > Remeshing, Simplification and Reconstruction > Close Hole これを実行すると,manifoldエラーが出るので,前もって, Filters > Cleaning and Repairing > Repair non Manifold Edges (デフォルトのRemove Facesのまま)(図37),Applyしたが,実行結果はゼロだった。つまり,不要だ。これはポアッソン再建実行後のためであろう。 そして,Filters > Remeshing, Simplification and Reconstruction > Close Holeで,サイズを100に設定して(図38),Apply。実行結果はゼロ。これも,ポアッソン再建実行後のためであろう。サイズを10,000 に設定して(図39), Apply。
図37 Filters > Cleaning and Repairing > Repair non Manifold Edges (デフォルトのRemove Facesのまま)
図38 Filters > Remeshing, Simplification and Reconstruction > Close Hole
図39 size=10,000で
その結果,図40に合わせて,consoleでは,Closed 1 holes and added 117 new face,というメッセージ。柱状石碑メッシュの底の半分ほどが塞がっている。図41 に見えるように,sizeを 20,000 にして,Prevent creation of selfintersecting facesの✓は外してみた。図42のように底抜けが解消されている。
図40 consoleでは,Closed 1 holes and added 117 new face
図41 sizeを20000にして, Prevent creation of selfintersecting facesの✓は外してみた
まずは,図52のように,Filters > Remeshing, Simplification and Reconstruction > Close Holeで,Max size to be closed: 10,000,他は全✓。結果は,Closed 0 holes and added 0 new faces。1,000,000も実行,これも駄目。原因はPreventの✓を外さなかったためかも知れないが。
図52 Close holes Max size to be closed: 10,000 他は全✓。
ポアッソンに期待。図53のパネル設定。
図53 Poisson Reconstruction Depth 12 Adaptive Octree 5 Minimum Number of Samples 10 Pre-Clean ✓。