美文网首页
Open CasCade -> 创建Edge

Open CasCade -> 创建Edge

作者: 诸事圆成 | 来源:发表于2020-09-24 22:51 被阅读0次

gp包

class gp_XYZ;
class gp_Dir
{
public:
  gp_Dir(); //创建一个对应 x 轴的方向
private:
  gp_XYZ xyz;
}
#方向
class gp_Vec
{
  private:
    gp_XYZ xyz;
}
#一条轴
class gp_Ax1
{
  private:
    gp_Pnt p;
    gp_Dir dir;
}
//右手坐标系 *左手事 gp_Ax3
#三维坐标系
class gp_Ax2
{
  public:
    //P是坐标原点, V是main 方向(相当于z轴), x和y轴会自动创建
     gp_Ax2(const gp_Pnt& P, const gp_Dir& V);
  private:
    gp_Ax1 ax1;
    gp_Dir vydir;
    gp_Dir vxdir;
}

Geom_TrimmedCurve

// 在3D空间创建一条线段, 由2个点创建
// 结果是一个Geom_TrimmedCurve 的曲线
class GC_MakeSegment 
{
public:
//! Returns the constructed line segment.(返回构造的线段)
  Standard_EXPORT const Handle(Geom_TrimmedCurve)& Value() const;
private:
  Handle(Geom_TrimmedCurve) TheSegment;
}

example

{
  //2个三维上的点 P1, P2
  gp_Pnt p1(0,0,0);
  gp_Pnt p2(3,4,5);
  //gp包创建 edge
  TopoDS_Edge segEdge0 = BRepBuilderAPI_MakeEdge(p1, p2);
  //Geom_TrimmedCurve 创建edge
  Hanlde(Geom_TrimmedCurve)  seg = GC_MakeSegment(p1,p2);
  TopoDS_Edge segEdge1 = BRepBuilderAPI_MakeEdge(seg);
    
}

相关文章

网友评论

      本文标题:Open CasCade -> 创建Edge

      本文链接:https://www.haomeiwen.com/subject/evmtuktx.html