Blender  V2.93
Functions | Variables
blender::meshintersect Namespace Reference

Functions

Meshdirect_mesh_boolean (blender::Span< const Mesh * > meshes, blender::Span< const float4x4 * > obmats, const float4x4 &target_transform, blender::Span< blender::Array< short >> material_remaps, const bool use_self, const bool hole_tolerant, const int boolean_mode)
 
template<typename T >
CDT_input< Tfill_input_from_string (const char *spec)
 
static int get_orig_index (const Array< Vector< int >> &out_to_orig, int orig_index)
 
template<typename T >
static double math_to_double (const T UNUSED(v))
 
template<>
double math_to_double< double > (const double v)
 
template<typename T >
static T math_abs (const T v)
 
template<>
double math_abs (const double v)
 
template<typename T >
int get_vertex_by_coord (const CDT_result< T > &out, double x, double y)
 
template<typename T >
int get_output_edge_index (const CDT_result< T > &out, int out_index_1, int out_index_2)
 
template<typename T >
bool output_edge_has_input_id (const CDT_result< T > &out, int out_edge_index, int in_edge_index)
 
template<typename T >
int get_output_face_index (const CDT_result< T > &out, const Array< int > &poly)
 
template<typename T >
int get_output_tri_index (const CDT_result< T > &out, int out_index_1, int out_index_2, int out_index_3)
 
template<typename T >
bool output_face_has_input_id (const CDT_result< T > &out, int out_face_index, int in_face_index)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const CDT_result< T > &r)
 
template<typename T >
void graph_draw (const std::string &label, const Array< vec2< T >> &verts, const Array< std::pair< int, int >> &edges, const Array< Vector< int >> &UNUSED(faces))
 
template<typename T >
void expect_coord_near (const vec2< T > &testco, const vec2< T > &refco)
 
template<>
void expect_coord_near< double > (const vec2< double > &testco, const vec2< double > &refco)
 
template<typename T >
void empty_test ()
 
template<typename T >
void onept_test ()
 
template<typename T >
void twopt_test ()
 
template<typename T >
void threept_test ()
 
template<typename T >
void mixedpts_test ()
 
template<typename T >
void quad0_test ()
 
template<typename T >
void quad1_test ()
 
template<typename T >
void quad2_test ()
 
template<typename T >
void quad3_test ()
 
template<typename T >
void quad4_test ()
 
template<typename T >
void lineinsquare_test ()
 
template<typename T >
void crosssegs_test ()
 
template<typename T >
void diamondcross_test ()
 
template<typename T >
void twodiamondscross_test ()
 
template<typename T >
void manycross_test ()
 
template<typename T >
void twoface_test ()
 
template<typename T >
void twoface2_test ()
 
template<typename T >
void overlapfaces_test ()
 
template<typename T >
void twosquaresoverlap_test ()
 
template<typename T >
void twofaceedgeoverlap_test ()
 
template<typename T >
void triintri_test ()
 
template<typename T >
void diamondinsquare_test ()
 
template<typename T >
void diamondinsquarewire_test ()
 
template<typename T >
void repeatedge_test ()
 
template<typename T >
void repeattri_test ()
 
 TEST (delaunay_d, Empty)
 
 TEST (delaunay_d, OnePt)
 
 TEST (delaunay_d, TwoPt)
 
 TEST (delaunay_d, ThreePt)
 
 TEST (delaunay_d, MixedPts)
 
 TEST (delaunay_d, Quad0)
 
 TEST (delaunay_d, Quad1)
 
 TEST (delaunay_d, Quad2)
 
 TEST (delaunay_d, Quad3)
 
 TEST (delaunay_d, Quad4)
 
 TEST (delaunay_d, LineInSquare)
 
 TEST (delaunay_d, CrossSegs)
 
 TEST (delaunay_d, DiamondCross)
 
 TEST (delaunay_d, TwoDiamondsCross)
 
 TEST (delaunay_d, ManyCross)
 
 TEST (delaunay_d, TwoFace)
 
 TEST (delaunay_d, TwoFace2)
 
 TEST (delaunay_d, OverlapFaces)
 
 TEST (delaunay_d, TwoSquaresOverlap)
 
 TEST (delaunay_d, TwoFaceEdgeOverlap)
 
 TEST (delaunay_d, TriInTri)
 
 TEST (delaunay_d, DiamondInSquare)
 
 TEST (delaunay_d, DiamondInSquareWire)
 
 TEST (delaunay_d, RepeatEdge)
 
 TEST (delaunay_d, RepeatTri)
 
 TEST (delaunay_d, CintTwoFace)
 

