Variational geometric modeling with black box constraints and DAGs Paper by: Gilles Gouaty, Lincong Fang, Dominique Michelucci, Marc Daniel, Jean-Philippe Pernot, Romain Raffin, Sandrine Lanquetin, Marc Neveuc A presentation by: Boris van Sosin 1 Introduction and motivation Modeling with CAD systems is a multi-level process Product Component Structure & surface details Geometric primitives Used by product designers Used by CAD systems 2 Introduction and motivation Parametric modeling: โข Vector of parameters: ๐ = ๐ข0 , ๐ข1 , โฆ , ๐ข๐โ1 โข Shape: ๐น ๐ โข Designer modifies ๐น ๐ by changing ๐. 3 Introduction and motivation Variational modeling: โข Designer specifies shape function and constraints: ๐น ๐ ๐0 ๐ = 0 ๐1 ๐ = 0 โฎ ๐๐โ1 ๐ = 0 โข Solver finds ๐ which satisfies constraints. 4 Introduction and motivation Variational modeling: โข Often the design needs to minimize some criterion. โข E.g. cost, mass, physical stress, surface energyโฆ โข Often, ๐ โซ ๐. โข๐น ๐ argmin๐ ๐บ ๐ s.t.: ๐0 ๐ = 0 ๐1 ๐ = 0 โฎ ๐๐โ1 ๐ = 0 5 Introduction and motivation Main tool: โข DAG representation โข Leaves are variables or constants โข Simple operators: + * ^ โข +,-,*,/, power, root, etc. โข More Complex operators: Var x Var y Const 2 โข Bézier/B-spline control points, subdivision surface parameters, etc. 6 Related work โข Variational modeling introduced in: โVariational geometry in computer-aided designโ, V. C. Lin, D. C. Gossard, R. A. Light, SIGGRAPH '81 Proceedings of the 8th annual conference on Computer graphics and interactive techniques, 1981 โข Feature based modeling introduced in: โExpert form feature modelling shellโ, J.J. Shah. M. T. Rogers, Computer-Aided Design, 1988 โข โModifying the shape of NURBS surfaces with geometric constraintsโ, S.M. Hu, Y.F. Li, T. Ju, X. Zhu, Computer-Aided Design, 2001 7 Numerical Optimization Numerically solving constraint problems / optimization problems โข Recall: single variable, scalar function ๐ ๐ฅ case. โข Observation: optimization problems are local extremum finding problems. โข Can be solved as zero problems of ๐ โฒ ๐ฅ . โข Newtonโs Method on ๐ โฒ ๐ฅ : 1 โฒ ๐ฅ๐+1 = ๐ฅ๐ โ ๐ ๐ฅ๐ โ โฒโฒ ๐ ๐ฅ 8 Numerical Optimization Numerically solving constraint problems / optimization problems โข Multivariate case: ๐ ๐ is a scalar function of a vector variable ๐. โข Derivative โ gradient vector Inverse second derivative โ inverse Hessian matrix โข Newtonโs Method: For finding extrema of ๐ ๐ , find ๐ such that ๐ป๐ ๐ = 0. ๐๐+1 = ๐๐ โ ๐พ ๐ฏ๐ ๐๐ โ1 ๐ป๐ ๐๐ โข where: ๐ฏ๐ ๐๐ โ1 is the inverse Hessian, and ๐พ is a step-size constant. 9 Numerical Optimization โข Quasi-Newton methods are used when ๐ฏ๐ ๐๐ is difficult to compute. โข Hessian is approximated by matrix ๐ฉ๐ . โข Update step is ๐๐+1 = ๐๐ โ ๐พ๐ฉโ1 ๐ ๐ป๐ ๐๐ โ1 โ1 โข ๐ฉโ1 ๐ has an update step: ๐ฉ๐+1 = ๐ข๐๐๐๐ก๐ ๐ฉ๐ โข Examples: โข DFP (DavidonโFletcherโPowell) โข BFGS (BroydenโFletcherโGoldfarbโShanno) 10 Numerical Optimization โข Pattern-search methods are used when even gradient is unavailable. โข A discretized gradient descent approach. โข Evaluate function at a finite set of points in a pre-determined pattern. โข If the minimum/maximum is not at the center, set new center to minimum/maximum. โข Otherwise, shrink pattern by half. โข โOptimization by Direct Search: New Perspectives on Some Classical and Modern Methodsโ, T.G. Kolda, R.M. Lewis, V. Torczon, SIAM Review, 2003 Image source: https://en.wikipedia.org/wiki/File:Direct_search_BROYDEN.gif 11 The DAG Representation โข Advantages: โข More general than simple Bézier/B-spline representation. โข Functions such as abs, sgn, min, max, etc. are easy to represent. โข Efficient to re-evaluate if only some parameters are changed. + โข Derivatives are computed by chain rule. โข Where they exist. * โข Composition is trivial to compute. ^ โข Disadvantages: โข Interval analysis. Var x Var y Const 2 โข Limitations: โข Closest point on curve/surface to a given point. โข The โifโ (or ternary) operator. 12 From DAGs to Procedures Solution: allow any procedure to be a โblack-boxโ node in a DAG. โข Properties: โข โข โข โข More high level operators. Can still know on which variables a node depends. Composition is still trivial to compute. Efficient evaluation by compiling procedures. โข Disadvantages: โข No symbolic evaluation, only floating-point. โข No closed-form formula representation. โข No derivative computation. โข Can be approximated by finite differences. โข Definitely no interval analysis. 13 Solving With Black-Box Constraints Problem formulation: โข Most generally: โข argmin๐ ๐บ(๐) s.t. ๐น ๐ =0 is a vector of variables, where ๐ = ๐0 , โฆ , ๐๐โ1 ๐บ ๐ is a scalar function, ๐น ๐ = ๐น0 ๐ , โฆ , ๐น๐โ1 ๐ is a vector function of constraints. 14 Solving With Black-Box Constraints Problem formulation: โข Shortcuts: argmin๐ ๐บ(๐) s.t. ๐น ๐ =0 โข If there is no ๐น ๐ : unconstrained optimization โ use BFGS. โข If only approximate solution is needed: minimize ๐ป ๐ = ๐บ ๐ + ๐ค ๐ ๐น๐ ๐ 2 , for a very large constant ๐ค. โข If no ๐บ ๐ : minimize ๐ป ๐ = ๐ ๐น๐ ๐ 2 . 15 Solving With Black-Box Constraints Problem formulation: โข argmin๐ ๐บ(๐) s.t. ๐น ๐ =0 โข Solved as Lagrange Multiplier problem: โ ๐, ๐ฟ = ๐บ ๐ + ๐ ๐ฟ๐ ๐น๐ ๐ โข Local minima of ๐บ ๐ , with constraints ๐น ๐ are: ๐โ ๐, ๐ฟ ๐๐บ ๐ ๐๐น๐ ๐ = + ๐ฟ๐ = 0 โ๐:0โค๐<๐ ๐๐๐ ๐๐๐ ๐๐๐ ๐ ๐ปโ = ๐โ ๐, ๐ฟ = ๐น๐ ๐ = 0 โ๐:0โค๐<๐ ๐๐ฟ๐ 16 Solving With Black-Box Constraints โข Constrained optimization: argmin๐ ๐บ(๐) s.t. ๐น ๐ =0 โข Solved as Lagrange Multiplier problem: โ ๐, ๐ฟ = ๐บ ๐ + โข Solved as unconstrained optimization: argmin๐ H ๐, ๐ฟ where: H ๐, ๐ฟ = ๐ปโ ๐, ๐ฟ 2 = ๐โ ๐,๐ฟ ๐ ๐๐๐ โข Derivatives approximated with finite differences. 2 + ๐โ ๐,๐ฟ ๐ ๐๐ฟ๐ ๐ ๐ฟ๐ ๐น๐ ๐ 2 17 Solving With Black-Box Constraints Solving: argmin๐ H ๐, ๐ฟ where: H ๐, ๐ฟ = ๐ปโ ๐, ๐ฟ 2 = ๐โ ๐,๐ฟ ๐ ๐๐๐ 2 + ๐โ ๐,๐ฟ ๐ ๐๐ฟ๐ 2 โข Finds only local minima โข Result depends on initial guess. โข Design process assumptions: โข Product design is an iterative process. โข ๐ from the previous design iteration used as initial guess. โข If no initial guess is provided, meta-heuristics are used: simulated annealing, genetic algorithms, swarm optimization, etc. 18 Solving With Black-Box Constraints Solving: argmin๐ H ๐, ๐ฟ where: H ๐, ๐ฟ = ๐ปโ ๐, ๐ฟ 2 = ๐โ ๐,๐ฟ ๐ ๐๐๐ 2 + ๐โ ๐,๐ฟ ๐ ๐๐ฟ๐ 2 โข No initial guess for ๐ฟ๐ โข Solved by homotopy-inspired method. โข Continuous deformation while preserving topology. โข โSolving geometric constraints by homotopyโ, Hervé Lamure, Dominique Michelucci, SMA '95 Proceedings โข Define a continuum of problems: ๐ ๐ก : argmin๐ ๐บ ๐ = ๐ก๐บ ๐ + 1 โ ๐ก ๐บ 0 ๐ s.t. ๐น ๐ก ๐ = ๐ก๐น ๐ + 1 โ ๐ก ๐น 0 ๐ = 0 for ๐ก โ 0,1 . 19 Solving With Black-Box Constraints Solving by homotopy-like method: ๐ ๐ก : argmin๐ ๐บ ๐ = ๐ก๐บ ๐ + 1 โ ๐ก ๐บ 0 ๐ s.t. ๐น ๐ก ๐ = ๐ก๐น ๐ + 1 โ ๐ก ๐น 0 ๐ = 0 for ๐ก โ 0,1 . โข ๐บ 1 ๐ = ๐บ ๐ ,๐น โข Choose: 1 ๐ = ๐น ๐ . ๐(1) is the original problem. ๐ 0 = ๐ = initial guess. ๐น 0 ๐ = ๐น ๐ โ ๐น ๐ 0 . Lagrange multipliers ๐ฟ = 0 satisfy these constraints. 0 0 2 ๐บ ๐ = ๐โ๐ or ๐บ 0 ๐ = ๐ถ๐๐๐ ๐ก โ 0 so that ๐ (0) minimizes ๐บ 0 . Lagrange multiplier problem: ๐โ ๐,๐ฟ ๐ ๐๐๐ 2 + ๐โ ๐,๐ฟ ๐ ๐๐ฟ๐ 2 = ๐ป๐บ 0 2 + ๐ ๐ฟ๐ ๐ป๐น๐ 0 2 + ๐ ๐น๐ 0 2 20 Solving With Black-Box Constraints Solving by homotopy-like method: ๐ ๐ก : argmin๐ ๐บ ๐ = ๐ก๐บ ๐ + 1 โ ๐ก ๐บ 0 ๐ s.t. ๐น ๐ก ๐ = ๐ก๐น ๐ + 1 โ ๐ก ๐น 0 ๐ = 0 for ๐ก โ 0,1 . โข ๐บ 1 ๐ = ๐บ ๐ ,๐น โข Choose: ๐ ๐น ๐บ 0 0 0 1 ๐ = ๐น ๐ . ๐(1) is the original problem. = ๐ = initial guess. ๐ = ๐น ๐ โ ๐น ๐ 0 . Lagrange multipliers ๐ฟ = 0 satisfy these constraints. 0 2 ๐ = ๐โ๐ or ๐บ 0 ๐ = ๐ถ๐๐๐ ๐ก โ 0 so that ๐ (0) minimizes ๐บ 0 โข Iterative step: โข Advance ๐ก by a small increment. 21 โข Formulate problem ๐ ๐ก and solve (e.g. with BFGS) with previous ๐ as initial guess. Examples of Use 1. Surface passing through point. โข Initial surface: bi-quadratic B-spline, with 7x7 uniformly-spaced control point, and open-ended uniform KVs. โข First design iteration: constrain ๐ 0.5,0.5 to pass through point ๐. โข Problem formulation: ๐บ ๐ = ๐ท๐๐ ๐๐๐๐ก๐๐ธ๐๐๐๐๐ฆ ๐ ๐น0 ๐ = ๐บ๐๐ก๐ ๐ถ๐๐๐๐๐ก ๐, 0.5,0.5 โ ๐บ๐๐ก๐ ๐ = 0 ๐น1 ๐ = ๐บ๐๐ก๐ ๐ถ๐๐๐๐๐ก ๐, 0.5,0.5 โ ๐บ๐๐ก๐ ๐ = 0 ๐น2 ๐ = ๐บ๐๐ก๐ ๐ถ๐๐๐๐๐ก ๐, 0.5,0.5 โ ๐บ๐๐ก๐ ๐ = 0 โข Border control points assumed to be constant โ 25 โ 3 = 75 variables. 22 Examples of Use 1. Surface passing through point. โข First design iteration: constrain ๐ 0.5,0.5 to pass through point ๐. โข Problem formulation: ๐บ ๐ = ๐ท๐๐ ๐๐๐๐ก๐๐ธ๐๐๐๐๐ฆ ๐ ๐บ๐๐ก๐ ๐ถ๐๐๐๐๐ก ๐, 0.5,0.5 โ ๐บ๐๐ก๐ ๐ = 0 ๐บ๐๐ก๐ ๐ถ๐๐๐๐๐ก ๐, 0.5,0.5 โ ๐บ๐๐ก๐ ๐ = 0 ๐บ๐๐ก๐ ๐ถ๐๐๐๐๐ก ๐, 0.5,0.5 โ ๐บ๐๐ก๐ ๐ = 0 23 Examples of Use 1. Surface passing through point. โข First design iteration: constrain ๐ 0.5,0.5 to pass through point ๐. โข Problem formulation: ๐บ ๐ = ๐ท๐๐ ๐๐๐๐ก๐๐ธ๐๐๐๐๐ฆ ๐ ๐บ๐๐ก๐ ๐ถ๐๐๐๐๐ก ๐, 0.5,0.5 โ ๐บ๐๐ก๐ ๐ = 0 ๐บ๐๐ก๐ ๐ถ๐๐๐๐๐ก ๐, 0.5,0.5 โ ๐บ๐๐ก๐ ๐ = 0 ๐บ๐๐ก๐ ๐ถ๐๐๐๐๐ก ๐, 0.5,0.5 โ ๐บ๐๐ก๐ ๐ = 0 โข Result: 24 Examples of Use 1. Surface passing through point. โข Second design iteration: constrain ๐ ๐ข, ๐ฃ to pass through ๐. โข Problem formulation: ๐บ ๐ = ๐ท๐๐ ๐๐๐๐ก๐๐ธ๐๐๐๐๐ฆ ๐ ๐น0 ๐ = ๐บ๐๐ก๐ ๐ถ๐๐๐๐๐ก ๐, ๐ข, ๐ฃ โ ๐บ๐๐ก๐ ๐ = 0 (ditto for ๐, ๐). โข Two new variables: ๐ข, ๐ฃ โ 25 โ 3 + 2 = 77 variables. โข Use previous design iteration as initial guess. 25 Examples of Use 1. Surface passing through point. โข Second design iteration: constrain ๐ ๐ข, ๐ฃ to pass through ๐. โข Problem formulation: ๐บ ๐ = ๐ท๐๐ ๐๐๐๐ก๐๐ธ๐๐๐๐๐ฆ ๐ ๐น0 ๐ = ๐บ๐๐ก๐ ๐ถ๐๐๐๐๐ก ๐, ๐ข, ๐ฃ โ ๐บ๐๐ก๐ ๐ = 0 (ditto for ๐, ๐) โข Two new variables: ๐ข, ๐ฃ โ 25 โ 3 + 2 = 77 variables. โข Use previous design iteration as initial guess. โข Result: discrete energy reduced by ~20%. 26 Examples of Use 2. Contact between two parametric surfaces: โข Two cylinder-like objects, each composed of six patches โข Four cylinder body patches + two top/bottom patches โข All patches are bi-quadratic B-spline surfaces with 5x5 control points. โข G1 continuity is forced along cylinder edges and G0 between cylinder and top/bottom. 27 Examples of Use 2. Contact between two parametric surfaces: โข Contact area between the two objects is assumed to be inside a single cylinder patch. โข Represented as 17 discrete contact-point constraints in parametric space. โข Constraint system: ๐ถ๐๐๐๐๐ก ๐1 , ๐ข1 ๐ , ๐ฃ1 ๐ = ๐ถ๐๐๐๐๐ก ๐2 , ๐ ๐๐ก ๐ผ, ๐ข2 ๐ , ๐ฃ2 ๐ ๐ถ๐๐๐๐๐๐๐๐๐ ๐1 , ๐ข1 ๐ , ๐ฃ1 ๐ = โ๐ถ๐๐๐๐๐๐๐๐๐ ๐2 , ๐ ๐๐ก ๐ผ, ๐ข2 ๐ , ๐ฃ2 ๐ Additional variables: control points, size and location of contact circleโฆ Additional constraints: G0 and G1 continuity. โข Not listed explicitly in the paper. 28 Examples of Use 2. Contact between two parametric surfaces: โข Result: โข Discretization of contact area canโt guarantee non-intersection of the surfaces. 29 Examples of Use 3. Contact between parametric surface ๐1 and subdivision surface ๐2 : โข Subdivision surfaces do not support ๐ถ๐๐๐๐๐ก, ๐ถ๐๐๐๐๐๐๐๐๐. โข Instead, contact is forced by: ๐ถ๐๐๐๐๐ก ๐1 , ๐ข, ๐ฃ = ๐ถ๐๐๐ ๐๐ ๐ก๐๐ก ๐2 , ๐ถ๐๐๐๐๐ก ๐1 , ๐ข, ๐ฃ ๐ถ๐๐๐๐๐๐๐๐๐ ๐1 , ๐ข, ๐ฃ = โ๐ถ๐๐๐ ๐๐ ๐ก๐๐๐๐๐๐ ๐2 , ๐ถ๐๐๐๐๐ก ๐1 , ๐ข, ๐ฃ โข ๐ถ๐๐๐ ๐๐ ๐ก๐๐ก is very difficult to implement without โblack-boxโ nodes. โข Also requires G0 and G1 continuity constraints. โข ๐ถ๐๐๐ ๐๐ ๐ก๐๐ก, ๐ถ๐๐๐ ๐๐ ๐ก๐๐๐๐๐๐ could be used in previous example. 30 Examples of Use 4. Deforming a plane to create a bump/hollow โข Start from a bi-quadratic B-spline plane ๐0 with 17x17 inner control point. โข Target surface ๐ must pass through a target curve above the plane, and a target outline curve. โข Outline curve is discretized into 30 points, and target curve into 11 points. 31 Examples of Use 4. Deforming a plane to create a bump/hollow โข Constraints: ๐ถ๐๐๐๐๐ก ๐, ๐ข๐ 1 , ๐ฃ๐ 1 = ๐ถ๐๐๐ ๐๐ ๐ก๐๐ก ๐0, ๐๐๐๐ข๐ก๐๐๐๐ ๐ถ๐๐๐๐๐๐๐๐๐ ๐, ๐ข๐ 1 , ๐ฃ๐ 1 = ๐ถ๐๐๐ ๐๐ ๐ก๐๐๐๐๐๐ ๐0, ๐๐๐๐ข๐ก๐๐๐๐ for outline points. ๐๐๐๐๐๐ก ๐ถ๐๐๐๐๐ก ๐, ๐ข๐ 2 , ๐ฃ๐ 2 = ๐๐ for target points. โข Variables: 17 โ 17 โ 3 control point variables, 30 + 11 โ 2 = 82 UV coordinate variables (possible error in paper), โข Total: 213 constraints in 949 variables. 32 Examples of Use 4. Deforming a plane to create a bump/hollow โข Experimental results: โข Initially, outline curve constraints are satisfied, but not target curve constraints. โข In first iterations, target curve constraints are improved, while outline constraints are deteriorated. โข At about 50 iterations, all constraints tend towards zero. โข Stopped at 300 iterations. โข Considered by authors to be a good result for initial draft. 33 Optimizations & Design Considerations โข DAGs allow partial re-evaluation of expressions. โข Needs system for tracking and managing changes in variables. โข Timestamps for all nodes. โข Vocabulary of operators: โข โข โข โข Arithmetic: +,-,*,/,^,abs,min, max,โฆ Vector to/from scalar componentsโฆ Parametric curve/surface creation/evaluation. Other: ClosestPt, ClosestNormal for parametric and subdivision surfaces, if-then-elseโฆ โข Tradeoff: High-level operations can be compiled into low-level computer code. Fine-grained operators are better optimized with partial evaluation. 34 Optimizations & Design Considerations โข DAGs allow partial re-evaluation of expressions. โข Needs system for tracking and managing changes in variables. โข Timestamps for all nodes. โข Vocabulary of operators: โข โข โข โข Arithmetic: +,-,*,/,^,abs,min, max,โฆ Vector to/from scalar componentsโฆ Parametric curve/surface creation/evaluation. Other: ClosestPt, ClosestNormal for parametric and subdivision surfaces, if-then-elseโฆ โข Tradeoff: High-level operations can be compiled into low-level computer code. Fine-grained operators are better optimized with partial evaluation. 35 Optimizations & Design Considerations โข Labels on โblack boxโ nodes: โข Make them not entirely โblack boxโ. โข Label properties such as: continuity and differentiability, convexity, linearity, etc. โข How can the solver take advantage of such information? โข Open problem. โข Failures, infinite loops, timeouts: โข Can occur in procedures (โblack boxโ nodes). โข Open problem. โข Is meaningful handling possible? 36 Optimizations & Design Considerations โข Persistent naming: โข Designer may want to preserve features. โข Example: the depression in example 4. User may want to move/rotate depression, but not lose it. โข Feature without โpersistenceโ may deform, get disconnected or disappear. โข Open problem. โข Interoperability: โข Results can be exported as mesh / spline / subdivision surface models. โข No simple operator history representation. โข Example: Cylinder -> apply deformation -> move to contact with a boxโฆ โข Open problem. 37 Thank you! 38
© Copyright 2026 Paperzz