why the setAngles function show the imprecision angles

why the setAngles function show the imprecision angles

Anonymous
Not applicable
1,011 Views
1 Reply
Message 1 of 2

why the setAngles function show the imprecision angles

Anonymous
Not applicable

I use the function setAngles to make a semicircle ,but the semicircle'angle is not 180 degree,it is mybe 179 degree. i was mixed-up,why????? my plaform is VS2005(C++)+arx2008,

code:

double PI = 3.14159265358979323846;

AcGeCircArc3d *cirArc = new AcGeCircArc3d();
cirArc->setAngles(0.0, PI); 

 

AcGeIntArray edgeTypes;
AcGeVoidPointerArray edgePtrs;
edgeTypes.append(AcDbHatch::kCirArc);
edgePtrs.append((void*)cirArc);
Hatch1->appendLoop(AcDbHatch::kDefault, edgePtrs, edgeTypes);
es=Hatch1->evaluateHatch();

what is the problem???

0 Likes
Accepted solutions (1)
1,012 Views
1 Reply
Reply (1)
Message 2 of 2

Balaji_Ram
Alumni
Alumni
Accepted solution

Hi,

 

This isnt a problem of the setAngles. The hatch boundary only has the circular arc without a closing edge and this is causing it to hatch incorrectly. You can try including a closing line for the hatch to fill it correctly.

 

const double PI = atan(1.0) * 4.0;

AcGeCircArc3d *cirArc = new AcGeCircArc3d();
cirArc->set(AcGePoint3d::kOrigin, AcGeVector3d::kZAxis, AcGeVector3d::kXAxis, 2.0, 0.0, PI); 
AcGeLine3d *line3d = new AcGeLine3d(cirArc->endPoint(), cirArc->startPoint());

AcGeIntArray edgeTypes;
edgeTypes.append(AcDbHatch::kCirArc);
edgeTypes.append(AcDbHatch::kLine);
		
AcGeVoidPointerArray edgePtrs;
edgePtrs.append((void*)cirArc);
edgePtrs.append((void*)line3d);

pHatch->appendLoop(AcDbHatch::kDefault, edgePtrs, edgeTypes);

 



Balaji
Developer Technical Services
Autodesk Developer Network