[CONNECT Update 12 C++] mdlBspline_extractCapAsSurface missing ?

Hello,

I'm working on porting a modulefromV8i to Connect. I have a problem with mdlBspline_extractCapAsSurface function.

The function is defined in msbsplin.fdf. Compiler work but  during linking phase, compiler says  function is missing.

Other mdlspline functions has no problem. With dumpbin I found a function named bspconv_extractCapAsSurface. It has the same parameters.

Is it the function to work with? 

Ciao

Franco

  • Hi Franco,

    at first, be aware this is general Developer and Programming Forum. Because your question seems to be about MicroStation, I recommend to move it to MicroStation Programming Forum. To move existing post, use More > Move tool available under your original post. Please, do not duplicate same question posting then to more forums!

    Also, please respect and follow the best practices, especially to specify information about used product and its version (build number), e.g. using standardized subject format. In your post this critical information is missing.

    Because the function is documented, but is not exported, it seems to be bug. I recommend to create Service Ticket to formalize the report bug. Also, there is a mistake in documentation, because as required Library, msbspline.dll is mentioned, but this file does not exist (correct one seems to be stdbspline.dll).

    With regards,

      Jan

  • I'm working on porting a modulefromV8i to Connect. I have a problem with mdlBspline_extractCapAsSurface function

    MicroStation CONNECT has introduced new C++ classes that augment or replace the procedural MDL functions.  In your case, the MSBsplineSurface class is potentially useful.

    However I don't see any MSBsplineSurface method that extracts a cap.  Perhaps one exists but uses different terminology?  Can help?

     
    Regards, Jon Summers
    LA Solutions

  • Hi ,

    [UPDATE: Please defer or consider Brien's response above first, then my recommendations secondary.]

    The function mdlBspline_extractCapAsSurface is a simple wrapper around the unpublished bspconv_extractCapAsSurface method you discovered. Since the function signatures are the same you can link BentleyGeom.lib where it is defined and temporarily add a function declaration like below until the method export is published again.

    Other options include migrating bspline surface code to use the Solids API; possibly considering: Body from Surface and Sweep Body Wire/Sheet methods.

    int bspconv_extractCapAsSurface
    (
    MSBsplineSurface *capP, /* <= cap surface (planar) */
    MSBsplineSurface *solidP, /* => surface */
    double tolerance, /* => chord height tolerance */
    bool lastRow /* => false gives surface start */
    )

    Thank you and HTH,
    Bob



  • Lots of different ways to get the cap geometry, for example SolidPrimitive::GetFace (using SolidLocationDetail::FaceIndices::Cap0 and Cap1) or DgnExtrusionDetail::FractionToProfile, etc.The IGeometry/CurveVector returned for a solid will be a region CurveVector (same type of geometry that was originally extruded/revolved, not a bspline surface).

    Seems preferable to get the analytic geometry instead of a bspline surface, but if you really want a bspline surface and don't want to refactor a lot of code you could try the following method on MSBsplineSurface which I believe is published:

    //! Convert surfaces of the SolidPrimitive to trimmed bspline surfaces.
    //! @param [out] surfaces array to receive bspline surfaces.
    //! @param [in] source curve vector with area regions
    //! @param [in] options optional controls for curve stroking.
    //! @return true if the entire solid primitive was converted.
    static bool CreateTrimmedSurfaces (bvector <MSBsplineSurfacePtr> &surfaces, ISolidPrimitiveCR source, IFacetOptionsP options = NULL);

    Something like:

    ISolidPrimitivePtr solidPrimitive = ISolidPrimitiveQuery::ElementToSolidPrimitive (eh, false);

    if (!solidPrimitive.IsValid ())
      return ERROR;

    bvector<MSBsplineSurfacePtr> surfaces;

    if (!MSBsplineSurface::CreateTrimmedSurfaces (surfaces, *solidPrimitive))
      return ERROR;

    If the result is multiple surfaces, the first 2 should be the caps...

    HTH

    -B



  • you could try the following method on MSBsplineSurface which I believe is published

    Thanks for the interpretation of CONNECT terminology.  There are two static methods of that name.  They differ in the type passed in as the geometry source...

    static bool  MSBsplineSurface::CreateTrimmedSurfaces (bvector< MSBsplineSurfacePtr > &surfaces, 
      CurveVectorCR source, IFacetOptionsP options=NULL)

    and

    static bool  MSBsplineSurface::CreateTrimmedSurfaces (bvector< MSBsplineSurfacePtr > &surfaces,
      ISolidPrimitiveCR source, IFacetOptionsP options=NULL) 

     
    Regards, Jon Summers
    LA Solutions

  • Thank you all for the help.

    Please apologize me  for the missing information on the first post. I read the best practices to write in the forum.

    Ciao

    Franco