 Research
 Open Access
Surface editing using swept surface 3D models
 Xiaohui Wang^{1} and
 Jingyan Qin^{1}Email author
https://doi.org/10.1186/s1364001702070
© The Author(s). 2017
 Received: 26 June 2017
 Accepted: 16 August 2017
 Published: 24 August 2017
Abstract
This paper presents a system for editing striplike patches on the mesh using swept surface. The user first selects a rough cylinderlike region, the boundary of which is automatically refined. A swept surface approximation is automatically done, including extraction of the trajectory and the corresponding deforming 2D curves. The swept surface is described by a map from a real interval to both rigid body deformations and 2D curves. These 2D curves are analyzed and decomposed into many elements, which can be edited respectively, and a novel pattern analysis is also performed on these elements to extract curve patterns. These 2D curves serve as handles for controlling the geometry, and modifications to them can change the geometry directly. Thus, users can just edit the pattern or element curve to control the global geometry. We show the novelty and efficiency of our framework using varietal demonstrations.
Keywords
 Swept surface
 Feature editing
 Pattern analysis
1 Introduction
To meet the growing needs for 3D models, modeling from existing models is becoming a practical way for generating new models rapidly and efficiently. Local surface editing is a popular way for this, which is also an important and active research topic in computer graphics.
The stateoftheart local surface editing techniques depend on intrinsic coordinates, such as multiresolution decompositions [1] and various shape deformation frameworks. Both provide efficient and reliable functionalities for deformation, geometry transferring, and so on. However, such techniques focus on global deformation of the surface patch or geometry transferring, which is not competent for more sophisticated surface editing with rich user interaction.
Though professional modeling packages [2, 3] can provide precise control using parametric patches or subdivision surfaces, they are really sophisticated and tiresome to use, especially for inexperienced users. In users’ point of view, surface editing or modeling by 2D curves is always the ideal choice. The most famous example is teddy [4], which is a huge success and is significantly improved by a recent work [5].
In the meanwhile, pattern recognition techniques develop rapidly in recent years. In the graphics field, techniques such as geometry feature (or pattern) clustering and analysis play a more and more important role. Typical work is [6], in which local featured areas are clustered and matched using geometrical descriptors. In a more recent work [7], they present a framework for discovering structural regularity including similar transformations. However, geometric features are hard to analyze. Current approaches focus on similar transformations extraction or local geometrical descriptor analysis. Both rely on simple geometric properties such as curvature. The applications are limited to simple geometric patterns with similar curvature distributions. More complicated patterns sensitive to human beings cannot be analyzed. Using such analysis for easier surface editing is even harder. To the best of our knowledge, no existing technique exploits pattern recognition for better user experience. Just think of the following scenario: you select a part and edit it, all similar parts changed, and then, the editing work is significantly simplified.

Usability: It must be sufficiently easy to use. 2D curve editing instead of sophisticated parameter control is always preferred.

Intelligence: It must be smart enough to handle boring repetitive work automatically, such as applying similar modification to similar parts can be done by just selecting one part, editing it, and all done.

Functionality: It must be powerful enough for complicated surface editing.
However, it is a challenging job. Precise control and easier user interaction is somewhat a contradiction. And intelligent interaction such as handling repetitive work automatically is even harder.
Luckily, we observe that a significant amount of feature regions we can see in 3D models are cylinderlike and have the nature of sweeping, that is, they can be described by swept surface. In general, it is known as swept volume, which is generated by the motion (including deformation) of arbitrary 3D object. In this paper, we only consider swept surface generated by restricting the object to be planar curves. The swept surface is a natural, intuitive, and convenient 3D modeling method with a long history and is widely used in computeraided design (CAD) field. It is generated by moving curve C_{1}(v) along another curve C_{2}(u), which are called profile curve and trajectory curve respectively, and C_{1}(u) may be deformed during its motion along the trajectory. Swept surface can naturally decompose the shape into the trajectory and associated profile curves. If we restrict C_{1}(v) to be planar curves, it can be described and analyzed easily using crossplanes given by local Frenet frames [8] of the trajectory. Then, editing the surface details becomes editing 2D curves, which provides both convenient and precise controlling of the shape. The most exciting thing is that the analysis of the geometry similarity becomes the analysis of a sequence of 2D curves, which is much easier. Such analysis also enables the system to supply intelligent editing as mentioned above. These 2D profile curves can be further decomposed into many elementary elements, including PCA (principle component analysis) and multiresolution analysis, each of which can be analyzed and edited independently. This is also our main motivation. In CAD field, this is also known as generalized cylinders [9]. Modeling using generalized cylinders is done through construction of the trajectory and the profile curves (crosssection curves), respectively.
Our work is also closely related to skeleton extraction methods as it is a crucial step for extracting the trajectory of swept surface. And a severe problem is that it is hard to extract the skeleton for open mesh, as common automatic methods such as medialaxesbased are illposed. In [10], they present a novel method for the extraction of mesh skeleton, which is robust and can bring a direct relation between the mesh vertices and the skeleton. We further improve this method to enable it to work on open mesh.

