Draft: workaround for exporting DXF with R14+ templates - fixes 2177
- Adapted Drawing algos to export R14+ compatible DXF code - Added option in DXF prefs to disable groups (not supported in R14+ templates)
This commit is contained in:
@@ -495,6 +495,10 @@ void DXFOutput::printCircle(const BRepAdaptor_Curve& c, std::ostream& out)
|
||||
out << "CIRCLE" << endl;
|
||||
out << 8 << endl; // Group code for layer name
|
||||
out << "sheet_layer" << endl; // Layer number
|
||||
out << "100" << endl;
|
||||
out << "AcDbEntity" << endl;
|
||||
out << "100" << endl;
|
||||
out << "AcDbCircle" << endl;
|
||||
out << 10 << endl; // Centre X
|
||||
out << p.X() << endl; // X in WCS coordinates
|
||||
out << 20 << endl;
|
||||
@@ -534,6 +538,10 @@ void DXFOutput::printCircle(const BRepAdaptor_Curve& c, std::ostream& out)
|
||||
out << "ARC" << endl;
|
||||
out << 8 << endl; // Group code for layer name
|
||||
out << "sheet_layer" << endl; // Layer number
|
||||
out << "100" << endl;
|
||||
out << "AcDbEntity" << endl;
|
||||
out << "100" << endl;
|
||||
out << "AcDbCircle" << endl;
|
||||
out << 10 << endl; // Centre X
|
||||
out << p.X() << endl; // X in WCS coordinates
|
||||
out << 20 << endl;
|
||||
@@ -542,6 +550,8 @@ void DXFOutput::printCircle(const BRepAdaptor_Curve& c, std::ostream& out)
|
||||
out << 0 << endl; // Z in WCS coordinates
|
||||
out << 40 << endl; //
|
||||
out << r << endl; // Radius
|
||||
out << "100" << endl;
|
||||
out << "AcDbArc" << endl;
|
||||
out << 50 << endl;
|
||||
out << start_angle << endl; // Start angle
|
||||
out << 51 << endl;
|
||||
@@ -601,6 +611,10 @@ void DXFOutput::printEllipse(const BRepAdaptor_Curve& c, int id, std::ostream& o
|
||||
out << "ELLIPSE" << endl;
|
||||
out << 8 << endl; // Group code for layer name
|
||||
out << "sheet_layer" << endl; // Layer number
|
||||
out << "100" << endl;
|
||||
out << "AcDbEntity" << endl;
|
||||
out << "100" << endl;
|
||||
out << "AcDbEllipse" << endl;
|
||||
out << 10 << endl; // Centre X
|
||||
out << p.X() << endl; // X in WCS coordinates
|
||||
out << 20 << endl;
|
||||
@@ -657,17 +671,14 @@ void DXFOutput::printBSpline(const BRepAdaptor_Curve& c, int id, std::ostream& o
|
||||
|
||||
|
||||
str << 0 << endl
|
||||
<< "SECTION" << endl
|
||||
<< 2 << endl
|
||||
<< "ENTITIES" << endl
|
||||
<< 0 << endl
|
||||
<< "SPLINE" << endl;
|
||||
//<< 8 << endl
|
||||
//<< 0 << endl
|
||||
//<< 66 << endl
|
||||
//<< 1 << endl
|
||||
//<< 0 << endl;
|
||||
str << 70 << endl
|
||||
<< "SPLINE" << endl
|
||||
<< 8 << endl // Group code for layer name
|
||||
<< "sheet_layer" << endl // Layer name
|
||||
<< "100" << endl
|
||||
<< "AcDbEntity" << endl
|
||||
<< "100" << endl
|
||||
<< "AcDbSpline" << endl
|
||||
<< 70 << endl
|
||||
<< spline->IsRational()*4 << endl //flags
|
||||
<< 71 << endl << spline->Degree() << endl
|
||||
<< 72 << endl << knotsequence.Length() << endl
|
||||
@@ -711,6 +722,10 @@ void DXFOutput::printGeneric(const BRepAdaptor_Curve& c, int id, std::ostream& o
|
||||
out << "LINE" << endl;
|
||||
out << "8" << endl; // Group code for layer name
|
||||
out << "sheet_layer" << endl; // Layer name
|
||||
out << "100" << endl;
|
||||
out << "AcDbEntity" << endl;
|
||||
out << "100" << endl;
|
||||
out << "AcDbLine" << endl;
|
||||
out << "10" << endl; // Start point of line
|
||||
out << PS.X() << endl; // X in WCS coordinates
|
||||
out << "20" << endl;
|
||||
|
||||
Reference in New Issue
Block a user