Variables

static bool draw_append = false
 
constexpr bool DO_DRAW = false
 

Function Documentation

◆ crosssegs_test()

template<typename T >
void blender::meshintersect::crosssegs_test ( )

Definition at line 647 of file BLI_delaunay_2d_test.cc.

References CDT_FULL, DO_DRAW, ELEM, EXPECT_EQ(), and get_orig_index().

◆ diamondcross_test()

template<typename T >
void blender::meshintersect::diamondcross_test ( )

Definition at line 686 of file BLI_delaunay_2d_test.cc.

References CDT_FULL, DO_DRAW, and EXPECT_EQ().

◆ diamondinsquare_test()

template<typename T >
void blender::meshintersect::diamondinsquare_test ( )

Definition at line 1151 of file BLI_delaunay_2d_test.cc.

References CDT_CONSTRAINTS_VALID_BMESH, DO_DRAW, and EXPECT_EQ().

◆ diamondinsquarewire_test()

template<typename T >
void blender::meshintersect::diamondinsquarewire_test ( )

Definition at line 1176 of file BLI_delaunay_2d_test.cc.

References CDT_CONSTRAINTS, DO_DRAW, and EXPECT_EQ().

◆ direct_mesh_boolean()

Mesh * blender::meshintersect::direct_mesh_boolean ( Span< const Mesh * >  meshes,
Span< const float4x4 * >  obmats,
const float4x4 target_transform,
Span< Array< short >>  material_remaps,
const bool  use_self,
const bool  hole_tolerant,
const int  boolean_mode 
)

Do a mesh boolean operation directly on meshes (without going back and forth to BMesh).

Parameters
meshesAn array of of Mesh pointers.
obmatsAn array of pointers to the obmat matrices that transform local coordinates to global ones. It is allowed for the pointers to be null, meaning the transformation is the identity.
material_remapsAn array of pointers to arrays of maps from material slot numbers in the corresponding mesh to the material slot in the first mesh. It is OK for material_remaps or any of its constituent arrays to be empty.

Definition at line 787 of file mesh_boolean_convert.cc.

References BLI_assert, blender::Span< T >::size(), and UNUSED_VARS.

Referenced by blender::nodes::geo_node_boolean_exec().

◆ empty_test()

template<typename T >
void blender::meshintersect::empty_test ( )

Definition at line 398 of file BLI_delaunay_2d_test.cc.

References CDT_FULL, and EXPECT_EQ().

◆ expect_coord_near()

template<typename T >
void blender::meshintersect::expect_coord_near ( const vec2< T > &  testco,
const vec2< T > &  refco 
)

◆ expect_coord_near< double >()

template<>
void blender::meshintersect::expect_coord_near< double > ( const vec2< double > &  testco,
const vec2< double > &  refco 
)

Definition at line 390 of file BLI_delaunay_2d_test.cc.

References e.

◆ fill_input_from_string()

template<typename T >
CDT_input<T> blender::meshintersect::fill_input_from_string ( const char *  spec)

Definition at line 39 of file BLI_delaunay_2d_test.cc.

References CDT_input::epsilon, faces, T, v, and verts.

◆ get_orig_index()

static int blender::meshintersect::get_orig_index ( const Array< Vector< int >> &  out_to_orig,
int  orig_index 
)
static