A swept surface representation of local surface patch. It provides the fundamental technique of the whole system. It allows users to edit local surface freely and efficiently and enables better pattern analysis for intelligent editing.

Approximating mesh surface patch by swept surface. We present a robust way of approximating surface patch by swept surface.

Analysis of patterns using swept surface. We present a novel way for detecting repetitive patterns along the trajectory.

A special fine property is that all the operations, including varieties of editing and even geometry transfer, do not need a reparameterization, that is, we can keep the topology of mesh while doing such editing work.
The left of the paper is arranged as the following. Section 2 is a description of our swept surface representation of mesh patch. Section 3 is an informal introduction of the user editing procedure of the system, that is, how the user can use our system to edit the mesh patch. Section 4 is the creation algorithm part and explains how the swept surface representation is created. Section 5 is the decomposition step for decomposing 2D curves to lower level elements, which can be edited respectively. Section 6 explains our analysis algorithm for further facilitating the user editing. Section 7 explains when the user finishes editing of the 2D curves and how the original mesh is modified.
2 The swept surface representation
2.1 Swept surface
2.2 Discrete swept surface patch on mesh
To clarify the subsequent statements, we suppose that the mesh has n vertices. We use V = {1, 2…n} to denote the set of its vertices. E = {(i, j)} is the set of edges, and V_{E} is the set of all the points on edges (including vertices). We identify (i, j) and (j, i) for each edge. For each point i, N_{1}(i) means the onering points of i. We use v_{i} and n_{i} to denote the original position and normal for vertex i, and v_{i}’ is the new position. Vertices of the selected region are denoted by V_{S}.

Discreteness. As the patch is to be analyzed and edited, a discrete representation is needed.

Editing. Editing of swept surface can change the mesh patch while keeping other regions of the mesh.
For ℂ_{i,j} = (p, k, l, λ), we use ℂ_{i,j}^{p}, ℂ_{i,j}^{k}, ℂ_{i,j}^{l}, ℂ_{i,j}λ to represent p, k, l, λ, respectively, and use ℂ_{i,j}^{p} to denote the projected 3D position τ_{i}ℂ_{i,j}^{p} + ξ_{i}.
3 User editing

Modify a subsequence of curves when the user just wants to change a small portion of the curve sequence. Usually, he does not have to change each of the curves. For example, he may make an affine transformation for one figure and use the same transformation for each of the curves. He may apply specify several transformations for some of them, and the system applies interpolated transformations for other curves automatically. He may also create new curves using similar methods to replace all them.

Editing the sequence using a single curve. When the curve decomposition includes real values, these values can then be edited as a single realvalued function (see Fig. 2 for example). The profile figure of the cuboid is a sequence of squares. Using PCA analysis, the rotation angle for one of the principle directions is a constant or a straight line of that described by a real value function. We just replace the line by another straight line, and then, the cuboid becomes twisty.

Editing repetitive templates. When the curves have the character of repetition, our system can further facilitate the editing work by an automatic analysis of such patterns. The user may just select a single pattern and replace it, and then, all the occurrences of the pattern are changed (see Fig. 5).

Using template library. We also design a template library for replacing existing curves by other predesigned curves. The user may replace portions of the curve sequence or patterns by predesigned curves.

Geometry transfer. Though it is not our main purpose, our system can still easily handle cylinderlike feature transfer. Each of the elements can be transferred respectively. This is done by replacing the sequence of target model by the corresponding element function of the source model (see Fig. 3).
4 Methods—creation of swept surface

Refinement of selection. The shape of the swept surface region is crucial to subsequent analysis and editing. However, it is impossible for users to select a precise region as they need. Generally, the most important quality of the boundary is the smoothness, which means the smoothness of not only the curve itself but also the region it crosses, that is, it should not cross the boundary of dissimilar regions. To ensure this criterion, we require the smoothness of both the curve and the normal of the original mesh along the curve.

Extraction of trajectory. The trajectory extraction is the pivotal step for creation of the representation. To create a meaningful swept surface, traditional skeleton is always the ideal choice. However, as the selected region is a cylinderlike open mesh, with surface details or noise, it is a challenge to extract the skeleton from such open mesh, and traditional methods such as Reeb graph, potential field, distance field, or medial surface will not give a robust and reliable solution. So, we use a variety of the method in [10]. However, there are sometimes more than one connected curves for each plane, and only the main curve is preserved.

