libsurf
Programmer's Documentation
Symmetric surface.
SymSurf automatically generates surfaces which are symmetric about a mirror plane (which, by default, is the xz-plane), and adapts derivatives and mesh initializers accordingly.
It is stronlgy recommended that the mirrored surface reaches the mirror plane exactly for v = 1, otherwise, the symmetric surface will either have a gap or have self-intersections.
Note that this class re-parameterizes such that v in (0,0.5) yields points on the original surface, and v > 0.5 yields points on the mirror-copy side.
#include <symsurf.h>
Public Member Functions | |
SymSurf (const std::string &name) | |
named construction | |
SymSurf (const SymSurf &s) | |
copy construction | |
void | init (const Surface &srf) |
initialize with surface to mirror (clones) | |
void | init (const SurfacePtr &psrf) |
initialize with surface to mirror (shallow copy) | |
void | setMirrorPlane (const Vct3 &orig, const Vct3 &nrm) |
change the mirror plane | |
SurfacePtr | baseSurface () const |
access base surface, that is, the one half | |
Vct3 | eval (Real u, Real v) const |
evaluation interface | |
Vct3 | derive (Real u, Real v, uint du, uint dv) const |
derive at (u,v) | |
void | plane (Real u, Real v, Vct3 &S, Vct3 &Su, Vct3 &Sv) const |
compute point and tangent derivatives at (u,v), for efficiency | |
Vct3 | normal (Real u, Real v) const |
compute normal vector | |
void | apply () |
coordinate transformation | |
void | initGridPattern (Vector &up, Vector &vp) const |
derive a grid pattern from mirrored surface | |
void | initGrid (Real lmax, Real lmin, Real phimax, PointGrid< 2 > &pts) const |
create an unconstrained point grid as initialization for mesh generator | |
void | initMesh (const DnRefineCriterion &c, DnMesh &gnr) const |
initialize mesh generator (marks kink edges) | |
XmlElement | toXml (bool share=false) const |
XML output. | |
void | fromXml (const XmlElement &xe) |
XML input. | |
int | toIges (IgesFile &file, int tfi=0) const |
write IGES entities and mirror them | |
SymSurf * | clone () const |
generate a clone | |
![]() | |
Surface (const std::string &s="NoNameSurface") | |
default initialization | |
virtual | ~Surface () |
virtual destructor | |
uint | objid () const |
access integer object id | |
void | rename (const std::string &s) |
change name | |
const std::string & | name () const |
return name | |
virtual void | eval (const PointList< 2 > &uv, PointList< 3 > &xyz) const |
utility interface | |
virtual Real | vcurvature (Real u, Real v) const |
compute curvature along v at u | |
virtual Real | ucurvature (Real u, Real v) const |
compute curvature along u at v | |
virtual Real | gaussianCurvature (Real u, Real v) const |
compute Gaussian curvature | |
virtual bool | project (const Vct3 &pt, Vct2 &q, Real tol=1e-6, Real dpmin=1e-6) const |
find projection of pt on surface (needs a guess in q) | |
virtual bool | intersect (const AbstractCurve &c, Vct2 &q, Real &t, Real tol=1e-6, Real dpmin=1e-6) const |
find approximate intersection with curve c | |
virtual void | dimStats (DimStat &stat) const |
compute dimensional statistics | |
Real | typLength (int nu=8, int nv=8) const |
compute typical dimension | |
virtual void | tessellate (CgMesh &cgm, uint maxtri=60000) const |
create a triangular mesh for visualization | |
virtual bool | fromIges (const IgesFile &file, const IgesDirEntry &entry) |
retrieve surface from IGES file, return false if not successfull | |
SurfacePtr | self () |
return shared-pointer from *this | |
virtual void | isSymmetric (bool &usym, bool &vsym) const |
return if surface is symmetric in u- or v-direction [false] | |
virtual void | gridViz (MeshFields &mvz) const |
debug : create simple visualization | |
![]() | |
void | clear () |
Vct3 | getOrigin () const |
void | translate (const Vct3 &v) |
void | translate (Real dx, Real dy, Real dz) |
void | rotate (Real betax, Real betay, Real betaz) |
void | rotate (const Vct3 &rotax, Real angle) |
void | scale (Real xf, Real yf, Real zf) |
void | scale (Real f) |
void | mirror (const Vct3 &normal) |
const SMatrix< 4, 4 > & | trafoMatrix () const |
void | setTrafoMatrix (const SMatrix< 4, 4 > &m) |
Vct3 | forward (const Vct3 &a) const |
void | forward (const PointList< 4 > &a, PointList< 4 > &b) const |
Protected Member Functions | |
void | mirror (const Vct3 &p, Vct3 &mp) const |
compute the mirror image | |
![]() | |
Real | localCurvature (const Vct3 &dc, const Vct3 &ddc) const |
determine local curvature given first and second derivative | |
void | applyIgesTrafo (const IgesFile &file, const IgesDirEntry &dir) |
apply a transformation retrieved from IGES file | |
void | setIgesName (const IgesFile &file, const IgesEntity &e) |
retrieve name from IGES file | |
Private Attributes | |
SurfacePtr | psf |
the right wing surface which is mirrored | |
Vct3 | mipo |
mirror plane (default: xz-plane) | |
Vct3 | mipn |
Additional Inherited Members | |
![]() | |
static SurfacePtr | createFromXml (const XmlElement &xe) |
static factory function | |
static SurfacePtr | createFromIges (const IgesFile &file, const IgesDirEntry &entry) |
static factory : create surface from IGES entity | |
![]() | |
static uint | nextObjectId () |
generate new object id | |
![]() | |
std::string | ids |
string identifier | |
uint | object_id |
integer id used to find object in serialization | |
![]() | |
SMatrix< 4, 4 > | mat |