diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/helper/geom-pointwise.cpp | 32 | ||||
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.cpp | 14 |
2 files changed, 38 insertions, 8 deletions
diff --git a/src/helper/geom-pointwise.cpp b/src/helper/geom-pointwise.cpp index 1fbed612c..a4e5530a4 100644 --- a/src/helper/geom-pointwise.cpp +++ b/src/helper/geom-pointwise.cpp @@ -77,18 +77,32 @@ void Pointwise::recalculatePwD2(PwD2SBasis const &A, Satellite const &S) for (size_t j = 0; j < old_pathv.size(); j++) { if ( new_pathv[i] == old_pathv[j]){ satellites.push_back(_satellites[j]); - old_pathv.erase(old_pathv.begin() + j); - new_pathv.erase(new_pathv.begin() + i); +// old_pathv.erase(old_pathv.begin() + j); +// new_pathv.erase(new_pathv.begin() + i); + + std::cout << "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmatch\n"; + _pathvector.push_back(new_pathv[i]); match = true; break; } } - //Removed subpath update for this version of fillet chamfer - std::vector<Satellite> subpath_satellites; - for (size_t k = 0; k < new_pathv[i].size_closed(); k++) { - subpath_satellites.push_back(S); + if (!match && new_size > old_size) { + //Removed subpath update for this version of fillet chamfer + std::vector<Satellite> subpath_satellites; + for (size_t k = 0; k < new_pathv[i].size_closed(); k++) { + subpath_satellites.push_back(S); + } + _pathvector.push_back(new_pathv[i]); + satellites.push_back(subpath_satellites); + } else if(!match) { + //Removed subpath update for this version of fillet chamfer + std::vector<Satellite> subpath_satellites; + for (size_t k = 0; k < new_pathv[i].size_closed(); k++) { + subpath_satellites.push_back(S); + } + _pathvector.push_back(new_pathv[i]); + satellites.push_back(subpath_satellites); } - satellites.push_back(subpath_satellites); } // if (new_size == old_size) { @@ -128,8 +142,10 @@ void Pointwise::recalculatePwD2(PwD2SBasis const &A, Satellite const &S) // satellites.push_back(subpath_satellites); // } // } - setPwd2(A); + Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2 = remove_short_cuts(paths_to_pw(_pathvector), 0.01);; + setPwd2(pwd2); setSatellites(satellites); + std::cout << _satellites.size() << "ssssssssssssssssssssss\n"; } //Remove subpath update for this version of fillet chamfer //void Pointwise::insertDegenerateSatellites(PwD2SBasis const &A, Geom::PathVector const &B, Satellite const &S) diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp index 7379efcf6..6ecffb388 100644 --- a/src/live_effects/lpe-fillet-chamfer.cpp +++ b/src/live_effects/lpe-fillet-chamfer.cpp @@ -360,6 +360,7 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) if(!_hp.empty()) { _hp.clear(); } + std::cout << "1\n"; SPLPEItem *splpeitem = const_cast<SPLPEItem *>(lpeItem); SPShape *shape = dynamic_cast<SPShape *>(splpeitem); if (shape) { @@ -368,6 +369,7 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) if (path) { c = path->get_original_curve(); } + std::cout << "2\n"; //fillet chamfer specific calls satellites_param.setUseDistance(use_knot_distance); //mandatory call @@ -409,9 +411,11 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) satellites[i][j].hidden = hide_knots; } } + std::cout << "3\n"; //if are diferent sizes call to poinwise recalculate //TODO: Update the satellite data in paths modified, Goal 0.93 if (pointwise && number_nodes != pointwise->getTotalSatellites()) { + std::cout << "4\n"; pointwise->setSatellites(satellites); Satellite satellite(satellites[0][0].satellite_type); satellite.setIsTime(satellites[0][0].is_time); @@ -419,12 +423,14 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) pointwise->recalculateForNewPwd2(pwd2, pathv, satellite); satellites_param.setPointwise(pointwise); } else { + std::cout << "5\n"; pointwise = new Pointwise(); pointwise->setPwd2(pwd2); pointwise->setSatellites(satellites); satellites_param.setPointwise(pointwise); refreshKnots(); } + std::cout << "6\n"; } else { g_warning("LPE Fillet can only be applied to shapes (not groups)."); } @@ -443,8 +449,10 @@ LPEFilletChamfer::doEffect_path(Geom::PathVector const &path_in) Geom::PathVector path_out; size_t path = 0; const double K = (4.0 / 3.0) * (sqrt(2.0) - 1.0); + std::cout << "7\n"; Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers(path_in); for (Geom::PathVector::const_iterator path_it = pathv.begin(); path_it != pathv.end(); ++path_it) { + std::cout << "8\n"; if (path_it->empty()) { continue; } @@ -467,6 +475,7 @@ LPEFilletChamfer::doEffect_path(Geom::PathVector const &path_in) } else if (curve != pathv[path].size() -1 || !pathv[path].closed()) { curve_next_index = curve + 1; } + std::cout << *curve_next_index << "\n"; if (curve == pathv[path].size() -1 && !pathv[path].closed()) { //the path is open and we are at end of path if (time0 != 1) { //Previous satellite not at 100% amount Geom::Curve *last_curve = curve_it1->portion(time0, 1); @@ -479,6 +488,11 @@ LPEFilletChamfer::doEffect_path(Geom::PathVector const &path_in) if (curve_next_index && *curve_next_index != pathv[path].size() - 1 && pathv[path][*curve_next_index].isDegenerate()) { curve_next_index = *curve_next_index + 1; } + std::cout << *curve_next_index << "\n"; + std::cout << pathv[path].size() << "pathv[path].size()\n"; + std::cout << path << "\n"; + std::cout << satellites.size() << "\n"; + std::cout << satellites[path].size() << "\n"; Geom::Curve const &curve_it2 = pathv[path][*curve_next_index]; if ((*curve_it1).isDegenerate()) { curve++; |
