iCAx开思工具箱

标题: 为何我的草图约束 并不对称,或者说对称得不理想 [打印本页]

作者: zsong22    时间: 2012-12-4 21:01
标题: 为何我的草图约束 并不对称,或者说对称得不理想
我通过caa做出的草图约束 在Catia里面为   对称1图片所示并不理想。
我想要的理想约束 如图 对称2

我首先 在草图中随意用三个点 创建了三条直线,然后对称约束:
double pt1[2] = {0, 250},
         pt2[2] = {250, 200},
         pt3[2] = {500, 500};

CATISpecObject_var spLine1 = spWF2DFactOnSketch->CreateLine(pt1,pt2);
  CATISpecObject_var spLine2 = spWF2DFactOnSketch->CreateLine(pt2,pt3);
  CATISpecObject_var spLine3 = spWF2DFactOnSketch->CreateLine(pt3,pt1);

spConstraint2DFactory->CreateConstraint( spLine2, NULL, spLine3, NULL, spLine1, NULL, NULL, Cst2DType_Symmetry, 0, 1 );


如何才能让我的对称约束变得理想呢?   
请教各位 看官!{:soso_e176:}

该贴已经同步到 zsong22的微博
作者: zsong22    时间: 2012-12-5 18:27
各位同仁, 问题已经解决!
主要是把约束后面的 1 换成0就好。   虽然 我也不懂这个数字代表什么!
spConstraint2DFactory->CreateConstraint( spLine2, NULL, spLine3, NULL, spLine1, NULL, NULL, Cst2DType_Symmetry, 0, 0);


附上,约束函数:
CreateConstraint
public virtual CATISpecObject_var CreateConstraint( CATBaseUnknown*  iElem1,
const double*  iSelPt1,
CATBaseUnknown*  iElem2,
const double*  iSelPt2,
CATBaseUnknown*  iElem3,
const double*  iSelPt3,
CATBaseUnknown*  iDirection,
const CAT2DCstType  iCstType,
const int  iDriven =0,
const int  iEvaluation =1) = 0  

Creates a constraint.
Parameters:
iElem1
[in] Address of the first geometrical element.
iSelPt1
[in] If the geometry is a curve, pass the 2D selection coordinates of the curve expressed according to the sketch system of reference. Else, pass NULL. (This entry serves as the initialization point of the resolution. If no information is passed, the system will evaluate one automatically. However, the returned solution (location where the constraint on the curve will be solved) can be unexpected for the user).
iElem2
[in] Address of the second geometrical element. Pass NULL if necessary (e.g. for a length constraint, only iElem1 should be valuated).
iSelPt2
[in] If the geometry is a curve, pass the 2D selection coordinates of the curve expressed according to the sketch system of reference. Else, pass NULL. (This entry serves as the initialization point of the resolution. If no information is passed, the system will evaluate one automatically. However, the returned solution (location where the constraint on the curve will be solved) can be unexpected for the user).
iElem3
[in] Address of the third geometrical element. Pass NULL if necessary.
iSelPt3
[in] If the geometry is a curve, pass the 2D selection coordinates of the curve expressed according to the sketch system of reference. Else, pass NULL. (This entry serves as the initialization point of the resolution. If no information is passed, the system will evaluate one automatically. However, the returned solution (location where the constraint on the curve will be solved) can be unexpected for the user).
iDirection
[in] Address of a geometrical element of the line type to create an oriented dimension. (e.g. vertical if the V direction of the sketch absolute axis is passed, or horizontal if the H direction is passed).
iCstType
[in] Type of the constraint to create.
iDriven
[in] The default value 0 corresponds to a driving dimension. If <> 0, if will be a measured dimension (reference constraint).
iEvaluation
[in] The default value 1 implies a solver evaluation after the constraint is created. If several constraints must be created successively, you can run explicitly a final evaluation by setting the value to 0.

还望,懂这个函数的同仁给于指点,   比如:参数const double*  iSelPt1 什么意思。  以及最后两个参数什么意思?
{:soso_e176:}






欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3