libsurf
Programmer's Documentation

roundcapsurf.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_ROUNDCAPSURF_H
16 #define SURF_ROUNDCAPSURF_H
17 
18 #include <genua/triangulation.h>
19 #include "surface.h"
20 
21 class TriMesh;
22 
39 class RoundCapSurf : public Surface
40 {
41  public:
42 
44  RoundCapSurf(const PointList<3> & pts, Real elv);
45 
47  void init(const PointList<3> & pts, Real elv);
48 
50  Vct3 eval(Real u, Real v) const;
51 
53  Vct3 derive(Real u, Real v, uint du, uint dv) const;
54 
56  void apply();
57 
59  XmlElement toXml(bool share=false) const;
60 
62  void fromXml(const XmlElement &);
63 
65  RoundCapSurf *clone() const {return new RoundCapSurf(*this);}
66 
68  void initMesh(const DnRefineCriterion & c, DnMesh & gnr) const;
69 
71  void merge(uint n, TriMesh & tmerge) const;
72 
74  void merge(const Vct3 & nref, uint n, TriMesh & tmerge) const;
75 
77  Triangulation mesh(uint n) const;
78 
80  PointList<2> boundary() const;
81 
83  void mgLimits(Real & lmax, Real & phimax) const;
84 
85  private:
86 
88  uint segment(Real u) const;
89 
90  private:
91 
93  Real rmean, elevation;
94 
96  Vct3 ctr, nrm;
97 
99  Vector useg;
100 
103 };
104 
105 #endif
void apply()
coordinate transformation
Definition: roundcapsurf.cpp:200
Real rmean
average radius
Definition: roundcapsurf.h:93
Vct3 derive(Real u, Real v, uint du, uint dv) const
derive at (u,v)
Definition: roundcapsurf.cpp:91
XmlElement toXml(bool share=false) const
XML output (disabled)
Definition: roundcapsurf.cpp:209
Mesh generation engine.
Definition: dnmesh.h:47
void merge(uint n, TriMesh &tmerge) const
create a mesh matching the boundary, and merge with tmerge
Definition: roundcapsurf.cpp:142
uint segment(Real u) const
identify segment
Definition: roundcapsurf.cpp:110
void init(const PointList< 3 > &pts, Real elv)
construct from point set
Definition: roundcapsurf.cpp:29
Vct3 eval(Real u, Real v) const
evaluation interface
Definition: roundcapsurf.cpp:79
Triangulation mesh(uint n) const
simplified mesh generation (hybrid)
Definition: roundcapsurf.cpp:183
Vector useg
parametrization
Definition: roundcapsurf.h:99
Vct3 ctr
center point and normal vector
Definition: roundcapsurf.h:96
void fromXml(const XmlElement &)
XML input (disabled)
Definition: roundcapsurf.cpp:215
PointList< 2 > boundary() const
return boundary points
Definition: roundcapsurf.cpp:218
Round cap surface.
Definition: roundcapsurf.h:39
RoundCapSurf(const PointList< 3 > &pts, Real elv)
construct from boundary points and mid elevation
Definition: roundcapsurf.cpp:23
Surface interface.
Definition: surface.h:37
RoundCapSurf * clone() const
generate clone
Definition: roundcapsurf.h:65
Simplest mesh refinement criterion.
Definition: dnrefine.h:43
void initMesh(const DnRefineCriterion &c, DnMesh &gnr) const
generate initial mesh
Definition: roundcapsurf.cpp:123
PointList< 3 > radius
radius vectors and boundary points
Definition: roundcapsurf.h:102
void mgLimits(Real &lmax, Real &phimax) const
access mesh generation limits
Definition: roundcapsurf.cpp:232
Generated on Mon Jan 24 2022 03:03:16 for libsurf by   doxygen 1.8.5