Skip to content

Commit

Permalink
Support for OCCT 7.5.3 (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
trelau authored Apr 24, 2022
1 parent d44afe9 commit e02a307
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ jobs:
sudo chown -R $USER $CONDA
curl -o MacOSX10.9.sdk.tar.xz -L https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.9.sdk.tar.xz
tar xf MacOSX10.9.sdk.tar.xz
sudo mkdir -p /Applications/Xcode_12.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
sudo mv -v MacOSX10.9.sdk /Applications/Xcode_12.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
- name: "Configure conda"
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.3)
project(SMESH VERSION 9.7.0.1 LANGUAGES C CXX)
project(SMESH VERSION 9.7.0.2 LANGUAGES C CXX)

# --------------------------------------------------------------------------- #
# OPTIONS
Expand All @@ -15,7 +15,7 @@ set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
set(SMESH_VERSION_MAJOR 9)
set(SMESH_VERSION_MINOR 7)
set(SMESH_VERSION_PATCH 0)
set(SMESH_VERSION_TWEAK 1)
set(SMESH_VERSION_TWEAK 2)

# Build shared libraries
set(BUILD_SHARED_LIBS TRUE)
Expand Down
6 changes: 3 additions & 3 deletions ci/conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: smesh4pyocct
version: "9.7.0.1"
version: "9.7.0.2"

source:
path: ../..
Expand All @@ -18,15 +18,15 @@ requirements:
- ninja

host:
- occt ==7.5.2
- occt ==7.5.3
- boost-cpp
- tbb-devel
- vtk
- zlib
- pthreads-win32 # [win]

run:
- occt ==7.5.2
- occt ==7.5.3
- vtk
- boost-cpp
- zlib
Expand Down
55 changes: 55 additions & 0 deletions test/src/NETGENPlugin.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

#include <catch2/catch.hpp>

#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <gp_Pln.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Solid.hxx>
#include <TopExp_Explorer.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <BRepAlgoAPI_Splitter.hxx>
#include <TopTools_ListOfShape.hxx>

#include <SMESH_Gen.hxx>
#include <SMESH_Mesh.hxx>
Expand Down Expand Up @@ -80,3 +87,51 @@ TEST_CASE("Mesh a box with tetrahedral elements and a local edge length.", "[NET
delete mesh;
delete gen;
}

TEST_CASE("Mesh a box with tetrahedral elements and split faces.", "[NETGENPlugin]") {

TopoDS_Solid box = BRepPrimAPI_MakeBox(10.0, 10.0, 10.0).Solid();

gp_Pnt origin = gp_Pnt(5.0, 0.0, 0.0);
gp_Dir normal = gp_Dir(1.0, 0.0, 0.0);
gp_Pln pln = gp_Pln(origin, normal);

TopoDS_Face face = BRepBuilderAPI_MakeFace(pln, -5.0, 5.0, -5.0, 5.0).Face();

TopTools_ListOfShape args = TopTools_ListOfShape();
args.Append(box);

TopTools_ListOfShape tools = TopTools_ListOfShape();
tools.Append(face);

BRepAlgoAPI_Splitter splitter = BRepAlgoAPI_Splitter();
splitter.SetArguments(args);
splitter.SetTools(tools);
splitter.Build();
REQUIRE(splitter.IsDone() == true);

TopoDS_Shape split_box = splitter.Shape();

SMESH_Gen* gen = new SMESH_Gen();
SMESH_Mesh* mesh = gen->CreateMesh(true);

NETGENPlugin_SimpleHypothesis_3D* hyp = new NETGENPlugin_SimpleHypothesis_3D(0, gen);
hyp->SetLocalLength(1.0);

NETGENPlugin_NETGEN_2D3D* algo = new NETGENPlugin_NETGEN_2D3D(1, gen);

mesh->ShapeToMesh(split_box);
mesh->AddHypothesis(split_box, 0);
mesh->AddHypothesis(split_box, 1);

bool success = gen->Compute(*mesh, split_box);
REQUIRE(success == true);

REQUIRE(mesh->NbTetras() == 4757);
REQUIRE(mesh->NbNodes() == 1194);

delete hyp;
delete algo;
delete mesh;
delete gen;
}

0 comments on commit e02a307

Please sign in to comment.