void
ArxDbgUtils::getEcsPlane(const AcGeVector3d& entNormal, AcGePlane& ecsPlane)
{
    AcGeMatrix3d ecsMat;
    getEcsToWcsMatrix(AcGePoint3d::kOrigin, entNormal, ecsMat);

    AcGePoint3d origin;
    AcGeVector3d xAxis, yAxis, zAxis;
    ecsMat.getCoordSystem(origin, xAxis, yAxis, zAxis);
    ecsPlane.set(origin, xAxis, yAxis);
}
Ejemplo n.º 2
0
void generateCutRegion(AcDb3dSolid* pSolid, int offset, int direction)
{
	//创建切面
	AcGePlane plane;

	if( direction == 1)
		plane.set(AcGePoint3d(offset,0,0),AcGeVector3d(1,0,0));
	else if( direction == 2)
		plane.set(AcGePoint3d(0,offset,0),AcGeVector3d(0,1,0));
	else if( direction == 3)
		plane.set(AcGePoint3d(0,0,offset),AcGeVector3d(0,0,1));

	//得到实体与切面相切的截面
	AcDbRegion *pSelectionRegion = NULL;
	pSolid->getSection(plane, pSelectionRegion);

	//将其移动到YZ平面
	//moveToBottom(pSelectionRegion);

	//将截面加入到模型空间
	PostToModelSpace(pSelectionRegion);
}
void
ArxDbgUtils::getEcsPlane(const AcGePoint3d& origin,
                        const AcGeVector3d& entNormal, AcGePlane& ecsPlane,
                        AcGeVector3d& ecsXAxis)
{
    AcGeMatrix3d ecsMat;
    getEcsToWcsMatrix(origin, entNormal, ecsMat);

    AcGePoint3d tmpOrigin;
    AcGeVector3d yAxis, zAxis;
    ecsMat.getCoordSystem(tmpOrigin, ecsXAxis, yAxis, zAxis);
    ecsPlane.set(tmpOrigin, ecsXAxis, yAxis);
}
Ejemplo n.º 4
0
void drawCylinder()
{
	// 创建特定参数的圆柱体(实际上最后一个参数决定了实体是一个圆锥体还是圆柱) 
	AcDb3dSolid *pSolid = new AcDb3dSolid(); 
	pSolid->createFrustum(30, 10, 10, 10);

	// 将圆锥体添加到模型空间
	PostToModelSpace(pSolid);

	//创建切面
	AcGePlane plane;
    plane.set(AcGePoint3d(8,0,0),AcGeVector3d(1,0,0));

	//得到实体与切面相切的截面
	AcDbRegion *pSelectionRegion = NULL;
	pSolid->getSection(plane, pSelectionRegion);

	//将其移动到YZ平面
	moveToBottom(pSelectionRegion);
	
	//将截面加入到模型空间
	PostToModelSpace(pSelectionRegion);
}