表面
曲面的方向部分决定了其评估的法向量。参数化曲面有两个参数,每个参数表示曲面上参数化线的方向。如果取切向量和切向量在同一点的叉积,则获得垂直于曲面的向量。该向量是该点表面的自然法线。可以通过调用以下函数来反转曲面的方向:uvuv AcGeSurface& AcGeSurface::reverseNormal(); 曲面赋值器返回自然法线或其逆法线,具体取决于调用次数是偶数还是奇数。如果曲面的方向与自然方向相反,则以下函数返回值 TRUE:reverseNormal() Adesk::Boolean AcGeSurface::isNormalReversed() const; 本示例构造一个圆并将其投影到 XY 平面上。然后检查投影实体的类型,以查看它被投影到哪种类型的实体中: AcGePlane plane; // ConstructsXY-plane. AcGePoint3d p1(2,3,5); AcGeVector3d v1(1,1,1); AcGeCircArc3d circ (p1, v1, 2.0); AcGeEntity3d *projectedEntity = circ.project(plane,v1); if (projectedEntity->type() == AcGe::kEllipArc3d) ... else if (projectedEntity->type() == AcGe::kCircArc3d) ... else if (projectedEntity->type() == AcGe::kLineSeg3d) ... 下面的示例构造 NURBS 曲线,并查找曲线上最接近该点的点 。最近的点作为对象返回,从中获取坐标和参数值:p1AcGePointOnCurve3d AcGeKnotVector knots; AcGePoint3dArray cntrlPnts, AcGePointOnCurve3d pntOnCrv; AcGePoint3d p1(1,3,2); knots.append (0.0); knots.append (0.0); knots.append (0.0); knots.append (0.0); knots.append (1.0); knots.append (1.0); knots.append (1.0); knots.append (1.0); cntrlPnts.append (AcGePoint3d(0,0,0)); cntrlPnts.append (AcGePoint3d(1,1,0)); cntrlPnts.append (AcGePoint3d(2,1,0)); cntrlPnts.append (AcGePoint3d(3,0,0)); AcGeNurbCurve3d nurb (3, knots, cntrlPnts); nurb.getClosestPointTo(p1,pntOnCrv); p2 = pntOnCrv.point(); double param = pntOnCrv.parameter(); 父主题: |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-19 06:42
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.