Refinement of trajectory and extraction of profile curves. The profile curves are extracted by the intersection of the crosssection planes and the mesh.
4.1 Refinement of selection
This is essentially a graphcut problem. To solve it, we first build a directed graph by creating two directed edges with the same weight for each edge of G and create a source vertex connecting to the vertices in V_{select} with weight ω_{select} and a sink vertex connected from the vertices in V_{unselect} with weight ω_{unselect}. Then maximal flow algorithm is used to solve it.
We apply the following rule to further smooth the boundary. For each vertex on the boundary, the spanning angle formed by it and its two neighbors is computed. At each time, the vertex that has the smallest value of angle and of which two neighbors share an edge on the original mesh is removed by connecting its two neighbors directly on the boundary. The process is repeated iteratively.
4.2 Extraction of skeleton
The method in [10] contains two steps: geometric contraction and connectivity surgery. We extend the first step to mesh with boundary and retain the latter unchanged.
The following statements take the mesh patch as a separated mesh. We denote E and \( \overline{E} \) as its interior edges set and boundary edges set, respectively.
However, this does not work for boundary points. We observe that if the patch is mirrored along its boundary, then the boundary points become inner points. We do not need to really mirror the patch, such as creating new points. Instead, we use a modified version of the Laplacian contraction, and these boundary points contract normally along the inward curvature flow in normal directions as inner points.
The output of this step is a skeleton consisting of points and straight lines connecting them, and a byproduct is the map from each vertex on the mesh and its corresponding point on the skeleton. For a point v on the mesh edge, we use S(v) to denote its corresponding point on the skeleton. Note that the skeleton may not just consist of a single curve; we take it as a graph and just choose the path with the maximal length as the initial trajectory (the vertices are treated as sample points). As not every point on the mesh is associated with the trajectory, we denote the vertices associated with the trajectory by V_{s0} and use T to denote the trajectory.
4.3 Refinement of trajectory and profile curves

Profile curve extraction. The local Frenet frame at each vertex of the trajectory is calculated using discrete geometry, including the associated crosssection planes.
Here, MeanDistance measures the mean belonging likelihood, the less value the MeanDistance has, the more likelihood this component belong to the vertex t. So, we just choose the component has the minimal value of MeanDistance.

Trajectory refinement. The trajectory is refined with respect to both the smoothness and the embedding. Suppose current positions of the trajectory vertices are x_{1}, x_{2},…, x_{n}, then the new positions x_{1}’, x_{2}’,…, x_{n}’ is given by minimizing the quadratic:
5 Decomposition of planar curves
To make the editing of sequence of planar curves practical, each planar curve can be decomposed into several independent lower level elements. The main motivation of such decomposition is to create an easier humancomputer interaction, and another motivation is to facilitate pattern analysis. Formally, for any curve C, there are several elements C_{1}, C_{2},…, C_{n}, such that C = F(C_{1}, C_{2},…,C_{n}), where F is the inverse map from lower level elements to the whole curve. Each C_{i} may be real value or planar curve.

Affine decomposition. Affine transform is a map of the form

Multidimensional decomposition. A curve can be further decomposed into multilevel curves using the Bspline wavelets. It has the form C = F(C_{1}, C_{2}), where F is the wavelet reconstruction operator and C_{1} and C_{2} are the base curve and detailed curve, respectively. Each curve may be edited respectively. This decomposition can be used to handle planar geometry textures as in Fig. 3.
6 Analysis of sequence
Analysis is the key step to provide the intelligence in the system and can magically ease the editing work.
6.1 Analysis representation
The repetitive pattern analysis is performed on a sequence of elements.
For a clearer description, we start from the continuous case:

The templates should be neither too long nor too short.

There should be as less templates as possible.

