Difference between revisions of "Working with 2Geom FAQ"
Jump to navigation
Jump to search
Line 8: | Line 8: | ||
Path p; | Path p; | ||
p.appendNew<LineSegment>(a, b); | p.appendNew<LineSegment>(a, b); | ||
Piecewise<D2<SBasis> > pwd2 = Piecewise<D2<SBasis> >(D2<SBasis>(Linear(a[X], b[X]), Linear(a[Y], b[Y]))); | Piecewise<D2<SBasis> > pwd2 = Piecewise<D2<SBasis> >(D2<SBasis>(Linear(a[X], b[X]), Linear(a[Y], b[Y]))); | ||
Revision as of 00:45, 31 October 2007
Introduction
Questions that arise during coding with 2geom are put here. To see other 2geom related questions go to the general lib2geom FAQ.
Questions
How to create a straight line (for types: Path, pwd2, d2pw)?
Path p; p.appendNew<LineSegment>(a, b); Piecewise<D2<SBasis> > pwd2 = Piecewise<D2<SBasis> >(D2<SBasis>(Linear(a[X], b[X]), Linear(a[Y], b[Y])));
How to convert from Path to pwd2 to d2pw to path and back?
D2<Piecewise<SBasis> > y = make_cuts_independant(x); x = sectionize(y);
How do I calculate the bounding box of a path?
Rect r = path.boundsFast();
or
Rect r = path.boundsExact();
How do I convert 2geom to svgd and back?
inkscape has code for this somewhere :p (Johan knows this)
What does "compose" do?
(i keep forgetting)