找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 192|回复: 0

[每日一码] AcDbRegion::transformBy在2014和2015结果不同的解决方案

[复制链接]

1

主题

0

回帖

55

积分

管理员

积分
55
发表于 2024-3-14 20:42:17 | 显示全部楼层 |阅读模式
  1. static void transformTest()
  2. {
  3.         /*Resetting sytsem wide tolerance for ACAD 2015*/
  4.         AcGeContext::gTol.setEqualPoint(1.0e-8);
  5.         AcGeContext::gTol.setEqualVector(1.0e-6);
  6.         double epTol = AcGeContext::gTol.equalPoint();
  7.         double evTol = AcGeContext::gTol.equalVector();
  8.         CString msg;
  9.         msg.Format(采用T("point tolerance is %e, and vector tolerance is %e\n"), epTol, evTol);
  10.         acedPrompt(msg);
  11.         // Second, create a transform matrix that maps from one coordinate syste to another
  12.         AcGePoint3d startPoint;
  13.         AcGeVector3d mStockProfileXDir, mExtrudeDir, mNormalDir;
  14.         startPoint.set(12342.705102605765, -14874.057509290647, 25.766600469474248);
  15.         mStockProfileXDir.set(0.00000000000000000, 1.0000000000000000, 0.00000000000000000);
  16.         mNormalDir.set(-0.048960818631765893, -6.4357153980460105e-012, 0.99880069995915965);
  17.         mExtrudeDir.set(-0.99880069995915977, 0.00000000000000000, -0.048960818631764047);
  18.         AcGeMatrix3d xform;
  19.         xform.setToAlignCoordSys(AcGePoint3d(0, 0, 0),
  20.                 AcGeVector3d::kXAxis,
  21.                 AcGeVector3d::kYAxis,
  22.                 AcGeVector3d::kZAxis,
  23.                 startPoint,
  24.                 mStockProfileXDir,
  25.                 mNormalDir,
  26.                 mExtrudeDir);
  27.         // Is the new coordinate system orthogonal?
  28.         if (!xform.isUniScaledOrtho())
  29.                 acedPrompt(采用T("Transform matrix axes are not orthogonal\n"));
  30.         else
  31.                 acedPrompt(采用T("Transform matrix axes are orthogonal\n"));
  32.         // Finally, transform a region to the new coordinate system.
  33.         AcDbVoidPtrArray curves, regions;
  34.         AcDbCircle *pTestCircle = new AcDbCircle(AcGePoint3d::kOrigin, AcGeVector3d::kZAxis, 10.0);
  35.         if (pTestCircle != NULL)
  36.         {
  37.                 curves.append(pTestCircle);
  38.                 AcDbRegion::createFromCurves(curves, regions);
  39.                 if (regions.length() != 0)
  40.                 {
  41.                         for (int i = 0; i < regions.length(); i++)
  42.                         {
  43.                                 AcDbRegion* testRegion = static采用cast<AcDbRegion*>(regions<i>);
  44.                                 Acad::ErrorStatus es = testRegion->transformBy(xform);
  45.                                 delete testRegion;
  46.                                 msg.Format(采用T("The transform operation returned %d\n"), es);
  47.                                 acedPrompt(msg);
  48.                         }
  49.                 }
  50.                 delete pTestCircle;
  51.         }
  52. }
复制代码

 

 

 

 

[每日一码] AcDbRegion::transformBy在2014和2015结果不同的解决方案
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|膜结构网

GMT+8, 2025-2-6 04:00 , Processed in 0.090038 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表