diff options
Diffstat (limited to 'primitives.cc')
-rw-r--r-- | primitives.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/primitives.cc b/primitives.cc index 7e6a9e1..95bd3b8 100644 --- a/primitives.cc +++ b/primitives.cc @@ -481,11 +481,17 @@ sphere_next_r2: dd.paths.append(DxfData::Path()); for (int j=0; j<paths.vec[i]->vec.size(); j++) { int idx = paths.vec[i]->vec[j]->num; - DxfData::Point *p = &dd.points[idx]; - dd.paths.last().points.append(p); + if (idx < dd.points.size()) { + DxfData::Point *p = &dd.points[idx]; + dd.paths.last().points.append(p); + } + } + if (dd.paths.last().points.isEmpty()) { + dd.paths.removeLast(); + } else { + dd.paths.last().points.append(dd.paths.last().points.first()); + dd.paths.last().is_closed = true; } - dd.paths.last().points.append(dd.paths.last().points.first()); - dd.paths.last().is_closed = true; } } |