Filling an imported STL with boundary particles

edited November 2016 in DualSPHysics_v4.0
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.


  • That is why in the STL you only have information of faces. It is an issue of STL.
    If you want to fill an external object you can use fillbox after drawfileXXX

  • Thanks for your prompt reply, Alex! I was able to get it working by doing the following (using the [ fillbox ] syntax outlined on Page 44 of XML_GUIDE_v4.pdf as reference):

    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.
  • Thanks for posting this Richmond!!!
    Really appreciated for other users!!!

  • I have the same issue. The code XML is:

    bound | border

    but it doesn't work...can you hel me to found the problem?
    Thank you in advance
  • setmkbound mk="1" /
    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" /
  • Hi Davide,

    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,
  • Thanks for the answer Nick, I did what you told me but nothing. How can i post the .stl file? Thanks in advance
  • This "fillbox" approach is good for only if you have one or two DEM objects. What if you need to model hundreds of them? There should be a better way to do it.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!