[G+smo] gsMultiPatch 类


1. gsMultiPatch类

gsMultiPatch类的继承关系


重要函数

得到几何信息: 
/// Dimension of the parameter domain (must match for all patches).
    int parDim() const 

/// Dimension of the geometry (must match for all patches).
    int geoDim() const;

/// Number of patches
    std::size_t nPatches() const          { return m_patches.size(); }

得到patch和geometry:

/// Return the \a i-th patch.
    gsGeometry<T>& patch( std::size_t i ) const


/// Return the basis of the \a i-th patch.
    gsBasis<T> & basis( std::size_t i ) const;

/// Returns the range of parameter
    gsMatrix<T> parameterRange(int i = 0) const;

 /// Number of patches
    std::size_t nPatches() const          { return m_patches.size(); }

/// Returns a vector of patches // to do : replace by copies
    PatchContainer const& patches() const { return m_patches; }

/// Return the \a i-th patch.
    const gsGeometry<T> & operator []( size_t i ) const { return *m_patches[i]; }

 /// Makes a deep copy of all bases and puts them in a vector
    std::vector<gsBasis<T> *> basesCopy() const;

修改几何:
/// Add a patch.
    void addPatch( gsGeometry<T> * g );

/// Search for the given geometry and return its patch index.
    int findPatchIndex( gsGeometry<T>* g ) const;

/// Add boundary
    void addPatchBoundary( gsGeometry<T>* g, boxSide s ) 

///几何的细化和升阶

    void uniformRefine(int numKnots = 1, int mul = 1);
    void degreeElevate(int elevationSteps = 1);


/// Attempt to compute interfaces and boundaries automatically. 几何类的计算
    bool computeTopology( T tol = 1e-4 );

///初始化
/// Clear (delete) all patches
    void clear()


重要变量



2. 使用示范

声明和定义


gsMultiPatch的声明:gsMultiPatch<> * patches;
gsMultiPatch的定义:patches = gsNurbsCreator<>::BSplineSquareGrid(1, 1, 2, -1,-1); 定义一个 1×1 NURBS片,每个片的边长为2,左下侧点坐标为(-1,-1)。


升阶和细化

patches->patch(0).degreeElevate(1);    
for (int i = 0; i < numRefine; ++i)
        patches->patch(0).uniformRefine();

    patches->degreeElevate(1); 
    for (int i = 0; i < numRefine; ++i)
        patches->uniformRefine();

控制点


 gsMultiPatch<> * patches  = gsNurbsCreator<>::BSplineSquareGrid(2, 2, 1, -1,-1);
//Scaling
    //for ( size_t i = 0; i<patches->nPatches(); ++i)
    //    patches->patch(i).coefs().array() /= 10.0;
    //gsWrite(*patches,"scaledpatches");


附录
头文件:stable\src\gsCore\gs\gsMultiPatch.h

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值