libsurf
Programmer's Documentation

ringcapsurf.h (r6227/r5337)
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_RINGCAPSURF_H
16 #define SURF_RINGCAPSURF_H
17 
18 #include "forward.h"
19 #include "transurf.h"
20 
36 class RingCapSurf : public TranSurf
37 {
38 public:
39 
41  RingCapSurf(const std::string & s = "Unknown") : TranSurf(s) {}
42 
44  void init(const Surface & srf, const PointList<2> & qts, Real h=0);
45 
47  const PointList<2> & boundaryRing() const {return m_bnq;}
48 
50  void initMesh(const DnRefineCriterion & c, DnMesh & gnr) const;
51 
53  XmlElement toXml(bool share=false) const;
54 
56  void fromXml(const XmlElement & xe);
57 
59  Surface *clone() const {return new RingCapSurf(*this);}
60 
62  void pavedMesh(PointList<2> &pts, Indices &tri) const;
63 
64 private:
65 
67  void initFlat(const Surface & srf, const PointList<2> & qts);
68 
70  void initDome(const Surface & srf, const PointList<2> & qts, Real h);
71 
72 private:
73 
75  Vct3 meanNormal(const Vct3 & ctr, const PointList<3> & bp) const;
76 
78  void smooth(PointList<3> & ni, int npass) const;
79 
81  void flatNormals(const Vct3 & pn, const Vector & up,
82  PointList<3> & ni) const;
83 
84  // debug : write simple quad mesh to file
85  void dump();
86 
88  void smoothCpGrid(int npass=1, Real omg=0.5);
89 
91  Real stdFactor(const Vct3 & pn, const PointList<3> & nout) const;
92 
93 private:
94 
97 };
98 
99 #endif // RINGCAPSURF_H
void smooth(PointList< 3 > &ni, int npass) const
smooth normal directions, single pass
Definition: ringcapsurf.cpp:211
const PointList< 2 > & boundaryRing() const
access boundary points in this surface&#39;s (u,v) space
Definition: ringcapsurf.h:47
void initDome(const Surface &srf, const PointList< 2 > &qts, Real h)
construct G1 continuous dome from boundary points
Definition: ringcapsurf.cpp:226
Real stdFactor(const Vct3 &pn, const PointList< 3 > &nout) const
determine standard height factor
Definition: ringcapsurf.cpp:381
Mesh generation engine.
Definition: dnmesh.h:47
void initFlat(const Surface &srf, const PointList< 2 > &qts)
construct flat surface from boundary points
Definition: ringcapsurf.cpp:38
Ring-parameterized cap surface.
Definition: ringcapsurf.h:36
void flatNormals(const Vct3 &pn, const Vector &up, PointList< 3 > &ni) const
generate a regularly spaced set of inward normals
Definition: ringcapsurf.cpp:188
void initMesh(const DnRefineCriterion &c, DnMesh &gnr) const
initialize mesh generation
Definition: ringcapsurf.cpp:392
PointList< 2 > m_bnq
map of the generating boundary points in parameter space
Definition: ringcapsurf.h:96
void init(const Surface &srf, const PointList< 2 > &qts, Real h=0)
construct flat surface from boundary points
Definition: ringcapsurf.cpp:28
XmlElement toXml(bool share=false) const
XML output.
Definition: ringcapsurf.cpp:402
void pavedMesh(PointList< 2 > &pts, Indices &tri) const
generate initial mesh by paving
Definition: ringcapsurf.cpp:435
void smoothCpGrid(int npass=1, Real omg=0.5)
smooth control point grid to avoid self-intersection
Definition: ringcapsurf.cpp:463
Surface * clone() const
generate a clone
Definition: ringcapsurf.h:59
RingCapSurf(const std::string &s="Unknown")
construct named surface
Definition: ringcapsurf.h:41
void fromXml(const XmlElement &xe)
XML input.
Definition: ringcapsurf.cpp:418
Vct3 meanNormal(const Vct3 &ctr, const PointList< 3 > &bp) const
mean boundary normal
Definition: ringcapsurf.cpp:175
Cubic transition patch.
Definition: transurf.h:29
Surface interface.
Definition: surface.h:37
Simplest mesh refinement criterion.
Definition: dnrefine.h:43
Generated on Wed Jan 19 2022 03:03:15 for libsurf by   doxygen 1.8.5