◆ get_output_edge_index()

template<typename T >
int blender::meshintersect::get_output_edge_index ( const CDT_result< T > &  out,
int  out_index_1,
int  out_index_2 
)

◆ get_output_face_index()

template<typename T >
int blender::meshintersect::get_output_face_index ( const CDT_result< T > &  out,
const Array< int > &  poly 
)

◆ get_output_tri_index()

template<typename T >
int blender::meshintersect::get_output_tri_index ( const CDT_result< T > &  out,
int  out_index_1,
int  out_index_2,
int  out_index_3 
)

◆ get_vertex_by_coord()

template<typename T >
int blender::meshintersect::get_vertex_by_coord ( const CDT_result< T > &  out,
double  x,
double  y 
)

Definition at line 148 of file BLI_delaunay_2d_test.cc.

References e, fabs(), math_to_double(), x, and y.

Referenced by twoface2_test().

◆ graph_draw()

template<typename T >
void blender::meshintersect::graph_draw ( const std::string &  label,
const Array< vec2< T >> &  verts,
const Array< std::pair< int, int >> &  edges,
const Array< Vector< int >> &  UNUSEDfaces 
)

Definition at line 267 of file BLI_delaunay_2d_test.cc.

References draw_append, e, height, label, math_to_double(), SX, SY, v, verts, and width.

◆ lineinsquare_test()

template<typename T >
void blender::meshintersect::lineinsquare_test ( )

Definition at line 619 of file BLI_delaunay_2d_test.cc.

References CDT_CONSTRAINTS, CDT_FULL, DO_DRAW, and EXPECT_EQ().

◆ manycross_test()

template<typename T >
void blender::meshintersect::manycross_test ( )

Definition at line 775 of file BLI_delaunay_2d_test.cc.

References CDT_FULL, DO_DRAW, and EXPECT_EQ().

◆ math_abs() [1/2]

template<>
double blender::meshintersect::math_abs ( const double  v)

Definition at line 140 of file BLI_delaunay_2d_test.cc.

References fabs(), and v.

◆ math_abs() [2/2]

template<typename T >
static T blender::meshintersect::math_abs ( const T  v)
static

Referenced by overlapfaces_test().

◆ math_to_double()

template<typename T >
static double blender::meshintersect::math_to_double ( const T   UNUSEDv)
static

Definition at line 113 of file BLI_delaunay_2d_test.cc.

References BLI_assert.

Referenced by get_vertex_by_coord(), and graph_draw().

◆ math_to_double< double >()

Definition at line 119 of file BLI_delaunay_2d_test.cc.

References v.

◆ mixedpts_test()

template<typename T >
void blender::meshintersect::mixedpts_test ( )

◆ onept_test()

template<typename T >
void blender::meshintersect::onept_test ( )

Definition at line 411 of file BLI_delaunay_2d_test.cc.

References CDT_FULL, and EXPECT_EQ().

◆ operator<<()

template<typename T >
std::ostream& blender::meshintersect::operator<< ( std::ostream &  os,
const CDT_result< T > &  r 
)

Definition at line 226 of file BLI_delaunay_2d_test.cc.

References r.

◆ output_edge_has_input_id()

template<typename T >
bool blender::meshintersect::output_edge_has_input_id ( const CDT_result< T > &  out,
int  out_edge_index,
int  in_edge_index 
)

◆ output_face_has_input_id()

template<typename T >
bool blender::meshintersect::output_face_has_input_id ( const CDT_result< T > &  out,
int  out_face_index,
int  in_face_index 
)

◆ overlapfaces_test()

template<typename T >
void blender::meshintersect::overlapfaces_test ( )

◆ quad0_test()

template<typename T >
void blender::meshintersect::quad0_test ( )

Definition at line 519 of file BLI_delaunay_2d_test.cc.

References CDT_FULL, DO_DRAW, EXPECT_EQ(), and get_output_edge_index().

