BRL-CAD
boolean.cpp File Reference
#include "common.h"
#include <assert.h>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include "vmath.h"
#include "bio.h"
#include "bu/log.h"
#include "brep.h"
#include "raytrace.h"
#include "brep_except.h"
Include dependency graph for boolean.cpp:

Go to the source code of this file.

Data Structures

struct  IntersectPoint
 
struct  SSICurve
 
struct  LinkedCurve
 
struct  TrimmedFace
 
struct  IntervalPoints
 
class  IntervalParams
 
struct  LinkedCurveX
 
class  CurvePoint
 
class  CurvePointAbsoluteCompare
 
class  CurveSegment
 
class  LoopBooleanResult
 

Macros

#define DEBUG_BREP_BOOLEAN   0
 
#define INTERSECTION_TOL   1e-4
 
#define ANGLE_TOL   ON_PI/1800.0
 
#define LOOP_DIRECTION_CCW   1
 
#define LOOP_DIRECTION_CW   -1
 
#define LOOP_DIRECTION_NONE   0
 

Enumerations

enum  { OUTSIDE_OR_ON_LOOP, INSIDE_OR_ON_LOOP }
 
enum  seam_location { SEAM_NONE, SEAM_ALONG_V, SEAM_ALONG_U, SEAM_ALONG_UV }
 
enum  { OUTSIDE_BREP, INSIDE_BREP, ON_BREP_SURFACE }
 

Functions

HIDDEN void append_to_polycurve (ON_Curve *curve, ON_PolyCurve &polycurve)
 
HIDDEN int loop_t_compare (const IntersectPoint *p1, const IntersectPoint *p2)
 
HIDDEN int curve_t_compare (const IntersectPoint *p1, const IntersectPoint *p2)
 
HIDDEN bool is_loop_valid (const ON_SimpleArray< ON_Curve * > &loop, double tolerance, ON_PolyCurve *polycurve=NULL)
 
HIDDEN int point_loop_location (const ON_2dPoint &pt, const ON_SimpleArray< ON_Curve * > &loop)
 
HIDDEN bool is_point_on_loop (const ON_2dPoint &pt, const ON_SimpleArray< ON_Curve * > &loop)
 
HIDDEN bool is_point_inside_loop (const ON_2dPoint &pt, const ON_SimpleArray< ON_Curve * > &loop)
 
HIDDEN bool is_point_outside_loop (const ON_2dPoint &pt, const ON_SimpleArray< ON_Curve * > &loop)
 
HIDDEN ON_Interval union_intervals (const ON_SimpleArray< ON_Interval > &intervals)
 
HIDDEN ON_Interval intersect_intervals (const ON_Interval &interval1, const ON_Interval &interval2)
 
HIDDEN void replace_curve_with_subcurve (ON_Curve *&curve, const ON_Interval &interval)
 
HIDDEN ON_SimpleArray< ON_Interval > get_curve_intervals_inside_or_on_face (ON_Curve *curve2D, const ON_ClassArray< ON_SimpleArray< ON_Curve * > > &face_loops, double isect_tol)
 
HIDDEN int compare_interval (const ON_Interval *a, const ON_Interval *b)
 
HIDDEN IntervalParams curve_interval_from_params (IntervalParams interval_t, const ON_Curve *curve)
 
HIDDEN IntervalPoints uv_interval_from_points (IntervalPoints interval_pts, const ON_Surface *surf)
 
HIDDEN IntervalPoints interval_2d_to_uv (const ON_Interval &interval_2d, const ON_Curve *curve2d, const ON_Surface *surf)
 
HIDDEN std::pair< IntervalPoints, IntervalPointsinterval_2d_to_2uv (const ON_Interval &interval_2d, const ON_Curve *curve2d, const ON_Surface *surf, double split_t)
 
HIDDEN IntervalPoints points_uv_to_3d (const IntervalPoints &interval_uv, const ON_Surface *surf)
 
HIDDEN IntervalParams points_3d_to_params_3d (const IntervalPoints &pts_3d, const ON_Curve *curve3d)
 
HIDDEN std::vector< ON_Interval > interval_2d_to_3d (const ON_Interval &interval, const ON_Curve *curve2d, const ON_Curve *curve3d, const ON_Surface *surf)
 
HIDDEN ON_Interval interval_3d_to_2d (const ON_Interval &interval, const ON_Curve *curve2d, const ON_Curve *curve3d, const ON_BrepFace *face)
 
HIDDEN void get_subcurves_inside_faces (ON_SimpleArray< ON_Curve * > &subcurves_on1, ON_SimpleArray< ON_Curve * > &subcurves_on2, const ON_Brep *brep1, const ON_Brep *brep2, int face_i1, int face_i2, ON_SSX_EVENT *event)
 
HIDDEN double bbox_diagonal_length (ON_Curve *curve)
 
HIDDEN void split_curve (ON_Curve *&left, ON_Curve *&right, const ON_Curve *in, double t)
 
HIDDEN double configure_for_linking (LinkedCurve *&first, LinkedCurve *&second, LinkedCurve &in1, LinkedCurve &in2)
 
HIDDEN ON_ClassArray< LinkedCurveget_joinable_ssi_curves (const ON_SimpleArray< SSICurve > &in)
 
HIDDEN ON_ClassArray< LinkedCurvelink_curves (const ON_SimpleArray< SSICurve > &in)
 
HIDDEN bool close_small_gap (ON_SimpleArray< ON_Curve * > &loop, int curr, int next)
 
HIDDEN void close_small_gaps (ON_SimpleArray< ON_Curve * > &loop)
 
ON_Curve * get_loop_curve (const ON_SimpleArray< ON_Curve * > &loop)
 
std::list< ON_SimpleArray< ON_Curve * > >::iterator find_innerloop (std::list< ON_SimpleArray< ON_Curve * > > &loops)
 
bool set_loop_direction (ON_SimpleArray< ON_Curve * > &loop, int dir)
 
void add_point_to_set (std::multiset< CurvePoint > &set, CurvePoint pt)
 
std::multiset< CurveSegmentmake_segments (std::multiset< CurvePoint > &curve1_points, ON_SimpleArray< ON_Curve * > &loop1, ON_SimpleArray< ON_Curve * > &loop2)
 
void set_append_segment (std::multiset< CurveSegment > &out, const CurveSegment &seg)
 
void set_append_segments_at_location (std::multiset< CurveSegment > &out, std::multiset< CurveSegment > &in, CurveSegment::Location location, bool reversed_segs_cancel)
 
std::multiset< CurveSegmentfind_similar_segments (std::multiset< CurveSegment > &set, const CurveSegment &seg)
 
HIDDEN std::multiset< CurveSegmentget_op_segments (std::multiset< CurveSegment > &curve1_segments, std::multiset< CurveSegment > &curve2_segments, op_type op)
 
std::list< ON_SimpleArray< ON_Curve * > > construct_loops_from_segments (std::multiset< CurveSegment > &segments)
 
std::multiset< CurvePointget_loop_points (int source_loop, ON_SimpleArray< ON_Curve * > loop1, ON_SimpleArray< ON_Curve * > loop2)
 
HIDDEN LoopBooleanResult make_result_from_loops (const std::list< ON_SimpleArray< ON_Curve * > > &loops)
 
LoopBooleanResult loop_boolean (const ON_SimpleArray< ON_Curve * > &l1, const ON_SimpleArray< ON_Curve * > &l2, op_type op)
 
std::list< ON_SimpleArray< ON_Curve * > > innerloops_inside_outerloop (const ON_SimpleArray< ON_Curve * > &outerloop_curve, const std::vector< ON_SimpleArray< ON_Curve * > > &innerloop_curves)
 
TrimmedFacemake_face_from_loops (const TrimmedFace *orig_face, const ON_SimpleArray< ON_Curve * > &outerloop, const std::vector< ON_SimpleArray< ON_Curve * > > &innerloops)
 
HIDDEN LoopBooleanResult combine_loops (const TrimmedFace *orig_face, const LoopBooleanResult &new_loops)
 
HIDDEN void append_faces_from_loops (ON_SimpleArray< TrimmedFace * > &out, const TrimmedFace *orig_face, const LoopBooleanResult &new_loops)
 
std::vector< ON_SimpleArray< ON_Curve * > > split_face_into_loops (const TrimmedFace *orig_face, LinkedCurve &linked_curve)
 
void free_loops (std::vector< ON_SimpleArray< ON_Curve * > > &loops)
 
bool loop_is_degenerate (const ON_SimpleArray< ON_Curve * > &loop)
 
HIDDEN ON_SimpleArray< TrimmedFace * > split_trimmed_face (const TrimmedFace *orig_face, ON_ClassArray< LinkedCurve > &ssx_curves)
 
HIDDEN bool is_same_surface (const ON_Surface *surf1, const ON_Surface *surf2)
 
HIDDEN void add_elements (ON_Brep *brep, ON_BrepFace &face, const ON_SimpleArray< ON_Curve * > &loop, ON_BrepLoop::TYPE loop_type)
 
HIDDEN bool is_point_on_brep_surface (const ON_3dPoint &pt, const ON_Brep *brep, ON_SimpleArray< Subsurface * > &surf_tree)
 
HIDDEN bool is_point_inside_brep (const ON_3dPoint &pt, const ON_Brep *brep, ON_SimpleArray< Subsurface * > &surf_tree)
 
