Filling an imported STL with boundary particles
Is there a reason why [ setdrawmode ] would be incompatible with an imported boundary object? I imported an STL [ drawfilestl file="path/to/my/object.stl" ], but neither [ setdrawmode mode="full" ] nor [ setdrawmode mode="solid" ] seem to have any effect on the boundary object imported from STL, which is being drawn as if [ setdrawmode mode="face" ].
The imported STL is being used as a DEM object, so for "relativeweight" purposes, it's quite important that the object isn't hollow.
Any guidance would be most appreciated.
The imported STL is being used as a DEM object, so for "relativeweight" purposes, it's quite important that the object isn't hollow.
Any guidance would be most appreciated.
Debug Trace
Notice |
Cannot assign an empty string to a string offset #0 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1203): gdn_ErrorHandler(2, 'Cannot assign a...', '/var/www/forums...', 1203, Array) #1 /var/www/forums-dual-sphysics-org/library/core/class.format.php(958): Gdn_Format::formatMentionsCallback('') #2 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1292): Gdn_Format::tagContent('@Jsalet have yo...', 'Gdn_Format::for...') #3 /var/www/forums-dual-sphysics-org/library/Vanilla/Formatting/Html/HtmlEnhancer.php(59): Gdn_Format::mentions('@Jsalet have yo...') #4 /var/www/forums-dual-sphysics-org/library/Vanilla/Formatting/Formats/HtmlFormat.php(74): Vanilla\Formatting\Html\HtmlEnhancer->enhance('@Jsalet have yo...') #5 /var/www/forums-dual-sphysics-org/library/Vanilla/Formatting/FormatService.php(34): Vanilla\Formatting\Formats\HtmlFormat->renderHtml('@Jsalet have yo...') #6 /var/www/forums-dual-sphysics-org/library/core/class.format.php(769): Vanilla\Formatting\FormatService->renderHTML('@Jsalet have yo...', 'html') #7 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1479): Gdn_Format::html('@Jsalet have yo...') #8 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(24): Gdn_Format::to('@Jsalet have yo...', 'Html') #9 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(170): formatBody(Object(stdClass)) #10 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/comments.php(19): writeComment(Object(stdClass), Object(DiscussionController), Object(Gdn_Session), 10) #11 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/index.php(53): include('/var/www/forums...') #12 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(778): include('/var/www/forums...') #13 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(1382): Gdn_Controller->fetchView('', false, false) #14 /var/www/forums-dual-sphysics-org/library/core/class.pluggable.php(217): Gdn_Controller->xRender() #15 /var/www/forums-dual-sphysics-org/applications/vanilla/controllers/class.discussioncontroller.php(310): Gdn_Pluggable->__call('render', Array) #16 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(862): DiscussionController->index('812', 'filling-an-impo...', '') #17 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(279): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #18 /var/www/forums-dual-sphysics-org/index.php(29): Gdn_Dispatcher->dispatch() #19 {main} |
Notice |
Cannot assign an empty string to a string offset #0 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1203): gdn_ErrorHandler(2, 'Cannot assign a...', '/var/www/forums...', 1203, Array) #1 /var/www/forums-dual-sphysics-org/library/core/class.format.php(958): Gdn_Format::formatMentionsCallback('') #2 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1292): Gdn_Format::tagContent('@Jsalet <br /><...', 'Gdn_Format::for...') #3 /var/www/forums-dual-sphysics-org/library/Vanilla/Formatting/Html/HtmlEnhancer.php(59): Gdn_Format::mentions('@Jsalet <br /><...') #4 /var/www/forums-dual-sphysics-org/library/Vanilla/Formatting/Formats/HtmlFormat.php(74): Vanilla\Formatting\Html\HtmlEnhancer->enhance('@Jsalet <br /><...') #5 /var/www/forums-dual-sphysics-org/library/Vanilla/Formatting/FormatService.php(34): Vanilla\Formatting\Formats\HtmlFormat->renderHtml('@Jsalet \r\n\r\nYes...') #6 /var/www/forums-dual-sphysics-org/library/core/class.format.php(769): Vanilla\Formatting\FormatService->renderHTML('@Jsalet \r\n\r\nYes...', 'html') #7 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1479): Gdn_Format::html('@Jsalet \r\n\r\nYes...') #8 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(24): Gdn_Format::to('@Jsalet \r\n\r\nYes...', 'Html') #9 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(170): formatBody(Object(stdClass)) #10 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/comments.php(19): writeComment(Object(stdClass), Object(DiscussionController), Object(Gdn_Session), 13) #11 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/index.php(53): include('/var/www/forums...') #12 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(778): include('/var/www/forums...') #13 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(1382): Gdn_Controller->fetchView('', false, false) #14 /var/www/forums-dual-sphysics-org/library/core/class.pluggable.php(217): Gdn_Controller->xRender() #15 /var/www/forums-dual-sphysics-org/applications/vanilla/controllers/class.discussioncontroller.php(310): Gdn_Pluggable->__call('render', Array) #16 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(862): DiscussionController->index('812', 'filling-an-impo...', '') #17 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(279): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #18 /var/www/forums-dual-sphysics-org/index.php(29): Gdn_Dispatcher->dispatch() #19 {main} |
Notice |
Cannot assign an empty string to a string offset #0 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1203): gdn_ErrorHandler(2, 'Cannot assign a...', '/var/www/forums...', 1203, Array) #1 /var/www/forums-dual-sphysics-org/library/core/class.format.php(958): Gdn_Format::formatMentionsCallback('') #2 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1292): Gdn_Format::tagContent('@NWRichmond<br ...', 'Gdn_Format::for...') #3 /var/www/forums-dual-sphysics-org/library/Vanilla/Formatting/Html/HtmlEnhancer.php(59): Gdn_Format::mentions('@NWRichmond<br ...') #4 /var/www/forums-dual-sphysics-org/library/Vanilla/Formatting/Formats/HtmlFormat.php(74): Vanilla\Formatting\Html\HtmlEnhancer->enhance('@NWRichmond<br ...') #5 /var/www/forums-dual-sphysics-org/library/Vanilla/Formatting/FormatService.php(34): Vanilla\Formatting\Formats\HtmlFormat->renderHtml('@NWRichmond\r\n T...') #6 /var/www/forums-dual-sphysics-org/library/core/class.format.php(769): Vanilla\Formatting\FormatService->renderHTML('@NWRichmond\r\n T...', 'html') #7 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1479): Gdn_Format::html('@NWRichmond\r\n T...') #8 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(24): Gdn_Format::to('@NWRichmond\r\n T...', 'Html') #9 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(170): formatBody(Object(stdClass)) #10 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/comments.php(19): writeComment(Object(stdClass), Object(DiscussionController), Object(Gdn_Session), 14) #11 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/index.php(53): include('/var/www/forums...') #12 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(778): include('/var/www/forums...') #13 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(1382): Gdn_Controller->fetchView('', false, false) #14 /var/www/forums-dual-sphysics-org/library/core/class.pluggable.php(217): Gdn_Controller->xRender() #15 /var/www/forums-dual-sphysics-org/applications/vanilla/controllers/class.discussioncontroller.php(310): Gdn_Pluggable->__call('render', Array) #16 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(862): DiscussionController->index('812', 'filling-an-impo...', '') #17 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(279): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #18 /var/www/forums-dual-sphysics-org/index.php(29): Gdn_Dispatcher->dispatch() #19 {main} |
Notice |
Cannot assign an empty string to a string offset #0 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1203): gdn_ErrorHandler(2, 'Cannot assign a...', '/var/www/forums...', 1203, Array) #1 /var/www/forums-dual-sphysics-org/library/core/class.format.php(958): Gdn_Format::formatMentionsCallback('') #2 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1292): Gdn_Format::tagContent('@NWRichmond<br ...', 'Gdn_Format::for...') #3 /var/www/forums-dual-sphysics-org/library/Vanilla/Formatting/Html/HtmlEnhancer.php(59): Gdn_Format::mentions('@NWRichmond<br ...') #4 /var/www/forums-dual-sphysics-org/library/Vanilla/Formatting/Formats/HtmlFormat.php(74): Vanilla\Formatting\Html\HtmlEnhancer->enhance('@NWRichmond<br ...') #5 /var/www/forums-dual-sphysics-org/library/Vanilla/Formatting/FormatService.php(34): Vanilla\Formatting\Formats\HtmlFormat->renderHtml('@NWRichmond\r\n T...') #6 /var/www/forums-dual-sphysics-org/library/core/class.format.php(769): Vanilla\Formatting\FormatService->renderHTML('@NWRichmond\r\n T...', 'html') #7 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1479): Gdn_Format::html('@NWRichmond\r\n T...') #8 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(24): Gdn_Format::to('@NWRichmond\r\n T...', 'Html') #9 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(170): formatBody(Object(stdClass)) #10 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/comments.php(19): writeComment(Object(stdClass), Object(DiscussionController), Object(Gdn_Session), 14) #11 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/index.php(53): include('/var/www/forums...') #12 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(778): include('/var/www/forums...') #13 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(1382): Gdn_Controller->fetchView('', false, false) #14 /var/www/forums-dual-sphysics-org/library/core/class.pluggable.php(217): Gdn_Controller->xRender() #15 /var/www/forums-dual-sphysics-org/applications/vanilla/controllers/class.discussioncontroller.php(310): Gdn_Pluggable->__call('render', Array) #16 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(862): DiscussionController->index('812', 'filling-an-impo...', '') #17 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(279): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #18 /var/www/forums-dual-sphysics-org/index.php(29): Gdn_Dispatcher->dispatch() #19 {main} |
Comments
If you want to fill an external object you can use fillbox after drawfileXXX
Regards
1.) Pick a seed point inside the STL geometry. I used ParaView's "cube axis visibility" to find the bounds of my object and selected a point somewhere close to the center of the interior space.
2.) For [ modefill ], I used "border|bound"
3.) For the points, I selected points slightly below the minimum x, y, and z determined by ParaView's "cube axis visibility"
4.) Size should be at least, but preferably slightly larger than, ( x_max - x_min ), ( y_max - y_min ), ( z_max - z_min ) as calculated from the confines visible with ParaView's "cube axis visibility"
Following these steps filled my STL with boundary particles as desired.
Really appreciated for other users!!!
Alex
bound | border
but it doesn't work...can you hel me to found the problem?
Thank you in advance
drawfilestl file="Esempio.stl"
fillbox x="0.3" y="10.5" z="0.3"
modefill bound | border /modefill
point x="-0.5" y="-0.5" z="-0.5" /
size x="69.11" y="11" z="20.61" /
/fillbox
/drawfilestl
I'm not sure how to help without the STL, but usually it's a problem of the point coordinates not being defined correctly. If you want to know which values to use for x, y, and z for point, you can do this easily with ParaView.
In Paraview, first load in your stl file, then apply the "Integrate Variables" filter. Open a new window (click the + sign next to "Layout #1") in Spreadsheet View, and then visualize the IntegrateVariables filter. The result should give you a Points field, which gives you the x, y, and z of the centroid of your object. Use these numbers for your point coordinates in your CaseXML and see if that helps to fill the STL with boundary particles.
Best of luck,
Nick
I have a question about the modefill option,
if I use the modefill void /modefill my .stl geometry fills neatly. But when i use modefill bound /modefill or modefill border|bound /modefill it does not fill at all.
Does someone know how i can fix this?
Thanks in advance,
It is hard to pinpoint exactly what goes wrong without knowing your case. Remember if you use modefill void you fill every empty void inside a specific domain which you have chosen to intersect with the fillbox as shown in the picture.
I am modeling a dam break with a bridge which should start moving at certain wave heights. including DEM coupling. I loaded the bridge geometry using a .stl file. Though I found out that the geometry is hollow and therefore the deck started floating.
Trying to use the fillbox option which i found indeed in the XML guide, and here on the forum, I thought i should use the modefill bound option so is could give it the proper density (of concrete) but this, I did not manage to get it working.
I managed to run it once with the void modefill. The object has a higher total mass since it is not floating.
Does this filled area now have the same density as the mkbound which it filled?
Now I still do not understand what the different modefill options physically do, since i thought the void option would keep it an hollow object. And the bound option would make it a rigid filled object. But i think this thoughts are not correct.
I attached how i used the fillmode in my case now.
Though i am still not sure if this is the right way.
Thanks in advance,
kind regards
border | bound
should work for filling your STL with boundary particles. Are you certain that the coordinates of the seed point for your fillbox are within the hollow region of your STL at 1:1000 scale?Re: "Does this filled area now have the same density as the mkbound which it filled?" ...yes, that's right, assuming you have assigned a
rhopbody
to particles with the same mk (in thesection). For what it's worth, I recently learned that if you know what the mass of the object should be, you might want to explicitly define it using
massbody
because mass will not change with dp during the simulation.Yes, if we take a look at your provided code we see that in the first picture:
If it still does not work - start from the beginning trying to fill a simple square until you discover your mistake.
Thank you for your reply.
I am quite sure my seedpoint is correct since it fills when I use the " void " option but not when I use the border|bound option. That is exactly what I find strange in this case and I did not understand. Though I checked it again in paraview and it should be on the correct location.
@Asalih3d
You are correct in the steps I take.
Only in step 2. I want to put particles in the whole geometry but when uploading the stl file it is needed to use the fillbox since it is just putting particles in the face of the geometry. (I could use the modefill solid or full when calling a .stl, but then it does the same as when i use the modefill face, if I am correct).
But now, if the density and therefore the mass of the object is correct when using void, I think this part of the model is working properly now. Though, I think there is a difference in compressibility between the void and the border|bound option.
if you want to fill the interior with boundary particles of the same mk as the STL faces, then just add fillbox with seed point inside and limits of a box beyond the limits of the STL, however you have to use modefill VOID modefill since you want to create particles in the VOIDs insided the STL
about correct mass or density: it is hard that the particles you create can discretize with high accuracy the exact geometry of the external model, so that the approximated mass computed automatically will converge to real value using very very high density
Therefore, the best way to proceed is to impose the known mass value (massbody) in the XML
Regards
I will use the massbody.
Thank you very much for your help!