|
Blender V4.3
|
#include <limits.h>#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "MEM_guardedalloc.h"#include "BLI_listbase.h"#include "BLI_math_geom.h"#include "BLI_math_matrix.h"#include "BLI_math_vector.h"#include "BLI_memarena.h"#include "BLI_utildefines.h"#include "BLI_scanfill.h"#include "BLI_strict_flags.h"Go to the source code of this file.
Classes | |
| struct | PolyFill |
| struct | ScanFillVertLink |
Macros | |
| #define | SF_EPSILON 0.00003f |
| #define | SF_EPSILON_SQ (SF_EPSILON * SF_EPSILON) |
| #define | SF_VERT_NEW 0 /* all new verts have this flag set */ |
| #define | SF_VERT_AVAILABLE 1 /* available - in an edge */ |
| #define | SF_VERT_ZERO_LEN 2 |
| #define | SF_EDGE_NEW 0 /* all new edges have this flag set */ |
| #define | SF_EDGE_INTERNAL 2 /* edge is created while scan-filling */ |
| #define | SF_POLY_NEW 0 /* all polys initialized to this */ |
| #define | SF_POLY_VALID 1 /* has at least 3 verts */ |
Typedefs | |
| typedef struct PolyFill | PolyFill |
| typedef struct ScanFillVertLink | ScanFillVertLink |
Triangulate multiple 2D/3D polygon with support for holes, use for tessellating curves, fonts and geometry. See main function BLI_scanfill_calc
Uses sweep-line method.
Definition in file scanfill.c.
| #define SF_EDGE_INTERNAL 2 /* edge is created while scan-filling */ |
Definition at line 65 of file scanfill.c.
Referenced by scanfill().
ScanFillEdge::f (status)
Definition at line 63 of file scanfill.c.
Referenced by BLI_scanfill_edge_add(), and scanfill().
| #define SF_EPSILON 0.00003f |
Definition at line 52 of file scanfill.c.
Referenced by BLI_scanfill_calc_ex(), and testvertexnearedge().
| #define SF_EPSILON_SQ (SF_EPSILON * SF_EPSILON) |
Definition at line 53 of file scanfill.c.
Referenced by testvertexnearedge().
| #define SF_POLY_NEW 0 /* all polys initialized to this */ |
PolyFill::f (status)
Definition at line 68 of file scanfill.c.
Referenced by BLI_scanfill_calc_ex(), and scanfill().
Definition at line 69 of file scanfill.c.
Referenced by BLI_scanfill_calc_ex().
| #define SF_VERT_AVAILABLE 1 /* available - in an edge */ |
Definition at line 57 of file scanfill.c.
Referenced by BLI_scanfill_calc_ex(), and scanfill().
ScanFillVert::f (status)
Definition at line 56 of file scanfill.c.
Referenced by BLI_scanfill_vert_add(), and scanfill().
| #define SF_VERT_ZERO_LEN 2 |
Definition at line 58 of file scanfill.c.
Referenced by scanfill().
| typedef struct PolyFill PolyFill |
| typedef struct ScanFillVertLink ScanFillVertLink |
|
static |
Definition at line 314 of file scanfill.c.
References addedgetoscanvert(), len, NULL, printf, UNLIKELY, ScanFillEdge::v1, ScanFillEdge::v2, vergscdata(), ScanFillVertLink::vert, and ScanFillVert::xy.
Referenced by scanfill().
|
static |
Definition at line 263 of file scanfill.c.
References BLI_addtail(), BLI_insertlinkbefore(), ScanFillVertLink::edge_first, ScanFillVertLink::edge_last, ScanFillEdge::next, NULL, ScanFillEdge::prev, ScanFillEdge::v1, ScanFillEdge::v2, x, ScanFillVert::xy, and y.
Referenced by addedgetoscanlist().
|
static |
Definition at line 136 of file scanfill.c.
References ScanFillContext::arena, BLI_addtail(), BLI_memarena_alloc(), ScanFillContext::fillfacebase, ScanFillFace::v1, ScanFillFace::v2, v2, and ScanFillFace::v3.
Referenced by scanfill().
| void BLI_scanfill_begin | ( | ScanFillContext * | sf_ctx | ) |
Definition at line 791 of file scanfill.c.
References ScanFillContext::arena, BLI_memarena_new(), BLI_SCANFILL_ARENA_SIZE, ScanFillContext::poly_nr, and SF_POLY_UNSET.
Referenced by bmo_triangle_fill_exec().
| void BLI_scanfill_begin_arena | ( | ScanFillContext * | sf_ctx, |
| MemArena * | arena ) |
Definition at line 798 of file scanfill.c.
References ScanFillContext::arena, ScanFillContext::poly_nr, and SF_POLY_UNSET.
Referenced by BKE_displist_fill(), and BKE_maskrasterize_handle_init().
| uint BLI_scanfill_calc | ( | ScanFillContext * | sf_ctx, |
| const int | flag ) |
Definition at line 1152 of file scanfill.c.
References BLI_scanfill_calc_ex(), flag, and NULL.
| uint BLI_scanfill_calc_ex | ( | ScanFillContext * | sf_ctx, |
| const int | flag, | ||
| const float | nor_proj[3] ) |
Definition at line 825 of file scanfill.c.
References add_newell_cross_v3_v3v3(), axis_dominant_v3_to_m3_negate(), BLI_assert, BLI_listbase_clear(), BLI_listbase_is_empty(), BLI_movelisttolist(), BLI_remlink(), BLI_SCANFILL_CALC_HOLES, BLI_SCANFILL_CALC_LOOSE, BLI_SCANFILL_CALC_POLYS, ScanFillVert::co, compare_v3v3(), copy_v3_v3(), ScanFillVert::edge_count, PolyFill::edges, PolyFill::f, ScanFillVert::f, fill_target_map_recursive(), ScanFillContext::filledgebase, ScanFillContext::fillvertbase, ListBase::first, flag, ListBase::last, len_squared_v3(), LIKELY, PolyFill::max_xy, MEM_freeN(), MEM_mallocN, mergepolysSimp(), PolyFill::min_xy, mul_v2_m3v3(), ScanFillEdge::next, ScanFillVert::next, normalize_v3(), NULL, pf, ScanFillContext::poly_nr, ScanFillEdge::poly_nr, ScanFillVert::poly_nr, ScanFillEdge::prev, printf, range_vn_u(), scanfill(), SF_EPSILON, SF_POLY_NEW, SF_POLY_UNSET, SF_POLY_VALID, SF_VERT_AVAILABLE, splitlist(), testvertexnearedge(), UNLIKELY, ScanFillEdge::v1, ScanFillEdge::v2, PolyFill::verts, ScanFillVert::xy, and zero_v3().
Referenced by BKE_displist_fill(), BKE_maskrasterize_handle_init(), BLI_scanfill_calc(), and bmo_triangle_fill_exec().
| ScanFillEdge * BLI_scanfill_edge_add | ( | ScanFillContext * | sf_ctx, |
| ScanFillVert * | v1, | ||
| ScanFillVert * | v2 ) |
Definition at line 117 of file scanfill.c.
References ScanFillContext::arena, BLI_addtail(), BLI_memarena_alloc(), ScanFillEdge::c, ScanFillEdge::f, ScanFillContext::filledgebase, ScanFillContext::poly_nr, ScanFillEdge::poly_nr, SF_EDGE_NEW, ScanFillEdge::tmp, ScanFillEdge::user_flag, ScanFillEdge::v1, ScanFillEdge::v2, and v2.
Referenced by BKE_displist_fill(), BKE_maskrasterize_handle_init(), bmo_triangle_fill_exec(), scanfill(), scanfill_preprocess_self_isect(), and testvertexnearedge().
| void BLI_scanfill_end | ( | ScanFillContext * | sf_ctx | ) |
Definition at line 805 of file scanfill.c.
References ScanFillContext::arena, BLI_listbase_clear(), BLI_memarena_free(), ScanFillContext::filledgebase, ScanFillContext::fillfacebase, ScanFillContext::fillvertbase, and NULL.
Referenced by bmo_triangle_fill_exec().
| void BLI_scanfill_end_arena | ( | ScanFillContext * | sf_ctx, |
| MemArena * | arena ) |
Definition at line 815 of file scanfill.c.
References ScanFillContext::arena, BLI_assert, BLI_listbase_clear(), BLI_memarena_clear(), ScanFillContext::filledgebase, ScanFillContext::fillfacebase, and ScanFillContext::fillvertbase.
Referenced by BKE_displist_fill(), and BKE_maskrasterize_handle_init().
| ScanFillVert * BLI_scanfill_vert_add | ( | ScanFillContext * | sf_ctx, |
| const float | vec[3] ) |
Definition at line 95 of file scanfill.c.
References ScanFillContext::arena, BLI_addtail(), BLI_memarena_alloc(), ScanFillVert::co, copy_v3_v3(), ScanFillVert::edge_count, ScanFillVert::f, ScanFillContext::fillvertbase, ScanFillVert::keyindex, NULL, ScanFillVert::p, ScanFillContext::poly_nr, ScanFillVert::poly_nr, SF_VERT_NEW, ScanFillVert::tmp, ScanFillVert::user_flag, ScanFillVert::xy, and zero_v2().
Referenced by BKE_displist_fill(), bmo_triangle_fill_exec(), scanfill_preprocess_self_isect(), and scanfill_vert_add_v2_with_depth().
|
static |
Return true if eve inside the bound-box of eed.
Definition at line 351 of file scanfill.c.
References ScanFillEdge::v1, ScanFillEdge::v2, and ScanFillVert::xy.
Referenced by testvertexnearedge().
Definition at line 152 of file scanfill.c.
References PolyFill::edges, PolyFill::max_xy, PolyFill::min_xy, and pf2.
Referenced by fill_target_map_recursive().
|
static |
Definition at line 178 of file scanfill.c.
References BLI_assert, boundisect(), and fill_target_map_recursive().
Referenced by BLI_scanfill_calc_ex(), and fill_target_map_recursive().
|
static |
Definition at line 200 of file scanfill.c.
References PolyFill::edges, PolyFill::f, ScanFillContext::filledgebase, ScanFillContext::fillvertbase, ListBase::first, PolyFill::max_xy, PolyFill::min_xy, ScanFillEdge::next, ScanFillVert::next, PolyFill::nr, pf2, ScanFillEdge::poly_nr, ScanFillVert::poly_nr, and PolyFill::verts.
Referenced by BLI_scanfill_calc_ex().
|
static |
Definition at line 462 of file scanfill.c.
References addedgetoscanlist(), addfillface(), b, BLI_addtail(), BLI_assert, BLI_insertlinkbefore(), BLI_remlink(), BLI_SCANFILL_CALC_HOLES, BLI_SCANFILL_CALC_REMOVE_DOUBLES, BLI_scanfill_edge_add(), cos_v2v2v2(), ScanFillVert::edge_count, ScanFillVertLink::edge_first, ScanFillVertLink::edge_last, equals_v2v2(), ScanFillEdge::f, ScanFillVert::f, ScanFillContext::filledgebase, ScanFillContext::fillvertbase, ListBase::first, flag, MEM_freeN(), MEM_mallocN, min_ff(), ScanFillEdge::next, ScanFillVert::next, NULL, pf, ScanFillVert::poly_nr, printf, SF_EDGE_INTERNAL, SF_EDGE_NEW, SF_POLY_NEW, SF_VERT_AVAILABLE, SF_VERT_NEW, SF_VERT_ZERO_LEN, testedgeside(), ScanFillVert::tmp, ScanFillVert::u, ScanFillVert::v, ScanFillEdge::v1, ScanFillEdge::v2, v2, vergscdata(), ScanFillVertLink::vert, verts, and ScanFillVert::xy.
Referenced by BLI_scanfill_calc_ex().
|
static |
Definition at line 436 of file scanfill.c.
References BLI_addtail(), BLI_movelisttolist(), BLI_remlink(), ScanFillContext::filledgebase, ScanFillContext::fillvertbase, ListBase::first, ScanFillEdge::next, ScanFillVert::next, ScanFillEdge::poly_nr, and ScanFillVert::poly_nr.
Referenced by BLI_scanfill_calc_ex().
|
static |
Definition at line 379 of file scanfill.c.
References BLI_scanfill_edge_add(), boundinsideEV(), compare_v2v2(), dist_squared_to_line_v2(), ScanFillVert::edge_count, ScanFillContext::filledgebase, ScanFillContext::fillvertbase, ListBase::first, ScanFillEdge::next, ScanFillVert::next, ScanFillEdge::poly_nr, ScanFillVert::poly_nr, SF_EPSILON, SF_EPSILON_SQ, ScanFillEdge::v1, ScanFillEdge::v2, and ScanFillVert::xy.
Referenced by BLI_scanfill_calc_ex().
|
static |
Definition at line 73 of file scanfill.c.
References ScanFillVertLink::vert, and ScanFillVert::xy.
Referenced by addedgetoscanlist(), and scanfill().