HIDDEN bool is_point_inside_trimmed_face (const ON_2dPoint &pt, const TrimmedFace *tface)
 
HIDDEN ON_2dPoint get_point_inside_trimmed_face (const TrimmedFace *tface)
 
HIDDEN int face_brep_location (const TrimmedFace *tface, const ON_Brep *brep, ON_SimpleArray< Subsurface * > &surf_tree)
 
HIDDEN ON_ClassArray< ON_SimpleArray< SSICurve > > get_face_intersection_curves (ON_SimpleArray< Subsurface * > &surf_tree1, ON_SimpleArray< Subsurface * > &surf_tree2, const ON_Brep *brep1, const ON_Brep *brep2, op_type operation)
 
HIDDEN ON_SimpleArray< ON_Curve * > get_face_trim_loop (const ON_Brep *brep, int face_loop_index)
 
HIDDEN ON_SimpleArray< TrimmedFace * > get_trimmed_faces (const ON_Brep *brep)
 
HIDDEN void categorize_trimmed_faces (ON_ClassArray< ON_SimpleArray< TrimmedFace * > > &trimmed_faces, const ON_Brep *brep1, const ON_Brep *brep2, ON_SimpleArray< Subsurface * > &surf_tree1, ON_SimpleArray< Subsurface * > &surf_tree2, op_type operation)
 
HIDDEN ON_ClassArray< ON_SimpleArray< TrimmedFace * > > get_evaluated_faces (const ON_Brep *brep1, const ON_Brep *brep2, op_type operation)
 
HIDDEN void standardize_loop_orientations (ON_Brep *brep)
 
int ON_Boolean (ON_Brep *evaluated_brep, const ON_Brep *brep1, const ON_Brep *brep2, op_type operation)
 

Detailed Description

Evaluate NURBS booleans (union, intersection and difference).

Definition in file boolean.cpp.

Macro Definition Documentation

#define ANGLE_TOL   ON_PI/1800.0

Definition at line 52 of file boolean.cpp.

Referenced by point_loop_location().

#define LOOP_DIRECTION_CCW   1
#define LOOP_DIRECTION_CW   -1
#define LOOP_DIRECTION_NONE   0

Definition at line 1677 of file boolean.cpp.

Referenced by set_loop_direction().

Enumeration Type Documentation

anonymous enum
Enumerator
OUTSIDE_OR_ON_LOOP 
INSIDE_OR_ON_LOOP 

Definition at line 416 of file boolean.cpp.

Enumerator
SEAM_NONE 
SEAM_ALONG_V 
SEAM_ALONG_U 
SEAM_ALONG_UV 

Definition at line 718 of file boolean.cpp.

anonymous enum
Enumerator
OUTSIDE_BREP 
INSIDE_BREP 
ON_BREP_SURFACE 

Definition at line 3352 of file boolean.cpp.

Function Documentation

HIDDEN void append_to_polycurve ( ON_Curve *  curve,
ON_PolyCurve &  polycurve 
)
HIDDEN int loop_t_compare ( const IntersectPoint p1,
const IntersectPoint p2 
)

Definition at line 320 of file boolean.cpp.

References IntersectPoint::m_loop_seg, and IntersectPoint::m_seg_t.

Referenced by split_face_into_loops().

HIDDEN int curve_t_compare ( const IntersectPoint p1,
const IntersectPoint p2 
)

Definition at line 331 of file boolean.cpp.

References IntersectPoint::m_curve_t.

Referenced by split_face_into_loops().

HIDDEN bool is_loop_valid ( const ON_SimpleArray< ON_Curve * > &  loop,
double  tolerance,
ON_PolyCurve *  polycurve = NULL 
)

Definition at line 359 of file boolean.cpp.

References append_to_polycurve(), bu_log(), and ON_NearZero().

Referenced by face_brep_location(), get_point_inside_trimmed_face(), is_point_on_loop(), point_loop_location(), and split_face_into_loops().

Here is the call graph for this function:

HIDDEN int point_loop_location ( const ON_2dPoint &  pt,
const ON_SimpleArray< ON_Curve * > &  loop 
)

Definition at line 429 of file boolean.cpp.

References ANGLE_TOL, INSIDE_OR_ON_LOOP, INTERSECTION_TOL, is_loop_valid(), ON_Intersect(), out, and OUTSIDE_OR_ON_LOOP.

Referenced by is_point_inside_loop(), is_point_outside_loop(), and CurvePoint::PointLoopLocation().

Here is the call graph for this function:

HIDDEN bool is_point_on_loop ( const ON_2dPoint &  pt,
const ON_SimpleArray< ON_Curve * > &  loop 
)

Definition at line 485 of file boolean.cpp.

References INTERSECTION_TOL, is_loop_valid(), and ON_Intersect().

Referenced by is_point_inside_loop(), is_point_outside_loop(), and CurvePoint::PointLoopLocation().

Here is the call graph for this function:

HIDDEN bool is_point_inside_loop ( const ON_2dPoint &  pt,
const ON_SimpleArray< ON_Curve * > &  loop 
)

Definition at line 503 of file boolean.cpp.

References INSIDE_OR_ON_LOOP, is_point_on_loop(), and point_loop_location().

Referenced by get_curve_intervals_inside_or_on_face(), is_point_inside_trimmed_face(), and split_face_into_loops().

Here is the call graph for this function:

HIDDEN bool is_point_outside_loop ( const ON_2dPoint &  pt,
const ON_SimpleArray< ON_Curve * > &  loop 
)

Definition at line 509 of file boolean.cpp.

References is_point_on_loop(), OUTSIDE_OR_ON_LOOP, and point_loop_location().

Referenced by get_curve_intervals_inside_or_on_face(), is_point_inside_brep(), is_point_inside_trimmed_face(), and is_point_on_brep_surface().

Here is the call graph for this function:

HIDDEN ON_Interval union_intervals ( const ON_SimpleArray< ON_Interval > &  intervals)

Definition at line 515 of file boolean.cpp.

HIDDEN ON_Interval intersect_intervals ( const ON_Interval &  interval1,
const ON_Interval &  interval2 
)

Definition at line 528 of file boolean.cpp.

HIDDEN void replace_curve_with_subcurve ( ON_Curve *&  curve,
const ON_Interval &  interval 
)

Definition at line 538 of file boolean.cpp.

References sub_curve().

Here is the call graph for this function:

HIDDEN ON_SimpleArray<ON_Interval> get_curve_intervals_inside_or_on_face ( ON_Curve *  curve2D,
const ON_ClassArray< ON_SimpleArray< ON_Curve * > > &  face_loops,
double  isect_tol 
)

Definition at line 551 of file boolean.cpp.

References bu_log(), is_point_inside_loop(), is_point_outside_loop(), ON_Intersect(), and ON_NearZero().

Referenced by get_subcurves_inside_faces().

Here is the call graph for this function:

HIDDEN int compare_interval ( const ON_Interval *  a,
const ON_Interval *  b 
)

Definition at line 641 of file boolean.cpp.

HIDDEN IntervalParams curve_interval_from_params ( IntervalParams  interval_t,
const ON_Curve *  curve 
)

Definition at line 678 of file boolean.cpp.

References IntervalParams::MakeIncreasing(), IntervalParams::max, IntervalParams::mid, IntervalParams::min, and ON_NearZero().

Referenced by interval_2d_to_3d(), and interval_3d_to_2d().

Here is the call graph for this function:

HIDDEN IntervalPoints uv_interval_from_points ( IntervalPoints  interval_pts,
const ON_Surface *  surf 
)

Definition at line 725 of file boolean.cpp.

References INTERSECTION_TOL, IsAtSeam(), IntervalPoints::max, IntervalPoints::mid, IntervalPoints::min, ON_Intersect(), ON_NearZero(), and SEAM_ALONG_U.

Referenced by interval_2d_to_uv(), and interval_3d_to_2d().

Here is the call graph for this function:

HIDDEN IntervalPoints interval_2d_to_uv ( const ON_Interval &  interval_2d,
const ON_Curve *  curve2d,
const ON_Surface *  surf 
)

Definition at line 810 of file boolean.cpp.

References IntervalPoints::max, IntervalPoints::mid, IntervalPoints::min, and uv_interval_from_points().

Referenced by interval_2d_to_2uv(), and interval_2d_to_3d().

Here is the call graph for this function:

HIDDEN std::pair<IntervalPoints, IntervalPoints> interval_2d_to_2uv ( const ON_Interval &  interval_2d,
const ON_Curve *  curve2d,
const ON_Surface *  surf,
double  split_t 
)

Definition at line 825 of file boolean.cpp.

References interval_2d_to_uv(), and out.

Referenced by interval_2d_to_3d().

Here is the call graph for this function:

HIDDEN IntervalPoints points_uv_to_3d ( const IntervalPoints interval_uv,
const ON_Surface *  surf 
)

Definition at line 843 of file boolean.cpp.

References IntervalPoints::max, IntervalPoints::mid, and IntervalPoints::min.

Referenced by interval_2d_to_3d().

HIDDEN IntervalParams points_3d_to_params_3d ( const IntervalPoints pts_3d,
const ON_Curve *  curve3d 
)

Definition at line 857 of file boolean.cpp.

References INTERSECTION_TOL, IntervalPoints::max, IntervalParams::max, IntervalPoints::mid, IntervalParams::mid, IntervalPoints::min, IntervalParams::min, and ON_Intersect().

