diff --git a/CHANGELOG.md b/CHANGELOG.md index 466ad25..f0e7671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Bug fixes: * Do not crash when applying a symmetry constraint to two points. * Fix TTF font metrics again (properly this time). * Fix the "draw back faces in red" option. + * Fix export of wireframe as 3D DXF. * Various minor crashes. 2.2 diff --git a/src/exportvector.cpp b/src/exportvector.cpp index 8732433..40e9fb1 100644 --- a/src/exportvector.cpp +++ b/src/exportvector.cpp @@ -121,7 +121,7 @@ public: } } - DRW_LWPolyline polyline; + DRW_Polyline polyline; auto startFunc = [&](PolylineBuilder::Vertex *start, PolylineBuilder::Vertex *next, @@ -129,16 +129,19 @@ public: hStyle hs = { e->kind }; polyline = {}; assignEntityDefaults(&polyline, hs); - polyline.vertlist.push_back(new DRW_Vertex2D(start->pos.x, start->pos.y, 0.0)); - polyline.vertlist.push_back(new DRW_Vertex2D(next->pos.x, next->pos.y, 0.0)); + polyline.vertlist.push_back( + new DRW_Vertex(start->pos.x, start->pos.y, start->pos.z, 0.0)); + polyline.vertlist.push_back( + new DRW_Vertex(next->pos.x, next->pos.y, next->pos.z, 0.0)); }; auto nextFunc = [&](PolylineBuilder::Vertex *next, PolylineBuilder::Edge *e) { - polyline.vertlist.push_back(new DRW_Vertex2D(next->pos.x, next->pos.y, 0.0)); + polyline.vertlist.push_back( + new DRW_Vertex(next->pos.x, next->pos.y, next->pos.z, 0.0)); }; auto endFunc = [&]() { - dxf->writeLWPolyline(&polyline); + dxf->writePolyline(&polyline); }; auto aloneFunc = [&](PolylineBuilder::Edge *e) { @@ -357,16 +360,14 @@ public: List lv = {}; sb->MakePwlInto(&lv, SS.ExportChordTolMm()); hStyle hs = { (uint32_t)sb->auxA }; - DRW_LWPolyline polyline; + DRW_Polyline polyline; assignEntityDefaults(&polyline, hs); for(int i = 0; i < lv.n; i++) { Vector *v = &lv.elem[i]; - DRW_Vertex2D *vertex = new DRW_Vertex2D(); - vertex->x = v->x; - vertex->y = v->y; + DRW_Vertex *vertex = new DRW_Vertex(v->x, v->y, v->z, 0.0); polyline.vertlist.push_back(vertex); } - dxf->writeLWPolyline(&polyline); + dxf->writePolyline(&polyline); lv.Clear(); } @@ -403,7 +404,8 @@ public: spline.ncontrol = sb->deg + 1; makeKnotsFor(&spline); for(int i = 0; i <= sb->deg; i++) { - spline.controllist.push_back(new DRW_Coord(sb->ctrl[i].x, sb->ctrl[i].y, 0.0)); + spline.controllist.push_back( + new DRW_Coord(sb->ctrl[i].x, sb->ctrl[i].y, sb->ctrl[i].z)); if(isRational) spline.weightlist.push_back(sb->weight[i]); } dxf->writeSpline(&spline);