如何在 OpenCASCADE 中获取与两个 gp_Dir 正交的 gp_Dir
OCCUtils 提供了计算两个方向的正交方向的便捷函数:
direction_example.cpp
#include <occutils/Direction.hxx>
using namespace OCCUtils;
gp_Dir dir1 = /* ... */;
gp_Dir dir2 = /* ... */;
gp_Dir orthogonalDirection = Direction::Orthogonal(dir1, dir2);如果你不能使用 OCCUtils,这里是手动执行的代码:
gp_dir_orthogonal_example.cpp
gp_Dir orthogonalDirection = dir1.Crossed(dir2);使用的函数称为 Crossed(),因为使用的数学运算是两个方向向量之间的叉积。
Check out similar posts by category:
C/C++, OpenCASCADE
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow