# Refinement and Computation Method for Line/Body Topological Relationships
## 3 Derivation and Computation of Basic Intersection Types
### Refinement Relationship Computation  
From Figure 4, it can be observed that among the 2 intersection points and 21 intersection lines between lines and bodies, the types of intersection points are entirely determined by the adjacency conditions \"_null, out_\" and \"_out, out_\". Among the 21 intersection lines, the adjacency conditions of their endpoints are expressed by \"_null, out, on, in_\", which play a crucial role in determining the basic types of intersection lines. Therefore, the following discussion focuses on the method of determining the adjacency relationships of intersection line endpoints. First, it is necessary to define the symbols and functions used in the computation of refinement relationships. The participating body object is denoted as **A**, and the line object is denoted as **B**. The boundary of **A** is represented as \(\partial\)**A**,  
1. Intersect the line object **B** with the boundary and interior of the body object **A** separately to obtain F and V and let I = F\(\cup\)V.
2. Since, mathematically, the interior intersections in V of the line/body do not include points on the boundary of the body object **A**, some isolated points in the line/body boundary intersections F are not unit intersections of the line/body but rather boundary points at the closure of some intersection lines \(v_{i}\) inside the line/body (i.e., endpoints of intersection lines that traverse the boundary of the body object in GIS). Therefore, we first need to extract these points from F, determining whether the closure of the elements \(v_{i}\) in V intersects with these isolated points in F. If there is no intersection, the point is a unit intersection; otherwise, the point, along with its adjacent intersection line \(v_{i}\) in the interior of the line/body, forms an intersection line of the line/body (with the point being an endpoint of the intersection line). Since this part constitutes derived points and is not a unit intersection of the line/body, it is marked for \"_discard_\" processing. 3. For the intersection points in F, their adjacency conditions still need to be determined. The method is as follows: if the unit intersection point is on the boundary (endpoint) of the line object, then its adjacency predicate is \"_null_, _out_\" (as shown in Figure 4a); otherwise, its adjacency type is \"_out_, _out_\" (as shown in Figure 4b). 4. For the unit intersection of lines, first extract the endpoints (_End_(_i_)). If this point is also a boundary point of the line object, then its adjacency predicate is \"_null_\" (as shown in Figure 4c-j,n-q); otherwise, take its adjacent point near this intersection endpoint by a distance \(\varepsilon\) (slightly larger than the tolerance) (_Adj_(_End_(_i_))) and determine the relationship between this adjacent point and the body object. If this adjacent point is outside the body object, then the adjacency predicate is \"_out_\" (as shown in Figure 4g,k, etc.). If this adjacent point is inside the body object, then the adjacency predicate is \"_in_\" (as shown in Figure 4m,u, etc. ); otherwise, the adjacency predicate is \"_on_\" (as shown in Figure 4q,t,w, etc.). This process allows us to determine the adjacency type of all endpoints of the intersection lines one by one. To determine the basic type of each intersection, we also need to determine the values of \(f_{E}\) and \(f_{S}\) in Equation (2). \(f_{S}\) represents the number of intersections between the endpoints of the intersection lines and the surface of the body. In the method for determining the unit intersection adjacency relationship in Figure 5, we have already determined the relationship between each intersection endpoint and the boundary of the body object **A**, indirectly determining the value of \(f_{S}\). Next, we focus on discussing the method for determining \(f_{E}\).