[MS CE Native]此工具的功能如何用编程实现?

sweep two along one如何用代码实现?它与放样曲面的区别在哪?

Parents
  • 应该就是我们前一些帖子讨论过的两个方法:SolidUtil::Create::BodyFromLoft和BodyFromSweep

    当前不支持勾选Parametric。



  • BodyFromSweep方法研究过,只能输入一个导向线和一个CurveVector,而microstation提供的工具功能包括一个导向线和两个CurveVector构面、两个导向线和一个CurveVector构面、两个导向线和两个CurveVector构面 三种扫略构面的方式,而我们项目中目前的需求是一个导向线和两个CurveVector构面,BodyFromSweep不能满足我们的要求哈,不知道microstation的工具是如何实现的?

  • Mstn工具中调用了许多非常底层未公开的函数来实现这些更复杂的功能的。目前公开的函数中没有能找到。



  • 符老师,我现在用的是microstation ce update4版本,不知道有没有其它途径可以解决,这个问题已经卡了我们很长时间了!

  • 找到一个内部未公开函数可以试一下:

    /*---------------------------------------------------------------------------------**//**
    * @description Create a B-spline surface that approximates given rail(s) and sections
    *       generated by sweeping given master section(s) along the rail(s).
    * @remarks Caller positions given sections (on rails if desired).  Rails and sections will be opened,
    *       made compatible and reversed into proper relative orientation as necessary.
    * @remarks The origin of each given section is taken to be the closest section point to the appropriate
    *       pRail0 endpoint.  Each section's x-axis point is the closest section point to the analogous pRail1
    *       endpoint, if pRail1 is given.  Otherwise, if a section's first/last points are different, its
    *       x-axis point is the section point at parameter 1.0.  Otherwise, a section's x-axis point
    *       is the furthest intersection point (from the section origin) between the section and the plane
    *       containing: the appropriate pRail0 endpoint, the section origin and the section normal at the
    *       section origin.
    * @remarks Best results occur with G1-continuous rail(s), nonrational planar section(s), and with section(s) and rail(s)
    *       that meet at corners of the future surface.
    * @param pSurface                       OUT     swept surface
    * @param pRail0                         IN      first rail curve (constant v/u=0 curve)
    * @param pRail1                         IN      second rail curve (constant v/u=1 curve) (or NULL)
    * @param pSection0                      IN      initial section, in position (constant u/v=0 curve)
    * @param pSection1                      IN      final section, in position (constant u/v=1 curve) (or NULL)
    * @param numSections                    IN      number of sections to use in the construction (or negative to autocompute)
    * @param skinTolerance                  IN      maximum section-surface deviation (or nonpositive to interpolate sections)
    * @param skinDirection                  IN      BSSURF_U/BSSURF_V: sections are const-u/v curves
    * @param bSectionRotate                 IN      TRUE: rotate each swept section to follow the rail(s); FALSE: no section rotation
    * @param bSectionRotationAxisFromRail0  IN      (if bSectionRotate) TRUE: rotation axis is orthogonal to pRail0 tangents; FALSE: rotation axis is swept section x-axis
    * @param bSectionOrthogonality          IN      TRUE: rotate master section(s) orthogonal to pRail0 at its closer endpoint; FALSE: no orthogonality enforcement
    * @param bSectionScale                  IN      TRUE: scale each swept section according to rail-to-rail distance; FALSE: no section scale
    * @param bSectionScaleUniformly         IN      (if bSectionScale) TRUE: scale uniformly; FALSE: scale along swept section x-axis
    * @return SUCCESS if surface is created
    +---------------+---------------+---------------+---------------+---------------+------*/
    Public StatusInt    mdlBspline_surfaceFromRailsAndSweptSections
    (
    MSBsplineSurface*       pSurface,
    const MSBsplineCurve*   pRail0,
    const MSBsplineCurve*   pRail1,
    const MSBsplineCurve*   pSection0,
    const MSBsplineCurve*   pSection1,
    int                     numSections,
    double                  skinTolerance,
    int                     skinDirection,
    BoolInt                 bSectionRotate,
    BoolInt                 bSectionRotationAxisFromRail0,
    BoolInt                 bSectionOrthogonality,
    BoolInt                 bSectionScale,
    BoolInt                 bSectionScaleUniformly
    );
    需要连接库splindlm.lib



    Answer Verified By: 周谦益 Zhou Qianyi 

