allow spirals with extrusion using zones

This commit is contained in:
Christopher Lackner 2021-04-15 19:02:05 +02:00
parent 4e2d2943f6
commit 6e87ff6ea7
2 changed files with 37 additions and 1 deletions

View File

@ -42,6 +42,16 @@ namespace netgen
} }
} }
for(auto i : Range(path->GetSplines()))
{
const auto& sp = path->GetSpline(i);
auto t1 = sp.GetTangent(0.);
t1.Normalize();
auto t2 = sp.GetTangent(1.);
t2.Normalize();
angles.Append(acos(t1 * t2));
}
profile->GetCoeff(profile_spline_coeff); profile->GetCoeff(profile_spline_coeff);
latest_point3d = -1.111e30; latest_point3d = -1.111e30;
} }
@ -657,6 +667,25 @@ namespace netgen
dez -= (dez * ez) * ez; dez -= (dez * ez) * ez;
} }
void ExtrusionFace :: DefineTangentialPlane(const Point<3>& ap1,
const Point<3>& ap2)
{
Surface::DefineTangentialPlane(ap1, ap2);
tangential_plane_seg = latest_seg;
}
void ExtrusionFace :: ToPlane(const Point<3>& p3d, Point<2>& p2d,
double h, int& zone) const
{
Surface::ToPlane(p3d, p2d, h, zone);
double angle = 0;
for(int i = latest_seg; i < tangential_plane_seg; i++)
angle += angles[i];
for(int i = tangential_plane_seg; i < latest_seg; i++)
angle -= angles[i];
if(fabs(angle) > 3.14/2.)
zone = -1;
}
Extrusion :: Extrusion(shared_ptr<SplineGeometry<3>> path_in, Extrusion :: Extrusion(shared_ptr<SplineGeometry<3>> path_in,
shared_ptr<SplineGeometry<2>> profile_in, shared_ptr<SplineGeometry<2>> profile_in,

View File

@ -12,8 +12,10 @@ namespace netgen
const SplineSeg<2> * profile; const SplineSeg<2> * profile;
const SplineGeometry<3> * path; const SplineGeometry<3> * path;
Vec<3> glob_z_direction; Vec<3> glob_z_direction;
Array<double> angles;
bool deletable; bool deletable;
int tangential_plane_seg;
NgArray< const SplineSeg3<3> * > spline3_path; NgArray< const SplineSeg3<3> * > spline3_path;
NgArray< const LineSeg<3> * > line_path; NgArray< const LineSeg<3> * > line_path;
@ -114,6 +116,11 @@ namespace netgen
Vec<3> & ex, Vec<3> & ey, Vec<3> & ez, Vec<3> & ex, Vec<3> & ey, Vec<3> & ez,
Vec<3> & dex, Vec<3> & dey, Vec<3> & dez) const; Vec<3> & dex, Vec<3> & dey, Vec<3> & dez) const;
void DefineTangentialPlane(const Point<3>& ap1,
const Point<3>& ap2) override;
void ToPlane(const Point<3>& p3d, Point<2>& p2d,
double h, int& zone) const override;
}; };