1 -- Created on: 1993-05-19
2 -- Created by: Laurent PAINNOT
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and / or modify it
9 -- under the terms of the GNU Lesser General Public version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 generic class SurfLeastSquare from AppCont(Surface as any;
19 ---as TheSurfTool(Surface)
24 uses Matrix from math,
26 Constraint from AppParCurves,
27 MultiCurve from AppParCurves,
28 BezierSurface from Geom
31 raises NotDone from StdFail,
32 OutOfRange from Standard,
33 DimensionError from Standard
39 Create(Surf: Surface; U0, U1, V0, V1: Real;
40 FirstCons, LastUCons, LastVCons, LastCons: Constraint;
41 DegU, DegV: Integer; NbPoints: Integer = 12)
42 ---Purpose: given a MultiLine, this algorithm computes the
43 -- approximation of a continous Surface into a bezier
45 -- The algorithm minimizes the volume between the
46 -- Surface Surf and the Bezier Surface doing the
48 -- NbPoints * NbPoints are taken on the Surface Surf.
49 -- The Constraints are affected to the following points:
51 -- U0, V0 |--|---|---|---|---|---|-----| U1, V0
52 -- FirstCons | | | | | | | LastUCons
53 -- |--|---|---|---|---|---|-----|
54 -- |--|---|---|---|---|---|-----|
56 -- U0, V1 |--|---|---|---|---|---|-----| U1, V1
60 returns SurfLeastSquare from AppCont
61 raises DimensionError from Standard;
66 ---Purpose: returns True if all has been correctly done.
73 ---Purpose: returns the result of the approximation.
74 -- An exception is raised if NotDone.
75 ---C++: return const &
77 returns BezierSurface from Geom
78 raises NotDone from StdFail
83 Error(me; F: in out Real; MaxE3d: in out Real)
84 ---Purpose: F is the sum of the square errors at each of the
85 -- NbPoints*NbPoints and MaxE3d is the maximum value
87 -- An exception is raised if NotDone.
89 raises NotDone from StdFail
97 SCU: BezierSurface from Geom;
113 end SurfLeastSquare from AppCont;