52 #define CLIPPER_MAX 1518500249
102 BG_EXPORT
extern void
197 const int *poly,
const size_t poly_npts,
198 const int **holes_array,
const size_t *holes_npts,
const size_t nholes,
199 const int *steiner,
const size_t steiner_npts,
235 const int *steiner,
const size_t steiner_npts,
260 const int *poly,
const size_t poly_pnts,
261 const int **holes_array,
const size_t *holes_npts,
const size_t nholes,
262 const int *steiner,
const size_t steiner_npts,
341 BG_EXPORT
extern void bg_tri_plot_2d(
const char *filename,
const int *faces,
int num_faces,
const point2d_t *pnts,
int r,
int g,
int b);
Header file for the BRL-CAD common definitions.
void bg_polygon_plot(const char *filename, const point_t *pnts, int npnts, int r, int g, int b)
int bg_polygon_direction(size_t npts, const point2d_t *pts, const int *pt_indices)
Test whether a polygon is clockwise (CW) or counter clockwise (CCW)
int bg_3d_polygon_centroid(point_t *cent, size_t npts, const point_t *pts)
Calculate the centroid of a non self-intersecting polygon in a 3D plane in space.
fastf_t bg_find_polygon_area(struct bg_polygon *gpoly, fastf_t sf, plane_t *vp, fastf_t size)
int bg_polygon_triangulate(int **faces, int *num_faces, point_t **out_pts, int *num_outpts, struct bg_polygon *p, triangulation_t type)
Triangulate a bg_polygon.
int bg_3d_polygon_area(fastf_t *area, size_t npts, const point_t *pts)
Calculate the interior area of a polygon in a 3D plane in space.
int bg_pnt_in_polygon(size_t npts, const point2d_t *pts, const point2d_t *test_pt)
test whether a point is inside a 2d polygon
int bg_polygons_overlap(struct bg_polygon *polyA, struct bg_polygon *polyB, plane_t *vp, const struct bn_tol *tol, fastf_t iscale)
void bg_polygon_cpy(struct bg_polygon *dest, struct bg_polygon *src)
void bg_tri_plot_2d(const char *filename, const int *faces, int num_faces, const point2d_t *pnts, int r, int g, int b)
void bg_polygons_free(struct bg_polygons *gpp)
bg_clip_t
Functions for working with polygons.
int bg_poly2tri_test(int **faces, int *num_faces, point2d_t **out_pts, int *num_outpts, const int *poly, const size_t poly_pnts, const int **holes_array, const size_t *holes_npts, const size_t nholes, const int *steiner, const size_t steiner_npts, const point2d_t *pts)
int bg_3d_polygon_sort_ccw(size_t npts, point_t *pts, plane_t cmp)
Sort an array of point_ts, building a convex polygon, counter-clockwise.
struct bg_polygon * bg_clip_polygons(bg_clip_t op, struct bg_polygons *subj, struct bg_polygons *clip, fastf_t sf, plane_t *vp)
int bg_nested_poly_triangulate(int **faces, int *num_faces, point2d_t **out_pts, int *num_outpts, const int *poly, const size_t poly_npts, const int **holes_array, const size_t *holes_npts, const size_t nholes, const int *steiner, const size_t steiner_npts, const point2d_t *pts, const size_t npts, triangulation_t type)
Triangulate a 2D polygon with holes.
int bg_3d_polygon_make_pnts_planes(size_t *npts, point_t **pts, size_t neqs, const plane_t *eqs)
Calculate for an array of plane_eqs, which build a polyhedron, the point_t's for each face.
void bg_polygon_plot_2d(const char *filename, const point2d_t *pnts, int npnts, int r, int g, int b)
void bg_polygon_free(struct bg_polygon *gpp)
void bg_polygon_view_bbox(point2d_t *bmin, point2d_t *bmax, struct bg_polygon *p, matp_t model2view)
Find the 2D axis aligned bounding box of a bg_polygon in view coordinates.
struct bg_polygon * bg_clip_polygon(bg_clip_t op, struct bg_polygon *subj, struct bg_polygon *clip, fastf_t sf, plane_t *vp)
int bg_poly_triangulate(int **faces, int *num_faces, point2d_t **out_pts, int *num_outpts, const int *steiner, const size_t steiner_npts, const point2d_t *pts, const size_t npts, triangulation_t type)
Triangulate a 2D polygon without holes.
@ TRI_CONSTRAINED_DELAUNAY
void float float int int int int float * size
int clip(fastf_t *, fastf_t *, fastf_t *, fastf_t *)
double fastf_t
fastest 64-bit (or larger) floating point type
fastf_t point2d_t[ELEMENTS_PER_POINT2D]
2-tuple point
fastf_t plane_t[ELEMENTS_PER_PLANE]
Definition of a plane equation.
fastf_t * matp_t
pointer to a 4x4 matrix
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
fundamental vector, matrix, quaternion math macros