played a little with settings for headstyle - causes strange numbers - check!!
[cluster_expansion_thesis.git] / little_helpers / tikz / sketch-0.2.161 / geomio.c
blobfd1e166a453ab77018e0874dfc8a6094a96f66ca
1 /* geomio.c
2 Copyright (C) 2005,2006,2007,2008 Eugene K. Ressler, Jr.
4 This file is part of Sketch, a small, simple system for making
5 3d drawings with LaTeX and the PSTricks or TikZ package.
7 Sketch is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 Sketch is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Sketch; see the file COPYING.txt. If not, see
19 http://www.gnu.org/copyleft */
21 #include "geomio.h"
23 void
24 print_pt_2d (FILE * f, POINT_2D pt)
26 fprintf (f, "(%.3f,%.3f)", pt[X], pt[Y]);
29 void
30 print_pt_3d (FILE * f, POINT_3D pt)
32 fprintf (f, "(%.3f,%.3f,%.3f)", pt[X], pt[Y], pt[Z]);
35 void
36 print_polyline_3d (FILE * f, POLYLINE_3D * polyline)
38 int i;
40 fprintf (f, "\\line");
41 for (i = 0; i < polyline->n_vertices; i++)
42 print_pt_3d (f, polyline->v[i]);
43 fprintf (f, "\n");
46 void
47 print_polygon_2d (FILE * f, POLYGON_2D * polygon)
49 int i;
51 fprintf (f, "\\polygon");
52 for (i = 0; i < polygon->n_sides; i++)
53 print_pt_2d (f, polygon->v[i]);
54 fprintf (f, "\n");
57 void
58 print_polygon_3d (FILE * f, POLYGON_3D * polygon)
60 int i;
62 fprintf (f, "\\polygon");
63 for (i = 0; i < polygon->n_sides; i++)
64 print_pt_3d (f, polygon->v[i]);
65 fprintf (f, "\n");
68 void
69 print_plane (FILE * f, PLANE * plane)
71 fprintf (f, "\\plane[n=%.3f %.3f %.3f,p=%.3f %.3f %.3f,c=%.3f]\n",
72 plane->n[X], plane->n[Y], plane->n[Z],
73 plane->p[X], plane->p[Y], plane->p[Z], plane->c);