Posted on 2022-11-12 15:31
eryar 阅读(1729)
评论(0) 编辑 收藏 引用 所属分类:
2.OpenCASCADE
Geometric Constrained Solver - PlaneGCS
eryar@163.com
Abstract: PlaneGCS is open source geometric constrained solver for 2d sketch. 2 main open source software use it as constrained solver: FreeCAD and SALOME Shaper.
Keywords: PlaneGCS
1 Introduction
在传统的三维设计软件中,都提供从草图通过拉伸、放样生成三维零件的功能。而草图的绘制都提供几何约束和参数化的功能来提高建模效率。目前主流商用软件一般使用西门子D-Cubed DCM及达索的CGM。在开源世界也有两款常用的几何约束求解器:


在开源有限元前后处理平台SALOME中,同时使用了这两款几何约束求解器:
https://git.salome-platform.org/gitweb/?p=modules/shaper.git;a=tree;f=src/SketchSolver
并做了封装示例:PlaneGCSSolver&SolveSpaceSolver。OpenCASCADE将SALOME的Shaper模块单独做成CAD Builder,可以在CAD Builder中体验PlaneGCS的效果。

2 PlaneGCS
PlaneGCS字面意思是平面几何约束求解器,主要用于二维草图。支持的约束有:

- 水平约束 Horizontal Constraint





- 垂直约束 Perpendicular Constraint




除了以上列举的约束以外,还支持参数变量的约束等。
3 Conclusion
PlaneGCS作为FreeCAD中二维草图约束求解器,在社区反应还不错。编译PlaneGCS主要依赖Eigen,用到了Eigen中的非线性方程组求解算法,如BFGS等。
https://forum.freecadweb.org/viewtopic.php?t=20541
SALOME中对开源几何约束求解器封装的代码可读性强,可以作为学习的示例代码。开源世界为我们打开了一扇理论联系实际的门,教材论文等一般理论性强,结合开源代码可以理论联系实践,提高学习效率。