(root)/
libredwg-0.13/
src/
geom.h
       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 "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  EXPORT void transform_OCS_2d (BITCODE_2DPOINT *out, BITCODE_2DPOINT pt,
      32                                BITCODE_BE ext) __nonnull ((1));
      33  // transform a 3D point via its OCS (extrusion) to 2D
      34  EXPORT void transform_OCS (BITCODE_3DPOINT *out, BITCODE_3DPOINT pt,
      35                             BITCODE_BE ext) __nonnull ((1));
      36  
      37  // TODO: bulge -> arc for svg and ps
      38  void angle_vector_2d (BITCODE_2DPOINT *out, BITCODE_2DPOINT ctr,
      39                        BITCODE_BD angle, BITCODE_BD len) __nonnull ((1));
      40  EXPORT void arc_split (BITCODE_2BD *pts, const int num_pts,
      41                         const BITCODE_2BD center_2d, BITCODE_BD start_angle,
      42                         BITCODE_BD end_angle, const BITCODE_BD radius)
      43      __nonnull ((1));
      44  
      45  #endif /* _GEOM_H_ */