mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
Store Ellipsoid csg surface in mesh files
This commit is contained in:
parent
3ece315bd0
commit
4810b4f1b2
@ -642,6 +642,32 @@ namespace netgen
|
|||||||
cz = v(2);
|
cz = v(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Ellipsoid :: GetPrimitiveData (const char *& classname, NgArray<double> & coeffs) const
|
||||||
|
{
|
||||||
|
classname = "ellipsoid";
|
||||||
|
coeffs.SetSize (12);
|
||||||
|
for(auto i : Range(3))
|
||||||
|
{
|
||||||
|
coeffs[i] = a(i);
|
||||||
|
coeffs[3+i] = v1(i);
|
||||||
|
coeffs[6+i] = v2(i);
|
||||||
|
coeffs[9+i] = v3(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Ellipsoid :: SetPrimitiveData (NgArray<double> & coeffs)
|
||||||
|
{
|
||||||
|
for(auto i : Range(3))
|
||||||
|
{
|
||||||
|
a(i) = coeffs[i];
|
||||||
|
v1(i) = coeffs[3+i];
|
||||||
|
v2(i) = coeffs[6+i];
|
||||||
|
v3(i) = coeffs[9+i];
|
||||||
|
}
|
||||||
|
|
||||||
|
CalcData();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
INSOLID_TYPE Ellipsoid :: BoxInSolid (const BoxSphere<3> & box) const
|
INSOLID_TYPE Ellipsoid :: BoxInSolid (const BoxSphere<3> & box) const
|
||||||
{
|
{
|
||||||
|
@ -339,23 +339,26 @@ namespace netgen
|
|||||||
// default constructor for archive
|
// default constructor for archive
|
||||||
Ellipsoid() {}
|
Ellipsoid() {}
|
||||||
|
|
||||||
virtual void DoArchive(Archive& ar)
|
void DoArchive(Archive& ar) override
|
||||||
{
|
{
|
||||||
QuadraticSurface::DoArchive(ar);
|
QuadraticSurface::DoArchive(ar);
|
||||||
ar & a & v1 & v2 & v3 & rmin;
|
ar & a & v1 & v2 & v3 & rmin;
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
virtual INSOLID_TYPE BoxInSolid (const BoxSphere<3> & box) const;
|
INSOLID_TYPE BoxInSolid (const BoxSphere<3> & box) const override;
|
||||||
///
|
///
|
||||||
virtual double HesseNorm () const;
|
double HesseNorm () const override;
|
||||||
///
|
///
|
||||||
virtual double MaxCurvature () const;
|
double MaxCurvature () const override;
|
||||||
///
|
///
|
||||||
virtual Point<3> GetSurfacePoint () const;
|
Point<3> GetSurfacePoint () const override;
|
||||||
|
|
||||||
virtual void GetTriangleApproximation (TriangleApproximation & tas,
|
void GetTriangleApproximation (TriangleApproximation & tas,
|
||||||
const Box<3> & bbox,
|
const Box<3> & bbox,
|
||||||
double facets) const;
|
double facets) const override;
|
||||||
|
|
||||||
|
void GetPrimitiveData (const char *& classname, NgArray<double> & coeffs) const override;
|
||||||
|
void SetPrimitiveData (NgArray<double> & coeffs) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CalcData();
|
void CalcData();
|
||||||
|
@ -562,6 +562,15 @@ namespace netgen
|
|||||||
delete_them.Append(cone);
|
delete_them.Append(cone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if(classname == "ellipsoid")
|
||||||
|
{
|
||||||
|
Ellipsoid * ellipsoid = new Ellipsoid(dummypoint,dummyvec,dummyvec,dummyvec);
|
||||||
|
ellipsoid->SetPrimitiveData(coeffs);
|
||||||
|
|
||||||
|
AddSurface(ellipsoid);
|
||||||
|
delete_them.Append(ellipsoid);
|
||||||
|
}
|
||||||
|
|
||||||
else if(classname == "ellipticcone")
|
else if(classname == "ellipticcone")
|
||||||
{
|
{
|
||||||
EllipticCone * ellipticcone = new EllipticCone(dummypoint,dummyvec,dummyvec,dummydouble,dummydouble);
|
EllipticCone * ellipticcone = new EllipticCone(dummypoint,dummyvec,dummyvec,dummydouble,dummydouble);
|
||||||
|
Loading…
Reference in New Issue
Block a user