zoukankan      html  css  js  c++  java
  • FreeCAD二次开发-Part.makePlane创建平面

    FreeCAD作为一款基于OpenCasCAD内核的开源CAD软件,可以在GitHub上下载源代码。阅读源代码,有助于我们学习CAD软件架构,了解底层几何算法。

    由博主Caesar卢尚宇自学整理(纯粹出于对三维CAD软件开发的热爱)

    # 指定长度与宽度创建一个平面
    b=Part.makePlane(20,50)
    # 显示对象 Part.show(b)

     平面就是一个简单的矩形平面。makePlane(length,width,[start_pnt,dir_normal])方法可用于创建一个平面。默认值为 start_pnt = Vector(0,0,0)与dir_normal = Vector(0,0,1)。通过dir_normal = Vector(0,0,1)将创建一个面向z轴正方向的平面,而dir_normal = Vector(1,0,0)将创建一个面向x轴正方向的平面:

    请注意,makePlane仅接收Base.Vector()作为其start_pnt与dir_normal参数,而非元组(tuples)。

    plane = Part.makePlane(2,2)
    Part.show(plane)
    plane1 = Part.makePlane(2, 2, Base.Vector(3,0,0), Base.Vector(0,1,0))
    Part.show(plane1)
    
    Caesar卢尚宇
    2020年3月31日

  • 相关阅读:
    Java Web开发 之VO、PO、DTO等收集
    Hive的安装与使用
    各种默认回车提交表单
    A/B Problem
    A+B Problem II
    A+B Problem IV
    关于521
    劝你别做
    无主之地1
    A+B Problem(V)
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/12555524.html
Copyright © 2011-2022 走看看