How to convert solid clockwise sense bspline surface boundaries to hole clockwise sense?

Hi All,

I have a Bspline Surface with a set of boundaries whose clockwise sense is set to "Solid". Is it possible through MDL API to get the equivalent set of boundaries on the same Bspline Surface whose clockwise sense is "Hole"?

Thanks & Regards,

kaab

Parents
  • It's not clear what you are asking.  What is your definition of 'solid' and 'hole'?

     
    Regards, Jon Summers
    LA Solutions

  • Hi Jon,

    To be more clear, I'll put my question this way. I have a BSpline Surface with 4 boundaries. If I see the Element Information for the Bspline Surface in MicroStation, under Geometry section, inside Trim Loop node, I see a field with name "Clockwise Sense" and its value is set to "Hole"

    Now, if I change the value to "Solid", MicroStation changes the display of the Bspline Surface such that the parts which were earlier holes now become filled and the ones which were earlier filled, now become holes. But, I've seen that the Trim loops shown in the Element Information dialog still remain the same.

    Now, I want to extract the boundaries of the holes shown for this new surface, using MDL API. Which API can I use for this purpose?

    Thanks & Regards,

    kaab

Reply
  • Hi Jon,

    To be more clear, I'll put my question this way. I have a BSpline Surface with 4 boundaries. If I see the Element Information for the Bspline Surface in MicroStation, under Geometry section, inside Trim Loop node, I see a field with name "Clockwise Sense" and its value is set to "Hole"

    Now, if I change the value to "Solid", MicroStation changes the display of the Bspline Surface such that the parts which were earlier holes now become filled and the ones which were earlier filled, now become holes. But, I've seen that the Trim loops shown in the Element Information dialog still remain the same.

    Now, I want to extract the boundaries of the holes shown for this new surface, using MDL API. Which API can I use for this purpose?

    Thanks & Regards,

    kaab

Children
  • Unknown said:
    I want to extract the boundaries of the holes shown for this new B-spline surface, using MDL API

    How about the mdlBspline_api?

     
    Regards, Jon Summers
    LA Solutions

  • Thank you for the reply. mdlBspline APIs are always returning same boundaries regardless of clockwise sense value.

  • Unknown said:
    mdlBspline APIs are always returning same boundaries regardless of clockwise sense value

    So you've written some code?  Post a snippet here.  With some evidence, perhaps someone can help.

    I remain uncertain about your interpretation of 'solid' and 'hole' and whether they match MicroStation's implementation of a B-spline surface.  What is your purpose in creating a surface that is a 'hole'?

    Unknown said:
    if I change the value to "Solid", MicroStation changes the display of the Bspline Surface such that the parts which were earlier holes now become filled and the ones which were earlier filled, now become holes

    Can you post here a DGN model that illustrates your point?

     
    Regards, Jon Summers
    LA Solutions

  • Actually, I've figured out that my problem would be solved if I could get the total outermost boundary curve of the original BSpline Surface along with the boundaries present on the Bspline Surface when the clockwise sense is set to "Solid".

    I tried using mdlBSpline_extractBoundary function on the BSpline Surface after intentionally setting the values of numbounds and boundaries to 0. But, I got 3 separate BSpline Surfaces in the new element descriptor created by the API instead of bounding curves of the surface. Many a time, I've seen that extract boundary API fails to give correct boundary for the BSpline Surface. So, is there any alternate API to extract the whole boundary of the BSpline Surface?

  • Hi Jon,

    Here, I'm posting screenshots of the Bspline Surface with boundaries set to solid and hole clockwise sense:

    Bspline Surface with boundaries set to Solid clockwise sense

    Same Bspline Surface with boundaries set to Hole clockwise sense

    I'm also attaching the DGN file.

    TestDgn.dgn
  • Good screenshots!

     
    Regards, Jon Summers
    LA Solutions

  • PMFJI. First of all, I need to say I am not a Bspline expert. So my advice is just for your reference.

    I guess you construct your element by trimming a sphere. As a sphere, it is a closed surface, so it has no boundary. That is why you only extract 3 boundaries with mdlBspline_extractBoundary function.

    Then why ElementInfo show us 4 trim loops ? I analyzed your element with the below snippet and found there are two trim loops to contruct the bottom circle (I moved one of semi-circle slightly to show them clearly).

     MSElement        el;
     MSElementDescrP  edP = NULL;
     MSBsplineSurface bsSurface;
     if(SUCCESS != mdlAssoc_getElementDescr(&edP, NULL, 195, ACTIVEMODEL, FALSE))
        return -1;
     mdlBspline_convertToSurface(&bsSurface, edP);
     mdlElmdscr_freeAll (&edP);   edP = NULL;
     for (int i=0; i<bsSurface.numBounds; i++)
     {
           DPoint3d   *pPoints = (DPoint3d *)dlmSystem_mdlMalloc (bsSurface.boundaries[i].numPoints * sizeof(DPoint3d));
           for (int j=0; j<bsSurface.boundaries[i].numPoints; j++)
           {
               mdlBspline_evaluateSurfacePoint (&pPoints[j], NULL, NULL, NULL,
                             bsSurface.boundaries[i].points[j].x, bsSurface.boundaries[i].points[j].y, &bsSurface);
           }
           mdlShape_create (&el, NULL, pPoints, bsSurface.boundaries[i].numPoints, -1);
           mdlElement_add (&el);
           dlmSystem_mdlFree (pPoints); 
     }
     mdlBspline_freeSurface (&bsSurface);

    Regards,

     Yongan



  • Back to your post topic. If you want to create a hole clockwise sense bspline surface from a solid clockwise sense bspline surface, it is really simple. Just need to change the holeOrigin and recreate the surface again. Following is the code:

     MSElementDescrP  edP = NULL;
     MSBsplineSurface bsSurface;
     if(SUCCESS != mdlAssoc_getElementDescr(&edP, NULL, 195, ACTIVEMODEL, FALSE))
        return -1;
     mdlBspline_convertToSurface(&bsSurface, edP);
     mdlElmdscr_freeAll (&edP);   edP = NULL;
     bsSurface.holeOrigin = !bsSurface.holeOrigin;
     mdlBspline_createSurface (&edP, NULL, &bsSurface);
     mdlElmdscr_add (edP);
     mdlElmdscr_freeAll (&edP);
     mdlBspline_freeSurface (&bsSurface);
    HTH, Yongan



  • Hi Yongan,

    Thank you very much for your detailed explanation about the Bspline Surface. I'm not sure about how this Bspline Surface is exactly created, since I have not created it. But, I've tried using your code snippet and observed that a new Bspline Surface with hole configuration is created. But, this is not exactly what I want. To even more clearly express my issue, kindly see screenshots for the below test case. It is more clear representation of my issue:

    I've the following Bspline surface, as shown in the below screenshot. When I use mdlBspline_extractSurface to extract the surface details, I get the boundary that is marked in red in the below screenshot.

    Now, I change the surface's clockwise sense to solid. The display of MicroStation is as shown in the below screenshot. But, I still get the same boundary as in the above screenshot when I extract surface details using mdlBspline_extractSurface() API.

    But, i want the boundary highlighted in red as shown in the below screenshot. How to get it using MDL API?

    I'm also attaching the V8 DGN file for the above test case.

    Thanks & Regards,

    kaab

    BspBoundary.dgn
  • Clearly understand your desired. For this case, I recommend you another approach (I haven't coded to test it):

    Convert this BsplineSurface to a sheet body and then get edge elements from this sheet body. You certainly need to dig into mdlKISolid_xxx functions.

    HTH, Yongan