There should be as less segments of [a, b] as possible.
The discrete case is almost the same. Let a be 0 and b length of the trajectory. For each sample point i, we just let f(l_{i}) the specified associated element, where l_{i} is the length parameter for the point as in Section 2.2. Other values of f are assigned using linear interpolation. We call the function f the element function.
6.2 Extraction of template
After the extraction of trajectory and profile curves, we aim to find the templates of the element function f along the trajectory. Here, we present a novel pattern analysis process. The algorithm is described as follows:
In order to find templates, sets of similar segments along the trajectory are computed at first. A segment s_{i} is denoted as [s_{i0}, s_{i1}], where s_{i0} and s_{i1} are the start and end of sample points along the trajectory. Two segments are considered similar if their distance is less than a prescribed threshold. The distance metric of segments can be defined based on the property of function f.
The set S_{i} that has the maximum value of maximum coverage is then found out, and the corresponding set of nonoverlapping segments is reported. The next possible template is extracted by repeating the above process after eliminating the reported segments from the trajectory.
In the case of handling planar curves, we use the centroid distancebased Fourier descriptor [12] as the shape descriptor of planar curves to compute the distance metric of segments, because it is suitable for describing planar curves. Each planar curve is then represented by a feature vector:
In other cases, the distance metric of segments can be defined based on property of function f. For example, if the object space D is R, the distance is defined as the L_{n} distance of two real functions.
7 Modification of the mesh
After profile curves being modified, the original mesh should be changed due to changed 2D curves. As mentioned in Section 2.2, regions controlled by the swept surface should be modified corresponding to the swept surface, while other regions should retain their original shapes. To keep the topology of the mesh, we only modify the positions of vertices. So points in V_{1} should be constrained by the swept surface, and points in V_{2} should be constrained by their original local coordinate, which is, in our implementation, the Laplacian coordinate.
The swept term controls the shape to be consistent with the swept surface. And the Laplacian term in Equation 29 constraints uncontrolled vertices to their original shape. However, the above two terms cannot determine a smooth shape (and sometimes there are infinitely many solutions). So, we use an average term to further control the smoothness of the controlled region.
8 Results and discussion
9 Conclusions
In this paper, we proposed a novel framework for mesh editing using swept surface. The user just selects a cylinderlike patch and then can edit it as 2D figures. A swept surface approximation is automatically done, including extraction of the trajectory and the corresponding deforming 2D curves. A novel pattern analysis is done, so the user can change a set of elements by just editing one of them. Demonstrations show the novelty and efficiency of this framework.
The swept surface analysis can be extended to multitrajectories, that is, the trajectory is not restricted to a single line. As for the future work, we intend to implement a multigrid linear solver, which can significantly improve the algorithm performance.
Declarations
Acknowledgements
The authors thank the editor and reviewers.
Funding
This work was supported by the Natural Science Foundation of China (61602033), the Social Science Fund of Beijing (16YTC027), the Science and Technology Plan Project of Beijing (Z171100001217009), and the Fundamental Research Funds for the Central Universities (FRFTP15027A1).
Availability of data and materials
We can provide the data.
Authors’ contributions
XW did the main work of the work. JQ did the experiments.
Ethics approval and consent to participate
We approved.
Authors’ information
Xiaohui Wang, female, has a PhD degree, and is from the School of Mechanical Engineering, University of Science and Technology Beijing. Her main research interests are computer vision, pattern recognition, affective computing, and interdisciplinary research across computer science and art design. Jingyan Qin, female, is a professor, has a PhD degree, and is from the School of Mechanical Engineering, University of Science and Technology Beijing. Her main research interests are interaction design, information design, and information visualization on big data.
Consent for publication
We agree.
Competing interests
The authors declare that they have no competing interests.
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
Authors’ Affiliations
References
 M. Lounsbery, T.D. DeRose, J. Warren, Multiresolution analysis for surfaces of arbitrary topological type. ACM Transaction on Graphics 16(1), 34–73 (1997)View ArticleGoogle Scholar
 MAYA. Autodesk. https://www.autodesk.com/products/maya.
 [3DS] MAX. Autodesk https://www.autodesk.com/products/3dsmax/.
 T. Igarashi, S. Matsuoka, H. Tanaka, Teddy: a sketching interface for 3D freeform design (ACM SIGGRAPH, ACM, New York, 2007)View ArticleGoogle Scholar
 A. Nealen, T. Igarashi, O. Sorkine, M. Alexa, FiberMesh: designing freeform surfaces with 3D curves (ACM SIGGRAPH, ACM, New York, 2007)Google Scholar
 R. Gal, D. CohenOr, Salient geometric features for partial shape matching and similarity. ACM Transaction on Graphics 25(1), 130–150 (2006)View ArticleGoogle Scholar
 M. Pauly, N.J. Mitra, J. Wallner, H. Pottmann, L.J. Guibas, Discovering structural regularity in 3D geometry. ACM Transaction on Graphics 27(3), 1–11 (2008)View ArticleGoogle Scholar
 Manfredo P. Do Carmo. Differential geometry of curves and surfaces. Prentice Hall, 1976Google Scholar
 A.S. Aguado, E. Montiel, E. Zaluska, Modeling generalized cylinders via Fourier morphing. ACM Transaction on Graphics 18(4), 293–315 (1999)View ArticleGoogle Scholar
 A. Oscar KinChung, C.L. Tai, H.K. Chu, D. CohenOr, T.Y. Lee, Skeleton extraction by mesh contraction. ACM Transaction on Graphics 27(3), 1–10 (2008)Google Scholar
 Y.k. Lai, Q.y. Zhou, S.m. Hu, J. Wallner, H. Pottmann, Robust feature classification and editing. IEEE Trans. Vis. Comput. Graph. 13(1), 34–45 (2007)View ArticleGoogle Scholar
 D. Zhang, L. Guojun, in Proc. of 5th Asian Conference on Computer Vision (ACCV). A comparative study of Fourier descriptors for shape representation and retrieval, vol 2 (2002), pp. 652–657Google Scholar