Referenced by interval_2d_to_3d().

Here is the call graph for this function:

HIDDEN std::vector<ON_Interval> interval_2d_to_3d ( const ON_Interval &  interval,
const ON_Curve *  curve2d,
const ON_Curve *  curve3d,
const ON_Surface *  surf 
)

Definition at line 879 of file boolean.cpp.

References bu_log(), curve_interval_from_params(), INTERSECTION_TOL, interval_2d_to_2uv(), interval_2d_to_uv(), IsAtSeam(), IntervalParams::max, IntervalParams::min, ON_Intersect(), ON_NearZero(), points_3d_to_params_3d(), points_uv_to_3d(), SEAM_ALONG_U, SEAM_ALONG_UV, SEAM_ALONG_V, and SEAM_NONE.

Referenced by get_subcurves_inside_faces().

Here is the call graph for this function:

HIDDEN ON_Interval interval_3d_to_2d ( const ON_Interval &  interval,
const ON_Curve *  curve2d,
const ON_Curve *  curve3d,
const ON_BrepFace *  face 
)

Definition at line 1011 of file boolean.cpp.

References curve_interval_from_params(), INTERSECTION_TOL, IntervalPoints::max, IntervalParams::max, IntervalPoints::mid, IntervalParams::mid, IntervalPoints::min, IntervalParams::min, ON_Intersect(), ON_NearZero(), and uv_interval_from_points().

Referenced by get_subcurves_inside_faces().

Here is the call graph for this function:

HIDDEN void get_subcurves_inside_faces ( ON_SimpleArray< ON_Curve * > &  subcurves_on1,
ON_SimpleArray< ON_Curve * > &  subcurves_on2,
const ON_Brep brep1,
const ON_Brep brep2,
int  face_i1,
int  face_i2,
ON_SSX_EVENT *  event 
)

Definition at line 1070 of file boolean.cpp.

References bu_log(), get_curve_intervals_inside_or_on_face(), INTERSECTION_TOL, interval_2d_to_3d(), interval_3d_to_2d(), out, and sub_curve().

Referenced by get_face_intersection_curves().

Here is the call graph for this function:

HIDDEN double bbox_diagonal_length ( ON_Curve *  curve)

Definition at line 1189 of file boolean.cpp.

Referenced by get_joinable_ssi_curves().

HIDDEN void split_curve ( ON_Curve *&  left,
ON_Curve *&  right,
const ON_Curve *  in,
double  t 
)

Definition at line 1204 of file boolean.cpp.

References sub_curve().

Referenced by get_joinable_ssi_curves().

Here is the call graph for this function:

HIDDEN double configure_for_linking ( LinkedCurve *&  first,
LinkedCurve *&  second,
LinkedCurve in1,
LinkedCurve in2 
)

Definition at line 1219 of file boolean.cpp.

References LinkedCurve::PointAtEnd(), LinkedCurve::PointAtStart(), and LinkedCurve::Reverse().

Referenced by link_curves().

Here is the call graph for this function:

HIDDEN ON_ClassArray<LinkedCurve> get_joinable_ssi_curves ( const ON_SimpleArray< SSICurve > &  in)

Definition at line 1262 of file boolean.cpp.

References LinkedCurve::Append(), bbox_diagonal_length(), bu_log(), INTERSECTION_TOL, ON_Intersect(), ON_NearZero(), out, split_curve(), and sub_curve().

Referenced by link_curves().

Here is the call graph for this function:

HIDDEN ON_ClassArray<LinkedCurve> link_curves ( const ON_SimpleArray< SSICurve > &  in)

Definition at line 1403 of file boolean.cpp.

References LinkedCurve::Append(), bu_log(), configure_for_linking(), DEBUG_BREP_BOOLEAN, get_joinable_ssi_curves(), INTERSECTION_TOL, LinkedCurve::m_ssi_curves, out, and LinkedCurve::PointAtEnd().

Referenced by get_evaluated_faces().

Here is the call graph for this function:

HIDDEN bool close_small_gap ( ON_SimpleArray< ON_Curve * > &  loop,
int  curr,
int  next 
)

Definition at line 1680 of file boolean.cpp.

Referenced by close_small_gaps().

HIDDEN void close_small_gaps ( ON_SimpleArray< ON_Curve * > &  loop)

Definition at line 1695 of file boolean.cpp.

References close_small_gap().

Referenced by loop_boolean(), split_face_into_loops(), and split_trimmed_face().

Here is the call graph for this function:

ON_Curve* get_loop_curve ( const ON_SimpleArray< ON_Curve * > &  loop)

Definition at line 1709 of file boolean.cpp.

References append_to_polycurve().

Referenced by find_innerloop(), loop_is_degenerate(), make_result_from_loops(), set_loop_direction(), and split_trimmed_face().