◆ quad1_test()

template<typename T >
void blender::meshintersect::quad1_test ( )

Definition at line 539 of file BLI_delaunay_2d_test.cc.

References CDT_FULL, DO_DRAW, EXPECT_EQ(), and get_output_edge_index().

◆ quad2_test()

template<typename T >
void blender::meshintersect::quad2_test ( )

Definition at line 559 of file BLI_delaunay_2d_test.cc.

References CDT_FULL, DO_DRAW, EXPECT_EQ(), and get_output_edge_index().

◆ quad3_test()

template<typename T >
void blender::meshintersect::quad3_test ( )

Definition at line 579 of file BLI_delaunay_2d_test.cc.

References CDT_FULL, DO_DRAW, EXPECT_EQ(), and get_output_edge_index().

◆ quad4_test()

template<typename T >
void blender::meshintersect::quad4_test ( )

Definition at line 599 of file BLI_delaunay_2d_test.cc.

References CDT_FULL, DO_DRAW, EXPECT_EQ(), and get_output_edge_index().

◆ repeatedge_test()

template<typename T >
void blender::meshintersect::repeatedge_test ( )

Definition at line 1207 of file BLI_delaunay_2d_test.cc.

References CDT_CONSTRAINTS, DO_DRAW, and EXPECT_EQ().

◆ repeattri_test()

template<typename T >
void blender::meshintersect::repeattri_test ( )

◆ TEST() [1/26]

blender::meshintersect::TEST ( delaunay_d  ,
CintTwoFace   
)

◆ TEST() [2/26]

blender::meshintersect::TEST ( delaunay_d  ,
CrossSegs   
)

Definition at line 1304 of file BLI_delaunay_2d_test.cc.

◆ TEST() [3/26]

blender::meshintersect::TEST ( delaunay_d  ,
DiamondCross   
)

Definition at line 1309 of file BLI_delaunay_2d_test.cc.

◆ TEST() [4/26]

blender::meshintersect::TEST ( delaunay_d  ,
DiamondInSquare   
)

Definition at line 1354 of file BLI_delaunay_2d_test.cc.

◆ TEST() [5/26]

blender::meshintersect::TEST ( delaunay_d  ,
DiamondInSquareWire   
)

Definition at line 1359 of file BLI_delaunay_2d_test.cc.

◆ TEST() [6/26]

blender::meshintersect::TEST ( delaunay_d  ,
Empty   
)

Definition at line 1249 of file BLI_delaunay_2d_test.cc.

◆ TEST() [7/26]

blender::meshintersect::TEST ( delaunay_d  ,
LineInSquare   
)

Definition at line 1299 of file BLI_delaunay_2d_test.cc.

◆ TEST() [8/26]

blender::meshintersect::TEST ( delaunay_d  ,
ManyCross   
)

Definition at line 1319 of file BLI_delaunay_2d_test.cc.

◆ TEST() [9/26]

blender::meshintersect::TEST ( delaunay_d  ,
MixedPts   
)

Definition at line 1269 of file BLI_delaunay_2d_test.cc.

◆ TEST() [10/26]

blender::meshintersect::TEST ( delaunay_d  ,
OnePt   
)

Definition at line 1254 of file BLI_delaunay_2d_test.cc.

◆ TEST() [11/26]

blender::meshintersect::TEST ( delaunay_d  ,
OverlapFaces   
)

Definition at line 1334 of file BLI_delaunay_2d_test.cc.

◆ TEST() [12/26]

blender::meshintersect::TEST ( delaunay_d  ,
Quad0   
)

Definition at line 1274 of file BLI_delaunay_2d_test.cc.

◆ TEST() [13/26]

blender::meshintersect::TEST ( delaunay_d  ,
Quad1   
)

Definition at line 1279 of file BLI_delaunay_2d_test.cc.

◆ TEST() [14/26]

