52#define CLIPPER_MAX 1518500249
191 const int *poly,
const size_t poly_npts,
192 const int **holes_array,
const size_t *holes_npts,
const size_t nholes,
193 const int *steiner,
const size_t steiner_npts,
225 const int *steiner,
const size_t steiner_npts,
232 const int *poly,
const size_t poly_pnts,
233 const int **holes_array,
const size_t *holes_npts,
const size_t nholes,
234 const int *steiner,
const size_t steiner_npts,
313BG_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);
318#define BV_POLYGON_GENERAL 0
319#define BV_POLYGON_CIRCLE 1
320#define BV_POLYGON_ELLIPSE 2
321#define BV_POLYGON_RECTANGLE 3
322#define BV_POLYGON_SQUARE 4
359#define BV_POLYGON_UPDATE_DEFAULT 0
360#define BV_POLYGON_UPDATE_PROPS_ONLY 1
361#define BV_POLYGON_UPDATE_PT_SELECT 2
362#define BV_POLYGON_UPDATE_PT_MOVE 3
363#define BV_POLYGON_UPDATE_PT_APPEND 4
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)
struct bv_scene_obj * bv_create_polygon_obj(struct bview *v, struct bv_polygon *p)
struct bg_polygon * bg_polygon_fill_segments(struct bg_polygon *poly, vect2d_t line_slope, fastf_t line_spacing)
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.
int bg_polygons_overlap(struct bg_polygon *polyA, struct bg_polygon *polyB, matp_t model2view, const struct bn_tol *tol, fastf_t iscale)
struct bv_scene_obj * bv_create_polygon(struct bview *v, int type, int x, int y)
struct bv_scene_obj * bv_select_polygon(struct bu_ptbl *objs, struct bview *v)
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.
void bv_polygon_vlist(struct bv_scene_obj *s)
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
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.
struct bv_scene_obj * bg_dup_view_polygon(const char *nname, struct bv_scene_obj *s)
int bv_polygon_csg(struct bu_ptbl *objs, struct bv_scene_obj *p, bg_clip_t op, int merge)
struct bg_polygon * bg_clip_polygon(bg_clip_t op, struct bg_polygon *subj, struct bg_polygon *clip, fastf_t sf, matp_t model2view, matp_t view2model)
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.
int bg_polygon_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.
int bg_nested_polygon_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 bv_update_polygon(struct bv_scene_obj *s, struct bview *v, int utype)
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.
struct bg_polygon * bg_clip_polygons(bg_clip_t op, struct bg_polygons *subj, struct bg_polygons *clip, fastf_t sf, matp_t model2view, matp_t view2model)
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)
int bv_move_polygon(struct bv_scene_obj *s)
fastf_t bg_find_polygon_area(struct bg_polygon *gpoly, fastf_t sf, matp_t model2view, fastf_t size)
@ 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
fastf_t vect2d_t[ELEMENTS_PER_VECT2D]
2-tuple vector
struct bg_polygon polygon
struct bu_color fill_color
fundamental vector, matrix, quaternion math macros