Here is the call graph for this function:

std::list<ON_SimpleArray<ON_Curve *> >::iterator find_innerloop ( std::list< ON_SimpleArray< ON_Curve * > > &  loops)

Definition at line 1719 of file boolean.cpp.

References get_loop_curve(), and LOOP_DIRECTION_CW.

Here is the call graph for this function:

bool set_loop_direction ( ON_SimpleArray< ON_Curve * > &  loop,
int  dir 
)

Definition at line 1735 of file boolean.cpp.

References get_loop_curve(), and LOOP_DIRECTION_NONE.

Referenced by innerloops_inside_outerloop(), and loop_boolean().

Here is the call graph for this function:

void add_point_to_set ( std::multiset< CurvePoint > &  set,
CurvePoint  pt 
)

Definition at line 1759 of file boolean.cpp.

Referenced by loop_boolean().

std::multiset<CurveSegment> make_segments ( std::multiset< CurvePoint > &  curve1_points,
ON_SimpleArray< ON_Curve * > &  loop1,
ON_SimpleArray< ON_Curve * > &  loop2 
)

Definition at line 1767 of file boolean.cpp.

References CurvePoint::BOUNDARY, CurveSegment::BOUNDARY, CurvePoint::curve_t, CurvePoint::INSIDE, CurveSegment::INSIDE, CurveSegment::IsDegenerate(), CurvePoint::location, CurveSegment::location, CurvePoint::loop_index, out, CurvePoint::OUTSIDE, CurveSegment::OUTSIDE, and CurvePoint::PointLoopLocation().

Referenced by loop_boolean().

Here is the call graph for this function:

void set_append_segment ( std::multiset< CurveSegment > &  out,
const CurveSegment seg 
)

Definition at line 1822 of file boolean.cpp.

References CurveSegment::Curve(), CurveSegment::from, INTERSECTION_TOL, ON_Intersect(), and CurveSegment::to.

Referenced by set_append_segments_at_location().

Here is the call graph for this function:

void set_append_segments_at_location ( std::multiset< CurveSegment > &  out,
std::multiset< CurveSegment > &  in,
CurveSegment::Location  location,
bool  reversed_segs_cancel 
)

Definition at line 1845 of file boolean.cpp.

References set_append_segment().

Referenced by get_op_segments().

Here is the call graph for this function:

std::multiset<CurveSegment> find_similar_segments ( std::multiset< CurveSegment > &  set,
const CurveSegment seg 
)

Definition at line 1868 of file boolean.cpp.

References CurveSegment::from, out, and CurveSegment::to.

Referenced by get_op_segments().

HIDDEN std::multiset<CurveSegment> get_op_segments ( std::multiset< CurveSegment > &  curve1_segments,
std::multiset< CurveSegment > &  curve2_segments,
op_type  op 
)

Definition at line 1886 of file boolean.cpp.

References CurveSegment::BOUNDARY, find_similar_segments(), CurveSegment::INSIDE, out, CurveSegment::OUTSIDE, and set_append_segments_at_location().

Referenced by loop_boolean().

Here is the call graph for this function:

std::list<ON_SimpleArray<ON_Curve *> > construct_loops_from_segments ( std::multiset< CurveSegment > &  segments)

Definition at line 1983 of file boolean.cpp.

References bu_log(), and out.

Referenced by loop_boolean().

Here is the call graph for this function:

std::multiset<CurvePoint> get_loop_points ( int  source_loop,
ON_SimpleArray< ON_Curve * >  loop1,
ON_SimpleArray< ON_Curve * >  loop2 
)

Definition at line 2055 of file boolean.cpp.

References out.

Referenced by loop_boolean().

HIDDEN LoopBooleanResult make_result_from_loops ( const std::list< ON_SimpleArray< ON_Curve * > > &  loops)

Definition at line 2077 of file boolean.cpp.

References get_loop_curve(), LoopBooleanResult::innerloops, LOOP_DIRECTION_CCW, LOOP_DIRECTION_CW, out, and LoopBooleanResult::outerloops.

Referenced by loop_boolean().

Here is the call graph for this function:

LoopBooleanResult loop_boolean ( const ON_SimpleArray< ON_Curve * > &  l1,
const ON_SimpleArray< ON_Curve * > &  l2,
op_type  op 
)

Definition at line 2108 of file boolean.cpp.

References add_point_to_set(), CurvePoint::BOUNDARY, bu_log(), close_small_gaps(), construct_loops_from_segments(), get_loop_points(), get_op_segments(), INTERSECTION_TOL, LOOP_DIRECTION_CCW, LOOP_DIRECTION_CW, make_result_from_loops(), make_segments(), ON_Intersect(), out, and set_loop_direction().