blender::meshintersect::TEST ( delaunay_d  ,
Quad2   
)

Definition at line 1284 of file BLI_delaunay_2d_test.cc.

◆ TEST() [15/26]

blender::meshintersect::TEST ( delaunay_d  ,
Quad3   
)

Definition at line 1289 of file BLI_delaunay_2d_test.cc.

◆ TEST() [16/26]

blender::meshintersect::TEST ( delaunay_d  ,
Quad4   
)

Definition at line 1294 of file BLI_delaunay_2d_test.cc.

◆ TEST() [17/26]

blender::meshintersect::TEST ( delaunay_d  ,
RepeatEdge   
)

Definition at line 1364 of file BLI_delaunay_2d_test.cc.

◆ TEST() [18/26]

blender::meshintersect::TEST ( delaunay_d  ,
RepeatTri   
)

Definition at line 1369 of file BLI_delaunay_2d_test.cc.

◆ TEST() [19/26]

blender::meshintersect::TEST ( delaunay_d  ,
ThreePt   
)

Definition at line 1264 of file BLI_delaunay_2d_test.cc.

◆ TEST() [20/26]

blender::meshintersect::TEST ( delaunay_d  ,
TriInTri   
)

Definition at line 1349 of file BLI_delaunay_2d_test.cc.

◆ TEST() [21/26]

blender::meshintersect::TEST ( delaunay_d  ,
TwoDiamondsCross   
)

Definition at line 1314 of file BLI_delaunay_2d_test.cc.

◆ TEST() [22/26]

blender::meshintersect::TEST ( delaunay_d  ,
TwoFace   
)

Definition at line 1324 of file BLI_delaunay_2d_test.cc.

◆ TEST() [23/26]

blender::meshintersect::TEST ( delaunay_d  ,
TwoFace2   
)

Definition at line 1329 of file BLI_delaunay_2d_test.cc.

◆ TEST() [24/26]

blender::meshintersect::TEST ( delaunay_d  ,
TwoFaceEdgeOverlap   
)

Definition at line 1344 of file BLI_delaunay_2d_test.cc.

◆ TEST() [25/26]

blender::meshintersect::TEST ( delaunay_d  ,
TwoPt   
)

Definition at line 1259 of file BLI_delaunay_2d_test.cc.

◆ TEST() [26/26]

blender::meshintersect::TEST ( delaunay_d  ,
TwoSquaresOverlap   
)

Definition at line 1339 of file BLI_delaunay_2d_test.cc.

◆ threept_test()

template<typename T >
void blender::meshintersect::threept_test ( )

◆ triintri_test()

template<typename T >
void blender::meshintersect::triintri_test ( )

Definition at line 1128 of file BLI_delaunay_2d_test.cc.

References CDT_CONSTRAINTS_VALID_BMESH, DO_DRAW, and EXPECT_EQ().

◆ twodiamondscross_test()

template<typename T >
void blender::meshintersect::twodiamondscross_test ( )

◆ twoface2_test()

template<typename T >
void blender::meshintersect::twoface2_test ( )

◆ twoface_test()

template<typename T >
void blender::meshintersect::twoface_test ( )

◆ twofaceedgeoverlap_test()

template<typename T >
void blender::meshintersect::twofaceedgeoverlap_test ( )

◆ twopt_test()

template<typename T >
void blender::meshintersect::twopt_test ( )

◆ twosquaresoverlap_test()

template<typename T >
void blender::meshintersect::twosquaresoverlap_test ( )

Definition at line 1041 of file BLI_delaunay_2d_test.cc.

References CDT_CONSTRAINTS_VALID_BMESH, DO_DRAW, and EXPECT_EQ().

Variable Documentation

◆ DO_DRAW

constexpr bool blender::meshintersect::DO_DRAW = false
constexpr

◆ draw_append

bool blender::meshintersect::draw_append = false
static

Definition at line 264 of file BLI_delaunay_2d_test.cc.

Referenced by graph_draw().