Problem with automatic normal generation - mdbc

Hi,

I want to make a hopper geometry as shown below. The created boundary surface is inside the actual boundary particles.

Below is a view of the boundary surface itself. When I check the automatic generated normals. It appears that only half the surface has corrected normals. The other half (marked in blue) has normals (0,0,0). In addition, there are some bands of non-zero normals but the directions are not correct. I cannot figure out what was the problem. Please help me. Thanks.!

Below is the Def.xml code:

<setfrdrawmode auto="false" />

               <!-- Draw surfaces without particles -->

               <setactive drawpoints="false" />

               <setmkbound mk="9"/>

               <drawquadri> # fronttop

                  <point x="0.64" y="0.2" z="0"/>

                  <point x="0.64" y="0.2" z="0.60"/>

                  <point x="0.02" y="0.2" z="0.6"/>

                  <point x="0.02" y="0.2" z="0"/>

               </drawquadri>

               <drawquadri> # backtop

                  <point x="0.64" y="0.02" z="0"/>

                  <point x="0.64" y="0.02" z="0.60"/>

                  <point x="0.02" y="0.02" z="0.6"/>

                  <point x="0.02" y="0.02" z="0"/>

               </drawquadri>

               <drawtrianglesstrip> # frontbottom

                  <point x="0.317" y="0.2" z="-0.515"/>

                  <point x="0.343" y="0.2" z="-0.515"/>

                  <point x="0.02" y="0.2" z="0"/>

                  <point x="0.64" y="0.2" z="0"/>

               </drawtrianglesstrip>

               <drawtrianglesstrip> # backbottom

                  <point x="0.317" y="0.02" z="-0.515"/>

                  <point x="0.343" y="0.02" z="-0.515"/>

                  <point x="0.02" y="0.02" z="0"/>

                  <point x="0.64" y="0.02" z="0"/>

               </drawtrianglesstrip>

               <drawextrude closed="false"> # sideleft

                  <point x="0.64" y="0.02" z="0.6"/>

                  <point x="0.64" y="0.02" z="0"/>

                  <point x="0.343" y="0.02" z="-0.515"/>

                  <extrude x="0" y="0.18" z="0" />

               </drawextrude>

               <drawextrude closed="false"> # sideright

                  <point x="0.02" y="0.02" z="0.6"/>

                  <point x="0.02" y="0.02" z="0"/>

                  <point x="0.317" y="0.02" z="-0.515"/>

                  <extrude x="0" y="0.18" z="0" />

               </drawextrude>

               <shapeout file="hdp" reset="true" />

               <!-- Draw surfaces with particles -->

               <matrixreset />

               <setfrdrawmode auto="true" />

               <setactive drawpoints="true" />

                   <move x="0.351" y="0.01" z="-0.516" />

                   <rotate ang="-29.999999999999996" x="-0.0" y="1.0" z="-0.0" />

                   <setmkbound mk="0" />

                   <setdrawmode mode="full" />

                   <drawbox objname="rightslide">

                       <boxfill>solid</boxfill>

                       <point x="0" y="0" z="0" />

                       <size x="0.01" y="0.2" z="0.6" />

                   </drawbox>

                   <matrixreset />

                   <move x="0.3" y="0.01" z="-0.52" />

                   <rotate ang="-29.999999999999996" x="-0.0" y="-1.0" z="-0.0" />

                   <setmkbound mk="1" />

                   <setdrawmode mode="full" />

                   <drawbox objname="leftslide">

                       <boxfill>solid</boxfill>

                       <point x="0" y="0" z="0" />

                       <size x="0.01" y="0.2" z="0.6" />

                   </drawbox>

                   <matrixreset />

                   <setmkbound mk="4" />

                   <setdrawmode mode="full" />

                   <drawbox objname="backtop">

                       <boxfill>solid</boxfill>

                       <point x="0.0" y="0.21" z="-0.52" />

                       <size x="0.66" y="0.01" z="1.12" />

                   </drawbox>

                   <setmkbound mk="5" />

                   <setdrawmode mode="full" />

                   <drawbox objname="righttop">

                       <boxfill>solid</boxfill>

                       <point x="0.65" y="0.01" z="0.0" />

                       <size x="0.01" y="0.2" z="0.6" />

                   </drawbox>

                   <setmkbound mk="6" />

                   <setdrawmode mode="full" />

                   <drawbox objname="lefttop">

                       <boxfill>solid</boxfill>

                       <point x="0.0" y="0.01" z="0.0" />

                       <size x="0.01" y="0.2" z="0.6" />

                   </drawbox>

                   <setmkbound mk="7" />

                   <setdrawmode mode="full" />

                   <drawbox objname="fronttop">

                       <boxfill>solid</boxfill>

                       <point x="0.0" y="0.0" z="-0.52" />

                       <size x="0.66" y="0.01" z="1.12" />

                   </drawbox>

                   <setmkbound mk="8" />

                   <setdrawmode mode="full" />

                   <drawbox objname="base">

                       <boxfill>solid</boxfill>

                       <point x="0.28" y="0.0" z="-0.535" />

                       <size x="0.1" y="0.22" z="0.01" />

                   </drawbox>

                   <setmkfluid mk="0" />

               <fillbox x="0.4" y="0.1" z="-0.19">

               <modefill>void</modefill>

               <point x="-0.1" y="-0.1" z="-0.54" />

               <size x="0.8" y="0.5" z="0.65" />

               </fillbox>

                   <shapeout file="" />

.....................

      <normals>

           <distanceh value="2.0" />

           <geometryfile file="hopper_0103_3_hdp_Actual.vtk" />

           <svshapes value="1" />

       </normals>

......................

Comments

  • Never mind. I figured out the problem.

    The sequence of the points in drawing is critical. For example, the original code was:


                   <drawtrianglesstrip> # backbottom

                      <point x="0.317" y="0.02" z="-0.515"/>

                      <point x="0.343" y="0.02" z="-0.515"/>

                      <point x="0.02" y="0.02" z="0"/>

                      <point x="0.64" y="0.02" z="0"/>

                   </drawtrianglesstrip>


    By changing the code to:

                   <drawtrianglesstrip> # backbottom

                      <point x="0.317" y="0.02" z="-0.515"/>

                      <point x="0.64" y="0.02" z="0"/>

                      <point x="0.02" y="0.02" z="0"/>

                      <point x="0.343" y="0.02" z="-0.515"/>

                   </drawtrianglesstrip>

    The normal can now be applied correctly.

  • Great job!

    I believe it matters because the way the triangle is drawn determines the "Normal" of the resulting face. As far as I remember it is therefore it is important to stay consistent with either using a clock-wise or counter clock wise ordering of triangular points.

    Kind regards

Sign In or Register to comment.