Reply
  • 找到一个内部未公开函数可以试一下:

    /*---------------------------------------------------------------------------------**//**
    * @description Create a B-spline surface that approximates given rail(s) and sections
    *       generated by sweeping given master section(s) along the rail(s).
    * @remarks Caller positions given sections (on rails if desired).  Rails and sections will be opened,
    *       made compatible and reversed into proper relative orientation as necessary.
    * @remarks The origin of each given section is taken to be the closest section point to the appropriate
    *       pRail0 endpoint.  Each section's x-axis point is the closest section point to the analogous pRail1
    *       endpoint, if pRail1 is given.  Otherwise, if a section's first/last points are different, its
    *       x-axis point is the section point at parameter 1.0.  Otherwise, a section's x-axis point
    *       is the furthest intersection point (from the section origin) between the section and the plane
    *       containing: the appropriate pRail0 endpoint, the section origin and the section normal at the
    *       section origin.
    * @remarks Best results occur with G1-continuous rail(s), nonrational planar section(s), and with section(s) and rail(s)
    *       that meet at corners of the future surface.
    * @param pSurface                       OUT     swept surface
    * @param pRail0                         IN      first rail curve (constant v/u=0 curve)
    * @param pRail1                         IN      second rail curve (constant v/u=1 curve) (or NULL)
    * @param pSection0                      IN      initial section, in position (constant u/v=0 curve)
    * @param pSection1                      IN      final section, in position (constant u/v=1 curve) (or NULL)
    * @param numSections                    IN      number of sections to use in the construction (or negative to autocompute)
    * @param skinTolerance                  IN      maximum section-surface deviation (or nonpositive to interpolate sections)
    * @param skinDirection                  IN      BSSURF_U/BSSURF_V: sections are const-u/v curves
    * @param bSectionRotate                 IN      TRUE: rotate each swept section to follow the rail(s); FALSE: no section rotation
    * @param bSectionRotationAxisFromRail0  IN      (if bSectionRotate) TRUE: rotation axis is orthogonal to pRail0 tangents; FALSE: rotation axis is swept section x-axis
    * @param bSectionOrthogonality          IN      TRUE: rotate master section(s) orthogonal to pRail0 at its closer endpoint; FALSE: no orthogonality enforcement
    * @param bSectionScale                  IN      TRUE: scale each swept section according to rail-to-rail distance; FALSE: no section scale
    * @param bSectionScaleUniformly         IN      (if bSectionScale) TRUE: scale uniformly; FALSE: scale along swept section x-axis
    * @return SUCCESS if surface is created
    +---------------+---------------+---------------+---------------+---------------+------*/
    Public StatusInt    mdlBspline_surfaceFromRailsAndSweptSections
    (
    MSBsplineSurface*       pSurface,
    const MSBsplineCurve*   pRail0,
    const MSBsplineCurve*   pRail1,
    const MSBsplineCurve*   pSection0,
    const MSBsplineCurve*   pSection1,
    int                     numSections,
    double                  skinTolerance,
    int                     skinDirection,
    BoolInt                 bSectionRotate,
    BoolInt                 bSectionRotationAxisFromRail0,
    BoolInt                 bSectionOrthogonality,
    BoolInt                 bSectionScale,
    BoolInt                 bSectionScaleUniformly
    );
    需要连接库splindlm.lib



    Answer Verified By: 周谦益 Zhou Qianyi 

Children