Referenced by combine_loops(), innerloops_inside_outerloop(), and split_trimmed_face().

Here is the call graph for this function:

std::list<ON_SimpleArray<ON_Curve *> > innerloops_inside_outerloop ( const ON_SimpleArray< ON_Curve * > &  outerloop_curve,
const std::vector< ON_SimpleArray< ON_Curve * > > &  innerloop_curves 
)

Definition at line 2217 of file boolean.cpp.

References LoopBooleanResult::ClearInnerloops(), loop_boolean(), LOOP_DIRECTION_CW, out, LoopBooleanResult::outerloops, and set_loop_direction().

Referenced by make_face_from_loops().

Here is the call graph for this function:

TrimmedFace* make_face_from_loops ( const TrimmedFace orig_face,
const ON_SimpleArray< ON_Curve * > &  outerloop,
const std::vector< ON_SimpleArray< ON_Curve * > > &  innerloops 
)

Definition at line 2240 of file boolean.cpp.

References innerloops_inside_outerloop(), TrimmedFace::m_face, TrimmedFace::m_innerloop, and TrimmedFace::m_outerloop.

Referenced by append_faces_from_loops().

Here is the call graph for this function:

HIDDEN LoopBooleanResult combine_loops ( const TrimmedFace orig_face,
const LoopBooleanResult new_loops 
)

Definition at line 2264 of file boolean.cpp.

References LoopBooleanResult::ClearOuterloops(), LoopBooleanResult::innerloops, loop_boolean(), TrimmedFace::m_innerloop, out, and LoopBooleanResult::outerloops.

Referenced by append_faces_from_loops().

Here is the call graph for this function:

HIDDEN void append_faces_from_loops ( ON_SimpleArray< TrimmedFace * > &  out,
const TrimmedFace orig_face,
const LoopBooleanResult new_loops 
)

Definition at line 2380 of file boolean.cpp.

References combine_loops(), LoopBooleanResult::innerloops, make_face_from_loops(), and LoopBooleanResult::outerloops.

Referenced by split_trimmed_face().

Here is the call graph for this function:

void free_loops ( std::vector< ON_SimpleArray< ON_Curve * > > &  loops)

Definition at line 2722 of file boolean.cpp.

Referenced by split_trimmed_face().

bool loop_is_degenerate ( const ON_SimpleArray< ON_Curve * > &  loop)

Definition at line 2733 of file boolean.cpp.

References get_loop_curve(), and INTERSECTION_TOL.

Referenced by split_trimmed_face().

Here is the call graph for this function:

HIDDEN ON_SimpleArray<TrimmedFace *> split_trimmed_face ( const TrimmedFace orig_face,
ON_ClassArray< LinkedCurve > &  ssx_curves 
)

Definition at line 2786 of file boolean.cpp.

References append_faces_from_loops(), bu_log(), LoopBooleanResult::ClearInnerloops(), close_small_gaps(), DEBUG_BREP_BOOLEAN, TrimmedFace::Duplicate(), free_loops(), get_loop_curve(), loop_boolean(), loop_is_degenerate(), TrimmedFace::m_outerloop, out, LoopBooleanResult::outerloops, and split_face_into_loops().

Referenced by get_evaluated_faces().

Here is the call graph for this function:

HIDDEN bool is_same_surface ( const ON_Surface *  surf1,
const ON_Surface *  surf2 
)

Definition at line 2910 of file boolean.cpp.

References ON_NearZero().

Referenced by get_face_intersection_curves().

Here is the call graph for this function:

HIDDEN void add_elements ( ON_Brep brep,
ON_BrepFace &  face,
const ON_SimpleArray< ON_Curve * > &  loop,
ON_BrepLoop::TYPE  loop_type 
)

Definition at line 2986 of file boolean.cpp.

References INTERSECTION_TOL, and MAX_FASTF.

Referenced by ON_Boolean().

HIDDEN bool is_point_on_brep_surface ( const ON_3dPoint &  pt,
const ON_Brep brep,
ON_SimpleArray< Subsurface * > &  surf_tree 
)

Definition at line 3165 of file boolean.cpp.

References bu_log(), INTERSECTION_TOL, is_point_outside_loop(), and ON_Intersect().

Referenced by face_brep_location().

Here is the call graph for this function:

HIDDEN bool is_point_inside_brep ( const ON_3dPoint &  pt,
const ON_Brep brep,
ON_SimpleArray< Subsurface * > &  surf_tree 
)

Definition at line 3217 of file boolean.cpp.

References bu_log(), INTERSECTION_TOL, is_point_outside_loop(), and ON_Intersect().

Referenced by face_brep_location().

Here is the call graph for this function:

HIDDEN bool is_point_inside_trimmed_face ( const ON_2dPoint &  pt,
const TrimmedFace tface 
)

