eryar

PipeCAD - Plant Piping Design Software.
RvmTranslator - Translate AVEVA RVM to OBJ, glTF, etc.
posts - 603, comments - 590, trackbacks - 0, articles - 0

在Open Cascade中创建基本几何实体

Posted on 2013-01-13 22:49 eryar 阅读(10137) 评论(7)  编辑 收藏 引用 所属分类: 2.OpenCASCADE

Open Cascade中创建基本几何实体

Construction of Primitives in Open Cascade

eryar@163.com

一、创建基本图元 Making Primitives

将用到如下的类创建基本图元,包括长方体(Box)、楔形体(Wedge)、旋转体(Revol)等。这些类提供ShellSolid函数来返回实体(solid)和壳(shell)。

使用方法都是调用这些类的构造函数,输入相应的参数,直接构造出基本图元。构造函数的参数不同,创建的基本几何实体的形状也会不同。

注:所有旋转体的角度值都是弧度值。

1. 创建长方体BRepPrimAPI_MakeBox

使用MakeBox类创建一个长方体,结果以一个壳或体返回。创建长方体的方式有如下四种:

以上创建方式对应类的BRepPrimAPI_MakeBox的四种构造函数:

Standard_EXPORT   BRepPrimAPI_MakeBox(const Standard_Real dx,const Standard_Real dy,const Standard_Real dz);
 
  Standard_EXPORT   BRepPrimAPI_MakeBox(const gp_Pnt& P,const Standard_Real dx,const Standard_Real dy,const Standard_Real dz);
 
  Standard_EXPORT   BRepPrimAPI_MakeBox(const gp_Pnt& P1,const gp_Pnt& P2);
 
  Standard_EXPORT   BRepPrimAPI_MakeBox(const gp_Ax2& Axes,const Standard_Real dx,const Standard_Real dy,const Standard_Real dz);

与上图对应的创建长方体的代码如下所示:

BRepPrimAPI_MakeBox (200.,150.,100.);
BRepPrimAPI_MakeBox (gp_Pnt(60, 60, 0), 200.,150.,100.);
BRepPrimAPI_MakeBox (gp_Pnt(60, 60, 0), gp_Pnt(200.,150.,100.));
BRepPrimAPI_MakeBox (gp_Ax2(gp_Pnt(100.,80.,70.),gp_Dir(1.,2.,1.)),80.,90.,120.);

2. 创建楔形体BRepPrimAPI_MakeWedge

使用类BRepPrimAPI_MakeWedge来创建楔形体。楔形体就是带斜面的长方体,即带角度的长方体。楔形体的创建方式与长方体的创建方式相似。下图所示为构造楔形体的两种方式。一种是加入ltx尺寸来描述dy上的面,另一种是加入xminxmaxzminzmax来描述dy上的面。

第一种方式是第二种方式在满足以下条件下的特例:

xmin = 0, xmax = ltx, zmin = 0, zmax = dz

创建一个金字塔的楔形体可以用下面的方式:

xmin = xmax = dx / 2, zmin = zmax = dz / 2

生成上图所示的程序如下所示:

TopoDS_Shape S1 = BRepPrimAPI_MakeWedge(60.,100.,80.,20.); 
TopoDS_Shape S2 = BRepPrimAPI_MakeWedge(gp_Ax2(gp_Pnt(100.,100.,0.),gp_Dir(0.,0.,1.)), 
                                    60.,50.,80.,25.,-10.,40.,70.); 

3. BRepPrimAPI_MakeOneAxis

BRepPrimAPI_MakeOneAxis是所有旋转体图元的基类。旋转体通过将曲线绕一个轴旋转得到。它们有圆柱体、圆锥体、球体、圆环体等。

这些旋转体对于不同的图元有不同的构造参数,但是它们也有共同的参数:

l 一个坐标系统;

l 一个角度,范围为[0, 2*PI];

l 曲线的vminvmax参数;

OneAxis构造的结果是体Solid、壳Shell或面Face

通常不会直接使用类BRepPrimAPI_MakeOneAxis,而是使用它的派生类。

如下图所示描述了类的参数:

4. 创建圆柱体BRepPrimAPI_MakeCylinder

使用类BRepPrimAPI_MakeCylinder来创建圆柱体。圆柱可以在默认的坐标系中被创建,也可以指定的坐标系(gp_Ax2)中创建。创建方式如下:

l 半径、高度创建一个完整的圆柱;

l 半径、高度及角度来创建部分圆柱;

如下代码所示为沿XYZ偏移一定距离的四分之一的圆柱:

Standard_Real X = 20;
Standard_Real Y = 10;
Standard_Real Z = 15;
Standard_Real R = 10;
Standard_Real DY = 30;
// Make the system of coordinates.
gp_Ax2 axes = gp::ZOX();
axes.Translate(gp_Vec(X, Y, Z));
TopoDS_Face F = BRepPrimAPI_MakeCylinder(axes, R, DY, PI/2.);

5. 创建圆锥体 BRepPrimAPI_MakeCone

使用类BRepPrimAPI_MakeCone来创建圆锥体。与圆柱体一样,圆锥体可以在默认的坐标系中被创建,也可以指定的坐标系中被创建。创建方式如下:

l 两个半径和高度来创建一个完整的圆锥。一个半径可以为零,这样就创建了一个尖顶的圆锥;

l 半径、高度和角度来创建部分圆锥。

如下代码创建的圆锥如下图所示:

TopoDS_Shape C1 = BRepPrimAPI_MakeCone (50.,25.,200.); 
TopoDS_Shape C2 = BRepPrimAPI_MakeCone(gp_Ax2(gp_Pnt(100.,100.,0.), 
                                          gp_Dir(0.,0.,1.)), 
                                   605.,0.,150.,210.*PI180); 

6. 创建球体BRepPrimAPI_MakeSphere

使用类BRepPrimAPI_MakeSphere来创建球体。与圆柱体一样,球体可以在默认的坐标系中被创建,也可以指定的坐标系中被创建。有四种创建方式,如下图所示:

l 一个半径值,创建一个完整的球体;

l 半径和角度,创建部分的球体;

l 半径和两个角度值,创建纬度上的部分的球体。两个角度a1a2必须满足如下条件:PI/2 <= a1 < a2 <= PI/2

l 一个半径和三个角度值;

实现上图中球体的代码如下:

TopoDS_Shape S1 = BRepPrimAPI_MakeSphere(gp_Pnt(-200.,-250.,0.),80.); 
TopoDS_Shape S2 = BRepPrimAPI_MakeSphere(100.,120.*PI180); 
TopoDS_Shape S3 = BRepPrimAPI_MakeSphere(gp_Pnt(200.,250.,0.),100., 
                                     -60.*PI180, 60.*PI180); 
TopoDS_Shape S4 = BRepPrimAPI_MakeSphere(gp_Pnt(0.,0.,-300.),150., 
                                     -45.*PI180, 45.*PI180, 45.*PI180);

7. 创建圆环体BRepPrimAPI_MakeTorus

使用类BRepPrimAPI_MakeTorus来创建圆环体。与其它基本图元类似,一个圆环体可以在默认的坐标系中创建,也可以在指定的坐标系中创建。创建与与球体创建方式类似:

l 两个半径,创建一个完整的圆环体;

l 两个半径和一个角度值,创建部分的圆环体;

l 两个半径和两个角度值,创建纬度上的部分圆环体;两个角度必须满足如下条件:0 < a2a1 < 2 * PI

l 两个半径和三个角度值,创建部分的圆环体;

TopoDS_Shape S1 = BRepPrimAPI_MakeTorus(60.,20.); 
TopoDS_Shape S2 = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(100.,100.,0.),gp_Dir(1.,1.,1.)), 
                                    50.,20.,210.*PI180); 
TopoDS_Shape S3 = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(-200.,-150.,-100),gp_Dir(0.,1.,0.)), 
                                    60.,20.,-45.*PI180,45.*PI180,90.*PI180); 

8. 创建旋转体BRepPrimAPI_MakeRevolution

使用类BRepPrimAPI_MakeRevolution来根据一条曲线和轴创建旋转体。曲线可以是任意的Geom_Curve,有四种构造方式:

l From a curve, use the full curve and make a full rotation;

l From a curve and an angle of rotation;

l From a curve and two parameters to trim the curve. The two parameters must be growing and within the curve range;

l From a curve, two parameters, and an angle. The two parameters must be growing and within the curve range.

 

二、创建扫掠体 Sweeping: Prism, Revolution and Pipe

扫掠体(Sweeps)就是一条截面(profile)沿任意轨道线(path)扫掠后得到的体。截面可以是任意的拓朴结构。轨道线通常是曲线(curve or wire)。创建扫掠体的规则如下:

l 点扫掠后得到边;Vertices generate Edges;

l 边扫掠后得到面;Edges generate Faces;

l 线扫掠后得到壳;Wires generate Shells;

l 面扫掠后得到体;Faces generate Solids;

l 壳扫掠后得到组合体;Shells generate Composite Solids;

l A Compound generates a Compound with the sweep of all its elements;

体(Solids)和组合体(Composite Solids)的扫掠是禁止的。

BRepPrimAPI中实现了三种扫掠体:称线性扫掠体为Prism,称旋转扫掠体为Revol和通用的扫掠体叫作Pipe

1. BRepPrimAPI_MakeSweep

BRepPrimAPI_MakeSweep是扫掠体的基类。对用户来说,没有什么实质的用途。

2. 创建拉伸体BRepPrimAPI_MakePrism

使用类BRepPrimAPI_MakePrism来创建线性拉伸体prism。拉伸体可从一个形状及一个向量或一个方向来创建。从一个向量可以创建一个有限拉伸体,而从一个方向可以创建一个无限的或半无限的拉伸体。一个布尔的函数参数用来控制半无限和全无限的拉伸体。所有的构造函数都有一个布尔值来控制构造的拉伸体与原拉伸体是否共享,默认是共享方式构造。如下代码为使用一个面,一个方向和一个长度来创建一个有限的、无限的和半无限的拉伸体。

生成上图所示形状的代码如下所示:

//--- Prism a vertex -> result is an edge --- 
TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-200.,-200.,0.)); 
TopoDS_Shape S1 = BRepBuilderAPI_MakePrism(V1,gp_Vec(0.,0.,100.)); 
//--- Prism an edge -> result is a face --- 
TopoDS_Edge E = BRepBuilderAPI_MakeEdge(gp_Pnt(-150.,-150,0.), gp_Pnt(-50.,-50,0.)); 
TopoDS_Shape S2 = BRepPrimAPI_MakePrism(E,gp_Vec(0.,0.,100.)); 
//--- Prism an wire -> result is a shell --- 
TopoDS_Edge E1 = BREpBuilderAPI_MakeEdge(gp_Pnt(0.,0.,0.), gp_Pnt(50.,0.,0.)); 
TopoDS_Edge E2 = BREpBuilderAPI_MakeEdge(gp_Pnt(50.,0.,0.), gp_Pnt(50.,50.,0.)); 
TopoDS_Edge E3 = BREpBuilderAPI_MakeEdge(gp_Pnt(50.,50.,0.), gp_Pnt(0.,0.,0.)); 
TopoDS_Wire W = BRepBuilderAPI_MakeWire(E1,E2,E3); 
TopoDS_Shape S3 = BRepPrimAPI_MakePrism(W,gp_Vec(0.,0.,100.)); 
//--- Prism a face or a shell -> result is a solid --- 
gp_Circ c = gp_Circ(gp_Ax2(gp_Pnt(200.,200.,0.gp_Dir(0.,0.,1.)), 80.); 
TopoDS_Edge Ec = BRepBuilderAPI_MakeEdge(c); 
TopoDS_Wire Wc = BRepBuilderAPI_MakeWire(Ec); 
TopoDS_Face F = BRepBuilderAPI_MakeFace(gp::XOY(),Wc); 
TopoDS_Shape S4 = BRepBuilderAPI_MakePrism(F,gp_Vec(0.,0.,100.)); 

3. 创建旋转体BRepPrimAPI_MakeRevol

使用类BRepPrimAPI_MakeRevol来创建旋转扫掠体。旋转扫掠体由一个形状、轴和一个角度构造而得。类BRepPrimAPI_MakeRevol所有的构造函数的最后一个参数是用来控制构造的形状与原形状的关系,默认为共享的方式。

生成上图所示形状的代码如下所示:

//--- Revol of a vertex -> result is an edge ---
TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-200.,-200.,0.));
gp_Ax1 axe = gp_Ax1(gp_Pnt(-170.,-170.,0.),gp_Dir(0.,0.,1.));
TopoDS_Shape S1 = BRepPrimAPI_MakeRevol(V1,axe);
//--- Revol of an edge -> result is a face --- 
TopoDS_Edge E = BRepBuilderAPI_MakeEdge(gp_Pnt(-120.,-120,0.), gp_Pnt(-120.,-120,100.)); 
axe = gp_Ax1(gp_Pnt(-100.,-100.,0.),gp_Dir(0.,0.,1.));
TopoDS_Shape S2 = BRepPrimAPI_MakeRevol(E,axe);
//--- Revol of a wire -> result is a shell ---
TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(gp_Pnt(0.,0.,0.), gp_Pnt(50.,0.,0.));
TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(gp_Pnt(50.,0.,0.), gp_Pnt(50.,50.,0.));
TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge(gp_Pnt(50.,50.,0.), gp_Pnt(0.,0.,0.));
TopoDS_Wire W = BRepBuilderAPI_MakeWire(E1,E2,E3);
axe = gp_Ax1(gp_Pnt(0.,0.,30.),gp_Dir(0.,1.,0.));
TopoDS_Shape S3 = BRepPrimAPI_MakeRevol(W,axe, 210.*PI180);
//--- Revol of a face -> result is a solid --- 
gp_Circ c = gp_Circ(gp_Ax2(gp_Pnt(200.,200.,0.),gp_Dir(0.,0.,1.)), 80.);
TopoDS_Edge Ec = BRepBuilderAPI_MakeEdge(c);
TopoDS_Wire Wc = BRepBuilderPI_MakeWire(Ec);
TopoDS_Face F = BRepBuilderAPI_MakeFace(gp_Pln(gp::XOY()),Wc);
axe = gp_Ax1(gp_Pnt(290,290.,0.),gp_Dir(0.,1,0.));
TopoDS_Shape S4 = BRepPrimAPI_MakeRevol(F,axe, 90.*PI180); 

 

Feedback

# re: 在Open Cascade中创建基本几何实体  回复  更多评论   

