BRL-CAD
Loading...
Searching...
No Matches

Data Structures

class  BBNode
 
class  BRNode
 
class  CurveTree
 
class  PullbackContext
 
struct  PullbackStatistics
 
class  SurfaceTree
 

Typedefs

typedef std::shared_ptr< PullbackWorkBudgetPullbackWorkBudgetHandle
 
typedef bool(* PullbackCancellationCallback) (void *context)
 

Functions

bool sortX (const BRNode *first, const BRNode *second)
 
bool sortY (const BRNode *first, const BRNode *second)
 
PullbackWorkBudgetHandle CreatePullbackWorkBudget (uint64_t maximum_work_milliseconds)
 
PullbackWorkBudgetHandle CurrentPullbackWorkBudget ()
 
void SetPullbackWorkLimit (PullbackCancellationCallback cancellation_callback, void *cancellation_context, uint64_t maximum_work_milliseconds, uint64_t maximum_stall_milliseconds=0)
 
void SetPullbackWorkLimit (PullbackCancellationCallback cancellation_callback, void *cancellation_context, const PullbackWorkBudgetHandle &work_budget, uint64_t maximum_stall_milliseconds=0)
 
void ClearPullbackWorkLimit ()
 
bool PullbackWorkCancelled ()
 
bool PullbackWorkDeadlineExpired ()
 
bool PullbackWorkStalled ()
 
void PullbackWorkProgress (uint64_t operations=1)
 
void PropagatePullbackWorkStop (bool deadline_expired, bool stalled)
 
uint64_t PullbackWorkRemainingMilliseconds ()
 
bool surface_GetClosestPoint3dFirstOrder (PullbackContext &context, const ON_Surface *surf, const ON_3dPoint &point, ON_2dPoint &surface_point, ON_3dPoint &lifted_point, double &distance, int quadrant=0, double same_point_tol=BREP_SAME_POINT_TOLERANCE, double within_distance_tol=BREP_EDGE_MISS_TOLERANCE)
 
bool get_closest_point (ON_2dPoint &outpt, const ON_BrepFace &face, const ON_3dPoint &point, const SurfaceTree *tree=NULL, double tolerance=BREP_FCP_ROOT_EPSILON)
 
ON_Curvepullback_curve (ON_BrepFace *face, const ON_Curve *curve, SurfaceTree *tree=NULL, double tolerance=BREP_FCP_ROOT_EPSILON, double flatness=1.0e-3)
 

Typedef Documentation

◆ PullbackWorkBudgetHandle

◆ PullbackCancellationCallback

typedef bool(* PullbackCancellationCallback) (void *context)

Install thread-local cancellation, CPU-work, and no-progress limits for the current geometry job. A zero work limit disables that timer.

Definition at line 199 of file pullback.h.

Function Documentation

◆ sortX()

bool sortX ( const BRNode first,
const BRNode second 
)
extern

◆ sortY()

bool sortY ( const BRNode first,
const BRNode second 
)
extern

◆ CreatePullbackWorkBudget()

PullbackWorkBudgetHandle CreatePullbackWorkBudget ( uint64_t  maximum_work_milliseconds)
extern

Create a CPU-work budget shared by all threads assisting one geometry job. The budget follows the longest sequential worker path, rather than charging time while workers are descheduled or summing genuinely parallel work. A zero limit returns an unlimited handle.

◆ CurrentPullbackWorkBudget()

PullbackWorkBudgetHandle CurrentPullbackWorkBudget ( )
extern

Return the calling thread's current job budget so nested helper threads can participate in the same limit.

◆ SetPullbackWorkLimit() [1/2]

void SetPullbackWorkLimit ( PullbackCancellationCallback  cancellation_callback,
void cancellation_context,
uint64_t  maximum_work_milliseconds,
uint64_t  maximum_stall_milliseconds = 0 
)
extern

◆ SetPullbackWorkLimit() [2/2]

