{"id":192,"date":"2026-03-05T11:43:02","date_gmt":"2026-03-05T03:43:02","guid":{"rendered":"https:\/\/www.alimzs.com\/index.php\/2026\/03\/05\/opencascade-7-7-0-%e5%ae%8c%e5%85%a8%e6%95%99%e7%a8%8b%ef%bc%88%e4%ba%8c%e5%8d%81%ef%bc%89%ef%bc%9a%e5%b8%83%e5%b0%94%e8%bf%90%e7%ae%97%e5%ae%9e%e6%88%98\/"},"modified":"2026-03-05T11:43:02","modified_gmt":"2026-03-05T03:43:02","slug":"opencascade-7-7-0-%e5%ae%8c%e5%85%a8%e6%95%99%e7%a8%8b%ef%bc%88%e4%ba%8c%e5%8d%81%ef%bc%89%ef%bc%9a%e5%b8%83%e5%b0%94%e8%bf%90%e7%ae%97%e5%ae%9e%e6%88%98","status":"publish","type":"post","link":"https:\/\/www.alimzs.com\/index.php\/2026\/03\/05\/opencascade-7-7-0-%e5%ae%8c%e5%85%a8%e6%95%99%e7%a8%8b%ef%bc%88%e4%ba%8c%e5%8d%81%ef%bc%89%ef%bc%9a%e5%b8%83%e5%b0%94%e8%bf%90%e7%ae%97%e5%ae%9e%e6%88%98\/","title":{"rendered":"OpenCASCADE 7.7.0 \u5b8c\u5168\u6559\u7a0b\uff08\u4e8c\u5341\uff09\uff1a\u5e03\u5c14\u8fd0\u7b97\u5b9e\u6218"},"content":{"rendered":"<h1>OpenCASCADE 7.7.0 \u5b8c\u5168\u6559\u7a0b\uff08\u4e8c\u5341\uff09\uff1a\u5e03\u5c14\u8fd0\u7b97\u5b9e\u6218<\/h1>\n<p>> <strong>\u7248\u672c<\/strong>: OCCT 7.7.0<br \/>\n> <strong>\u96be\u5ea6<\/strong>: \u8fdb\u9636<br \/>\n> <strong>\u5b57\u6570<\/strong>: \u7ea6 2500 \u5b57<br \/>\n> <strong>\u6848\u4f8b<\/strong>: \u7ec4\u5408\u96f6\u4ef6\u8bbe\u8ba1<\/p>\n<p>&#8212;<\/p>\n<h2>\u5e03\u5c14\u8fd0\u7b97\u6982\u8ff0<\/h2>\n<p>\u5e03\u5c14\u8fd0\u7b97\u662f CAD \u5efa\u6a21\u4e2d\u6700\u6838\u5fc3\u7684\u64cd\u4f5c\u4e4b\u4e00\uff0c\u7528\u4e8e\u5c06\u591a\u4e2a\u51e0\u4f55\u4f53\u7ec4\u5408\u6210\u590d\u6742\u5f62\u72b6\u3002<\/p>\n<h3>\u4e09\u79cd\u57fa\u672c\u8fd0\u7b97<\/h3>\n<table>\n<thead>\n<tr> \u8fd0\u7b97 <\/td>\n<td> \u8bf4\u660e <\/td>\n<td> API \u7c7b <\/td>\n<td> \u5e94\u7528\u573a\u666f <\/tr>\n<\/thead>\n<tbody>\n<tr> <strong>Common<\/strong> <\/td>\n<td> \u4ea4\u96c6\uff08\u5171\u540c\u90e8\u5206\uff09 <\/td>\n<td> BRepAlgoAPI_Common <\/td>\n<td> \u63d0\u53d6\u91cd\u53e0\u533a\u57df <\/tr>\n<\/tbody>\n<\/table>\n<tr> <strong>Fuse<\/strong> <\/td>\n<td> \u5e76\u96c6\uff08\u5408\u5e76\uff09 <\/td>\n<td> BRepAlgoAPI_Fuse <\/td>\n<td> \u7ec4\u5408\u591a\u4e2a\u96f6\u4ef6 <\/tr>\n<\/tbody>\n<\/table>\n<tr> <strong>Cut<\/strong> <\/td>\n<td> \u5dee\u96c6\uff08\u5207\u9664\uff09 <\/td>\n<td> BRepAlgoAPI_Cut <\/td>\n<td> \u6253\u5b54\u3001\u5207\u5272 <\/tr>\n<\/tbody>\n<\/table>\n<p>&#8212;<\/p>\n<h2>\u57fa\u7840\u793a\u4f8b\uff1a\u7acb\u65b9\u4f53\u4e0e\u7403\u4f53<\/h2>\n<h3>\u521b\u5efa\u57fa\u7840\u51e0\u4f55\u4f53<\/h3>\n<pre><code class=\"language-cpp\">#include <BRepPrimAPI_MakeBox.hxx>\n#include <BRepPrimAPI_MakeSphere.hxx>\n#include <BRepAlgoAPI_Fuse.hxx>\n#include <BRepAlgoAPI_Cut.hxx>\n#include <BRepAlgoAPI_Common.hxx>\n#include <iostream>\n<p>int main() {\n    \/\/ \u521b\u5efa\u7acb\u65b9\u4f53 50x50x50\n    TopoDS_Solid box = BRepPrimAPI_MakeBox(50, 50, 50);\n    \n    \/\/ \u521b\u5efa\u7403\u4f53\uff0c\u534a\u5f84 30\uff0c\u4e2d\u5fc3\u5728 (25, 25, 25)\n    gp_Pnt center(25, 25, 25);\n    TopoDS_Solid sphere = BRepPrimAPI_MakeSphere(center, 30);\n    \n    std::cout << \"\u57fa\u7840\u51e0\u4f55\u4f53\u521b\u5efa\u5b8c\u6210\" << std::endl;\n    return 0;\n}\n<\/code><\/pre>\n<\/p>\n<h3>\u5e76\u96c6\u8fd0\u7b97\uff08Fuse\uff09<\/h3>\n<pre><code class=\"language-cpp\">\/\/ \u5408\u5e76\u7acb\u65b9\u4f53\u548c\u7403\u4f53\nBRepAlgoAPI_Fuse fuseOp(box, sphere);\nif (!fuseOp.IsDone()) {\n    std::cerr << \"\u5e03\u5c14\u5e76\u96c6\u8fd0\u7b97\u5931\u8d25!\" << std::endl;\n    return 1;\n}\nTopoDS_Shape fusedShape = fuseOp.Shape();\n<p>\/\/ \u9a8c\u8bc1\u7ed3\u679c\nif (fusedShape.IsNull()) {\n    std::cerr << \"\u7ed3\u679c\u4e3a\u7a7a!\" << std::endl;\n}\n<\/code><\/pre>\n<\/p>\n<h3>\u5dee\u96c6\u8fd0\u7b97\uff08Cut\uff09<\/h3>\n<pre><code class=\"language-cpp\">\/\/ \u4ece\u7acb\u65b9\u4f53\u4e2d\u5207\u9664\u7403\u4f53\nBRepAlgoAPI_Cut cutOp(box, sphere);\nif (!cutOp.IsDone()) {\n    std::cerr << \"\u5e03\u5c14\u5dee\u96c6\u8fd0\u7b97\u5931\u8d25!\" << std::endl;\n    return 1;\n}\nTopoDS_Shape cutShape = cutOp.Shape();\n<\/code><\/pre>\n<h3>\u4ea4\u96c6\u8fd0\u7b97\uff08Common\uff09<\/h3>\n<pre><code class=\"language-cpp\">\/\/ \u53d6\u7acb\u65b9\u4f53\u548c\u7403\u4f53\u7684\u5171\u540c\u90e8\u5206\nBRepAlgoAPI_Common commonOp(box, sphere);\nif (!commonOp.IsDone()) {\n    std::cerr << \"\u5e03\u5c14\u4ea4\u96c6\u8fd0\u7b97\u5931\u8d25!\" << std::endl;\n    return 1;\n}\nTopoDS_Shape commonShape = commonOp.Shape();\n<\/code><\/pre>\n<p>---<\/p>\n<h2>\u5b9e\u6218\u6848\u4f8b\uff1a\u5e26\u5b54\u6cd5\u5170\u76d8<\/h2>\n<h3>\u6848\u4f8b\u63cf\u8ff0<\/h3>\n<p>\u521b\u5efa\u4e00\u4e2a\u6cd5\u5170\u76d8\u96f6\u4ef6\uff1a<\/p>\n<ul>\n<li>\u4e3b\u4f53\uff1a\u5706\u67f1\u4f53\uff08\u76f4\u5f84 100mm\uff0c\u539a\u5ea6 10mm\uff09<\/li>\n<li>\u4e2d\u5fc3\u5b54\uff1a\u76f4\u5f84 30mm<\/li>\n<li>\u87ba\u6813\u5b54\uff1a4 \u4e2a\u76f4\u5f84 8mm \u7684\u5b54\uff0c\u5747\u5300\u5206\u5e03<\/li>\n<\/ul>\n<h3>\u5b8c\u6574\u4ee3\u7801<\/h3>\n<\/p>\n<pre><code class=\"language-cpp\">#include <BRepPrimAPI_MakeCylinder.hxx>\n#include <BRepAlgoAPI_Cut.hxx>\n#include <BRepAlgoAPI_Fuse.hxx>\n#include <TopTools_ListOfShape.hxx>\n#include <iostream>\n<p>int main() {\n    \/\/ 1. \u521b\u5efa\u6cd5\u5170\u76d8\u4e3b\u4f53\n    gp_Pnt origin(0, 0, 0);\n    gp_Ax2 axis(origin, gp_Dir(0, 0, 1));\n    TopoDS_Solid disk = BRepPrimAPI_MakeCylinder(axis, 50, 10);\n    \n    \/\/ 2. \u521b\u5efa\u4e2d\u5fc3\u5b54\u5200\u5177\n    TopoDS_Solid centerHole = BRepPrimAPI_MakeCylinder(axis, 15, 10);\n    \n    \/\/ 3. \u5207\u9664\u4e2d\u5fc3\u5b54\n    BRepAlgoAPI_Cut cut1(disk, centerHole);\n    TopoDS_Shape withCenterHole = cut1.Shape();\n    \n    \/\/ 4. \u521b\u5efa\u87ba\u6813\u5b54\n    double boltCircleRadius = 35; \/\/ \u87ba\u6813\u5b54\u5206\u5e03\u5706\u534a\u5f84\n    TopTools_ListOfShape boltHoles;\n    \n    for (int i = 0; i < 4; i++) {\n        double angle = i * M_PI \/ 2.0; \/\/ 90 \u5ea6\u95f4\u9694\n        double x = boltCircleRadius * cos(angle);\n        double y = boltCircleRadius * sin(angle);\n        \n        gp_Ax2 boltAxis(gp_Pnt(x, y, 0), gp_Dir(0, 0, 1));\n        TopoDS_Solid boltHole = BRepPrimAPI_MakeCylinder(boltAxis, 4, 10);\n        boltHoles.Append(boltHole);\n    }\n    \n    \/\/ 5. \u5408\u5e76\u6240\u6709\u87ba\u6813\u5b54\u5200\u5177\n    TopoDS_Shape allBoltHoles = boltHoles.First();\n    for (TopTools_ListIteratorOfListOfShape it(boltHoles); it.More(); it.Next()) {\n        if (it.Value() != boltHoles.First()) {\n            BRepAlgoAPI_Fuse fuse(allBoltHoles, it.Value());\n            allBoltHoles = fuse.Shape();\n        }\n    }\n    \n    \/\/ 6. \u5207\u9664\u6240\u6709\u87ba\u6813\u5b54\n    BRepAlgoAPI_Cut cut2(withCenterHole, allBoltHoles);\n    TopoDS_Shape finalPart = cut2.Shape();\n    \n    std::cout << \"\u6cd5\u5170\u76d8\u5efa\u6a21\u5b8c\u6210!\" << std::endl;\n    return 0;\n}\n<\/code><\/pre>\n<\/p>\n<p>---<\/p>\n<h2>\u9ad8\u7ea7\u6280\u5de7<\/h2>\n<h3>\u591a\u4f53\u5e03\u5c14\u8fd0\u7b97<\/h3>\n<pre><code class=\"language-cpp\">\/\/ \u4f9d\u6b21\u5bf9\u591a\u4e2a\u7269\u4f53\u8fdb\u884c\u5e03\u5c14\u8fd0\u7b97\nTopoDS_Shape result = shape1;\nfor (const auto& tool : tools) {\n    BRepAlgoAPI_Cut cut(result, tool);\n    result = cut.Shape();\n}\n<\/code><\/pre>\n<h3>\u68c0\u67e5\u5e03\u5c14\u8fd0\u7b97\u72b6\u6001<\/h3>\n<pre><code class=\"language-cpp\">BRepAlgoAPI_Fuse fuseOp(shape1, shape2);\n<p>\/\/ \u68c0\u67e5\u662f\u5426\u5b8c\u6210\nif (!fuseOp.IsDone()) {\n    std::cerr << \"\u8fd0\u7b97\u672a\u5b8c\u6210\" << std::endl;\n}<\/p>\n<p>\/\/ \u68c0\u67e5\u662f\u5426\u6709\u9519\u8bef\nif (fuseOp.HasErrors()) {\n    std::cerr << \"\u8fd0\u7b97\u5b58\u5728\u9519\u8bef\" << std::endl;\n}<\/p>\n<p>\/\/ \u83b7\u53d6\u9519\u8bef\u7c7b\u578b\nStandard_Integer err = fuseOp.ErrorStatus();\n<\/code><\/pre>\n<\/p>\n<h3>\u4f18\u5316\u5e03\u5c14\u8fd0\u7b97\u6027\u80fd<\/h3>\n<pre><code class=\"language-cpp\">\/\/ \u8bbe\u7f6e\u6a21\u7cca\u516c\u5dee\uff08\u5f71\u54cd\u8fd0\u7b97\u7cbe\u5ea6\u548c\u901f\u5ea6\uff09\nBRepAlgoAPI_Fuse fuseOp(shape1, shape2);\nfuseOp.SetFuzzyValue(1e-5); \/\/ \u9ed8\u8ba4\u503c\uff0c\u589e\u5927\u53ef\u63d0\u9ad8\u6548\u7387\u4f46\u964d\u4f4e\u7cbe\u5ea6\nTopoDS_Shape result = fuseOp.Shape();\n<\/code><\/pre>\n<p>---<\/p>\n<h2>\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/h2>\n<h3>\u95ee\u9898 1\uff1a\u5e03\u5c14\u8fd0\u7b97\u5931\u8d25<\/h3>\n<p><strong>\u539f\u56e0<\/strong>: \u51e0\u4f55\u4f53\u76f8\u5207\u6216\u91cd\u5408\u5bfc\u81f4\u8ba1\u7b97\u56f0\u96be<br \/>\n<strong>\u89e3\u51b3\u65b9\u6848<\/strong>:<\/p>\n<pre><code class=\"language-cpp\">\/\/ \u7a0d\u5fae\u504f\u79fb\u5200\u5177\u51e0\u4f55\u4f53\ngp_Trsf trsf;\ntrsf.SetTranslation(gp_Vec(0.001, 0.001, 0.001));\nBRepBuilderAPI_Transform mover(tool, trsf);\nTopoDS_Shape movedTool = mover.Shape();\n<p>BRepAlgoAPI_Cut cut(base, movedTool);\n<\/code><\/pre>\n<\/p>\n<h3>\u95ee\u9898 2\uff1a\u7ed3\u679c\u51e0\u4f55\u4f53\u8d28\u91cf\u5dee<\/h3>\n<p><strong>\u539f\u56e0<\/strong>: \u516c\u5dee\u8bbe\u7f6e\u4e0d\u5f53<br \/>\n<strong>\u89e3\u51b3\u65b9\u6848<\/strong>:<\/p>\n<pre><code class=\"language-cpp\">\/\/ \u4f7f\u7528\u66f4\u4e25\u683c\u7684\u516c\u5dee\nBRepAlgoAPI_Fuse fuseOp(shape1, shape2);\nfuseOp.SetRunParallel(Standard_True); \/\/ \u542f\u7528\u5e76\u884c\u8ba1\u7b97\nTopoDS_Shape result = fuseOp.Shape();\n<\/code><\/pre>\n<p>---<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u5e03\u5c14\u8fd0\u7b97\u662f OCCT \u5efa\u6a21\u7684\u6838\u5fc3\u6280\u80fd\uff1a<\/p>\n<table>\n<thead>\n<tr> \u6280\u5de7 <\/td>\n<td> \u8981\u70b9 <\/tr>\n<\/thead>\n<tbody>\n<tr> <strong>\u9009\u62e9\u5408\u9002\u7684\u8fd0\u7b97<\/strong> <\/td>\n<td> Fuse \u5408\u5e76\u3001Cut \u5207\u9664\u3001Common \u53d6\u4ea4\u96c6 <\/tr>\n<\/tbody>\n<\/table>\n<tr> <strong>\u68c0\u67e5\u8fd0\u7b97\u72b6\u6001<\/strong> <\/td>\n<td> \u4f7f\u7528 IsDone() \u548c HasErrors() <\/tr>\n<\/tbody>\n<\/table>\n<tr> <strong>\u5904\u7406\u5931\u8d25\u60c5\u51b5<\/strong> <\/td>\n<td> \u5fae\u8c03\u51e0\u4f55\u4f53\u4f4d\u7f6e\u6216\u516c\u5dee <\/tr>\n<\/tbody>\n<\/table>\n<tr> <strong>\u6027\u80fd\u4f18\u5316<\/strong> <\/td>\n<td> \u5408\u7406\u8bbe\u7f6e\u6a21\u7cca\u516c\u5dee\uff0c\u542f\u7528\u5e76\u884c\u8ba1\u7b97 <\/tr>\n<\/tbody>\n<\/table>\n<p>---<\/p>\n<p><em>\u5b57\u6570\uff1a\u7ea6 2500 \u5b57 <\/td>\n<td> \u5206\u7c7b\uff1aOpenCASCADE \u6559\u7a0b <\/td>\n<td> \u96be\u5ea6\uff1a\u8fdb\u9636 <\/td>\n<td> \u7248\u672c\uff1a7.7.0<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpenCASCADE 7.7.0 \u5b8c\u5168\u6559\u7a0b\uff08\u4e8c\u5341\uff09\uff1a\u5e03\u5c14\u8fd0\u7b97\u5b9e\u6218 > \u7248\u672c: OCCT 7.7.0 > \u96be\u5ea6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-192","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.alimzs.com\/index.php\/wp-json\/wp\/v2\/posts\/192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.alimzs.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.alimzs.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.alimzs.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.alimzs.com\/index.php\/wp-json\/wp\/v2\/comments?post=192"}],"version-history":[{"count":0,"href":"https:\/\/www.alimzs.com\/index.php\/wp-json\/wp\/v2\/posts\/192\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.alimzs.com\/index.php\/wp-json\/wp\/v2\/media?parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.alimzs.com\/index.php\/wp-json\/wp\/v2\/categories?post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.alimzs.com\/index.php\/wp-json\/wp\/v2\/tags?post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}