Rhino3D犀牛中文网

标题: 【python】rhinopython选择自相交曲线 [打印本页]

作者: 筑梦NARUTO    时间: 2017-11-23 23:30
标题: 【python】rhinopython选择自相交曲线
前段时间有人问我这个,今天写个代码分享一下。
[AppleScript] 纯文本查看 复制代码
#coding=utf-8
#Author:月之眼  E-mail:naruto@n-dda.cn

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino.Geometry as rg

#custom_filter
def select_CurveXSelf(rhino_objects, geometry, geometry_index):
    list = rs.CurveCurveIntersection(geometry)
    return (list!=None)and(list[0]==Overlap)


def commond():
    geometrys = rs.GetObjects("Select self intersecting curves",rs.filter.curve,True,True,custom_filter = select_CurveXSelf)
    color = rs.GetColor(0)
    if geometrys and color:
        [rs.ObjectColor(i,color) for i in geometrys]


if __name__=="__main__":
    commond()


作者: Jorin    时间: 2018-1-5 12:29
月月这几句代码很 python




欢迎光临 Rhino3D犀牛中文网 (https://rhino3d.asia/) Powered by Discuz! X3.3