void SetPullbackWorkLimit ( PullbackCancellationCallback  cancellation_callback,
void cancellation_context,
const PullbackWorkBudgetHandle work_budget,
uint64_t  maximum_stall_milliseconds = 0 
)
extern

Join an existing job budget from a nested helper thread.

◆ ClearPullbackWorkLimit()

void ClearPullbackWorkLimit ( )
extern

◆ PullbackWorkCancelled()

bool PullbackWorkCancelled ( )
extern

◆ PullbackWorkDeadlineExpired()

bool PullbackWorkDeadlineExpired ( )
extern

◆ PullbackWorkStalled()

bool PullbackWorkStalled ( )
extern

◆ PullbackWorkProgress()

void PullbackWorkProgress ( uint64_t  operations = 1)
extern

Record completion of one or more bounded solver operations. This heartbeat is independent of elapsed item deadlines and therefore keeps –no-item-budget runs cancellable when an algorithm stops advancing.

◆ PropagatePullbackWorkStop()

void PropagatePullbackWorkStop ( bool  deadline_expired,
bool  stalled 
)
extern

Propagate a helper thread's stop reason to the parent geometry job.

◆ PullbackWorkRemainingMilliseconds()

uint64_t PullbackWorkRemainingMilliseconds ( )
extern

Milliseconds remaining on the calling thread's CPU-work budget. UINT64_MAX means no deadline is installed. This permits a bounded parent conversion job to propagate its original budget to helper threads without restarting the per-item limit.

◆ surface_GetClosestPoint3dFirstOrder()

bool surface_GetClosestPoint3dFirstOrder ( PullbackContext context,
const ON_Surface surf,
const ON_3dPoint point,
ON_2dPoint surface_point,
ON_3dPoint lifted_point,
double distance,
int  quadrant = 0,
double  same_point_tol = BREP_SAME_POINT_TOLERANCE,
double  within_distance_tol = BREP_EDGE_MISS_TOLERANCE 
)
extern

◆ get_closest_point()

bool get_closest_point ( ON_2dPoint outpt,
const ON_BrepFace face,
const ON_3dPoint point,
const SurfaceTree tree = NULL,
double  tolerance = BREP_FCP_ROOT_EPSILON 
)

approach:

  • get an estimate using the surface tree (if non-null, create one otherwise)
  • find a point (u, v) for which S(u, v) is closest to point


    – minimize the distance function: D(u, v) = sqrt(|S(u, v)-pt|^2)


    – simplify by minimizing f(u, v) = |S(u, v)-pt|^2

    – minimum occurs when the gradient is zero, i.e.

    \[ \nabla f(u, v) = |\vec{S}(u, v)-\vec{p}|^2 = 0 \]

◆ pullback_curve()

ON_Curve * pullback_curve ( ON_BrepFace face,
const ON_Curve curve,
SurfaceTree tree = NULL,
double  tolerance = BREP_FCP_ROOT_EPSILON,
double  flatness = 1.0e-3 
)
extern

Pull an arbitrary model-space curve onto the given surface as a curve within the surface's domain when, for each point c = C(t) on the curve and the closest point s = S(u, v) on the surface, we have: distance(c, s) <= tolerance.

The resulting 2-dimensional curve will be approximated using the following process:

  1. Adaptively sample the 3d curve in the domain of the surface (ensure tolerance constraint). Sampling terminates when the following flatness criterion is met:

given two parameters on the curve t1 and t2 (which map to points p1 and p2 on the curve) let m be a parameter randomly chosen near the middle of the interval [t1, t2] ____ then the curve between t1 and t2 is flat if distance(C(m), p1p2) < flatness

  1. Use the sampled points to perform a global interpolation using universal knot generation to build a B-Spline curve.
  2. If the curve is a line or an arc (determined with openNURBS routines), return the appropriate ON_Curve subclass (otherwise, return an ON_NurbsCurve).