mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
fixes for OCCT 7.6.0-dev
This commit is contained in:
parent
8c8d7420ed
commit
08993ae5e2
@ -1236,9 +1236,13 @@ namespace netgen
|
||||
|
||||
for (int k = 1; k <=3; k++)
|
||||
{
|
||||
int n = triangulation->Triangles()(j)(k);
|
||||
p[k-1] = triangulation->Nodes()(n).Transformed(loc);
|
||||
par[k-1] = triangulation->UVNodes()(n);
|
||||
// int n = triangulation->Triangles()(j)(k);
|
||||
// p[k-1] = triangulation->Nodes()(n).Transformed(loc);
|
||||
// par[k-1] = triangulation->UVNodes()(n);
|
||||
// fix for OCC7.6.0-dev
|
||||
int n = triangulation->Triangle(j)(k);
|
||||
p[k-1] = triangulation->Node(n).Transformed(loc);
|
||||
par[k-1] = triangulation->UVNode(n);
|
||||
}
|
||||
|
||||
//double maxside = 0;
|
||||
|
@ -105,8 +105,8 @@ void ExtractEdgeData( const TopoDS_Edge & edge, int index, std::vector<double> *
|
||||
int nbnodes = poly -> NbNodes();
|
||||
for (int j = 1; j < nbnodes; j++)
|
||||
{
|
||||
auto p0 = occ2ng((T -> Nodes())(poly->Nodes()(j)).Transformed(loc));
|
||||
auto p1 = occ2ng((T -> Nodes())(poly->Nodes()(j+1)).Transformed(loc));
|
||||
auto p0 = occ2ng((T -> Node(poly->Node(j))).Transformed(loc));
|
||||
auto p1 = occ2ng((T -> Node(poly->Node(j+1))).Transformed(loc));
|
||||
for(auto k : Range(3))
|
||||
{
|
||||
p[0].push_back(p0[k]);
|
||||
@ -138,15 +138,15 @@ void ExtractFaceData( const TopoDS_Face & face, int index, std::vector<double> *
|
||||
int ntriangles = triangulation -> NbTriangles();
|
||||
for (int j = 1; j <= ntriangles; j++)
|
||||
{
|
||||
Poly_Triangle triangle = (triangulation -> Triangles())(j);
|
||||
Poly_Triangle triangle = triangulation -> Triangle(j);
|
||||
std::array<Point<3>,3> pts;
|
||||
std::array<Vec<3>,3> normals;
|
||||
for (int k = 0; k < 3; k++)
|
||||
pts[k] = occ2ng( (triangulation -> Nodes())(triangle(k+1)).Transformed(loc) );
|
||||
pts[k] = occ2ng( (triangulation -> Node(triangle(k+1))).Transformed(loc) );
|
||||
|
||||
for (int k = 0; k < 3; k++)
|
||||
{
|
||||
auto uv = (triangulation -> UVNodes())(triangle(k+1));
|
||||
auto uv = triangulation -> UVNode(triangle(k+1));
|
||||
prop.SetParameters (uv.X(), uv.Y());
|
||||
if (!prop.IsNormalDefined())
|
||||
throw Exception("No normal defined on face");
|
||||
@ -1011,11 +1011,10 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
||||
Array< std::array<Point<3>,3> > triangles;
|
||||
for (int j = 1; j <= ntriangles; j++)
|
||||
{
|
||||
Poly_Triangle triangle = (triangulation -> Triangles())(j);
|
||||
Poly_Triangle triangle = triangulation -> Triangle(j);
|
||||
std::array<Point<3>,3> pts;
|
||||
for (int k = 0; k < 3; k++)
|
||||
pts[k] = occ2ng( (triangulation -> Nodes())(triangle(k+1)).Transformed(loc) );
|
||||
|
||||
pts[k] = occ2ng( (triangulation -> Node(triangle(k+1))).Transformed(loc) );
|
||||
triangles.Append ( pts );
|
||||
}
|
||||
|
||||
|
@ -463,7 +463,8 @@ namespace netgen
|
||||
glBegin (GL_LINE_STRIP);
|
||||
for (int j = 1; j <= nbnodes; j++)
|
||||
{
|
||||
gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
|
||||
// gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
|
||||
gp_Pnt p = (T -> Node(aEdgePoly->Nodes()(j))).Transformed(aEdgeLoc);
|
||||
glVertex3f (p.X(), p.Y(), p.Z());
|
||||
}
|
||||
glEnd ();
|
||||
@ -510,7 +511,8 @@ namespace netgen
|
||||
glBegin (GL_LINE_STRIP);
|
||||
for (int j = 1; j <= nbnodes; j++)
|
||||
{
|
||||
gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
|
||||
// gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
|
||||
gp_Pnt p = (T -> Node(aEdgePoly->Node(j))).Transformed(aEdgeLoc);
|
||||
glVertex3f (p.X(), p.Y(), p.Z());
|
||||
}
|
||||
glEnd ();
|
||||
@ -582,18 +584,18 @@ namespace netgen
|
||||
gp_Vec n;
|
||||
|
||||
glBegin (GL_TRIANGLES);
|
||||
|
||||
int ntriangles = triangulation -> NbTriangles();
|
||||
for (int j = 1; j <= ntriangles; j++)
|
||||
{
|
||||
Poly_Triangle triangle = (triangulation -> Triangles())(j);
|
||||
Poly_Triangle triangle = (triangulation -> Triangle(j));
|
||||
gp_Pnt p[3];
|
||||
for (int k = 1; k <= 3; k++)
|
||||
p[k-1] = (triangulation -> Nodes())(triangle(k)).Transformed(loc);
|
||||
p[k-1] = (triangulation -> Node(triangle(k))).Transformed(loc);
|
||||
|
||||
for (int k = 1; k <= 3; k++)
|
||||
{
|
||||
uv = (triangulation -> UVNodes())(triangle(k));
|
||||
// uv = (triangulation -> UVNodes())(triangle(k));
|
||||
uv = triangulation -> UVNode(triangle(k));
|
||||
prop.SetParameters (uv.X(), uv.Y());
|
||||
|
||||
// surf->D0 (uv.X(), uv.Y(), pnt);
|
||||
|
Loading…
Reference in New Issue
Block a user