|
◆ liangBarskyClip()
Clip a line segment using the Liang-Barsky algorithm.
- Parameters
-
[in] | point1,point2 | Input points |
[in] | box | Bounding box |
[in] | hasz | Has Z dimension? |
[in] | border_inc | True when the box contains the upper border, otherwise the upper border is assumed as outside of the box. |
[out] | point3,point4 | Output points |
[out] | p3_inc,p4_inc | Are the points included or not in the box? These are only written/returned when border_inc is false |
- Returns
- True if the line segment defined by p1,p2 intersects the bounding box, false otherwise.
- Note
- It is possible to mix 2D/3D geometries, the Z dimension is only considered if both the temporal point and the box have Z dimension
- See also
- The Liang-Barsky algorithm is explained in https://www.researchgate.net/publication/255657434_Some_Improvements_to_a_Parametric_Line_Clipping_Algorithm
|