Generative Modeling System
Basic System
#define NVPTS 4
#define MAXPTS 2048
Vector3 g[MAXPTS];
int read_curve(void)
{
int k = 0;
while (scanf("%lf %lf %lf\n" ,&(g[k].x),&(g[k].y),&(g[k].z)) != EOF)
if (k++ > MAXPTS)
break;
return k;
}
main(int argc, char **argv)
{
int nu, nv = NVPTS;
Poly *tl;
if (argc == 2)
nv = atoi(argv[1]);
nu = read_curve();
tl = rotsurf(nu, g, nv);
trilist_write(tl, stdout);
exit(0);
}
Input-Output
Input
1 1 0
1 -1 0
Output
trilist {
{{-1, -1, 0}, {1, -1, 0}, {1, 1, 0}},
{{-1, 1, 0}, {-1, -1, 0}, {1, 1, 0}},
{{1, -1, 0}, {-1, -1, 0}, {-1, 1, 0}},
{{1, 1, 0}, {1, -1, 0}, {-1, 1, 0}}
}
Extension Options
-
Include visualization as 3 orthogonal views (XYZ) and an auxiliary view.
-
Include interactive capabilities. The user should be able draw a curve
in the auxiliary view and create a surface rotation from it.
-
Include curve editing capabilities, such as moving, deleting and
adding points. These changes should reflect in the current surface.
-
Include surface editing capabilities, such as moving a vertex.
-
Include new generative models: Extrude, Twist, Bend, and Taper.
-
Include support for a command language integrated with the
interactive operations.
Copyright © 1998 Luiz Velho