You can subscribe to this list here.
2007 |
Jan
(2) |
Feb
(3) |
Mar
(4) |
Apr
(27) |
May
(5) |
Jun
|
Jul
(14) |
Aug
|
Sep
(1) |
Oct
(4) |
Nov
(19) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(8) |
Feb
(1) |
Mar
(4) |
Apr
(28) |
May
(77) |
Jun
(79) |
Jul
(112) |
Aug
(36) |
Sep
(33) |
Oct
(19) |
Nov
(9) |
Dec
(11) |
2009 |
Jan
|
Feb
|
Mar
(12) |
Apr
(11) |
May
(13) |
Jun
(23) |
Jul
(5) |
Aug
(25) |
Sep
(9) |
Oct
(22) |
Nov
(16) |
Dec
(5) |
2010 |
Jan
(23) |
Feb
(12) |
Mar
(5) |
Apr
(29) |
May
(4) |
Jun
(9) |
Jul
(22) |
Aug
(2) |
Sep
(10) |
Oct
(6) |
Nov
(8) |
Dec
|
2011 |
Jan
(2) |
Feb
(44) |
Mar
|
Apr
(4) |
May
|
Jun
(9) |
Jul
(5) |
Aug
(4) |
Sep
(7) |
Oct
|
Nov
|
Dec
(10) |
2012 |
Jan
(16) |
Feb
(8) |
Mar
(9) |
Apr
(5) |
May
(3) |
Jun
(3) |
Jul
(6) |
Aug
(10) |
Sep
(48) |
Oct
(6) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(19) |
Sep
(3) |
Oct
(5) |
Nov
(35) |
Dec
(3) |
2014 |
Jan
|
Feb
(3) |
Mar
(4) |
Apr
(12) |
May
(6) |
Jun
(16) |
Jul
(25) |
Aug
(16) |
Sep
(3) |
Oct
|
Nov
(7) |
Dec
|
2015 |
Jan
(3) |
Feb
(1) |
Mar
(21) |
Apr
(10) |
May
(6) |
Jun
(3) |
Jul
(2) |
Aug
(4) |
Sep
(4) |
Oct
|
Nov
(2) |
Dec
|
2016 |
Jan
|
Feb
(11) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Krzysztof K. <twe...@gm...> - 2011-12-30 05:25:56
|
By the way, all people who work on a trunk checkout of lib2geom might need to use bzr pull --overwrite or get a fresh checkout. I'm not sure how a bound branch works in this case. If you opt for a fresh checkout, you can carry over your uncommitted changes using bzr merge --uncommitted or a diff Regards, Krzysztof |
From: Krzysztof K. <twe...@gm...> - 2011-12-30 05:18:34
|
It is fixed now. I've set the append-only flag to prevent this from recurring. The commands I used, in case somebody does this again somewhere: 1. Get the revision just before the mangling merge, using its ID. You can use 'bzr visualise' or 'bzr log --show-ids' to find it. e.g.: bzr branch lp:lib2geom -r goe...@zo...-20111027194254-wudfjcmoze5hdzsr 2. Merge the correct way bzr merge lp:lib2geom 3. Commit. You can give credit to the author of the changes that obfuscated the revision history using the --author option bzr commit --author "Master Brokeder <bro...@pr...> 4. Replace trunk with cleaned-up branch ~src/lib2geom$ bzr push --overwrite lp:lib2geom 5. You can now convert the branch you worked with into a trunk checkout bzr bind :push Regards, Krzysztof |
From: Nathan H. <nj...@nj...> - 2011-12-29 22:21:00
|
On Thu, Dec 29, 2011 at 09:28:38PM +0100, Johan Engelen wrote: > Hi all, > > A recent commit to lib2geom compressed almost all commits since februari > into one. Very annoying, although I know you can find out what those > individual commits were with some more clicking. I'm truly sorry. I was baffled as to why my commit was back so far (I've been watching krys' steady commit and got jealous :) yet it seemed to have all the new code features. > These mistakes don't surprise me; I am scared of the bzr tool that does > things I do not understand. Me too. I complained to martin about this last time I saw him. I'm tempted to switch to git if possible, because it is equally hairy, but for me at least I've used it a lot more and generally know how to fix things hen they get broken. We do not appear to have such expertise for bzr over the whole inkscape community. I've not enjoyed using bzr and personally feel it has been a backward step for development compared to svn(!). > So to make people aware of the dangers of bzr, I'd like to give advice > to simple folks like me: > > ************************************* > I strongly advise you to not work in branches and merge it into trunk, > and stay away from any other so-called convenient advanced functionality > of bzr, like push-pull-whatever. Simply use it in 'svn mode'. > http://wiki.inkscape.org/wiki/index.php/Working_with_Bazaar#Using_a_centralized_.28SVN-like.29_workflow > ************************************* > > If you have fully understood how bzr works, perhaps you can try to use > the extra functionality. In that case, learn how to foul up the history > (like rev2000 in lib2geom) so you don't type in such commands. Oops? njh > > Thank you very very very much, > Johan > > (PS. no hard feelings to the committer of course! I blame the tool that > allows these things to happen) > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Lib2geom-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/lib2geom-devel |
From: Nathan H. <nj...@nj...> - 2011-12-29 22:13:03
|
On Thu, Dec 29, 2011 at 09:16:49PM +0100, Johan Engelen wrote: > Hi Nathan, > Seems you have forgotten to commit "solve-bezier-convex-hull.cpp"! I don't think it's actually used, but I've commited it. It was an implementation of the left bounded convex hull algorithm (which is claimed to be more robust with multiple roots, but I did not find this to be true, at least without using special fp rounding modes). I also added the far more important testing.h file which would allow you to build the newly added tests. I'm working on complete coverage with this testing stuff, but it's slow going given I have to modify the code on a machine in a different city over ssh. njh > :) > Ciao, > Johan > > > On 19-12-2011 22:58, Johan Engelen wrote: > >On 23-9-2011 22:59, Nathan Hurst wrote: > >>On Fri, Sep 23, 2011 at 09:17:06PM +0200, Diederik van Lierop wrote: > >>>Thanks Nathan for your help, that is much appreciated. > >>> > >>>... and of course it's always good to hear that it isn't something > >>>trivial ;-) > >> > >>roots is definitely misbehaving, I improved its behaviour dramatically > >>by deflating out roots at 0 when they are detected. Now to generalise > >>this approach to all roots. That is not to say that there aren't > >>other edge cases in things like nearest point. > > > >Nice that you fixed some issues in trunk Nathan! > >Is it safe for me to update Inkscape's copy? > > > >Thanks, > > Johan > > > >------------------------------------------------------------------------------ > >Write once. Port to many. > >Get the SDK and tools to simplify cross-platform app development. Create > >new or port existing apps to sell to consumers worldwide. Explore the > >Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join > >http://p.sf.net/sfu/intel-appdev > >_______________________________________________ > >Lib2geom-devel mailing list > >Lib...@li... > >https://lists.sourceforge.net/lists/listinfo/lib2geom-devel > > |
From: Johan E. <jbc...@sw...> - 2011-12-29 20:28:44
|
Hi all, A recent commit to lib2geom compressed almost all commits since februari into one. Very annoying, although I know you can find out what those individual commits were with some more clicking. These mistakes don't surprise me; I am scared of the bzr tool that does things I do not understand. So to make people aware of the dangers of bzr, I'd like to give advice to simple folks like me: ************************************* I strongly advise you to not work in branches and merge it into trunk, and stay away from any other so-called convenient advanced functionality of bzr, like push-pull-whatever. Simply use it in 'svn mode'. http://wiki.inkscape.org/wiki/index.php/Working_with_Bazaar#Using_a_centralized_.28SVN-like.29_workflow ************************************* If you have fully understood how bzr works, perhaps you can try to use the extra functionality. In that case, learn how to foul up the history (like rev2000 in lib2geom) so you don't type in such commands. Thank you very very very much, Johan (PS. no hard feelings to the committer of course! I blame the tool that allows these things to happen) |
From: Johan E. <jbc...@sw...> - 2011-12-29 20:16:55
|
Hi Nathan, Seems you have forgotten to commit "solve-bezier-convex-hull.cpp"! :) Ciao, Johan On 19-12-2011 22:58, Johan Engelen wrote: > On 23-9-2011 22:59, Nathan Hurst wrote: >> On Fri, Sep 23, 2011 at 09:17:06PM +0200, Diederik van Lierop wrote: >>> Thanks Nathan for your help, that is much appreciated. >>> >>> ... and of course it's always good to hear that it isn't something >>> trivial ;-) >> >> roots is definitely misbehaving, I improved its behaviour dramatically >> by deflating out roots at 0 when they are detected. Now to generalise >> this approach to all roots. That is not to say that there aren't >> other edge cases in things like nearest point. > > Nice that you fixed some issues in trunk Nathan! > Is it safe for me to update Inkscape's copy? > > Thanks, > Johan > > ------------------------------------------------------------------------------ > Write once. Port to many. > Get the SDK and tools to simplify cross-platform app development. Create > new or port existing apps to sell to consumers worldwide. Explore the > Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join > http://p.sf.net/sfu/intel-appdev > _______________________________________________ > Lib2geom-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/lib2geom-devel > |
From: Johan E. <jbc...@sw...> - 2011-12-19 21:58:20
|
On 23-9-2011 22:59, Nathan Hurst wrote: > On Fri, Sep 23, 2011 at 09:17:06PM +0200, Diederik van Lierop wrote: >> Thanks Nathan for your help, that is much appreciated. >> >> ... and of course it's always good to hear that it isn't something >> trivial ;-) > > roots is definitely misbehaving, I improved its behaviour dramatically > by deflating out roots at 0 when they are detected. Now to generalise > this approach to all roots. That is not to say that there aren't > other edge cases in things like nearest point. Nice that you fixed some issues in trunk Nathan! Is it safe for me to update Inkscape's copy? Thanks, Johan |
From: Nathan H. <nj...@nj...> - 2011-09-23 20:59:06
|
On Fri, Sep 23, 2011 at 09:17:06PM +0200, Diederik van Lierop wrote: > Thanks Nathan for your help, that is much appreciated. > > ... and of course it's always good to hear that it isn't something > trivial ;-) roots is definitely misbehaving, I improved its behaviour dramatically by deflating out roots at 0 when they are detected. Now to generalise this approach to all roots. That is not to say that there aren't other edge cases in things like nearest point. njh |
From: Diederik v. L. <ma...@di...> - 2011-09-23 19:17:24
|
Thanks Nathan for your help, that is much appreciated. ... and of course it's always good to hear that it isn't something trivial ;-) Diederik |
From: Nathan H. <nj...@nj...> - 2011-09-23 19:05:56
|
Hi Diederik, I spent some time last night isolating the bug. I haven't succeeded, but I did find some interesting breakage: It is definitely wrong. I've looked at the example svgd using toys/point-curve-nearest-point (you can pass an svgd file as a parameter and using the 6 option.) What I've noticed is that if the path is < 0 in the y axis then the misbehaviour you've noticed happens, if it lies wholely above y = 0 then it behaves correctly. The X position seems unconnected. > Let me explain: I'm using nearestPoint() to find the closest > point > on a path segment, and snap to it. Now for some segments this > only > returns the desired time t for about half of the path, whereas > for > the other part it simply returns t = 0. <br> I'm seeing it skip whole curves, it is coincidence that the nearest curve point is at the start point. I have a strong suspicion that the problem is in the Path::nearestPoint, rather than the curve nearestPoint code. I can't reproduce this behaviour in single curves^H^H^H^ Actually, I can.... njh On Fri, Sep 23, 2011 at 08:49:46PM +0200, Diederik van Lierop wrote: > Hi all, > > This is more illustrative: > http://www.diedenrezi.nl/SingleSegmentPath.webm. Watch the green > diamond, which indicates what 2geom believes to be the closest > point. > > Now the problem is demonstrated using a path with only a single > segment. I've also updated my patch to eliminate the trailing tail > of the snap indicator, and have attached this very basic SVG file. > > Thanks, > > Diederik > === modified file 'src/2geom/bezier-curve.cpp' > --- src/2geom/bezier-curve.cpp 2011-07-25 01:06:47 +0000 > +++ src/2geom/bezier-curve.cpp 2011-09-21 21:10:45 +0000 > @@ -166,6 +166,7 @@ > template<> > Coord BezierCurveN<1>::nearestPoint(Point const& p, Coord from, Coord to) const > { > + std::cout << "(entering nearestPoint in bezier-curve.cpp, line 169)" << std::endl; > if ( from > to ) std::swap(from, to); > Point ip = pointAt(from); > Point fp = pointAt(to); > @@ -173,9 +174,18 @@ > Coord l2v = L2sq(v); > if (l2v == 0) return 0; > Coord t = dot( p - ip, v ) / l2v; > - if ( t <= 0 ) return from; > - else if ( t >= 1 ) return to; > - else return from + t*(to-from); > + if ( t <= 0 ) { > + std::cout << " zero nr. 0 | t -> " << from << std::endl; > + return from; > + } > + else if ( t >= 1 ) { > + std::cout << " zero nr. 0 | t -> " << to << std::endl; > + return to; > + } > + else { > + std::cout << " zero nr. 0 | t -> " << from + t*(to-from) << std::endl; > + return from + t*(to-from); > + } > } > > > > === modified file 'src/2geom/nearest-point.cpp' > --- src/2geom/nearest-point.cpp 2008-11-21 05:24:08 +0000 > +++ src/2geom/nearest-point.cpp 2011-09-21 19:42:11 +0000 > @@ -54,6 +54,7 @@ > D2<SBasis> const& dc, > double from, double to ) > { > + std::cout << "(entering nearest_point in nearest-point.cpp, line 57)" << std::endl; > if ( from > to ) std::swap(from, to); > if ( from < 0 || to > 1 ) > { > @@ -66,6 +67,9 @@ > double closest = from; > double min_dist_sq = L2sq(c(from) - p); > double distsq; > + if (zeros.size() == 0) { > + std::cout << " No zeroes found; how can there possibly be NO nearest points for any segment?" << std::endl; > + } > for ( unsigned int i = 0; i < zeros.size(); ++i ) > { > distsq = L2sq(c(zeros[i]) - p); > @@ -74,9 +78,12 @@ > closest = zeros[i]; > min_dist_sq = distsq; > } > + std::cout << " zero nr. " << i << " | t -> " << zeros[i] << std::endl; > } > if ( min_dist_sq > L2sq( c(to) - p ) ) > closest = to; > + > + std::cout << "All zeros have been examined; closest t = " << closest; > return closest; > > } > > === modified file 'src/2geom/nearest-point.h' > --- src/2geom/nearest-point.h 2008-10-28 04:45:31 +0000 > +++ src/2geom/nearest-point.h 2011-09-21 19:42:11 +0000 > @@ -77,7 +77,7 @@ > D2<SBasis> const& c, > double from = 0, double to = 1 ) > { > - return nearest_point(p, c, Geom::derivative(c), from, to); > + return nearest_point(p, c, Geom::derivative(c), from, to); > } > > /* > @@ -110,7 +110,7 @@ > inline > double nearest_point( Point const& p, Piecewise< D2<SBasis> > const& c ) > { > - return nearest_point(p, c, c.cuts[0], c.cuts[c.size()]); > + return nearest_point(p, c, c.cuts[0], c.cuts[c.size()]); > } > > > > === modified file 'src/2geom/path.cpp' > --- src/2geom/path.cpp 2011-02-02 21:24:36 +0000 > +++ src/2geom/path.cpp 2011-09-21 18:30:05 +0000 > @@ -205,11 +205,18 @@ > { > //return a single nearest point for each curve in this path > std::vector<double> np; > + int count = 0; > + std::cout << "Mouse pointer is at " << _point << std::endl; > for (const_iterator it = begin() ; it != end_default() ; ++it) > //for (std::vector<Path>::const_iterator it = _path.begin(); it != _path.end(), ++it){ > { > - np.push_back(it->nearestPoint(_point)); > + std::cout << "***** Start examining segment nr." << count << " *****" << std::endl; > + double dummy = it->nearestPoint(_point); > + std::cout << " | point = " << it->pointAt(dummy) << std::endl; > + np.push_back(dummy); > + count++; > } > + std::cout << "************** Done with this path*****************" << std::endl; > return np; > } > > > === modified file 'src/2geom/path.h' > --- src/2geom/path.h 2011-06-23 16:38:51 +0000 > +++ src/2geom/path.h 2011-09-21 19:42:11 +0000 > @@ -681,7 +681,7 @@ > inline > Coord nearest_point(Point const& p, Path const& c) > { > - return c.nearestPoint(p); > + return c.nearestPoint(p); > } > > } // end namespace Geom > > === modified file 'src/display/snap-indicator.cpp' > --- src/display/snap-indicator.cpp 2011-09-18 17:09:29 +0000 > +++ src/display/snap-indicator.cpp 2011-09-23 18:32:57 +0000 > @@ -302,7 +302,7 @@ > void > SnapIndicator::set_new_snapsource(Inkscape::SnapCandidatePoint const &p) > { > - remove_snapsource(); > + //remove_snapsource(); > > g_assert(_desktop != NULL); > > @@ -326,6 +326,25 @@ > } > > void > +SnapIndicator::set_new_debugging_point(Geom::Point const &p) > +{ > + g_assert(_desktop != NULL); > + SPCanvasItem * canvasitem = sp_canvas_item_new( sp_desktop_tempgroup (_desktop), > + SP_TYPE_CTRL, > + "anchor", GTK_ANCHOR_CENTER, > + "size", 10.0, > + "fill_color", 0x00ff00ff, > + "stroked", FALSE, > + "mode", SP_KNOT_MODE_XOR, > + "shape", SP_KNOT_SHAPE_DIAMOND, > + NULL ); > + > + SP_CTRL(canvasitem)->moveto(p); > + _debugging_points.push_back(_desktop->add_temporary_canvasitem(canvasitem, 5000)); > + > +} > + > +void > SnapIndicator::remove_snapsource() > { > if (_snapsource) { > @@ -334,6 +353,16 @@ > } > } > > +void > +SnapIndicator::remove_debugging_points() > +{ > + for (std::list<TemporaryItem *>::const_iterator i = _debugging_points.begin(); i != _debugging_points.end(); i++) { > + _desktop->remove_temporary_canvasitem(*i); > + } > + _debugging_points.clear(); > +} > + > + > } //namespace Display > } /* namespace Inkscape */ > > > === modified file 'src/display/snap-indicator.h' > --- src/display/snap-indicator.h 2010-12-23 08:10:28 +0000 > +++ src/display/snap-indicator.h 2011-09-23 18:15:57 +0000 > @@ -33,11 +33,15 @@ > void set_new_snapsource(Inkscape::SnapCandidatePoint const &p); > void remove_snapsource(); > > + void set_new_debugging_point(Geom::Point const &p); > + void remove_debugging_points(); > + > protected: > TemporaryItem *_snaptarget; > TemporaryItem *_snaptarget_tooltip; > TemporaryItem *_snaptarget_bbox; > TemporaryItem *_snapsource; > + std::list<TemporaryItem *> _debugging_points; > bool _snaptarget_is_presnap; > SPDesktop *_desktop; > > > === modified file 'src/object-snapper.cpp' > --- src/object-snapper.cpp 2011-09-17 12:08:49 +0000 > +++ src/object-snapper.cpp 2011-09-23 18:23:54 +0000 > @@ -506,6 +506,7 @@ > > bool strict_snapping = _snapmanager->snapprefs.getStrictSnapping(); > > + _snapmanager->getDesktop()->snapindicator->remove_debugging_points(); > for (std::vector<SnapCandidatePath >::const_iterator it_p = _paths_to_snap_to->begin(); it_p != _paths_to_snap_to->end(); it_p++) { > if (_allowSourceToSnapToTarget(p.getSourceType(), (*it_p).target_type, strict_snapping)) { > bool const being_edited = node_tool_active && (*it_p).currently_being_edited; > @@ -516,12 +517,14 @@ > // n curves will return n time values with 0 <= t <= 1 > std::vector<double> anp = (*it_pv).nearestPointPerCurve(p_doc); > > + std::cout << "#nearest points = " << anp.size() << " | p = " << p.getPoint() << std::endl; > std::vector<double>::const_iterator np = anp.begin(); > unsigned int index = 0; > for (; np != anp.end(); np++, index++) { > Geom::Curve const *curve = &((*it_pv).at_index(index)); > Geom::Point const sp_doc = curve->pointAt(*np); > - > + //_snapmanager->getDesktop()->snapindicator->set_new_snapsource(Inkscape::SnapCandidatePoint(sp_doc*_snapmanager->getDesktop()->doc2dt(), SNAPSOURCE_UNDEFINED)); > + _snapmanager->getDesktop()->snapindicator->set_new_debugging_point(sp_doc*_snapmanager->getDesktop()->doc2dt()); > bool c1 = true; > bool c2 = true; > if (being_edited) { > @@ -547,6 +550,7 @@ > Geom::Point const sp_dt = _snapmanager->getDesktop()->doc2dt(sp_doc); > if (!being_edited || (c1 && c2)) { > Geom::Coord const dist = Geom::distance(sp_doc, p_doc); > + std::cout << " dist -> " << dist << std::endl; > if (dist < getSnapperTolerance()) { > isr.curves.push_back(SnappedCurve(sp_dt, num_path, index, dist, getSnapperTolerance(), getSnapperAlwaysSnap(), false, curve, p.getSourceType(), p.getSourceNum(), it_p->target_type, it_p->target_bbox)); > } > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2dcopy2 > _______________________________________________ > Lib2geom-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/lib2geom-devel |
From: Diederik v. L. <ma...@di...> - 2011-09-23 18:50:00
|
Hi all, This is more illustrative: http://www.diedenrezi.nl/SingleSegmentPath.webm. Watch the green diamond, which indicates what 2geom believes to be the closest point. Now the problem is demonstrated using a path with only a single segment. I've also updated my patch to eliminate the trailing tail of the snap indicator, and have attached this very basic SVG file. Thanks, Diederik |
From: Diederik v. L. <ma...@di...> - 2011-09-22 19:24:08
|
=== modified file 'src/2geom/bezier-curve.cpp' --- src/2geom/bezier-curve.cpp 2011-07-25 01:06:47 +0000 +++ src/2geom/bezier-curve.cpp 2011-09-21 21:10:45 +0000 @@ -166,6 +166,7 @@ template<> Coord BezierCurveN<1>::nearestPoint(Point const& p, Coord from, Coord to) const { + std::cout << "(entering nearestPoint in bezier-curve.cpp, line 169)" << std::endl; if ( from > to ) std::swap(from, to); Point ip = pointAt(from); Point fp = pointAt(to); @@ -173,9 +174,18 @@ Coord l2v = L2sq(v); if (l2v == 0) return 0; Coord t = dot( p - ip, v ) / l2v; - if ( t <= 0 ) return from; - else if ( t >= 1 ) return to; - else return from + t*(to-from); + if ( t <= 0 ) { + std::cout << " zero nr. 0 | t -> " << from << std::endl; + return from; + } + else if ( t >= 1 ) { + std::cout << " zero nr. 0 | t -> " << to << std::endl; + return to; + } + else { + std::cout << " zero nr. 0 | t -> " << from + t*(to-from) << std::endl; + return from + t*(to-from); + } } === modified file 'src/2geom/nearest-point.cpp' --- src/2geom/nearest-point.cpp 2008-11-21 05:24:08 +0000 +++ src/2geom/nearest-point.cpp 2011-09-21 19:42:11 +0000 @@ -54,6 +54,7 @@ D2<SBasis> const& dc, double from, double to ) { + std::cout << "(entering nearest_point in nearest-point.cpp, line 57)" << std::endl; if ( from > to ) std::swap(from, to); if ( from < 0 || to > 1 ) { @@ -66,6 +67,9 @@ double closest = from; double min_dist_sq = L2sq(c(from) - p); double distsq; + if (zeros.size() == 0) { + std::cout << " No zeroes found; how can there possibly be NO nearest points for any segment?" << std::endl; + } for ( unsigned int i = 0; i < zeros.size(); ++i ) { distsq = L2sq(c(zeros[i]) - p); @@ -74,9 +78,12 @@ closest = zeros[i]; min_dist_sq = distsq; } + std::cout << " zero nr. " << i << " | t -> " << zeros[i] << std::endl; } if ( min_dist_sq > L2sq( c(to) - p ) ) closest = to; + + std::cout << "All zeros have been examined; closest t = " << closest; return closest; } === modified file 'src/2geom/nearest-point.h' --- src/2geom/nearest-point.h 2008-10-28 04:45:31 +0000 +++ src/2geom/nearest-point.h 2011-09-21 19:42:11 +0000 @@ -77,7 +77,7 @@ D2<SBasis> const& c, double from = 0, double to = 1 ) { - return nearest_point(p, c, Geom::derivative(c), from, to); + return nearest_point(p, c, Geom::derivative(c), from, to); } /* @@ -110,7 +110,7 @@ inline double nearest_point( Point const& p, Piecewise< D2<SBasis> > const& c ) { - return nearest_point(p, c, c.cuts[0], c.cuts[c.size()]); + return nearest_point(p, c, c.cuts[0], c.cuts[c.size()]); } === modified file 'src/2geom/path.cpp' --- src/2geom/path.cpp 2011-02-02 21:24:36 +0000 +++ src/2geom/path.cpp 2011-09-21 18:30:05 +0000 @@ -205,11 +205,18 @@ { //return a single nearest point for each curve in this path std::vector<double> np; + int count = 0; + std::cout << "Mouse pointer is at " << _point << std::endl; for (const_iterator it = begin() ; it != end_default() ; ++it) //for (std::vector<Path>::const_iterator it = _path.begin(); it != _path.end(), ++it){ { - np.push_back(it->nearestPoint(_point)); + std::cout << "***** Start examining segment nr." << count << " *****" << std::endl; + double dummy = it->nearestPoint(_point); + std::cout << " | point = " << it->pointAt(dummy) << std::endl; + np.push_back(dummy); + count++; } + std::cout << "************** Done with this path*****************" << std::endl; return np; } === modified file 'src/2geom/path.h' --- src/2geom/path.h 2011-06-23 16:38:51 +0000 +++ src/2geom/path.h 2011-09-21 19:42:11 +0000 @@ -681,7 +681,7 @@ inline Coord nearest_point(Point const& p, Path const& c) { - return c.nearestPoint(p); + return c.nearestPoint(p); } } // end namespace Geom === modified file 'src/display/snap-indicator.cpp' --- src/display/snap-indicator.cpp 2011-09-18 17:09:29 +0000 +++ src/display/snap-indicator.cpp 2011-09-19 20:23:59 +0000 @@ -302,7 +302,7 @@ void SnapIndicator::set_new_snapsource(Inkscape::SnapCandidatePoint const &p) { - remove_snapsource(); + //remove_snapsource(); g_assert(_desktop != NULL); === modified file 'src/object-snapper.cpp' --- src/object-snapper.cpp 2011-09-17 12:08:49 +0000 +++ src/object-snapper.cpp 2011-09-21 18:16:30 +0000 @@ -516,12 +516,13 @@ // n curves will return n time values with 0 <= t <= 1 std::vector<double> anp = (*it_pv).nearestPointPerCurve(p_doc); + std::cout << "#nearest points = " << anp.size() << " | p = " << p.getPoint() << std::endl; std::vector<double>::const_iterator np = anp.begin(); unsigned int index = 0; for (; np != anp.end(); np++, index++) { Geom::Curve const *curve = &((*it_pv).at_index(index)); Geom::Point const sp_doc = curve->pointAt(*np); - + _snapmanager->getDesktop()->snapindicator->set_new_snapsource(Inkscape::SnapCandidatePoint(sp_doc*_snapmanager->getDesktop()->doc2dt(), SNAPSOURCE_UNDEFINED)); bool c1 = true; bool c2 = true; if (being_edited) { @@ -547,6 +548,7 @@ Geom::Point const sp_dt = _snapmanager->getDesktop()->doc2dt(sp_doc); if (!being_edited || (c1 && c2)) { Geom::Coord const dist = Geom::distance(sp_doc, p_doc); + std::cout << " dist -> " << dist << std::endl; if (dist < getSnapperTolerance()) { isr.curves.push_back(SnappedCurve(sp_dt, num_path, index, dist, getSnapperTolerance(), getSnapperAlwaysSnap(), false, curve, p.getSourceType(), p.getSourceNum(), it_p->target_type, it_p->target_bbox)); } |
From: Diederik v. L. <ma...@di...> - 2011-09-06 20:48:43
|
Hi Nathan & Krzysztof, Thanks for the pointers. I will have stab at it one of these days. Diederik |
From: Krzysztof K. <twe...@gm...> - 2011-09-02 14:44:48
|
2011/8/30 Diederik van Lierop <ma...@di...>: > - Can't this be done without having to convert each path to sbasis > first? Converting will take CPU time It's hard to do anything nontrivial in Bezier basis. In fact converting to SBasis, doing the operation in SBasis and then converting back could be faster than doing the operation in Bezier directly. Regards, Krzysztof |
From: Nathan H. <nj...@nj...> - 2011-08-30 22:21:10
|
On Tue, Aug 30, 2011 at 09:00:46PM +0200, Diederik van Lierop wrote: > Hi all, > > Due to popular demand, I'm thinking of implementing tangential and > perpendicular snapping in Inkscape. Well, at least for the case where > the user draws a straight line or manipulates a guide. So I have a curve > I want to snap to, and some distant point P0. Now I need to find all > points P1, for which the line P0-P1 is either tangential or > perpendicular to the curve. > > I guess I could first convert the path to sbasis, and then call > find_tangents() (see the code snippet below, from sbasis-geometric.cpp). > But a few questions come to mind: > - Can't this be done without having to convert each path to sbasis > first? Converting will take CPU time No more than a matrix multiply. You need to convert it into a form with a suitable algebra. It could be done with bernstein basis (bezier curves) but we currently lack code to do that. > - Am I really the first one to need this functionality? find_tangets() > is not being used anywhere as far as I can tell. Are there other ways to > solve this? lib2geom is full of solutions looking for problems :) > - How do I implement perpendicular snapping? There's no method yet > called find_normals() Ok, there are a bunch of operations that are interesting: * given a direction D, find all points on the curve A that point in that direction: roots(dot(derivative(A), rot90(D))) * given a point P, find all points on the curve A whose tangent passes through P: find_tangents(P, A) * given a point P, find all points on the curve A whose normal passes through P, same as find tangents, but use the dot product: SBasis crs (dot(A - P, derivative(A))); crs = shift(crs*Linear(-1, 0)*Linear(-1, 0), -2); // We know that there is a double root at t=0 so we divide out t^2 // JFB points out that this is equivalent to (t-1)^2 followed by a divide by s^2 (shift) return roots(crs); * given a pair of curves, find the lines which are normal to both curves: collinear_normals * same, but for tangents (fillets): There is no code for this currently, but I'm sure it can be built from collinear_normals. * snap arcs to matching curvature: filet-minion (I particularly like the name of this one :) There are more snappy things, but I can't think of them right now. I'm going away for a few days (no internet!!!), but don't hestitate to ask for more help. njh |
From: Diederik v. L. <ma...@di...> - 2011-08-30 19:01:01
|
Hi all, Due to popular demand, I'm thinking of implementing tangential and perpendicular snapping in Inkscape. Well, at least for the case where the user draws a straight line or manipulates a guide. So I have a curve I want to snap to, and some distant point P0. Now I need to find all points P1, for which the line P0-P1 is either tangential or perpendicular to the curve. I guess I could first convert the path to sbasis, and then call find_tangents() (see the code snippet below, from sbasis-geometric.cpp). But a few questions come to mind: - Can't this be done without having to convert each path to sbasis first? Converting will take CPU time - Am I really the first one to need this functionality? find_tangets() is not being used anywhere as far as I can tell. Are there other ways to solve this? - How do I implement perpendicular snapping? There's no method yet called find_normals() It would me much appreciated if someone could shed some light on this. Diederik /** * \brief returns all the parameter values of A whose tangent passes through P. * \relates D2 */ std::vector<double> find_tangents(Point P, D2<SBasis> const &A) { SBasis crs (cross(A - P, derivative(A))); crs = shift(crs*Linear(-1, 0)*Linear(-1, 0), -2); // We know that there is a double root at t=0 so we divide out t^2 // JFB points out that this is equivalent to (t-1)^2 followed by a divide by s^2 (shift) return roots(crs); } |
From: Johan E. <jbc...@sw...> - 2011-08-21 10:32:30
|
On 20-8-2011 15:25, Alvin Penner wrote: > attached is a modified version of file src/2geom/hvlinesegment.h. It > contains two minor modifications, in the routine 'pointAt(Coord t)' and > the routine 'pointAndDerivatives(Coord t, unsigned n)'. These changes > were made/proposed in order to interchange x and y coordinates for > vertical lines to fix LP Bug 813829. > > https://bugs.launchpad.net/inkscape/+bug/813829 > http://article.gmane.org/gmane.comp.graphics.inkscape.devel/37125 > > Does this seem like a reasonable way to fix this bug, or is there a > better way? Thanks for pointing to the fix Alvin. I committed a fix. (modified your fix, because I didn't like that it depended on the exact numerical definition of 'axis') Ciao, Johan |
From: Alvin P. <pe...@va...> - 2011-08-20 13:42:42
|
attached is a modified version of file src/2geom/hvlinesegment.h. It contains two minor modifications, in the routine 'pointAt(Coord t)' and the routine 'pointAndDerivatives(Coord t, unsigned n)'. These changes were made/proposed in order to interchange x and y coordinates for vertical lines to fix LP Bug 813829. https://bugs.launchpad.net/inkscape/+bug/813829 http://article.gmane.org/gmane.comp.graphics.inkscape.devel/37125 Does this seem like a reasonable way to fix this bug, or is there a better way? tia, Alvin Penner |
From: Frater <fr...@po...> - 2011-07-04 20:06:54
|
I compile on ubuntu source code cmake . make make install (install lib) $ruby toy-cairo.rb /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- 2geom (LoadError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' from toy-cairo.rb:10 What I can to do with this? ---------------------------------------------------------------- Najwieksza baza samochodow nowych i uzywanych Sprawdz >> http://linkint.pl/f29e3 |
From: Frater <fr...@po...> - 2011-07-04 15:16:15
|
> > > Tell me if I've understood you correctly. > > > ok, many thanks >> >> 1. What I can to do a outline of silmple path and get simplle closed path >> >> http://www.bankfotek.pl/image/850527.jpeg >> >> I need to have control over all aspects of the line. End, Beginning, >> >> thickness. >> >> >> > > > > You want to make the outlines of curves that have been drawn with a > > circular pen. > > > Yes I draw example "m 383.20331,319.69162 c -9.13671,-65.08967 -80.61009,-125.59713 -143.0029,-121.91195 -14.80466,0 -38.70723,14.55665 -53.5119,14.55665 -21.14148,9.83629 -23.02546,29.10813 -30.93288,52.76786 -27.82934,143.72189 116.50341,245.05707 211.07143,316.60717 6.16166,13.57652 20.68928,12.53864 25.44847,5.643 138.77759,-61.99806 258.96041,-147.03259 216.5559,-285.85854 -3.67085,-15.66112 -51.50034,-57.32597 -68.93786,-52.76786 -85.35308,11.14542 -97.72069,28.57407 -143.95318,85.52033" http://wklej.to/6OoGm/text > You might like to look at offset-toy for a starting point on how to do > this. One thing we don't have a toy for is handling the cusp 'butterflys' > correctly. I have some code lurking somewhere, but in the switch to > using bzr I never committed it. I can rewrite it if this is important. > How I can import this line and compiled? I will try small steps to reach the destination. How to load the above line. Then how to find out where are the individual nodes and draw a line perpendicular to one of them. How then compile it. Cmake itself is not enough. If the short term 'offset-toy.cpp' to 'offset-test.cpp' as it compile? gcc offset-test.cpp -I -L ... ? cmake dont' show any comand line. >> >> 2. How do I calculate the amount or say whether it is part of a joint >> >> two figures. >> >> >> > > > > You want to perform a union operation on the resulting paths so that > > overlapping sections aren't 'dran twice'? Or, perhaps you want to > > detect that overlap has occurred? > > > hm..... both ;) But let's start simple. Is the two closed lines overlap each other or not? Is there any way to find out what is the distance from each other letters? I would write two letters at a distance of 10 pixels apart. The letters "T" and "a". Letter 'a' should fall under the letter 'T'. The kerning for fonts that do not have kerning saved inside. Is it possible? >> >> If someone wanted to show you how to write such an example in C + + and >> >> how to compile. >> >> program need not be a GUI. Just the command line. >> >> >> > > ---------------------------------------------------------------- Najwieksza baza samochodow nowych i uzywanych Sprawdz >> http://linkint.pl/f29e3 |
From: Nathan H. <nj...@nj...> - 2011-07-04 13:51:32
|
On Mon, Jul 04, 2011 at 12:23:20PM +0200, Mateusz wrote: > Hello everybody. Hi Mateusz, > My english is horrible i know ;( > Please help me. Tell me if I've understood you correctly. > 1. What I can to do a outline of silmple path and get simplle closed path > http://www.bankfotek.pl/image/850527.jpeg > I need to have control over all aspects of the line. End, Beginning, > thickness. You want to make the outlines of curves that have been drawn with a circular pen. You might like to look at offset-toy for a starting point on how to do this. One thing we don't have a toy for is handling the cusp 'butterflys' correctly. I have some code lurking somewhere, but in the switch to using bzr I never committed it. I can rewrite it if this is important. > 2. How do I calculate the amount or say whether it is part of a joint > two figures. You want to perform a union operation on the resulting paths so that overlapping sections aren't 'dran twice'? Or, perhaps you want to detect that overlap has occurred? > If someone wanted to show you how to write such an example in C + + and > how to compile. > program need not be a GUI. Just the command line. The toys directory has lots of simple programs that show how to implement things. Play with them, and look at the source. We try to make the toys not much more than 200 lines of actual code. To compile, just use the cmake tool like it says in the documentation. njh |
From: Frater <fr...@po...> - 2011-07-04 10:16:48
|
Hello everybody. My english is horrible i know ;( Please help me. 1. What I can to do a outline of silmple path and get simplle closed path http://www.bankfotek.pl/image/850527.jpeg I need to have control over all aspects of the line. End, Beginning, thickness. 2. How do I calculate the amount or say whether it is part of a joint two figures. If someone wanted to show you how to write such an example in C + + and how to compile. program need not be a GUI. Just the command line. ---------------------------------------------------------------- Znajdz samochod idealny dla siebie! Szukaj >> http://linkint.pl/f29e2 |
From: Mateusz <kro...@in...> - 2011-07-04 10:16:42
|
Hello everybody. My english is horrible i know ;( Please help me. 1. What I can to do a outline of silmple path and get simplle closed path http://www.bankfotek.pl/image/850527.jpeg I need to have control over all aspects of the line. End, Beginning, thickness. 2. How do I calculate the amount or say whether it is part of a joint two figures. If someone wanted to show you how to write such an example in C + + and how to compile. program need not be a GUI. Just the command line. ---------------------------------------------------------------- Dziesiatki tysiecy ofert domow i mieszkan! Ogladaj >> http://linkint.pl/f29ae |
From: Krzysztof K. <twe...@gm...> - 2011-06-21 23:36:10
|
2011/6/21 Johan Engelen <jbc...@sw...>: > I assume in option 3 that you keep operator[] ? I agree that [Geom::Y] > is extremely annoying and much too verbose. operator[] would be kept in all the options I mentioned - there doesn't seem to be a good reason to remove it. Regards, Krzysztof |
From: Johan E. <jbc...@sw...> - 2011-06-21 20:42:33
|
On 17-6-2011 22:49, Krzysztof Kosiński wrote: > Hello all > I'm writing an integer rectangle class which I will use in my GSoC > project, and since i need to also introduce integer points, I would > like to ask for your opinions about one thing related to all points: > Currently Geom::Point has the index operator as the only way of access > to the coordinates. However, this is often inconvenient, especially > when Geom::X and Geom::Y, and leads to hard to parse notation like > (a-b)[Geom::Y]. Here are the proposed solutions: > > 1. New methods > Coord&x(); Coord&y(); + const versions > This is OK, but I don't see much merit in having the extra parentheses > of a method call, since there is read-write access to the coordinates > anyway. > > 2. Public members in a transparent union > union { struct { Coord x; Coord y; }; Coord _pt[2]; } > Might not work on some compilers. > > 3. Replace _pt with public members > Coord x, y; > Could theoretically be lower performing, because we now have to use an > if for indexing, but in reality on anything more modern than Pentium > Pro both the if and the table access will be compiled to conditional > moves. I assume in option 3 that you keep operator[] ? I agree that [Geom::Y] is extremely annoying and much too verbose. Ciao, Johan |