1 /*****************************************************************************/
2 /*  LibreDWG - free implementation of the DWG file format                    */
3 /*                                                                           */
4 /*  Copyright (C) 2019 Free Software Foundation, Inc.                        */
5 /*                                                                           */
6 /*  This library is free software, licensed under the terms of the GNU       */
7 /*  General Public License as published by the Free Software Foundation,     */
8 /*  either version 3 of the License, or (at your option) any later version.  */
9 /*  You should have received a copy of the GNU General Public License        */
10 /*  along with this program.  If not, see <http://www.gnu.org/licenses/>.    */
11 /*****************************************************************************/
12 
13 /*
14  * geom.h: geometric projections from OCS
15  * written by Reini Urban
16 */
17 
18 #ifndef _GEOM_H_
19 #define _GEOM_H_
20 
21 #include "../src/config.h"
22 #include <dwg.h>
23 
24 #ifndef M_PI
25 #  define M_PI 3.14159265358979323846264338327950288
26 #endif
27 
28 void normalize (BITCODE_3DPOINT *out, BITCODE_3DPOINT pt);
29 void cross (BITCODE_3DPOINT *out, BITCODE_3DPOINT pt1, BITCODE_3DPOINT pt2);
30 // transform a 2D point via its OCS (extrusion) to 2D
31 void transform_OCS_2d (BITCODE_2DPOINT *out, BITCODE_2DPOINT pt, BITCODE_BE ext);
32 // transform a 3D point via its OCS (extrusion) to 2D
33 void transform_OCS (BITCODE_3DPOINT *out, BITCODE_3DPOINT pt, BITCODE_BE ext);
34 // TODO: bulge -> arc for svg and ps
35 
36 #endif  /* _GEOM_H_ */
37