libsurf
Programmer's Documentation

skinsurf.h (r6227/r5385)
1 
2 /* Copyright (C) 2015 David Eller <david@larosterna.com>
3  *
4  * Commercial License Usage
5  * Licensees holding valid commercial licenses may use this file in accordance
6  * with the terms contained in their respective non-exclusive license agreement.
7  * For further information contact david@larosterna.com .
8  *
9  * GNU General Public License Usage
10  * Alternatively, this file may be used under the terms of the GNU General
11  * Public License version 3.0 as published by the Free Software Foundation and
12  * appearing in the file gpl.txt included in the packaging of this file.
13  */
14 
15 #ifndef SURF_SKINSURF_H
16 #define SURF_SKINSURF_H
17 
18 #include <boost/shared_ptr.hpp>
19 #include <genua/point.h>
20 #include <genua/sharedvector.h>
21 #include <genua/splinebasis.h>
22 #include "curve.h"
23 #include "surface.h"
24 
25 class IgesFile;
26 
42 class SkinSurf : public Surface
43 {
44  public:
45 
47  SkinSurf(const std::string & s) : Surface(s) {}
48 
50  void init(CurvePtrArray & cv, bool iplocal=true, bool akima=false);
51 
53  Vct3 eval(Real u, Real v) const;
54 
56  Vct3 derive(Real u, Real v, uint ku, uint kv) const;
57 
59  void plane(Real u, Real v, Vct3 & S, Vct3 & Su, Vct3 & Sv) const;
60 
62  void apply();
63 
65  XmlElement toXml(bool share=false) const;
66 
68  void fromXml(const XmlElement & xe);
69 
71  SkinSurf *clone() const {return new SkinSurf(*this);}
72 
74  int toIges(IgesFile & file, int tfi = 0) const;
75 
77  static void uKnotMergeTolerance(Real tol) {umergetol = tol;}
78 
80  static void limitUKnotCount(uint c) {iMaxKnots = c;}
81 
83  void dimStats(DimStat &stat) const;
84 
86  void initGridPattern(Vector & up, Vector & vp) const;
87 
89  void isSymmetric(bool & usym, bool & vsym) const;
90 
91  private:
92 
94  void globalIpol(CurvePtrArray & cv);
95 
97  void localIpol(CurvePtrArray & cv, bool akima = false);
98 
100  uint adaptCurves(CurvePtrArray & cv);
101 
103  void lcubCtlPoints(const PointGrid<3> & cvp, uint row, bool akima);
104 
106  void tangentsBessel(const PointList<3> & pts, PointList<3> & tng) const;
107 
109  void tangentsAkima(const PointList<3> & pts, PointList<3> & tng) const;
110 
111  private:
112 
115 
118 
120  CurvePtrArray ipc;
121 
123  bool iploc, ipakima;
124 
126  static Real umergetol;
127 
129  static uint iMaxKnots;
130 };
131 
132 typedef boost::shared_ptr<SkinSurf> SkinSurfPtr;
133 
134 #endif
135 
void globalIpol(CurvePtrArray &cv)
interpolate globally
Definition: skinsurf.cpp:237
static uint iMaxKnots
avoid more than 100 knots in u-direction
Definition: skinsurf.h:129
void plane(Real u, Real v, Vct3 &S, Vct3 &Su, Vct3 &Sv) const
compute surface point and tangent derivatives
Definition: skinsurf.cpp:83
CurvePtrArray ipc
curve pointers used for interpolation
Definition: skinsurf.h:120
void apply()
coordinate transformation
Definition: skinsurf.cpp:120
Skinned surface.
Definition: skinsurf.h:42
XmlElement toXml(bool share=false) const
XML output.
Definition: skinsurf.cpp:451
Main interface to IGES files.
Definition: igesfile.h:32
SplineBasis ub
basis in u- and v-direction
Definition: skinsurf.h:114
Vct3 eval(Real u, Real v) const
evaluate spline surface
Definition: skinsurf.cpp:42
void initGridPattern(Vector &up, Vector &vp) const
return an initial discretization pattern to start with
Definition: skinsurf.cpp:504
Vct3 derive(Real u, Real v, uint ku, uint kv) const
derive spline surface
Definition: skinsurf.cpp:60
void fromXml(const XmlElement &xe)
XML input.
Definition: skinsurf.cpp:470
static Real umergetol
tolerance for merging knot vectors
Definition: skinsurf.h:126
static void uKnotMergeTolerance(Real tol)
change knot merging tolerance
Definition: skinsurf.h:77
void lcubCtlPoints(const PointGrid< 3 > &cvp, uint row, bool akima)
determine one row of control points by local cubic interpolation
Definition: skinsurf.cpp:417
void isSymmetric(bool &usym, bool &vsym) const
return if surface is symmetric in u- or v-direction
Definition: skinsurf.cpp:523
void localIpol(CurvePtrArray &cv, bool akima=false)
interpolate locally
Definition: skinsurf.cpp:292
SkinSurf * clone() const
generate clone
Definition: skinsurf.h:71
SkinSurf(const std::string &s)
init surface
Definition: skinsurf.h:47
void dimStats(DimStat &stat) const
compute statistics
Definition: skinsurf.cpp:516
uint adaptCurves(CurvePtrArray &cv)
make curves compatible
Definition: skinsurf.cpp:136
void init(CurvePtrArray &cv, bool iplocal=true, bool akima=false)
interpolate a vector of curves
Definition: skinsurf.cpp:104
void tangentsBessel(const PointList< 3 > &pts, PointList< 3 > &tng) const
compute approximate tangent vectors for surface slice
Definition: skinsurf.cpp:327
int toIges(IgesFile &file, int tfi=0) const
generate an IGES entity 128
Definition: skinsurf.cpp:529
Surface interface.
Definition: surface.h:37
void tangentsAkima(const PointList< 3 > &pts, PointList< 3 > &tng) const
compute approximate tangent vectors for surface slice
Definition: skinsurf.cpp:358
bool iploc
interpolation parameter
Definition: skinsurf.h:123
PointGrid< 3 > cp
control points
Definition: skinsurf.h:117
static void limitUKnotCount(uint c)
set this to 100 if you need IGES export to CAD
Definition: skinsurf.h:80
Generated on Wed Jan 19 2022 03:03:15 for libsurf by   doxygen 1.8.5