Export Radial Dim to Dxf

This commit is contained in:
wandererfan
2018-05-21 10:53:53 -04:00
parent 65f67d8ff8
commit 8115c8e80b
5 changed files with 86 additions and 22 deletions

View File

@@ -396,27 +396,6 @@ void CDxfWrite::WriteLinearDim(const double* textMidPoint, const double* lineDef
(*m_ofs) << extLine2[1] << endl;
(*m_ofs) << 34 << endl;
(*m_ofs) << extLine2[2] << endl;
////angular dims
// (*m_ofs) << 100 << endl;
// (*m_ofs) << "AcDb3PointAngularDimension" << endl;
// (*m_ofs) << 13 << endl;
// (*m_ofs) << extLine1[0] << endl;
// (*m_ofs) << 23 << endl;
// (*m_ofs) << extLine1[1] << endl;
// (*m_ofs) << 33 << endl;
// (*m_ofs) << extLine1[2] << endl;
// (*m_ofs) << 14 << endl;
// (*m_ofs) << extLine2[0] << endl;
// (*m_ofs) << 24 << endl;
// (*m_ofs) << extLine2[1] << endl;
// (*m_ofs) << 34 << endl;
// (*m_ofs) << extLine2[2] << endl;
// (*m_ofs) << 15 << endl;
// (*m_ofs) << apexPoint[0] << endl;
// (*m_ofs) << 25 << endl;
// (*m_ofs) << apexPoint[1] << endl;
// (*m_ofs) << 35 << endl;
// (*m_ofs) << apexPoint[2] << endl;
////radial dims
// (*m_ofs) << 100 << endl;
// (*m_ofs) << "AcDbRadialDimension" << endl;
@@ -516,6 +495,56 @@ void CDxfWrite::WriteAngularDim(const double* textMidPoint, const double* lineDe
(*m_ofs) << 36 << endl;
(*m_ofs) << lineDefPoint[2] << endl;
}
//***************************
//WriteRadialDim
//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project
void CDxfWrite::WriteRadialDim(const double* centerPoint, const double* textMidPoint,
const double* arcPoint,
const char* dimText,
const char* layer_name)
{
(*m_ofs) << 0 << endl;
(*m_ofs) << "DIMENSION" << endl;
(*m_ofs) << 8 << endl;
(*m_ofs) << layer_name << endl;
(*m_ofs) << 100 << endl;
(*m_ofs) << "AcDbEntity" << endl;
(*m_ofs) << 100 << endl;
(*m_ofs) << "AcDbDimension" << endl;
(*m_ofs) << 2 << endl;
(*m_ofs) << "*D1" << endl; // blockName *D1 ??
(*m_ofs) << 10 << endl; // arc center point
(*m_ofs) << centerPoint[0] << endl;
(*m_ofs) << 20 << endl;
(*m_ofs) << centerPoint[1] << endl;
(*m_ofs) << 30 << endl;
(*m_ofs) << centerPoint[2] << endl;
(*m_ofs) << 11 << endl; //text mid point
(*m_ofs) << textMidPoint[0] << endl;
(*m_ofs) << 21 << endl;
(*m_ofs) << textMidPoint[1] << endl;
(*m_ofs) << 31 << endl;
(*m_ofs) << textMidPoint[2] << endl;
(*m_ofs) << 70 << endl;
(*m_ofs) << 4 << endl; // dimType 4 = Radius
(*m_ofs) << 71 << endl;
(*m_ofs) << 1 << endl; // attachPoint 5 = middle center
(*m_ofs) << 1 << endl;
(*m_ofs) << dimText << endl;
(*m_ofs) << 3 << endl;
(*m_ofs) << "STANDARD" << endl; //style
//radial dims
(*m_ofs) << 100 << endl;
(*m_ofs) << "AcDbRadialDimension" << endl;
(*m_ofs) << 15 << endl;
(*m_ofs) << arcPoint[0] << endl;
(*m_ofs) << 25 << endl;
(*m_ofs) << arcPoint[1] << endl;
(*m_ofs) << 35 << endl;
(*m_ofs) << arcPoint[2] << endl;
(*m_ofs) << 40 << endl; // leader length????
(*m_ofs) << 0 << endl;
}
CDxfRead::CDxfRead(const char* filepath)