{"id":2034,"date":"2021-02-03T06:41:17","date_gmt":"2021-02-03T04:41:17","guid":{"rendered":"https:\/\/www.albertopassalacqua.com\/?p=2034"},"modified":"2021-02-03T06:41:17","modified_gmt":"2021-02-03T04:41:17","slug":"a-basic-geometry-module","status":"publish","type":"post","link":"https:\/\/www.albertopassalacqua.com\/?p=2034","title":{"rendered":"A basic geometry module"},"content":{"rendered":"<p style=\"text-align: justify;\">It is time for another update about my <a href=\"https:\/\/www.albertopassalacqua.com\/?p=1992\">hobby project<\/a>. I have been working on a module to perform basic operations on the geometry used to perform CFD simulations. Originally my application did this inside the module used to configure meshing with snappyHexMesh. However, this directly linked the geometry assembly to the mesh. I wanted to separate the two tasks for two reasons:<\/p>\n<ol style=\"text-align: justify;\">\n<li>Allow the same geometry assembly to be reused in multiple simulations. This also allows to reduce the number of times the same geometry information is stored, which is good side effect.<\/li>\n<li>Reduce the complexity of the mesh configuration tool.<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">Focus of this update is the part of the app that allows the creation of geometry assemblies from both simple analytical shapes and STL geometries. The landing page looks like the following:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/GeometryEditor1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2036\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/GeometryEditor1-1024x513.png\" alt=\"\" width=\"960\" height=\"481\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/GeometryEditor1-1024x513.png 1024w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/GeometryEditor1-300x150.png 300w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/GeometryEditor1-768x385.png 768w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/GeometryEditor1-1536x770.png 1536w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/GeometryEditor1-1080x540.png 1080w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/GeometryEditor1-1140x571.png 1140w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/GeometryEditor1.png 1910w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">After clicking on + New, the basic information of the assembly is requested. Only Save and Cancel are allowed actions at this stage.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2037\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry2-1024x484.png\" alt=\"\" width=\"960\" height=\"454\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry2-1024x484.png 1024w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry2-300x142.png 300w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry2-768x363.png 768w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry2-1536x726.png 1536w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry2-1140x539.png 1140w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry2.png 1900w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">After pressing Save, the interface is updated and the other options become available:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2038\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry3.png\" alt=\"\" width=\"655\" height=\"378\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry3.png 655w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry3-300x173.png 300w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">In the order, the buttons with secondary color are:<\/p>\n<ol style=\"text-align: justify;\">\n<li>Geometry file library<\/li>\n<li>Box<\/li>\n<li>Cylinder<\/li>\n<li>Hollow cylinder<\/li>\n<li>Sphere<\/li>\n<li>File upload<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">The latter only allows to upload geometry files (STL and OBJ) to the Geometry file library, which is an archive that allows files to be reused in multiple assemblies. Files belong to the user who uploaded them and only such user can use them. At the moment, a maximum file size of 100 MB is allowed, due to how files are stored and managed. User&#8217;s geometry files can be seen in the Geometry file library:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2039\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry5.png\" alt=\"\" width=\"552\" height=\"474\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry5.png 552w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry5-300x258.png 300w\" sizes=\"auto, (max-width: 552px) 100vw, 552px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">The library is searchable by name and description. If either contain the string inserted in the search box, files will be show in the list. The checkbox on the left of the file name allows the file to be added to or removed from the assembly. The eye icon expands the Geometry library modal and shows a preview in a GL canvas:<a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2040\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry6-1024x682.png\" alt=\"\" width=\"960\" height=\"639\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry6-1024x682.png 1024w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry6-300x200.png 300w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry6-768x511.png 768w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry6-1140x759.png 1140w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry6.png 1196w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">The object is automatically zoomed in to fit into the size of the modal and the bounding box is determined and visualized. The GL canvas is active and allows the object to be zoomed in and out and rotated with mouse or touch controls. If a geometry file has multiple solids, each is assigned a different color automatically:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/MultiColored.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2047\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/MultiColored-1024x695.png\" alt=\"\" width=\"960\" height=\"652\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/MultiColored-1024x695.png 1024w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/MultiColored-300x204.png 300w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/MultiColored-768x521.png 768w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/MultiColored.png 1133w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">The list of object has three main features:<\/p>\n<ul style=\"text-align: justify;\">\n<li>Clicking on the object name highlights it in the GL canvas making it semi-transparent.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Select.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2045\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Select-1024x490.png\" alt=\"\" width=\"960\" height=\"459\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Select-1024x490.png 1024w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Select-300x144.png 300w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Select-768x368.png 768w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Select-1536x736.png 1536w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Select-1140x546.png 1140w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Select.png 1595w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<ul style=\"text-align: justify;\">\n<li>Hovering on the name shows the Edit and Delete icons.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2041\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry7.png\" alt=\"\" width=\"640\" height=\"417\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry7.png 640w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry7-300x195.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">If the object is a file, the following modal dialog is opened when clicking on the Edit button:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2042\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry8.png\" alt=\"\" width=\"520\" height=\"560\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry8.png 520w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Geometry8-279x300.png 279w\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Details of the geometry file are shown. If the file has multiple solids, their names are shown too.<a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/FileOptions2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2048\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/FileOptions2.png\" alt=\"\" width=\"509\" height=\"639\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/FileOptions2.png 509w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/FileOptions2-239x300.png 239w\" sizes=\"auto, (max-width: 509px) 100vw, 509px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Similarly, for analytical shapes, dialogs with the information needed to define the geometry is shown. For example, for a box:<a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Box.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2043\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Box.png\" alt=\"\" width=\"515\" height=\"506\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Box.png 515w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Box-300x295.png 300w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Box-75x75.png 75w\" sizes=\"auto, (max-width: 515px) 100vw, 515px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">and for a sphere:<a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Sphere.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2044\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Sphere.png\" alt=\"\" width=\"510\" height=\"505\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Sphere.png 510w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Sphere-300x297.png 300w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Sphere-150x150.png 150w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/Sphere-75x75.png 75w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Finally, geometry assemblies are listed in the main page, and can be opened by clicking on the folder icon:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/AssemblyList.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2049\" src=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/AssemblyList.png\" alt=\"\" width=\"615\" height=\"280\" srcset=\"https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/AssemblyList.png 615w, https:\/\/www.albertopassalacqua.com\/wp-content\/uploads\/2021\/02\/AssemblyList-300x137.png 300w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><\/a>This is all for this update. The next step, after cleaning some code up, is to integrate the geometry module with the mesh configuration part of the app.<\/p>\n<p>Enjoy \ud83d\ude00<\/p>\n\n\n<p style=\"text-align: justify;\"><em>This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM\u00ae and OpenCFD\u00ae trade marks. Alberto Passalacqua is not associated to OpenCFD Ltd.<\/em><\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>It is time for another update about my hobby project. I have been working on a module to perform basic operations on the geometry used to perform CFD simulations. Originally my application did this inside the module used to configure meshing with snappyHexMesh. However, this directly linked the geometry assembly to the mesh. I wanted to separate the two tasks for two reasons: Allow the same geometry assembly to be reused in multiple simulations. This also allows to reduce the number of times the same geometry information is stored, which is good side effect. Reduce the complexity of the mesh configuration tool. Focus of this update is the part of the app that allows the creation of geometry assemblies from both simple analytical shapes and STL geometries. The landing page looks like the following: After clicking on + New, the basic information of the assembly is requested. Only Save and Cancel are allowed actions at this stage. After pressing Save, the interface is updated and the other options become available: In the order, the buttons with secondary color are: Geometry file library Box Cylinder Hollow cylinder Sphere File upload The latter only allows to upload geometry files (STL and OBJ) to the Geometry file library, which is an archive that allows files to be reused in multiple assemblies. Files belong to the user who uploaded them and only such user can use them. At the moment, a maximum file size of 100 MB is allowed, due to how files are stored and managed. User&#8217;s geometry files can be seen in the Geometry file library: The library is searchable by name and description. If either contain the string inserted in the search box, files will be show in the list. The checkbox on the left of the file name allows the file to be added to or removed from the assembly. The eye icon expands the Geometry library modal and shows a preview in a GL canvas: The object is automatically zoomed in to fit into the size of the modal and the bounding box is determined and visualized. The GL canvas is active and allows the object to be zoomed in and out and rotated with mouse or touch controls. If a geometry file has multiple solids, each is assigned a different color automatically: The list of object has three main features: Clicking on the object name highlights it in the GL canvas making it semi-transparent. Hovering on the name shows the Edit and Delete icons. If the object is a file, the following modal dialog is opened when clicking on the Edit button: Details of the geometry file are shown. If the file has multiple solids, their names are shown too. Similarly, for analytical shapes, dialogs with the information needed to define the geometry is shown. For example, for a box: and for a sphere: Finally, geometry assemblies are listed in the main page, and can be opened by clicking on the folder icon: This is all for this update. The next step, after cleaning some code up, is to integrate the geometry module with the mesh configuration part of the app. Enjoy \ud83d\ude00<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,133,4,134],"tags":[],"class_list":["post-2034","post","type-post","status-publish","format-standard","hentry","category-cfd","category-development","category-linux","category-personal-projects"],"_links":{"self":[{"href":"https:\/\/www.albertopassalacqua.com\/index.php?rest_route=\/wp\/v2\/posts\/2034","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.albertopassalacqua.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.albertopassalacqua.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.albertopassalacqua.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.albertopassalacqua.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2034"}],"version-history":[{"count":2,"href":"https:\/\/www.albertopassalacqua.com\/index.php?rest_route=\/wp\/v2\/posts\/2034\/revisions"}],"predecessor-version":[{"id":2051,"href":"https:\/\/www.albertopassalacqua.com\/index.php?rest_route=\/wp\/v2\/posts\/2034\/revisions\/2051"}],"wp:attachment":[{"href":"https:\/\/www.albertopassalacqua.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.albertopassalacqua.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.albertopassalacqua.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}