24 for(
double t = M.cuts.front(); t <
max; t += space) {
25 Point pos = M(t), perp = Mperp(t);
39 for(
unsigned i = 0; i < pw.size(); i++) {
61class Parametrics:
public Toy {
71 std::ostringstream *notify,
72 int width,
int height,
bool save, std::ostringstream *timer_stream)
override {
77 t = g_timer_elapsed(time, foo) * 100;
91 if(waitt>20) waitt = 0;
100 if(t==obj.
cuts.back()) t +=
inc/2;
101 cairo_set_source_rgb(cr, 1,1,1);
111 Point curpt = rport[0].at0();
112 if(t<obj.
cuts.back()) {
119 sprintf(tlab,
"t=%.02f", t);
122 cairo_set_line_width (cr, 2);
148 cairo_set_line_width (cr, 1);
156 sprintf(file,
"output/%04d.png", count);
183 cat +=
Point(50, 50);
188 monk +=
Point(50,50);
191 arc +=
Point(200, 200);
205 time = g_timer_new();
215int main(
int argc,
char **argv) {
216 init(argc, argv,
new Parametrics, 720, 480);
Path - a sequence of contiguous curves.
3x3 affine transformation matrix.
static void dot_plot(cairo_t *cr, Piecewise< D2< SBasis > > const &M, double space=10)
Conversion between Bezier control points and SBasis curves.
3x3 matrix representing an affine transformation.
Adaptor that creates 2D functions from 1D ones.
Function that interpolates linearly between two values.
Function defined as discrete pieces.
void push(const T &s, double to)
Convenience/implementation hiding function to add segment/cut pairs.
std::vector< double > cuts
Two-dimensional point that doubles as a vector.
Polynomial in symmetric power basis.
virtual void mouse_moved(Geom::Point const &pos, unsigned modifiers)
virtual void save(FILE *f)
virtual void draw(cairo_t *cr, std::ostringstream *notify, int w, int h, bool save, std::ostringstream *timing_stream)
Lifts one dimensional objects into 2D.
PathVector read_svgd(char const *filename)
Create path vector from SVG path data stored in a file.
Various utility functions.
SBasisN< n > cos(LinearN< n > bo, int k)
Piecewise< D2< SBasis > > paths_to_pw(PathVector const &paths)
MultiDegree< n > max(MultiDegree< n > const &p, MultiDegree< n > const &q)
Returns the maximal degree appearing in the two arguments for each variables.
Affine from_basis(const Point &x_basis, const Point &y_basis, const Point &offset=Point(0, 0))
Creates a Affine given an axis and origin point.
Piecewise< D2< SBasis > > sectionize(D2< Piecewise< SBasis > > const &a)
Bezier portion(const Bezier &a, double from, double to)
Bezier derivative(Bezier const &a)
Piecewise< D2< SBasis > > arc_length_parametrization(D2< SBasis > const &M, unsigned order=3, double tol=.01)
iter inc(iter const &x, unsigned n)
SBasisN< n > sin(LinearN< n > bo, int k)
D2< T > rot90(D2< T > const &a)
Point abs(Point const &b)
static void dot_plot(cairo_t *cr, Piecewise< D2< SBasis > > const &M, double max, double space=10)
static void draw_axis(cairo_t *cr, Piecewise< D2< SBasis > > const &pw, unsigned d, Affine m)
void cairo_rectangle(cairo_t *cr, Geom::Rect const &r)
void cairo_d2_sb(cairo_t *cr, Geom::D2< Geom::SBasis > const &p)
void cairo_pw_d2_sb(cairo_t *cr, Geom::Piecewise< Geom::D2< Geom::SBasis > > const &p)
void draw_line_seg(cairo_t *cr, Geom::Point a, Geom::Point b)
Obsolete 2D SBasis function class.
two-dimensional geometric operators.
some std functions to work with (pw)s-basis
Polynomial in symmetric power basis (S-basis)
parse SVG path specifications
void draw_text(cairo_t *cr, Geom::Point pos, const char *txt, bool bottom=false, const char *fontdesc="Sans")
void cairo_set_source_rgba(cairo_t *cr, colour c)
void init(int argc, char **argv, Toy *t, int width=600, int height=600)