Skip to content

Instantly share code, notes, and snippets.

@tpaviot
Created February 16, 2013 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tpaviot/4966329 to your computer and use it in GitHub Desktop.
Save tpaviot/4966329 to your computer and use it in GitHub Desktop.
Fuse toruses patch
diff --git a/test/BRepAlgoAPI_test/boolean_ops.cpp b/test/BRepAlgoAPI_test/boolean_ops.cpp
index 3d03ac2..84acb16 100644
--- a/test/BRepAlgoAPI_test/boolean_ops.cpp
+++ b/test/BRepAlgoAPI_test/boolean_ops.cpp
@@ -1,7 +1,9 @@
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
+#include <BRepPrimAPI_MakeTorus.hxx>
#include <BRepAlgoAPI_Cut.hxx>
+#include <BRepAlgoAPI_Fuse.hxx>
#include <gtest/gtest.h>
@@ -33,6 +35,19 @@ TEST(BRepAlgoAPITestSuite, testCutCylSphere)
ASSERT_FALSE(shp_result.IsNull());
}
+TEST(BRepAlgoAPITestSuite, testFuseToruses)
+{
+ // create the first shape: a sphere, centered at the origin
+ TopoDS_Solid torus_1 = BRepPrimAPI_MakeTorus(5.,10.);
+ ASSERT_FALSE(torus_1.IsNull());
+ // the second shape: a cylinder cube, a corner at the origin
+ TopoDS_Solid torus_2 = BRepPrimAPI_MakeTorus(6.,11.);
+ ASSERT_FALSE(torus_2.IsNull());
+ // boolean cut
+ TopoDS_Shape shp_result = BRepAlgoAPI_Fuse(torus_1,torus_2);
+ ASSERT_FALSE(shp_result.IsNull());
+}
+
int main(int argc, char **argv){
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment