OpenCasCade (四) 常用对象

1.1     基本对象

(1)    OCgp_Pnt类:创建三维空间上的一个几何点对象。

例:OCgp_Pnt point = new OCgp_Pnt(113, 0, 0.05)

(2)    OCTColgp_Array1OfPnt类:创建三维空间几何点的一维数组对象。

例:

OCgp_Pnt P1 = new OCgp_Pnt(0, 0, 1);

            OCgp_Pnt P2 = new OCgp_Pnt(1, 2, 2);

            OCTColgp_Array1OfPnt array = new OCTColgp_Array1OfPnt(1, 2);                                     

            array.SetValue(1, P1);

            array.SetValue(2, P2);

(3)    OCTColgp_Array2OfPnt:二维点数组;

例:

OCTColgp_Array2OfPnt Poles = new OCTColgp_Array2OfPnt(1214);

            Poles.SetValue(11new OCgp_Pnt(000));

            Poles.SetValue(12new OCgp_Pnt(0102));

            Poles.SetValue(13new OCgp_Pnt(02010));

            Poles.SetValue(14new OCgp_Pnt(0300));

            Poles.SetValue(21new OCgp_Pnt(1005));

            Poles.SetValue(22new OCgp_Pnt(10103));

            Poles.SetValue(23new OCgp_Pnt(102020));

            Poles.SetValue(24new OCgp_Pnt(10300));

 

(4)    OCTColStd_Array1OfReal:一维Double数组。

例:

OCTColStd_Array1OfReal UKnots = new OCTColStd_Array1OfReal(12);

            UKnots.SetValue(10);

            UKnots.SetValue(21);

(5)    OCTColStd_Array1OfInteger:一维Integer数组

例:

OCTColStd_Array1OfInteger VMults = new OCTColStd_Array1OfInteger(13);

            VMults.SetValue(13);

            VMults.SetValue(21);

            VMults.SetValue(33);

 

(6)    OCTopoDS_ListOfShape:拓扑对象LIST集合。

(7)    OCTopTools_ListIteratorOfListOfShape:拓扑对象LIST集合的迭代器。

(8)    OCgp_Dir:单位向量。

(9)    OCgp_Ver:向量。

(10)  OCGeom_Axis1Placement:

(11)  OCgp_Trsf:

定义一个矩阵变换的类

 --可以定义平移、旋转、缩放的矩阵;

 --可以对称于一个点,一条线,一个平面;

--复杂的变换可以通过初等变换来实现。

实例参见拓扑变换目录;

(12)  OCgp_GTrsf:

它与OCgp_Trsf变换是相似的。

--只能通过三组XYZ坐标(由XYZ坐标组成的3*3的变换矩阵)来进行变换。

--应用此变换,会改变原有的几何对象。

实例参见拓扑变换目录;

 

(13)  OCgp_Mat:矩阵对象

例:OCgp_Mat rot = new OCgp_Mat(1, 0, 0, 0, 0.5, 0, 0, 0, 1.5);

 

1.2     坐标轴对象

(1)    OCgp_Ax1

--- Purpose : Describes an axis in 3D space.  3D空间定义一个轴,

-- An axis is defined by:一个轴可以按照下列方式定义:

-- -   its origin (also referred to as its "Location point"), and

-- -   its unit vector (referred to as its "Direction" or "main   Direction").

一个原点和一个单位向量

-- An axis is used:一个轴用于:

-- -   to describe 3D geometric entities (for example, the

描述三维几何实体

-- axis of a revolution entity). It serves the same purpose

一个旋转实体的轴

-- as the STEP function "axis placement one axis", or

作为STEP功能的 一个轴位移

 -- -   to define geometric transformations (axis of

--   symmetry, axis of rotation, and so on).

定义几何旋转

-- For example, this entity can be used to locate a geometric entity

--  or to define a symmetry axis.

例如一个轴可以用于定位一个几何实体

(2)    OCgp_Ax2

--- Purpose :

        --  Describes a right-handed coordinate system in 3D space.

在三维空间描述一个右手坐标系

        -- A coordinate system is defined by:

一个坐标系可以通过下列方式定义

        -- -   its origin (also referred to as its "Location point"), and

        -- -   three orthogonal unit vectors, termed respectively the

        -- "X Direction", the "Y Direction" and the "Direction" (also

        --   referred to as the "main Direction").

原点,三个直角坐标单位向量,分别是X方向、Y方向。。。

        -- The "Direction" of the coordinate system is called its

        -- "main Direction" because whenever this unit vector is

        -- modified, the "X Direction" and the "Y Direction" are

        -- recomputed. However, when we modify either the "X

        -- Direction" or the "Y Direction", "Direction" is not modified.

坐标系统的方向叫做主方向,因为任何情况下当这个单位向量修改的时候

X方向和Y方向都会重新计算,但是

当我们修改X方向或者Y方向的时候,主方向是不修改的

        -- The "main Direction" is also the "Z Direction".

主方向也叫做Z方向

        -- Since an Ax2 coordinate system is right-handed, its

        -- "main Direction" is always equal to the cross product of

        -- its "X Direction" and "Y Direction". (To define a

        -- left-handed coordinate system, use gp_Ax3.)

因为Ax2坐标系统是右手坐标系,主方向等于X方向和Y方向的差乘积。

(3)    OCgp_Ax3

类似于OCgp_Ax2:不同的地方就是既可以是右手坐标系,也可以是左手坐标系

 

 

1.3     枚举类型

(1)    OCQuantity_NameOfColor:颜色枚举

(2)    OCAIS_DisplayMode:显示模式枚举

(3)    OCGraphic3d_NameOfMaterial:显示材料枚举

(4)    OCTopAbs_ShapeEnum:拓扑类型枚举

例:判断一个拓扑几何是否为边Edge

public bool IsEdge(OCTopoDS_Shape aS)

          {

            return (!aS.IsNull() && (aS.ShapeType() == OCTopAbs_ShapeEnum.TopAbs_EDGE));

          }

(5)    V3d_TypeOfOrientation:三维取向类型

 

 

1.4     其它

(1)    Select3D_Projector:A framework to define 3D projectors

(2)    ProjLib:提供曲线沿着给定方向在一个平面上的投影;

         提供曲面上曲线的投影用于计算参数空间中的曲线;

(3)    ElSLib:提供初等曲面的几何计算静态方法

(4)    TopExp_Explorer:拓扑类型的展开

例:

           OCTopExp_Explorer ex = new OCTopExp_Explorer();

            for (ex.Init(ShapeCut2, OCTopAbs_ShapeEnum.TopAbs_FACE, OCTopAbs_ShapeEnum.TopAbs_SHAPE); ex.More(); ex.Next())

            {

                OCTopoDS_Face aE = OCTopoDS.Face(ex.Current());

            }

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值