Definition at line 3299 of file boolean.cpp.

References is_point_inside_loop(), is_point_outside_loop(), TrimmedFace::m_innerloop, and TrimmedFace::m_outerloop.

Referenced by get_point_inside_trimmed_face().

Here is the call graph for this function:

HIDDEN ON_2dPoint get_point_inside_trimmed_face ( const TrimmedFace tface)

Definition at line 3319 of file boolean.cpp.

References is_loop_valid(), is_point_inside_trimmed_face(), and TrimmedFace::m_outerloop.

Referenced by categorize_trimmed_faces(), and face_brep_location().

Here is the call graph for this function:

HIDDEN int face_brep_location ( const TrimmedFace tface,
const ON_Brep brep,
ON_SimpleArray< Subsurface * > &  surf_tree 
)

Definition at line 3364 of file boolean.cpp.

References bu_log(), DEBUG_BREP_BOOLEAN, get_point_inside_trimmed_face(), INSIDE_BREP, INTERSECTION_TOL, is_loop_valid(), is_point_inside_brep(), is_point_on_brep_surface(), TrimmedFace::m_face, TrimmedFace::m_outerloop, ON_BREP_SURFACE, and OUTSIDE_BREP.

Referenced by categorize_trimmed_faces().

Here is the call graph for this function:

HIDDEN ON_ClassArray<ON_SimpleArray<SSICurve> > get_face_intersection_curves ( ON_SimpleArray< Subsurface * > &  surf_tree1,
ON_SimpleArray< Subsurface * > &  surf_tree2,
const ON_Brep brep1,
const ON_Brep brep2,
op_type  operation 
)

Definition at line 3408 of file boolean.cpp.

References bu_log(), DEBUG_BREP_BOOLEAN, get_subcurves_inside_faces(), INTERSECTION_TOL, is_same_surface(), SSICurve::m_curve, and ON_Intersect().

Referenced by get_evaluated_faces().

Here is the call graph for this function:

HIDDEN ON_SimpleArray<ON_Curve *> get_face_trim_loop ( const ON_Brep brep,
int  face_loop_index 
)

Definition at line 3595 of file boolean.cpp.

Referenced by get_trimmed_faces().

HIDDEN ON_SimpleArray<TrimmedFace *> get_trimmed_faces ( const ON_Brep brep)

Definition at line 3608 of file boolean.cpp.

References get_face_trim_loop(), TrimmedFace::m_face, TrimmedFace::m_innerloop, and TrimmedFace::m_outerloop.

Referenced by get_evaluated_faces().

Here is the call graph for this function:

HIDDEN void categorize_trimmed_faces ( ON_ClassArray< ON_SimpleArray< TrimmedFace * > > &  trimmed_faces,
const ON_Brep brep1,
const ON_Brep brep2,
ON_SimpleArray< Subsurface * > &  surf_tree1,
ON_SimpleArray< Subsurface * > &  surf_tree2,
op_type  operation 
)

Definition at line 3633 of file boolean.cpp.

References TrimmedFace::BELONG, bu_log(), DEBUG_BREP_BOOLEAN, face_brep_location(), get_point_inside_trimmed_face(), INSIDE_BREP, INTERSECTION_TOL, TrimmedFace::NOT_BELONG, ON_BREP_SURFACE, ON_Intersect(), OUTSIDE_BREP, and TrimmedFace::UNKNOWN.

Referenced by get_evaluated_faces().

Here is the call graph for this function:

HIDDEN ON_ClassArray<ON_SimpleArray<TrimmedFace *> > get_evaluated_faces ( const ON_Brep brep1,
const ON_Brep brep2,
op_type  operation 
)

Definition at line 3750 of file boolean.cpp.

References categorize_trimmed_faces(), get_face_intersection_curves(), get_trimmed_faces(), link_curves(), and split_trimmed_face().

Referenced by ON_Boolean().

Here is the call graph for this function:

HIDDEN void standardize_loop_orientations ( ON_Brep brep)

Definition at line 3819 of file boolean.cpp.

References LOOP_DIRECTION_CCW, and LOOP_DIRECTION_CW.

Referenced by ON_Boolean().

int ON_Boolean ( ON_Brep evaluated_brep,
const ON_Brep brep1,
const ON_Brep brep2,
op_type  operation 
)

Definition at line 3891 of file boolean.cpp.

References add_elements(), TrimmedFace::BELONG, bu_log(), TrimmedFace::Duplicate(), get_evaluated_faces(), TrimmedFace::m_belong_to_final, TrimmedFace::m_innerloop, TrimmedFace::m_outerloop, TrimmedFace::m_rev, and standardize_loop_orientations().

Referenced by conv_tree(), and rt_brep_boolean().

Here is the call graph for this function: