OpenCasCade数学库 - 轴(gp_Ax1)

    gp_Ax1描述了三维空间中的一个轴。

1.gp_Ax1的作用

  • 描述三维几何体(如:旋转体的轴)
  • 描述几何变换(如:对称轴、旋转轴)

2.gp_Ax1的定义

  • 位置
  • 方向
class gp_Ax1 
{
public:
    ...
private:
    gp_Pnt loc;
    gp_Dir vdir;
};

    默认情况下,位置为原点,方向为Z轴正向。

inline gp_Ax1::gp_Ax1() : loc(0.,0.,0.), vdir(0.,0.,1.){ }

3.相等    

两个轴是否相同的判断:位置相同,方向相同(夹角为0度)。

Standard_Boolean gp_Ax1::IsCoaxial(const gp_Ax1& Other, const Standard_Real AngularTolerance,const Standard_Real LinearTolerance) const
{
  gp_XYZ XYZ1 = loc.XYZ();
  XYZ1.Subtract (Other.loc.XYZ());
  XYZ1.Cross (Other.vdir.XYZ());
  Standard_Real D1 = XYZ1.Modulus();

  gp_XYZ XYZ2 = Other.loc.XYZ();
  XYZ2.Subtract (loc.XYZ());
  XYZ2.Cross (vdir.XYZ());
  Standard_Real D2 = XYZ2.Modulus();
  
  return (vdir.IsEqual (Other.vdir, AngularTolerance) && D1 <= LinearTolerance && D2 <= LinearTolerance);
}

4.垂直 

    两个轴是否垂直的判断:轴的方向垂直(夹角为90度)。

inline Standard_Boolean gp_Ax1::IsNormal(const gp_Ax1& Other,const Standard_Real AngularTolerance) const
{ 
    return vdir.IsNormal(Other.vdir, AngularTolerance); 
}
inline Standard_Boolean gp_Dir::IsNormal(const gp_Dir& Other,const Standard_Real AngularTolerance) const
{
  Standard_Real Ang = M_PI / 2.0 - Angle (Other);
  if (Ang < 0) Ang = - Ang;
  return   Ang <= AngularTolerance;
} 

5.平行

    两个轴是否平行的判断:轴的夹角为0度或180度。

inline Standard_Boolean gp_Ax1::IsParallel(const gp_Ax1& Other,const Standard_Real AngularTolerance) const
{ 
    return vdir.IsParallel(Other.vdir, AngularTolerance); 
}
inline Standard_Boolean gp_Dir::IsParallel(const gp_Dir& Other, const Standard_Real AngularTolerance) const
{
  Standard_Real Ang = Angle (Other);
  return Ang <= AngularTolerance || M_PI - Ang <= AngularTolerance;
} 

6.相反    

    两个轴是否相反的判断:轴的夹角为180度。

inline Standard_Boolean gp_Ax1::IsOpposite(const gp_Ax1& Other, const Standard_Real AngularTolerance) const
{ 
    return vdir.IsOpposite(Other.vdir, AngularTolerance); 
}
inline Standard_Boolean gp_Dir::IsOpposite(const gp_Dir& Other,const Standard_Real AngularTolerance) const
{ 
    return M_PI - Angle (Other) <= AngularTolerance; 
} 

 

  • 3
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
opencascade-7.4.0-vc14-64.exe 是OpenCASCADE开源几何建模工具的一个安装程序。OpenCASCADE是一个用于开发CAD/CAM/CAE、3D建模和数据交换软件的开源三维几何建模工具包,提供了丰富的几何处理和模型分析功能。 这个安装程序的版本号为7.4.0,适用于使用Visual Studio 2017 (vc14)编译环境的64位Windows操作系统。安装程序主要用于将OpenCASCADE和相关文件安装到计算机系统中,以便开发人员能够在其开发的软件中使用OpenCASCADE的功能和特性。 通过运行opencascade-7.4.0-vc14-64.exe,用户可以按照安装向导的指示完成安装过程。安装程序通常会将OpenCASCADE文件、示例代码、文档和其他必要的文件复制到指定的目录中。一旦安装完成,用户就可以在其开发环境中配置OpenCASCADE,并开始使用OpenCASCADE的几何建模和分析功能。 OpenCASCADE具有广泛的应用领域,包括CAD软件、建筑设计、工业设计、仿真和分析等。开发人员可以使用OpenCASCADE的API来创建和编辑3D几何模型,执行各种几何操作,如裁剪、旋转、平移等,进行模型分析,如求交、求交集等,并进行数据交换与转换,使得用户能够与其他CAD软件进行数据的互操作。 总之,opencascade-7.4.0-vc14-64.exe 是OpenCASCADE开源几何建模工具的安装程序,允许用户在64位Windows系统上使用Visual Studio 2017编译环境来开发应用程序,利用OpenCASCADE的功能和特性进行几何建模、分析和数据交换。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值