Modeladvanced
Function representation
Also called FRep, F-rep.
Represents a solid as the set where a continuous real function is at least 0. Booleans, blends, offsets and maps are operations that make new functions from old ones.
Function representation (F-rep) describes a solid by one real function. A continuous function on space defines the solid : the points with are inside, the points with are on the boundary, and the points with are outside. A union, an intersection, a blend or a twist of solids is then an operation that makes a new function from the old ones, so a model is an expression tree of primitives and operations, like a CSG tree with more kinds of nodes. Pasko, Adzhiev, Sourin and Savchenko proposed this framework in 1995, and its set operations use the R-functions of Rvachev, of which and are the simplest. The page has the kind "model", but F-rep is a representation scheme, not a model of cost; so the four sections of the model kind give the representation ("the machine"), what it can express ("what it counts"), its relation to other representations, and the known results.
The machine
The "machine" here is the representation: the data that stores a solid and the one query that it answers directly, the sign of at a point. An F-rep object in is given by a continuous function , and the object is
The sign is the opposite of the signed distance function, which is negative inside; if is the signed distance to a solid, then represents it here. The function is stored as an expression: a tree whose leaves are primitives and whose inner nodes are operations. To classify a point, evaluate the tree at the point and look at the sign of the value. This takes one pass over the tree.
Some primitives, with a point and :
| primitive | function |
|---|---|
| ball of radius at | |
| halfspace | |
| infinite cylinder of radius about the axis | |
| a sampled volume, such as a CT scan | the interpolated value minus a threshold |
The set operations come from R-functions. For a parameter with ,
Union is , intersection is , complement is and difference is . With the root is , so and . With the operations are , which are smooth wherever and are smooth and not both 0.
The other operations of the F-rep framework act on the function in the same way. The blend below is the bounded blending used in F-rep: a displacement added to an R-function.
| operation | new function | what it does |
|---|---|---|
| blended union | adds material near the meeting of the two boundaries, so the join is rounded; removes material instead | |
| offset | or | shrinks or grows the solid; it is the true offset by only when is a distance |
| bijective map | moves, scales, twists or bends the solid | |
| metamorphosis | for | turns one solid into the other as goes from 0 to 1 |
| Cartesian product | on the pairs | the product of an -dimensional and an -dimensional object |
| projection | the shadow of an object of dimension in dimension |
What it counts
F-rep counts no cost; this section says which solids it can express. In the terms of Requicha's theory of representation schemes, F-rep has these properties.
- Domain. Every closed set is for some continuous , for example . So the domain is limited only by the primitives and operations that a system offers. With polynomial primitives and and , the domain is exactly the closed semialgebraic sets (see the known results).
- Validity. Every continuous gives a closed set, but the set can be empty, unbounded, or not regular. For the set is the plane , which has no interior. So a valid solid needs a check that the tree alone does not give.
- Unambiguity. The function decides each point, so the set is fixed by the function.
- Uniqueness. It fails. The functions , and , and the R-function operations for every , give the same set with different functions.
The model is not limited to three dimensions. A function of is an object that changes with the time , a function of more coordinates can carry material or colour, and the product and the projection move between dimensions.
Relation to other models
The other models here are the other representation schemes of solids and surfaces.
- Constructive solid geometry. A CSG tree whose primitives have defining functions becomes an F-rep tree when each , and is replaced by , and . The known results below give the condition under which this is exact for the regularized operations. Blends, metamorphosis and general maps have no CSG node, so F-rep is the larger scheme.
- Implicit surfaces. The boundary is an implicit surface, and it is a smooth surface where the gradient of is not 0. F-rep is about the solid, not about the surface: the sign gives the inside.
- Distance functions. A signed distance is one choice of , with the opposite sign. F-rep does not need it: most F-rep functions, among them every and result, are not distances.
- Spatial occupancy enumeration. Sampling the sign of at the centres of grid cells gives a voxel set, and a voxel grid of values with interpolation gives an F-rep primitive.
- Boundary representation. F-rep stores no faces or edges. A B-rep or a mesh must be computed, usually by isosurface extraction such as marching cubes, and it is an approximation. In the other direction, B-rep to CSG conversion in the work of Shapiro and Vossler finds a Boolean expression of halfspaces, and R-functions can turn such an expression into one function.
Known results in the model
The sign sets of min and max. For continuous and , , and , since exactly when or , and exactly when both are. These are the ordinary set operations, not the regularized ones. For the halfspaces and , is the plane : a dangling face.
The regularized reading. Read the solid of as , which is always closed and regular. Suppose the zero sets and have no interior. Then , and , and the three new functions again have zero sets with no interior, so the rule holds for whole trees. In the example above, , the regularized answer.
Proof. Write , , and ; these sets are open, and is dense in . Union: , whose closure is , and a union of two regular closed sets is regular, so it is . Intersection: let . The open set is dense in , so is dense and open in , and in the same way is dense and open in . Two dense open subsets of meet in a dense subset, so . Difference: , because is closed. The set is open and misses . Each nonempty open outside has on it, and is not inside the zero set of , so meets : is dense in . As for the intersection, . The zero sets of and lie in the union of the zero sets of and , a finite union of closed sets with no interior, which has no interior.
R-functions keep the sign of min and max. For , has the sign of and has the sign of , so every result above holds for them too. Proof. Write , and , so . If , then and . If one of them is 0 and the other is at most 0, the sum is 0. If , then and the sum is positive; if and not both 0, the sum is positive. Divide by . For , note . This is the defining property of an R-function: its sign depends only on the signs of its arguments, through a Boolean function. It also means that an exact sign test of an R-function tree needs no square roots: compute the signs of the leaves and combine them by the Boolean rules, as in exact geometric computation.
The functions are not the same as the sets. The operations and for are not idempotent on functions: for . So the function of a tree depends on its shape, a distance function does not stay a distance after an R-function, and an offset of such a result is not the true offset by (see solid offsetting).
The domain with polynomials. If the primitives are polynomials and the operations are , and , then is a closed semialgebraic set, by induction on the tree. Conversely, by the finiteness theorem of real algebraic geometry, every closed semialgebraic set is a finite union of sets , so it is .
Point membership and rendering. One point test costs one evaluation of the tree, operations for a tree of nodes. With interval arithmetic, the same tree evaluated on a box gives an interval that contains every value of on the box. If the interval is positive, the whole box is inside; if it is negative, the whole box is outside. This gives guaranteed in and out boxes for meshing and for octrees, and only the unknown boxes need more work. Ray casting needs the first root of along a ray; when has a known Lipschitz constant (Lipschitz condition), sphere tracing finds it without missing a thin part. Without such a bound, sampling of at grid points or along a ray can miss features smaller than the step. These guarantees are proved; the speed of the methods depends on the model and is only measured.
History. Ricci in 1973 defined union and intersection of solids given by functions, with and , and smooth approximations of them that blend the joins. Rvachev developed the theory of R-functions from the 1960s, as Shapiro's survey of 2007 describes. Pasko, Adzhiev, Sourin and Savchenko gave the F-rep framework in 1995, with R-functions for the set operations and a list of other operations on the defining function, in any number of dimensions.
References
- Alexander Pasko, Valery Adzhiev, Alexei Sourin and Vladimir Savchenko, Function representation in geometric modeling, concepts, implementation and applications, The Visual Computer 11(8), 429 to 446, 1995, the definition of an object by f(X) ≥ 0 in n dimensions, and the operations on the defining function, set-theoretic operations by R-functions, blending, offsetting, bijective mapping, projection, Cartesian product and metamorphosis
- Vadim Shapiro, Semi-analytic geometry with R-functions, Acta Numerica 16, 239 to 303, 2007, the definition of R-functions, the systems R_α with min and max as the case α = 1, their smoothness, and their history from Rvachev's work of the 1960s
- A. Ricci, A constructive geometry for computer graphics, The Computer Journal 16(2), 157 to 160, 1973, union and intersection of solids given by functions, and their smooth approximations that blend the joins
- Jacek Bochnak, Michel Coste and Marie-Françoise Roy, Real Algebraic Geometry, Springer, 1998, Chapter 2, Section 2.7, Theorem 2.7.2 (the finiteness theorem, every closed semi-algebraic set is a finite union of basic closed semi-algebraic sets)
- Aristides A. G. Requicha, Representations for rigid solids, theory, methods, and systems, ACM Computing Surveys 12(4), 437 to 464, 1980, the properties of a representation scheme, its domain, validity, unambiguity and uniqueness, used here to place F-rep among the schemes
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 6SDGKH Edit this page History Report an error Markdown