42cf5bc1 |
1 | // Created on: 1995-10-12 |
2 | // Created by: Bruno DUMORTIER |
3 | // Copyright (c) 1995-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License 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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _BRepOffset_HeaderFile |
18 | #define _BRepOffset_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
42cf5bc1 |
24 | #include <BRepOffset_Status.hxx> |
42cf5bc1 |
25 | |
8574e329 |
26 | class Geom_Surface; |
27 | class TopoDS_Face; |
42cf5bc1 |
28 | |
8574e329 |
29 | //! Auxiliary tools for offset algorithms |
42cf5bc1 |
30 | |
31 | class BRepOffset |
32 | { |
33 | public: |
34 | |
42cf5bc1 |
35 | //! returns the Offset surface computed from the |
36 | //! surface <Surface> at an OffsetDistance <Offset>. |
37 | //! |
38 | //! If possible, this method returns the real type of |
39 | //! the surface ( e.g. An Offset of a plane is a plane). |
40 | //! |
41 | //! If no particular case is detected, the returned |
42 | //! surface will have the Type Geom_OffsetSurface. |
8574e329 |
43 | //! Parameter allowC0 is then passed as last argument to |
44 | //! constructor of Geom_OffsetSurface. |
45 | Standard_EXPORT static Handle(Geom_Surface) Surface (const Handle(Geom_Surface)& Surface, |
46 | const Standard_Real Offset, |
47 | BRepOffset_Status& theStatus, |
48 | Standard_Boolean allowC0 = Standard_False); |
49 | |
50 | //! Preprocess surface to be offset (bspline, bezier, or revolution based on |
51 | //! bspline or bezier curve), by collapsing each singular side to single point. |
52 | //! |
53 | //! This is to avoid possible flipping of normal at the singularity |
54 | //! of the surface due to non-zero distance between the poles that |
55 | //! logically should be in one point (singularity). |
56 | //! |
57 | //! The (parametric) side of the surface is considered to be singularity if face |
58 | //! has degenerated edge whose vertex encompasses (by its tolerance) all points on that side, |
59 | //! or if all poles defining that side fit into sphere with radius thePrecision. |
60 | //! |
61 | //! Returns either original surface or its modified copy (if some poles have been moved). |
62 | Standard_EXPORT static Handle(Geom_Surface) CollapseSingularities (const Handle(Geom_Surface)& theSurface, |
63 | const TopoDS_Face& theFace, |
64 | Standard_Real thePrecision); |
42cf5bc1 |
65 | |
66 | }; |
67 | |
42cf5bc1 |
68 | #endif // _BRepOffset_HeaderFile |