From nobody Thu Mar 03 21:10:55 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A980C19F5CB2; Thu, 3 Mar 2022 21:10:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K8kDH44yWz3jr2; Thu, 3 Mar 2022 21:10:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646341855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4t5e0nkmC1G2mt/oiZK8bIVKGDGTDSfHDove9r1euFY=; b=w7Wca9dzNJNE2QLaN9SC49IKCjwuRrE1t+opFDLFo0qsUdDXH7znRXt3GZndQ5gwOFBCSY 1LxVqdAsiuy2GxL8059fwSzdAQDwBr42mMDS/eftvEPNbqZ9IHf+lxFFWvBGIEiJdwGX0V 2uRfke6EtVWUbFtDgoM1HSDnj4OLZps/Io1mc/EoE47p162ANB7qcVLEpu01JRSdyRK/9l KT1xg6ztU3ykSDkjG/L6u9ZKtqSINhFOyynimAO1S24JrujTI9tA+SyIOQMK06H0OAJVRP nLnBev7vatRtz9Fqp+0+VQOBYj2bwuBBXGVM8T+NSuu2pjILTMMZl6pOVCNACA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BA2A1EF68; Thu, 3 Mar 2022 21:10:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 223LAtIP049273; Thu, 3 Mar 2022 21:10:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 223LAtY5049272; Thu, 3 Mar 2022 21:10:55 GMT (envelope-from git) Date: Thu, 3 Mar 2022 21:10:55 GMT Message-Id: <202203032110.223LAtY5049272@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Christoph Moench-Tegeder Subject: git: d25a7563aaa6 - main - cad/freecad: update to 0.19.4 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cmt X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d25a7563aaa6b357e7ee4fcea1a634bbc5fb40c9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646341855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4t5e0nkmC1G2mt/oiZK8bIVKGDGTDSfHDove9r1euFY=; b=s0bqrGsXa5wVH8GHNIpqJttAuofwp/D38LD0w12nib+N2JS9WkjZiYhebt9XLIVKyvW7jn LBy51WhlH6WtUtRB0FrMMHTzOCOjcn5HZDuXxxLfltaocdN/k4RcOKCbgauKpdqRu0k1zE zj1pCJ/RRkWRIIuFVhYBh7NCExCCwYV7ioHIr3jjGYk4FL7veeKPyIwUOw/5+tHeVVwHfv fWpeA/3YsNfyK0e046IpK1PVUwhYe95l2dgsJ3KEXbhiYVDOc3r7eMzav/D0MDSz82m6LY QXZ/nYdHh7i1q/k/UpE+twg2C5g0Gy0erhjYY4Lzet8jCnT6o7QHrYFIgWgxag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646341855; a=rsa-sha256; cv=none; b=vCXLdmeOuJdx2b35HmWUK8Dng3WbHqGWKqVzubZkmKNGVlYUL9oVLq7kpdCQcfpp47uSkf 5MR8+amnVb+kGzufB7m8hTur+bDmzFL5Xt7eiW1mlnI/f/cF7UHX4AhPaMqa73D8Ke0QcG KCRUk+1Laz/u74iMOMKj4xX5gL1umdA9pd5bCd9dgIegkwfjQ0MC/Rkd/1I3V0RXjbAv5A ubfeE6vnMTyOB+XEBsojAI8Y7bvoZ/8bPFqPb86ooZtO/dGFtlc/qeVsiOwUlHmWJHg7SP /xiRSLzQQnLD2eKLXqoKAK0mUTd5q0XugakeZr0najJGJ+/nQGN6u4hR570r5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cmt: URL: https://cgit.FreeBSD.org/ports/commit/?id=d25a7563aaa6b357e7ee4fcea1a634bbc5fb40c9 commit d25a7563aaa6b357e7ee4fcea1a634bbc5fb40c9 Author: Christoph Moench-Tegeder AuthorDate: 2022-03-03 21:08:54 +0000 Commit: Christoph Moench-Tegeder CommitDate: 2022-03-03 21:08:54 +0000 cad/freecad: update to 0.19.4 Notes: https://github.com/FreeCAD/FreeCAD/releases/tag/0.19.4 Also switch back to current opencascade to make this port actually installable in the presence of other ports --- cad/freecad/Makefile | 4 +- cad/freecad/distinfo | 6 +- .../patch-74639da997d5f2e53f001d9f256be86ceee901f5 | 477 +++++++++++++++++++++ ...c_3rdParty_salomesmesh_src_SMESH_SMESH_Mesh.cpp | 10 + .../files/patch-src_Mod_Fem_App_FemConstraint.cpp | 22 + .../patch-src_Mod_Fem_App_FemConstraintFixed.cpp | 11 + .../patch-src_Mod_MeshPart_App_MeshFlattening.cpp | 52 +++ ...h-src_Mod_PartDesign_Gui_ViewProviderAddSub.cpp | 21 + ..._Mod_PartDesign_Gui_ViewProviderTransformed.cpp | 19 + .../files/patch-src_Mod_Part_App_AppPartPy.cpp | 29 ++ cad/freecad/files/patch-src_Mod_Part_App_Tools.cpp | 45 ++ .../files/patch-src_Mod_Part_App_TopoShape.cpp | 146 +++++++ .../patch-src_Mod_Part_Gui_ViewProviderExt.cpp | 81 ++++ .../patch-src_Mod_Raytracing_App_PovTools.cpp | 23 + 14 files changed, 941 insertions(+), 5 deletions(-) diff --git a/cad/freecad/Makefile b/cad/freecad/Makefile index 47bf2a05f54e..2c9833d244fa 100644 --- a/cad/freecad/Makefile +++ b/cad/freecad/Makefile @@ -1,5 +1,5 @@ PORTNAME= FreeCAD -DISTVERSION= 0.19.3 +DISTVERSION= 0.19.4 # use these for bugfixes/snapshots # DISTVERSION= 0.18-16093 # git rev-list --count # DISTVERSIONSUFFIX= -g690774c0e @@ -22,7 +22,7 @@ LIB_DEPENDS= libexpat.so:textproc/expat2 \ libpng.so:graphics/png \ libtiff.so:graphics/tiff \ libvtksys-${VTK_VER}.so:math/vtk${VTK_VER:R} \ - libTKernel.so:cad/opencascade740 \ + libTKernel.so:cad/opencascade \ libxerces-c.so:textproc/xerces-c3 \ libboost_thread.so:devel/boost-libs \ libarea.so:devel/libarea \ diff --git a/cad/freecad/distinfo b/cad/freecad/distinfo index ce81c476485f..4786748e1b59 100644 --- a/cad/freecad/distinfo +++ b/cad/freecad/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1646330977 -SHA256 (FreeCAD-FreeCAD-0.19.3_GH0.tar.gz) = 568fa32a9601693ff9273f3a5a2e825915f58b2455ffa173bc23f981edecd07d -SIZE (FreeCAD-FreeCAD-0.19.3_GH0.tar.gz) = 296986058 +TIMESTAMP = 1646236843 +SHA256 (FreeCAD-FreeCAD-0.19.4_GH0.tar.gz) = e40a1c343956e13c56cc8578d025ae83d68d9d20acda1732953bc8a3883e9722 +SIZE (FreeCAD-FreeCAD-0.19.4_GH0.tar.gz) = 296990652 diff --git a/cad/freecad/files/patch-74639da997d5f2e53f001d9f256be86ceee901f5 b/cad/freecad/files/patch-74639da997d5f2e53f001d9f256be86ceee901f5 new file mode 100644 index 000000000000..dcd1a2d81116 --- /dev/null +++ b/cad/freecad/files/patch-74639da997d5f2e53f001d9f256be86ceee901f5 @@ -0,0 +1,477 @@ +commit 74639da997d5f2e53f001d9f256be86ceee901f5 +Author: wmayer +Date: Sat Oct 9 13:49:02 2021 +0200 + + OCCT: port FreeCAD sources to version 7.6 + SMESH is not yet ported + Although FreeCAD code compiles with OCCT 7.6 it doesn't work at the moment + +diff --git src/Mod/Drawing/App/DrawingExport.cpp src/Mod/Drawing/App/DrawingExport.cpp +index b87891ed50..7572be417c 100644 +--- src/Mod/Drawing/App/DrawingExport.cpp ++++ src/Mod/Drawing/App/DrawingExport.cpp +@@ -64,10 +64,7 @@ + #include + + #include +-#include + #include +-#include +-#include + #include + #include + #include +@@ -75,11 +72,19 @@ + #include + #include + #include ++#include ++#if OCC_VERSION_HEX < 0x070600 ++#include ++#endif + + #include "DrawingExport.h" + #include + #include + ++#if OCC_VERSION_HEX >= 0x070600 ++using BRepAdaptor_HCurve = BRepAdaptor_Curve; ++#endif ++ + using namespace Drawing; + using namespace std; + +diff --git src/Mod/Drawing/App/ProjectionAlgos.cpp src/Mod/Drawing/App/ProjectionAlgos.cpp +index 9afae7e9c0..da03d49057 100644 +--- src/Mod/Drawing/App/ProjectionAlgos.cpp ++++ src/Mod/Drawing/App/ProjectionAlgos.cpp +@@ -61,10 +61,7 @@ + #include + #include + #include +-#include + #include +-#include +-#include + #include + #include + #include +diff --git src/Mod/Import/App/ImpExpDxf.cpp src/Mod/Import/App/ImpExpDxf.cpp +index 09827bd928..dcd88ef138 100644 +--- src/Mod/Import/App/ImpExpDxf.cpp ++++ src/Mod/Import/App/ImpExpDxf.cpp +@@ -29,7 +29,6 @@ + + #include + #include +-#include + #include + #include + #include +@@ -47,6 +46,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -55,6 +55,9 @@ + #include + #include + #include ++#if OCC_VERSION_HEX < 0x070600 ++#include ++#endif + + #include + #include +@@ -68,6 +71,10 @@ + + using namespace Import; + ++#if OCC_VERSION_HEX >= 0x070600 ++using BRepAdaptor_HCurve = BRepAdaptor_Curve; ++#endif ++ + + //****************************************************************************** + // reading +diff --git src/Mod/Part/App/GeomPlate/CurveConstraintPyImp.cpp src/Mod/Part/App/GeomPlate/CurveConstraintPyImp.cpp +index 3271f3651a..b63227d537 100644 +--- src/Mod/Part/App/GeomPlate/CurveConstraintPyImp.cpp ++++ src/Mod/Part/App/GeomPlate/CurveConstraintPyImp.cpp +@@ -24,10 +24,13 @@ + #include "PreCompiled.h" + #ifndef _PreComp_ + # include +-# include + # include +-# include + # include ++# include ++# if OCC_VERSION_HEX < 0x070600 ++# include ++# include ++# endif + #endif + + #include "GeomPlate/CurveConstraintPy.h" +@@ -76,6 +79,16 @@ int CurveConstraintPy::PyInit(PyObject* args, PyObject* kwds) + return -1; + } + ++#if OCC_VERSION_HEX >= 0x070600 ++ Handle(Adaptor3d_Curve) hCurve; ++ if (curve->getTypeId().isDerivedFrom(GeomTrimmedCurve::getClassTypeId())) { ++ GeomTrimmedCurve* trim = static_cast(curve); ++ hCurve = new GeomAdaptor_Curve(handle, trim->getFirstParameter(), trim->getLastParameter()); ++ } ++ else { ++ hCurve = new GeomAdaptor_Curve(handle); ++ } ++#else + Handle(Adaptor3d_HCurve) hCurve; + if (curve->getTypeId().isDerivedFrom(GeomTrimmedCurve::getClassTypeId())) { + GeomTrimmedCurve* trim = static_cast(curve); +@@ -86,6 +99,7 @@ int CurveConstraintPy::PyInit(PyObject* args, PyObject* kwds) + GeomAdaptor_Curve adapt(handle); + hCurve = new GeomAdaptor_HCurve(adapt); + } ++#endif + + ptr.reset(new GeomPlate_CurveConstraint(hCurve, order, nbPts, tolDist, tolAng, tolCurv)); + } +@@ -212,11 +226,15 @@ PyObject* CurveConstraintPy::curve3d(PyObject *args) + return nullptr; + + try { +- Handle(Adaptor3d_HCurve) hAdapt = getGeomPlate_CurveConstraintPtr()->Curve3d(); ++ auto hAdapt = getGeomPlate_CurveConstraintPtr()->Curve3d(); + if (hAdapt.IsNull()) + Py_Return; + ++#if OCC_VERSION_HEX >= 0x070600 ++ const Adaptor3d_Curve& a3d = *hAdapt; ++#else + const Adaptor3d_Curve& a3d = hAdapt->Curve(); ++#endif + std::unique_ptr ptr(Part::makeFromCurveAdaptor(a3d)); + return ptr->getPyObject(); + } +@@ -282,6 +300,16 @@ PyObject* CurveConstraintPy::setProjectedCurve(PyObject *args) + return nullptr; + } + ++#if OCC_VERSION_HEX >= 0x070600 ++ Handle(Adaptor2d_Curve2d) hCurve; ++ if (handle->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) { ++ Handle(Geom2d_TrimmedCurve) aTC (Handle(Geom2d_TrimmedCurve)::DownCast (handle)); ++ hCurve = new Geom2dAdaptor_Curve(handle, aTC->FirstParameter(), aTC->LastParameter()); ++ } ++ else { ++ hCurve = new Geom2dAdaptor_Curve(handle); ++ } ++#else + Handle(Adaptor2d_HCurve2d) hCurve; + if (handle->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) { + Handle(Geom2d_TrimmedCurve) aTC (Handle(Geom2d_TrimmedCurve)::DownCast (handle)); +@@ -292,6 +320,7 @@ PyObject* CurveConstraintPy::setProjectedCurve(PyObject *args) + Geom2dAdaptor_Curve adapt(handle); + hCurve = new Geom2dAdaptor_HCurve(adapt); + } ++#endif + + getGeomPlate_CurveConstraintPtr()->SetProjectedCurve(hCurve, tolU, tolV); + Py_Return; +@@ -308,11 +337,15 @@ PyObject* CurveConstraintPy::projectedCurve(PyObject *args) + return nullptr; + + try { +- Handle(Adaptor2d_HCurve2d) hAdapt = getGeomPlate_CurveConstraintPtr()->ProjectedCurve(); ++ auto hAdapt = getGeomPlate_CurveConstraintPtr()->ProjectedCurve(); + if (hAdapt.IsNull()) + Py_Return; + ++#if OCC_VERSION_HEX >= 0x070600 ++ const Adaptor2d_Curve2d& a2d = *hAdapt; ++#else + const Adaptor2d_Curve2d& a2d = hAdapt->Curve2d(); ++#endif + std::unique_ptr ptr(Part::makeFromCurveAdaptor2d(a2d)); + return ptr->getPyObject(); + } +diff --git src/Mod/Part/App/Geometry.cpp src/Mod/Part/App/Geometry.cpp +index e6d6396ca9..1d1d67d4f0 100644 +--- src/Mod/Part/App/Geometry.cpp ++++ src/Mod/Part/App/Geometry.cpp +@@ -51,7 +51,6 @@ + # include + # include + # include +-# include + # include + # include + # include +@@ -101,6 +100,9 @@ + # include + # include + # include ++# if OCC_VERSION_HEX < 0x070600 ++# include ++# endif + + # include + # include +@@ -144,6 +146,9 @@ + + #include "Geometry.h" + ++#if OCC_VERSION_HEX >= 0x070600 ++using GeomAdaptor_HCurve = GeomAdaptor_Curve; ++#endif + + using namespace Part; + +diff --git src/Mod/Part/App/PartFeatures.cpp src/Mod/Part/App/PartFeatures.cpp +index 2dc503bdf2..4d9e1fc0f9 100644 +--- src/Mod/Part/App/PartFeatures.cpp ++++ src/Mod/Part/App/PartFeatures.cpp +@@ -25,9 +25,7 @@ + #ifndef _PreComp_ + # include + # include +-# include + # include +-# include + # include + # include + # include +@@ -43,7 +41,7 @@ + # include + # include + # include +-# include ++# include + #endif + + +@@ -170,22 +168,18 @@ App::DocumentObjectExecReturn *RuledSurface::execute(void) + + if (Orientation.getValue() == 0) { + // Automatic +- Handle(Adaptor3d_HCurve) a1; +- Handle(Adaptor3d_HCurve) a2; ++ std::unique_ptr a1; ++ std::unique_ptr a2; + if (!isWire) { +- BRepAdaptor_Curve adapt1(TopoDS::Edge(S1)); +- BRepAdaptor_Curve adapt2(TopoDS::Edge(S2)); +- a1 = new BRepAdaptor_HCurve(adapt1); +- a2 = new BRepAdaptor_HCurve(adapt2); ++ a1 = std::make_unique(TopoDS::Edge(S1)); ++ a2 = std::make_unique(TopoDS::Edge(S2)); + } + else { +- BRepAdaptor_CompCurve adapt1(TopoDS::Wire(S1)); +- BRepAdaptor_CompCurve adapt2(TopoDS::Wire(S2)); +- a1 = new BRepAdaptor_HCompCurve(adapt1); +- a2 = new BRepAdaptor_HCompCurve(adapt2); ++ a1 = std::make_unique(TopoDS::Wire(S1)); ++ a2 = std::make_unique(TopoDS::Wire(S2)); + } + +- if (!a1.IsNull() && !a2.IsNull()) { ++ if (a1 && a2) { + // get end points of 1st curve + Standard_Real first, last; + first = a1->FirstParameter(); +diff --git src/Mod/Part/App/TopoShapeFacePyImp.cpp src/Mod/Part/App/TopoShapeFacePyImp.cpp +index ea6cd98bdf..63e8bead74 100644 +--- src/Mod/Part/App/TopoShapeFacePyImp.cpp ++++ src/Mod/Part/App/TopoShapeFacePyImp.cpp +@@ -493,6 +493,15 @@ PyObject* TopoShapeFacePy::getUVNodes(PyObject *args) + return Py::new_reference_to(list); + } + ++#if OCC_VERSION_HEX >= 0x070600 ++ for (int i=1; i<=mesh->NbNodes(); i++) { ++ gp_Pnt2d pt2d = mesh->UVNode(i); ++ Py::Tuple uv(2); ++ uv.setItem(0, Py::Float(pt2d.X())); ++ uv.setItem(1, Py::Float(pt2d.Y())); ++ list.append(uv); ++ } ++#else + const TColgp_Array1OfPnt2d& aNodesUV = mesh->UVNodes(); + for (int i=aNodesUV.Lower(); i<=aNodesUV.Upper(); i++) { + gp_Pnt2d pt2d = aNodesUV(i); +@@ -501,6 +510,7 @@ PyObject* TopoShapeFacePy::getUVNodes(PyObject *args) + uv.setItem(1, Py::Float(pt2d.Y())); + list.append(uv); + } ++#endif + + return Py::new_reference_to(list); + } +diff --git src/Mod/Part/App/TopoShapeWirePyImp.cpp src/Mod/Part/App/TopoShapeWirePyImp.cpp +index 95c1aff681..a1f32d6d03 100644 +--- src/Mod/Part/App/TopoShapeWirePyImp.cpp ++++ src/Mod/Part/App/TopoShapeWirePyImp.cpp +@@ -344,9 +344,9 @@ PyObject* TopoShapeWirePy::approximate(PyObject *args, PyObject *kwds) + return 0; + try { + BRepAdaptor_CompCurve adapt(TopoDS::Wire(getTopoShapePtr()->getShape())); +- Handle(Adaptor3d_HCurve) hcurve = adapt.Trim(adapt.FirstParameter(), +- adapt.LastParameter(), +- tol2d); ++ auto hcurve = adapt.Trim(adapt.FirstParameter(), ++ adapt.LastParameter(), ++ tol2d); + Approx_Curve3d approx(hcurve, tol3d, GeomAbs_C0, maxseg, maxdeg); + if (approx.IsDone()) { + return new BSplineCurvePy(new GeomBSplineCurve(approx.Curve())); +diff --git src/Mod/Part/Gui/TaskCheckGeometry.cpp src/Mod/Part/Gui/TaskCheckGeometry.cpp +index 5de7c16920..aaef13d9d0 100644 +--- src/Mod/Part/Gui/TaskCheckGeometry.cpp ++++ src/Mod/Part/Gui/TaskCheckGeometry.cpp +@@ -711,8 +711,10 @@ int TaskCheckGeometryResults::goBOPSingleCheck(const TopoDS_Shape& shapeIn, Resu + #if OCC_VERSION_HEX >= 0x060900 + #if OCC_VERSION_HEX < 0x070500 + BOPCheck.SetProgressIndicator(theProgress); +-#else ++#elif OCC_VERSION_HEX < 0x070600 + BOPCheck.SetProgressIndicator(theScope); ++#else ++ Q_UNUSED(theScope) + #endif // 0x070500 + #else + Q_UNUSED(theProgress); +@@ -740,7 +742,7 @@ int TaskCheckGeometryResults::goBOPSingleCheck(const TopoDS_Shape& shapeIn, Resu + Base::TimeInfo start_time; + #endif + +-BOPCheck.Perform(); ++ BOPCheck.Perform(); + + #ifdef FC_DEBUG + float bopAlgoTime = Base::TimeInfo::diffTimeF(start_time,Base::TimeInfo()); +diff --git src/Mod/Part/Gui/ViewProviderExt.cpp src/Mod/Part/Gui/ViewProviderExt.cpp +index 77cefbe3e0..8a52f1701b 100644 +--- src/Mod/Part/Gui/ViewProviderExt.cpp ++++ src/Mod/Part/Gui/ViewProviderExt.cpp +@@ -1150,16 +1150,25 @@ + + + // cycling through the poly mesh ++#if OCC_VERSION_HEX < 0x070600 + const Poly_Array1OfTriangle& Triangles = mesh->Triangles(); + const TColgp_Array1OfPnt& Nodes = mesh->Nodes(); + TColgp_Array1OfDir Normals (Nodes.Lower(), Nodes.Upper()); ++#else ++ int numNodes = mesh->NbNodes(); ++ TColgp_Array1OfDir Normals (1, numNodes); ++#endif + if (NormalsFromUV) + getNormals(actFace, mesh, Normals); + + for (int g=1;g<=nbTriInFace;g++) { + // Get the triangle + Standard_Integer N1,N2,N3; ++#if OCC_VERSION_HEX < 0x070600 + Triangles(g).Get(N1,N2,N3); ++#else ++ mesh->Triangle(g).Get(N1,N2,N3); ++#endif + + // change orientation of the triangle if the face is reversed + if ( orient != TopAbs_FORWARD ) { +@@ -1169,7 +1178,11 @@ + } + + // get the 3 points of this triangle ++#if OCC_VERSION_HEX < 0x070600 + gp_Pnt V1(Nodes(N1)), V2(Nodes(N2)), V3(Nodes(N3)); ++#else ++ gp_Pnt V1(mesh->Node(N1)), V2(mesh->Node(N2)), V3(mesh->Node(N3)); ++#endif + + // get the 3 normals of this triangle + gp_Vec NV1, NV2, NV3; +@@ -1246,7 +1259,11 @@ + // rare cases where some points are only referenced by the polygon + // but not by any triangle. Thus, we must apply the coordinates to + // make sure that everything is properly set. ++#if OCC_VERSION_HEX < 0x070600 + gp_Pnt p(Nodes(nodeIndex)); ++#else ++ gp_Pnt p(mesh->Node(nodeIndex)); ++#endif + if (!identity) + p.Transform(myTransf); + verts[index].setValue((float)(p.X()),(float)(p.Y()),(float)(p.Z())); +diff --git src/Mod/Path/App/AppPathPy.cpp src/Mod/Path/App/AppPathPy.cpp +index 6e0c72d2f5..ce912b4474 100644 +--- src/Mod/Path/App/AppPathPy.cpp ++++ src/Mod/Path/App/AppPathPy.cpp +@@ -49,10 +49,7 @@ + #include + #include + #include +-#include +-#include +-#include +-#include ++#include + + #include "CommandPy.h" + #include "PathPy.h" +diff --git src/Mod/TechDraw/App/Geometry.cpp src/Mod/TechDraw/App/Geometry.cpp +index b6c3637137..59a92d7e51 100644 +--- src/Mod/TechDraw/App/Geometry.cpp ++++ src/Mod/TechDraw/App/Geometry.cpp +@@ -28,13 +28,13 @@ + #include + #include + #include +-#include + #include + #include + #include + #include + #include + #include ++#include + #include + #include + #include +@@ -58,14 +58,16 @@ + #include + #include + #include ++#include + #include + #include + #include + #include + #include + #include +-#include +- ++#if OCC_VERSION_HEX < 0x070600 ++#include ++#endif + #include + #endif // #ifndef _PreComp_ + +@@ -86,6 +88,10 @@ + using namespace TechDraw; + using namespace std; + ++#if OCC_VERSION_HEX >= 0x070600 ++using BRepAdaptor_HCurve = BRepAdaptor_Curve; ++#endif ++ + #define GEOMETRYEDGE 0 + #define COSMETICEDGE 1 + #define CENTERLINE 2 diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH_Mesh.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH_Mesh.cpp new file mode 100644 index 000000000000..f88315cbaeb4 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH_Mesh.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp.orig 2022-01-30 21:22:20.383703000 +0100 ++++ src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp 2022-01-30 21:22:56.240456000 +0100 +@@ -64,7 +64,6 @@ + + #include + +-#undef _Precision_HeaderFile + #include + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_Fem_App_FemConstraint.cpp b/cad/freecad/files/patch-src_Mod_Fem_App_FemConstraint.cpp new file mode 100644 index 000000000000..88d9de1b36e6 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Fem_App_FemConstraint.cpp @@ -0,0 +1,22 @@ +--- src/Mod/Fem/App/FemConstraint.cpp.orig 2022-02-04 00:04:15.767125000 +0100 ++++ src/Mod/Fem/App/FemConstraint.cpp 2022-02-04 00:04:38.270409000 +0100 +@@ -36,8 +36,6 @@ + # include + # include + # include +-# include +-# include + # include + # include + # include +@@ -248,8 +246,8 @@ + gp_Pnt center; + + // Get an estimate for the number of arrows by finding the average length of curves +- Handle(Adaptor3d_HSurface) hsurf; +- hsurf = new BRepAdaptor_HSurface(surface); ++ Handle(Adaptor3d_Surface) hsurf; ++ hsurf = new BRepAdaptor_Surface(surface); + + Adaptor3d_IsoCurve isoc(hsurf); + try { diff --git a/cad/freecad/files/patch-src_Mod_Fem_App_FemConstraintFixed.cpp b/cad/freecad/files/patch-src_Mod_Fem_App_FemConstraintFixed.cpp new file mode 100644 index 000000000000..319300cae57e --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Fem_App_FemConstraintFixed.cpp @@ -0,0 +1,11 @@ +--- src/Mod/Fem/App/FemConstraintFixed.cpp.orig 2022-02-03 23:52:01.569143000 +0100 ++++ src/Mod/Fem/App/FemConstraintFixed.cpp 2022-02-03 23:52:36.672029000 +0100 +@@ -32,8 +32,6 @@ + #include + #include + #include +-#include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_MeshPart_App_MeshFlattening.cpp b/cad/freecad/files/patch-src_Mod_MeshPart_App_MeshFlattening.cpp new file mode 100644 index 000000000000..b68142a11254 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_MeshPart_App_MeshFlattening.cpp @@ -0,0 +1,52 @@ +--- src/Mod/MeshPart/App/MeshFlattening.cpp.orig 2022-02-03 23:13:33.919226000 +0100 ++++ src/Mod/MeshPart/App/MeshFlattening.cpp 2022-02-03 23:30:59.747315000 +0100 +@@ -141,37 +141,37 @@ + if (triangulation.IsNull()) + throw std::runtime_error("null triangulation in face construction"); + ++ Standard_Integer numNodes = triangulation->NbNodes(); ++ Standard_Integer numTriangles = triangulation->NbTriangles(); ++ + // compute uv coordinates + if (triangulation->HasUVNodes()) + { +- const TColgp_Array1OfPnt2d &_uv_nodes = triangulation->UVNodes(); +- this->uv_nodes.resize(triangulation->NbNodes(), 2); ++ this->uv_nodes.resize(numNodes, 2); + i = 0; +- for (Standard_Integer index = _uv_nodes.Lower(); index <= _uv_nodes.Upper(); ++index) ++ for (Standard_Integer index = 1; index <= numNodes; ++index) + { +- const gp_Pnt2d& _uv_node = _uv_nodes.Value(index); ++ const gp_Pnt2d& _uv_node = triangulation->UVNode(index); + this->uv_nodes.row(i) << _uv_node.X(), _uv_node.Y(); + i++; + } + } + // +- const TColgp_Array1OfPnt &_nodes = triangulation->Nodes(); +- this->xyz_nodes.resize(triangulation->NbNodes(), 3); ++ this->xyz_nodes.resize(numNodes, 3); + i = 0; +- for (Standard_Integer index = _nodes.Lower(); index <= _nodes.Upper(); ++index) ++ for (Standard_Integer index = 1; index <= numNodes; ++index) + { +- gp_Pnt _node = _nodes.Value(index); ++ gp_Pnt _node = triangulation->Node(index); + this->xyz_nodes.row(i) << _node.X(), _node.Y(), _node.Z(); + i++; + } + +- const Poly_Array1OfTriangle &_tris = triangulation->Triangles(); +- this->tris.resize(triangulation->NbTriangles(), 3); ++ this->tris.resize(numTriangles, 3); + i = 0; +- for (Standard_Integer index = _tris.Lower(); index <= _tris.Upper(); ++index) ++ for (Standard_Integer index = 1; index <= numTriangles; ++index) + { + int n1, n2, n3; +- Poly_Triangle _tri = _tris.Value(index); ++ Poly_Triangle _tri = triangulation->Triangle(index); + _tri.Get(n1, n2, n3); + this->tris.row(i) << n1-1, n2-1, n3-1; + i++; diff --git a/cad/freecad/files/patch-src_Mod_PartDesign_Gui_ViewProviderAddSub.cpp b/cad/freecad/files/patch-src_Mod_PartDesign_Gui_ViewProviderAddSub.cpp new file mode 100644 index 000000000000..7c7c3c09accd --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_PartDesign_Gui_ViewProviderAddSub.cpp @@ -0,0 +1,21 @@ +--- src/Mod/PartDesign/Gui/ViewProviderAddSub.cpp.orig 2022-03-03 20:43:05.599798000 +0100 ++++ src/Mod/PartDesign/Gui/ViewProviderAddSub.cpp 2022-03-03 21:06:11.466643000 +0100 +@@ -194,8 +194,7 @@ + + // cycling through the poly mesh + const Poly_Array1OfTriangle& Triangles = mesh->Triangles(); +- const TColgp_Array1OfPnt& Nodes = mesh->Nodes(); +- TColgp_Array1OfDir Normals (Nodes.Lower(), Nodes.Upper()); ++ TColgp_Array1OfDir Normals (1, nbNodesInFace); + getNormals(actFace, mesh, Normals); + + for (int g=1;g<=nbTriInFace;g++) { +@@ -211,7 +210,7 @@ + } + + // get the 3 points of this triangle +- gp_Pnt V1(Nodes(N1)), V2(Nodes(N2)), V3(Nodes(N3)); ++ gp_Pnt V1(mesh->Node(N1)), V2(mesh->Node(N2)), V3(mesh->Node(N3)); + + // get the 3 previewNormals of this triangle + gp_Dir NV1(Normals(N1)), NV2(Normals(N2)), NV3(Normals(N3)); diff --git a/cad/freecad/files/patch-src_Mod_PartDesign_Gui_ViewProviderTransformed.cpp b/cad/freecad/files/patch-src_Mod_PartDesign_Gui_ViewProviderTransformed.cpp new file mode 100644 index 000000000000..2e2c02a95065 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_PartDesign_Gui_ViewProviderTransformed.cpp @@ -0,0 +1,19 @@ +--- src/Mod/PartDesign/Gui/ViewProviderTransformed.cpp.orig 2022-03-03 21:21:36.816245000 +0100 ++++ src/Mod/PartDesign/Gui/ViewProviderTransformed.cpp 2022-03-03 21:22:41.559121000 +0100 +@@ -285,7 +285,6 @@ + + // cycling through the poly mesh + const Poly_Array1OfTriangle& Triangles = mesh->Triangles(); +- const TColgp_Array1OfPnt& Nodes = mesh->Nodes(); + for (int g=1; g <= nbTriInFace; g++) { + // Get the triangle + Standard_Integer N1,N2,N3; +@@ -299,7 +298,7 @@ + } + + // get the 3 points of this triangle +- gp_Pnt V1(Nodes(N1)), V2(Nodes(N2)), V3(Nodes(N3)); ++ gp_Pnt V1(mesh->Node(N1)), V2(mesh->Node(N2)), V3(mesh->Node(N3)); + + // transform the vertices to the place of the face + if (!identity) { diff --git a/cad/freecad/files/patch-src_Mod_Part_App_AppPartPy.cpp b/cad/freecad/files/patch-src_Mod_Part_App_AppPartPy.cpp new file mode 100644 index 000000000000..dc95388b984e --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_AppPartPy.cpp @@ -0,0 +1,29 @@ +--- src/Mod/Part/App/AppPartPy.cpp.orig 2022-01-30 22:29:02.026790000 +0100 ++++ src/Mod/Part/App/AppPartPy.cpp 2022-01-30 22:50:54.044159000 +0100 +@@ -804,14 +804,26 @@ + const TopAbs_Orientation anOrientation = currentFace.Orientation(); + bool flip = (anOrientation == TopAbs_REVERSED); + if (!facets.IsNull()) { ++#if OCC_VERSION_HEX < 0x070600 + const TColgp_Array1OfPnt& nodes = facets->Nodes(); + const Poly_Array1OfTriangle& triangles = facets->Triangles(); + for (int i = 1; i <= triangles.Length(); i++) { ++#else ++ int nbtri = facets->NbTriangles(); ++ for (int i = 1; i <= nbtri; i++) { ++#endif + Standard_Integer n1,n2,n3; ++#if OCC_VERSION_HEX < 0x070600 + triangles(i).Get(n1, n2, n3); + gp_Pnt p1 = nodes(n1); + gp_Pnt p2 = nodes(n2); + gp_Pnt p3 = nodes(n3); ++#else ++ facets->Triangle(i).Get(n1, n2, n3); ++ gp_Pnt p1 = facets->Node(n1); ++ gp_Pnt p2 = facets->Node(n2); ++ gp_Pnt p3 = facets->Node(n3); ++#endif + p1.Transform(loc.Transformation()); + p2.Transform(loc.Transformation()); + p3.Transform(loc.Transformation()); diff --git a/cad/freecad/files/patch-src_Mod_Part_App_Tools.cpp b/cad/freecad/files/patch-src_Mod_Part_App_Tools.cpp new file mode 100644 index 000000000000..191d1c081f35 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_Tools.cpp @@ -0,0 +1,45 @@ +--- src/Mod/Part/App/Tools.cpp.orig 2022-02-03 20:59:16.862252000 +0100 ++++ src/Mod/Part/App/Tools.cpp 2022-02-03 21:43:13.008464000 +0100 +@@ -25,10 +25,9 @@ + # include + # include + # include +-# include + # include + # include +-# include ++# include + # include + # include + # include +@@ -98,8 +97,8 @@ + return found; + } + +-/*! The objects in \a theBoundaries must be of the type Adaptor3d_HCurveOnSurface or +-GeomAdaptor_HCurve or Geom_Point indicating type of a constraint. Otherwise an exception ++/*! The objects in \a theBoundaries must be of the type Adaptor3d_CurveOnSurface or ++GeomAdaptor_Curve or Geom_Point indicating type of a constraint. Otherwise an exception + Standard_TypeMismatch is thrown. + + If the \a theBoundaries list is empty then Standard_ConstructionError is thrown. +@@ -138,15 +137,15 @@ + assert (0); + Standard_ConstructionError::Raise ("Tools::makeSurface()"); + } +- else if (aCur->IsKind (STANDARD_TYPE (Adaptor3d_HCurveOnSurface))) { ++ else if (aCur->IsKind (STANDARD_TYPE (Adaptor3d_CurveOnSurface))) { + //G1 constraint +- Handle(Adaptor3d_HCurveOnSurface) aHCOS (Handle(Adaptor3d_HCurveOnSurface)::DownCast (aCur)); ++ Handle(Adaptor3d_CurveOnSurface) aHCOS (Handle(Adaptor3d_CurveOnSurface)::DownCast (aCur)); + Handle (GeomPlate_CurveConstraint) aConst = new GeomPlate_CurveConstraint (aHCOS, 1 /*GeomAbs_G1*/,aNbPnts, aTol3d, anAngTol, aCurvTol); + aPlateBuilder.Add (aConst); + } +- else if (aCur->IsKind (STANDARD_TYPE (GeomAdaptor_HCurve))) { ++ else if (aCur->IsKind (STANDARD_TYPE (GeomAdaptor_Curve))) { + //G0 constraint +- Handle(GeomAdaptor_HCurve) aHC (Handle(GeomAdaptor_HCurve)::DownCast (aCur)); ++ Handle(GeomAdaptor_Curve) aHC (Handle(GeomAdaptor_Curve)::DownCast (aCur)); + Handle (GeomPlate_CurveConstraint) aConst = new GeomPlate_CurveConstraint (aHC, 0 /*GeomAbs_G0*/, aNbPnts, aTol3d); + aPlateBuilder.Add (aConst); + } diff --git a/cad/freecad/files/patch-src_Mod_Part_App_TopoShape.cpp b/cad/freecad/files/patch-src_Mod_Part_App_TopoShape.cpp new file mode 100644 index 000000000000..51285e1c05f4 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_TopoShape.cpp @@ -0,0 +1,146 @@ +--- src/Mod/Part/App/TopoShape.cpp.orig 2022-02-03 21:51:04.000000000 +0100 ++++ src/Mod/Part/App/TopoShape.cpp 2022-02-03 22:55:05.882488000 +0100 +@@ -38,8 +38,6 @@ + # include + # include + # include +-# include +-# include + # include + # include + # include +@@ -1122,10 +1120,10 @@ + // check orientation + TopAbs_Orientation orient = aFace.Orientation(); + ++ nbTriInFace = aPoly->NbTriangles(); + // cycling through the poly mesh + const Poly_Array1OfTriangle& Triangles = aPoly->Triangles(); +- const TColgp_Array1OfPnt& Nodes = aPoly->Nodes(); +- for (int i=1;i<=nbTriInFace;i++) { ++ for (int i=1; i<=nbTriInFace; i++) { + // Get the triangle + Standard_Integer N1,N2,N3; + Triangles(i).Get(N1,N2,N3); +@@ -1137,9 +1135,9 @@ + N2 = tmp; + } + +- gp_Pnt V1 = Nodes(N1); +- gp_Pnt V2 = Nodes(N2); +- gp_Pnt V3 = Nodes(N3); ++ gp_Pnt V1 = aPoly->Node(N1); ++ gp_Pnt V2 = aPoly->Node(N2); ++ gp_Pnt V3 = aPoly->Node(N3); + + // transform the vertices to the place of the face + if (!identity) { +@@ -1193,6 +1191,7 @@ + + std::vector vertices; + Standard_Integer nbNodesInFace; ++ Standard_Integer nbNodesInTria; + + // triangulation succeeded? + if (!aPoly.IsNull()) { +@@ -1233,16 +1232,14 @@ + + // getting size and create the array + nbNodesInFace = aPoly->NbNodes(); ++ nbNodesInTria = aPolyTria->NbNodes(); + vertices.resize(nbNodesInFace); + +- const TColStd_Array1OfInteger& indices = aPoly->Nodes(); +- const TColgp_Array1OfPnt& Nodes = aPolyTria->Nodes(); +- + gp_Pnt V; + int pos = 0; + // go through the index array +- for (Standard_Integer i=indices.Lower();i <= indices.Upper();i++) { +- V = Nodes(indices(i)); ++ for (Standard_Integer i=1; i<=nbNodesInTria; i++) { ++ V = aPolyTria->Node(i); + V.Transform(myTransf); + vertices[pos++].Set((float)(V.X()),(float)(V.Y()),(float)(V.Z())); + } +@@ -2215,12 +2212,20 @@ + if (this->_Shape.IsNull()) + Standard_Failure::Raise("Cannot sweep along empty spine"); + ++#if OCC_VERSION_HEX >= 0x070600 ++ Handle(Adaptor3d_Curve) myPath; ++ if (this->_Shape.ShapeType() == TopAbs_EDGE) { ++ const TopoDS_Edge& path_edge = TopoDS::Edge(this->_Shape); ++ myPath = new BRepAdaptor_Curve(path_edge); ++ } ++#else + Handle(Adaptor3d_HCurve) myPath; + if (this->_Shape.ShapeType() == TopAbs_EDGE) { + const TopoDS_Edge& path_edge = TopoDS::Edge(this->_Shape); + BRepAdaptor_Curve path_adapt(path_edge); + myPath = new BRepAdaptor_HCurve(path_adapt); + } ++#endif + //else if (this->_Shape.ShapeType() == TopAbs_WIRE) { + // const TopoDS_Wire& path_wire = TopoDS::Wire(this->_Shape); + // BRepAdaptor_CompCurve path_adapt(path_wire); +@@ -3401,10 +3406,10 @@ + + Domain domain; + // copy the points +- const TColgp_Array1OfPnt& points = theTriangulation->Nodes(); +- domain.points.reserve(points.Length()); +- for (int i = 1; i <= points.Length(); i++) { +- gp_Pnt p = points(i); ++ int nbptintria = theTriangulation->NbNodes(); ++ domain.points.reserve(nbptintria); ++ for (int i = 1; i <= nbptintria; i++) { ++ gp_Pnt p = theTriangulation->Node(i); + p.Transform(loc.Transformation()); + Standard_Real X, Y, Z; + p.Coord (X, Y, Z); +@@ -3414,11 +3419,11 @@ + // copy the triangles + const TopAbs_Orientation anOrientation = face.Orientation(); + bool flip = (anOrientation == TopAbs_REVERSED); +- const Poly_Array1OfTriangle& faces = theTriangulation->Triangles(); +- domain.facets.reserve(faces.Length()); +- for (int i = 1; i <= faces.Length(); i++) { ++ int nbtri = theTriangulation->NbTriangles(); ++ domain.facets.reserve(nbtri); ++ for (int i = 1; i <= nbtri; i++) { + Standard_Integer N1, N2, N3; +- faces(i).Get(N1, N2, N3); ++ theTriangulation->Triangle(i).Get(N1, N2, N3); + + Facet tria; + tria.I1 = N1-1; tria.I2 = N2-1; tria.I3 = N3-1; +@@ -3774,8 +3779,8 @@ + const TColgp_Array1OfPnt& Nodes = aPoly->Nodes(); + + gp_Pnt V; +- for (Standard_Integer i=0;i < nbNodesInFace;i++) { +- V = Nodes(i+1); ++ for (Standard_Integer i=1; i <= nbNodesInFace; i++) { ++ V = Nodes(i); + V.Transform(myTransf); + vertices.emplace_back(V.X(),V.Y(),V.Z()); + } +@@ -3808,14 +3813,12 @@ + + // getting size and create the array + nbNodesInFace = aPoly->NbNodes(); ++ int nbNodesInTria = aPolyTria->NbNodes(); + +- const TColStd_Array1OfInteger& indices = aPoly->Nodes(); +- const TColgp_Array1OfPnt& Nodes = aPolyTria->Nodes(); +- + gp_Pnt V; + // go through the index array +- for (Standard_Integer i=indices.Lower();i <= indices.Upper();i++) { +- V = Nodes(indices(i)); ++ for (Standard_Integer i=1 ;i <= nbNodesInTria; i++) { ++ V = aPolyTria->Node(i); + V.Transform(myTransf); + vertices.emplace_back(V.X(),V.Y(),V.Z()); + } diff --git a/cad/freecad/files/patch-src_Mod_Part_Gui_ViewProviderExt.cpp b/cad/freecad/files/patch-src_Mod_Part_Gui_ViewProviderExt.cpp new file mode 100644 index 000000000000..197253155500 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_Gui_ViewProviderExt.cpp @@ -0,0 +1,81 @@ +--- src/Mod/Part/Gui/ViewProviderExt.cpp.orig 2022-03-02 17:15:16.283319000 +0100 ++++ src/Mod/Part/Gui/ViewProviderExt.cpp 2022-03-02 23:49:04.036080000 +0100 +@@ -137,26 +137,17 @@ + const Handle(Poly_Triangulation)& aPolyTri, + TColgp_Array1OfDir& theNormals) + { +- const TColgp_Array1OfPnt& aNodes = aPolyTri->Nodes(); +- + if(aPolyTri->HasNormals()) + { + // normals pre-computed in triangulation structure +- const TShort_Array1OfShortReal& aNormals = aPolyTri->Normals(); +- const Standard_ShortReal* aNormArr = &(aNormals.Value(aNormals.Lower())); +- +- for(Standard_Integer aNodeIter = aNodes.Lower(); aNodeIter <= aNodes.Upper(); ++aNodeIter) ++ for(Standard_Integer aNodeIter = 1; aNodeIter <= aPolyTri->NbNodes(); ++aNodeIter) + { +- const Standard_Integer anId = 3 * (aNodeIter - aNodes.Lower()); +- const gp_Dir aNorm(aNormArr[anId + 0], +- aNormArr[anId + 1], +- aNormArr[anId + 2]); +- theNormals(aNodeIter) = aNorm; ++ theNormals(aNodeIter) = aPolyTri->Normal(aNodeIter); + } *** 86 LINES SKIPPED ***