pythonocc基础使用:2.提取曲线上的点位信息或者曲面上的点位信息

总目录 >> PythonOCC入门进阶到实战(目前已更新入门篇、基础篇和进阶篇)


BRepLProp:(local property 局部性质)

  • These global functions compute the degree ofcontinuity of a curve built by concatenation of twoedges at their junction point.
    BRepGProp :(global property 全部性质)
    -Provides global functions to compute a shape’s globalproperties for lines, surfaces or volumes, and bringthem together with the global properties alreadycomputed for a geometric system.The global properties computed for a system are :- its mass(质量),- its center of mass(质心),- its matrix of inertia(惯性矩阵),- its moment(惯性矩) about an axis,- its radius of gyration(回转半径) about an axis,- and its principal properties of inertia such as principal axis, principal moments, principal radius of gyration.

做cad开发,有一个很重要的目的就是识别曲线或者曲面的点位信息。
用的主要函数是breptools_UVBoundsGeomLProp_SurfaceTool.D1


    for shape in shp: #只有选中的是shp中的部分,才跳入到下面循环
        face = topods_Face(shape)
        surface=BRep_Tool.Surface(face)
        global umax, umin, vmax, vmin
        Umin, Umax, Vmin, Vmax = breptools_UVBounds(face)
        umax = str(Umax)
        umin = str(Umin)
        vmax = str(Vmax)
        vmin = str(Vmin)
        #face2 = BRepAdaptor_Surface(face1).D1()
        p=gp_Pnt() #点
        D1U=gp_Vec() #一阶u
        D1V=gp_Vec() #一阶v
        GeomLProp_SurfaceTool.D1(surface,0.3,0.4,p,D1U,D1V)
        #此处可以返回p(也就是该点的位置信息),,D1U是指U的一阶导数,D1V是指V的一阶导数,通过U的一阶导数与V的一阶导数的叉乘可以得到该点的法向量
  • 4
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值