2017-04-14 10:25 by Sirius
您好,我在进行学习occ实体创建的时候尝试使用他所给的那个瓶子的代码“src/MakeBottle.cxx”想生成出来一个瓶子,但是在编译的过程中出现一些问题。
1>Bottle.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl ChFiDS_ListOfStripe::Clear(void)" (?Clear@ChFiDS_ListOfStripe@@QEAAXXZ),该符号在函数 "public: __cdecl ChFiDS_ListOfStripe::~ChFiDS_ListOfStripe(void)" (??1ChFiDS_ListOfStripe@@QEAA@XZ) 中被引用
1>Bottle.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl ChFiDS_IndexedDataMapOfVertexListOfStripe::ChFiDS_IndexedDataMapOfVertexListOfStripe(int)" (??0ChFiDS_IndexedDataMapOfVertexListOfStripe@@QEAA@H@Z),该符号在函数 "public: void __cdecl ChFiDS_IndexedDataMapOfVertexListOfStripe::`default constructor closure'(void)" (??_FChFiDS_IndexedDataMapOfVertexListOfStripe@@QEAAXXZ) 中被引用
1>Bottle.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl ChFiDS_IndexedDataMapOfVertexListOfStripe::Clear(void)" (?Clear@ChFiDS_IndexedDataMapOfVertexListOfStripe@@QEAAXXZ),该符号在函数 "public: __cdecl ChFiDS_IndexedDataMapOfVertexListOfStripe::~ChFiDS_IndexedDataMapOfVertexListOfStripe(void)" (??1ChFiDS_IndexedDataMapOfVertexListOfStripe@@QEAA@XZ) 中被引用
1>Bottle.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl ChFiDS_Regularities::Clear(void)" (?Clear@ChFiDS_Regularities@@QEAAXXZ),该符号在函数 "public: __cdecl ChFiDS_Regularities::~ChFiDS_Regularities(void)" (??1ChFiDS_Regularities@@QEAA@XZ) 中被引用
1>Bottle.obj : error LNK2019: 无法解析的外部符号 "public: virtual void __cdecl ChFi3d_Builder::Delete(void)" (?Delete@ChFi3d_Builder@@UEAAXXZ),该符号在函数 "public: virtual __cdecl ChFi3d_Builder::~ChFi3d_Builder(void)" (??1ChFi3d_Builder@@UEAA@XZ) 中被引用
1>Bottle.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __cdecl ChFi3d_Builder::SimulSurf(class Handle_ChFiDS_SurfData &,class Handle_ChFiDS_HElSpine const &,class Handle_ChFiDS_Spine const &,int,class Handle_BRepAdaptor_HSurface const &,class Handle_Adaptor3d_TopolTool const &,class Handle_BRepAdaptor_HCurve2d const &,class Handle_BRepAdaptor_HSurface const &,class Handle_BRepAdaptor_HCurve2d const &,unsigned int &,class Handle_BRepAdaptor_HSurface const &,class Handle_Adaptor3d_TopolTool const &,enum TopAbs_Orientation,double,double,double &,double &,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,class math_Vector const &)" (?SimulSurf@ChFi3d_Builder@@MEAAXAEAVHandle_ChFiDS_SurfData@@AEBVHandle_ChFiDS_HElSpine@@AEBVHandle_ChFiDS_Spine@@HAEBVHandle_BRepAdaptor_HSurface@@AEBVHandle_Adaptor3d_TopolTool@@AEBVHandle_BRepAdaptor_HCurve2d@@35AEAI34W4TopAbs_Orientation@@NNAEAN8IIIIIIAEBVmath_Vector@@@Z)
1>Bottle.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __cdecl ChFi3d_Builder::SimulSurf(class Handle_ChFiDS_SurfData &,class Handle_ChFiDS_HElSpine const &,class Handle_ChFiDS_Spine const &,int,class Handle_BRepAdaptor_HSurface const &,class Handle_Adaptor3d_TopolTool const &,enum TopAbs_Orientation,class Handle_BRepAdaptor_HSurface const &,class Handle_Adaptor3d_TopolTool const &,class Handle_BRepAdaptor_HCurve2d const &,class Handle_BRepAdaptor_HSurface const &,class Handle_BRepAdaptor_HCurve2d const &,unsigned int &,double,double,double &,double &,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,class math_Vector const &)" (?SimulSurf@ChFi3d_Builder@@MEAAXAEAVHandle_ChFiDS_SurfData@@AEBVHandle_ChFiDS_HElSpine@@AEBVHandle_ChFiDS_Spine@@HAEBVHandle_BRepAdaptor_HSurface@@AEBVHandle_Adaptor3d_TopolTool@@W4TopAbs_Orientation@@34AEBVHandle_BRepAdaptor_HCurve2d@@36AEAINNAEAN8IIIIIIAEBVmath_Vector@@@Z)
1>Bottle.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __cdecl ChFi3d_Builder::SimulSurf(class Handle_ChFiDS_SurfData &,class Handle_ChFiDS_HElSpine const &,class Handle_ChFiDS_Spine const &,int,class Handle_BRepAdaptor_HSurface const &,class Handle_Adaptor3d_TopolTool const &,class Handle_BRepAdaptor_HCurve2d const &,class Handle_BRepAdaptor_HSurface const &,class Handle_BRepAdaptor_HCurve2d const &,unsigned int &,enum TopAbs_Orientation,class Handle_BRepAdaptor_HSurface const &,class Handle_Adaptor3d_TopolTool const &,class Handle_BRepAdaptor_HCurve2d const &,class Handle_BRepAdaptor_HSurface const &,class Handle_BRepAdaptor_HCurve2d const &,unsigned int &,enum TopAbs_Orientation,double,double,double &,double &,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,class math_Vector const &)" (?SimulSurf@ChFi3d_Builder@@MEAAXAEAVHandle_ChFiDS_SurfData@@AEBVHandle_ChFiDS_HElSpine@@AEBVHandle_ChFiDS_Spine@@HAEBVHandle_BRepAdaptor_HSurface@@AEBVHandle_Adaptor3d_TopolTool@@AEBVHandle_BRepAdaptor_HCurve2d@@35AEAIW4TopAbs_Orientation@@3453567NNAEAN8IIIIIIIAEBVmath_Vector@@@Z)
1>Bottle.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __cdecl ChFi3d_Builder::PerformSurf(class ChFiDS_SequenceOfSurfData &,class Handle_ChFiDS_HElSpine const &,class Handle_ChFiDS_Spine const &,int,class Handle_BRepAdaptor_HSurface const &,class Handle_Adaptor3d_TopolTool const &,class Handle_BRepAdaptor_HCurve2d const &,class Handle_BRepAdaptor_HSurface const &,class Handle_BRepAdaptor_HCurve2d const &,unsigned int &,class Handle_BRepAdaptor_HSurface const &,class Handle_Adaptor3d_TopolTool const &,enum TopAbs_Orientation,double,double,double,double &,double &,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,class math_Vector const &)" (?PerformSurf@ChFi3d_Builder@@MEAAXAEAVChFiDS_SequenceOfSurfData@@AEBVHandle_ChFiDS_HElSpine@@AEBVHandle_ChFiDS_Spine@@HAEBVHandle_BRepAdaptor_HSurface@@AEBVHandle_Adaptor3d_TopolTool@@AEBVHandle_BRepAdaptor_HCurve2d@@35AEAI34W4TopAbs_Orientation@@NNNAEAN8IIIIIIAEBVmath_Vector@@@Z)
1>Bottle.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __cdecl ChFi3d_Builder::PerformSurf(class ChFiDS_SequenceOfSurfData &,class Handle_ChFiDS_HElSpine const &,class Handle_ChFiDS_Spine const &,int,class Handle_BRepAdaptor_HSurface const &,class Handle_Adaptor3d_TopolTool const &,enum TopAbs_Orientation,class Handle_BRepAdaptor_HSurface const &,class Handle_Adaptor3d_TopolTool const &,class Handle_BRepAdaptor_HCurve2d const &,class Handle_BRepAdaptor_HSurface const &,class Handle_BRepAdaptor_HCurve2d const &,unsigned int &,double,double,double,double &,double &,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,class math_Vector const &)" (?PerformSurf@ChFi3d_Builder@@MEAAXAEAVChFiDS_SequenceOfSurfData@@AEBVHandle_ChFiDS_HElSpine@@AEBVHandle_ChFiDS_Spine@@HAEBVHandle_BRepAdaptor_HSurface@@AEBVHandle_Adaptor3d_TopolTool@@W4TopAbs_Orientation@@34AEBVHandle_BRepAdaptor_HCurve2d@@36AEAINNNAEAN8IIIIIIAEBVmath_Vector@@@Z)
1>Bottle.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __cdecl ChFi3d_Builder::PerformSurf(class ChFiDS_SequenceOfSurfData &,class Handle_ChFiDS_HElSpine const &,class Handle_ChFiDS_Spine const &,int,class Handle_BRepAdaptor_HSurface const &,class Handle_Adaptor3d_TopolTool const &,class Handle_BRepAdaptor_HCurve2d const &,class Handle_BRepAdaptor_HSurface const &,class Handle_BRepAdaptor_HCurve2d const &,unsigned int &,enum TopAbs_Orientation,class Handle_BRepAdaptor_HSurface const &,class Handle_Adaptor3d_TopolTool const &,class Handle_BRepAdaptor_HCurve2d const &,class Handle_BRepAdaptor_HSurface const &,class Handle_BRepAdaptor_HCurve2d const &,unsigned int &,enum TopAbs_Orientation,double,double,double,double &,double &,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,class math_Vector const &)" (?PerformSurf@ChFi3d_Builder@@MEAAXAEAVChFiDS_SequenceOfSurfData@@AEBVHandle_ChFiDS_HElSpine@@AEBVHandle_ChFiDS_Spine@@HAEBVHandle_BRepAdaptor_HSurface@@AEBVHandle_Adaptor3d_TopolTool@@AEBVHandle_BRepAdaptor_HCurve2d@@35AEAIW4TopAbs_Orientation@@3453567NNNAEAN8IIIIIIIAEBVmath_Vector@@@Z)
1>Bottle.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl BRepFilletAPI_MakeFillet::BRepFilletAPI_MakeFillet(class TopoDS_Shape const &,enum ChFi3d_FilletShape)" (??0BRepFilletAPI_MakeFillet@@QEAA@AEBVTopoDS_Shape@@W4ChFi3d_FilletShape@@@Z),该符号在函数 "class TopoDS_Shape __cdecl MakeBottle(double,double,double)" (?MakeBottle@@YA?AVTopoDS_Shape@@NNN@Z) 中被引用
1>Bottle.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl BRepFilletAPI_MakeFillet::Add(double,class TopoDS_Edge const &)" (?Add@BRepFilletAPI_MakeFillet@@QEAAXNAEBVTopoDS_Edge@@@Z),该符号在函数 "class TopoDS_Shape __cdecl MakeBottle(double,double,double)" (?MakeBottle@@YA?AVTopoDS_Shape@@NNN@Z) 中被引用

我添加的lib都是64位的debug也是64的,不存在不搭配产生这种错误的情况。我觉得会不会可能是我少添加了一些lib?
TKernel.lib
TKMath.lib
TKBRep.lib
TKTopAlgo.lib
TKPrim.lib
TKBO.lib
TKG3d.lib
TKGeomAlgo.lib
TKMesh.lib
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib
TKGeomBase.lib
TKSTL.lib
TKIGES.lib
TKXSBase.lib
TKSTEP.lib
以上是我添加的所有lib,还麻烦您有空看一下,问题出在了什么地方。不胜感激。

# re: 在Open Cascade中创建基本几何实体  回复  更多评论   

2017-04-14 10:34 by eryar
@Sirius
Hi Sirius,

你好!

缺少了TkFillet.lib.

你可以用Reference文档去搜索。

Best Regards,
Shing Liu

# re: 在Open Cascade中创建基本几何实体  回复  更多评论   

2017-04-14 10:37 by Sirius
@Sirius
您好,我已经自己找到了缺少的lib,嗯基本上是误打误撞试出来的,应该是“TKFillet.lib”。打扰了。
但是还想问一下,在出现这种问题的情况下,我怎么能知道我缺少的是哪个lib呢?

# re: 在Open Cascade中创建基本几何实体  回复  更多评论   

2017-04-14 10:38 by Sirius
@eryar
哈哈哈您回复的太快了 不胜感激

# re: 在Open Cascade中创建基本几何实体  回复  更多评论   

2017-04-14 10:43 by Sirius
@eryar
我想问一下您所说的Reference文档是指的哪个?方便给一个连接么?麻烦您了

# re: 在Open Cascade中创建基本几何实体  回复  更多评论   

2017-04-14 10:46 by eryar
@Sirius
有空我写一个这方面的Blog吧!

# re: 在Open Cascade中创建基本几何实体  回复  更多评论   

2017-04-14 10:49 by Sirius
@eryar
恩恩 好的。
我会在http://www.cppblog.com/eryar/archive/2014/11/16/208897.html
这个outline中关注您的最新更新的!

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理