BRL-CAD
View related geometric clipping
Collaboration diagram for View related geometric clipping:

Files

file  clip.h
 

Functions

int bg_lseg_clip (fastf_t *xp1, fastf_t *yp1, fastf_t *xp2, fastf_t *yp2, fastf_t clip_min, fastf_t clip_max)
 Clip a 2-D integer line seg against the size of the display. More...
 
int bg_ray_vclip (point_t a, point_t b, fastf_t *min_pt, fastf_t *max_pt)
 Clip a line segment against a rectangular parallelepiped (RPP). More...
 

Detailed Description

Clipping functions for comment geometric operations needed when drawing wireframes in a view window.

Function Documentation

◆ bg_lseg_clip()

int bg_lseg_clip ( fastf_t xp1,
fastf_t yp1,
fastf_t xp2,
fastf_t yp2,
fastf_t  clip_min,
fastf_t  clip_max 
)

Clip a 2-D integer line seg against the size of the display.

◆ bg_ray_vclip()

int bg_ray_vclip ( point_t  a,
point_t  b,
fastf_t min_pt,
fastf_t max_pt 
)

Clip a line segment against a rectangular parallelepiped (RPP).

The RPP has faces parallel to the coordinate planes and is defined by a minimum point and a maximum point.

FIXME: the function name implies this takes a point,dir for a,b but it actually takes a line segment going from points a to b!

Returns - 0 if ray does not hit RPP, !0 if ray hits RPP.

Implicit Return - if !0 was returned, "a" and "b" have been clipped to the RPP.